OLD | NEW |
| (Empty) |
1 // Copyright (c) 2009 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 <Cocoa/Cocoa.h> | |
6 | |
7 #import "chrome/browser/ui/cocoa/find_bar_cocoa_controller.h" | |
8 | |
9 #include "base/scoped_nsobject.h" | |
10 #include "base/string16.h" | |
11 | |
12 class BrowserWindowCocoa; | |
13 class FindBarBridge; | |
14 @class FindBarTextField; | |
15 class FindNotificationDetails; | |
16 @class FocusTracker; | |
17 | |
18 // A controller for the find bar in the browser window. Manages | |
19 // updating the state of the find bar and provides a target for the | |
20 // next/previous/close buttons. Certain operations require a pointer | |
21 // to the cross-platform FindBarController, so be sure to call | |
22 // setFindBarBridge: after creating this controller. | |
23 | |
24 @interface FindBarCocoaController : NSViewController { | |
25 @private | |
26 IBOutlet NSView* findBarView_; | |
27 IBOutlet FindBarTextField* findText_; | |
28 IBOutlet NSButton* nextButton_; | |
29 IBOutlet NSButton* previousButton_; | |
30 | |
31 // Needed to call methods on FindBarController. | |
32 FindBarBridge* findBarBridge_; // weak | |
33 | |
34 scoped_nsobject<FocusTracker> focusTracker_; | |
35 | |
36 // The currently-running animation. This is defined to be non-nil if an | |
37 // animation is running, and is always nil otherwise. The | |
38 // FindBarCocoaController should not be deallocated while an animation is | |
39 // running (stopAnimation is currently called before the last tab in a | |
40 // window is removed). | |
41 scoped_nsobject<NSViewAnimation> currentAnimation_; | |
42 | |
43 // If YES, do nothing as a result of find pasteboard update notifications. | |
44 BOOL suppressPboardUpdateActions_; | |
45 }; | |
46 | |
47 // Initializes a new FindBarCocoaController. | |
48 - (id)init; | |
49 | |
50 - (void)setFindBarBridge:(FindBarBridge*)findBar; | |
51 | |
52 - (IBAction)close:(id)sender; | |
53 | |
54 - (IBAction)nextResult:(id)sender; | |
55 | |
56 - (IBAction)previousResult:(id)sender; | |
57 | |
58 // Position the find bar at the given maximum y-coordinate (the min-y of the | |
59 // bar -- toolbar + possibly bookmark bar, but not including the infobars) with | |
60 // the given maximum width (i.e., the find bar should fit between 0 and | |
61 // |maxWidth|). | |
62 - (void)positionFindBarViewAtMaxY:(CGFloat)maxY maxWidth:(CGFloat)maxWidth; | |
63 | |
64 // Methods called from FindBarBridge. | |
65 - (void)showFindBar:(BOOL)animate; | |
66 - (void)hideFindBar:(BOOL)animate; | |
67 - (void)stopAnimation; | |
68 - (void)setFocusAndSelection; | |
69 - (void)restoreSavedFocus; | |
70 - (void)setFindText:(NSString*)findText; | |
71 | |
72 - (void)clearResults:(const FindNotificationDetails&)results; | |
73 - (void)updateUIForFindResult:(const FindNotificationDetails&)results | |
74 withText:(const string16&)findText; | |
75 - (BOOL)isFindBarVisible; | |
76 - (BOOL)isFindBarAnimating; | |
77 | |
78 @end | |
OLD | NEW |