OLD | NEW |
(Empty) | |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "ios/chrome/browser/ui/tabs/target_frame_cache.h" |
| 6 |
| 7 TargetFrameCache::TargetFrameCache() {} |
| 8 |
| 9 TargetFrameCache::~TargetFrameCache() {} |
| 10 |
| 11 void TargetFrameCache::AddFrame(UIView* view, CGRect frame) { |
| 12 targetFrames_[view] = frame; |
| 13 } |
| 14 |
| 15 void TargetFrameCache::RemoveFrame(UIView* view) { |
| 16 targetFrames_.erase(view); |
| 17 } |
| 18 |
| 19 CGRect TargetFrameCache::GetFrame(UIView* view) { |
| 20 std::map<UIView*, CGRect>::iterator it = targetFrames_.find(view); |
| 21 if (it != targetFrames_.end()) |
| 22 return it->second; |
| 23 |
| 24 return CGRectZero; |
| 25 } |
| 26 |
| 27 bool TargetFrameCache::HasFrame(UIView* view) { |
| 28 return targetFrames_.find(view) != targetFrames_.end(); |
| 29 } |
OLD | NEW |