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 #import "ios/chrome/browser/find_in_page/find_in_page_model.h" |
| 6 |
| 7 @implementation FindInPageModel |
| 8 |
| 9 @synthesize enabled = enabled_; |
| 10 @synthesize matches = matches_; |
| 11 @synthesize currentIndex = currentIndex_; |
| 12 @synthesize currentPoint = currentPoint_; |
| 13 |
| 14 - (NSString*)text { |
| 15 return text_; |
| 16 } |
| 17 |
| 18 - (void)setEnabled:(BOOL)enabled { |
| 19 enabled_ = enabled; |
| 20 matches_ = 0; |
| 21 currentIndex_ = 0; |
| 22 currentPoint_ = CGPointZero; |
| 23 } |
| 24 |
| 25 - (void)updateQuery:(NSString*)query matches:(NSUInteger)matches { |
| 26 if (query) |
| 27 text_.reset([query copy]); |
| 28 matches_ = matches; |
| 29 currentIndex_ = 0; |
| 30 } |
| 31 |
| 32 - (void)updateIndex:(NSInteger)index atPoint:(CGPoint)point { |
| 33 currentIndex_ = index; |
| 34 currentPoint_ = point; |
| 35 } |
| 36 |
| 37 @end |
OLD | NEW |