blob: ec0c25fd27a87867ad3126b6a0a805a2886f70b2 [file] [log] [blame]
// Copyright 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef IOS_CHROME_BROWSER_UI_TABS_TARGET_FRAME_CACHE_H_
#define IOS_CHROME_BROWSER_UI_TABS_TARGET_FRAME_CACHE_H_
#import <UIKit/UIKit.h>
#include <map>
// Stores target frames for a set of UIViews.
class TargetFrameCache {
public:
TargetFrameCache();
~TargetFrameCache();
// Add or remove the target frame for a view.
void AddFrame(UIView* view, CGRect rect);
void RemoveFrame(UIView* view);
// Gets the cached target frame for |view|.
CGRect GetFrame(UIView* view);
// Returns whether |view| has a cached target frame.
bool HasFrame(UIView* view);
private:
std::map<UIView*, CGRect> targetFrames_;
};
#endif // IOS_CHROME_BROWSER_UI_TABS_TARGET_FRAME_CACHE_H_