OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #import <Cocoa/Cocoa.h> | 5 #import <Cocoa/Cocoa.h> |
6 | 6 |
7 #import "chrome/browser/cocoa/find_bar_cocoa_controller.h" | 7 #import "chrome/browser/cocoa/find_bar_cocoa_controller.h" |
8 | 8 |
| 9 #include "base/scoped_nsobject.h" |
9 #include "base/string16.h" | 10 #include "base/string16.h" |
10 | 11 |
11 class BrowserWindowCocoa; | 12 class BrowserWindowCocoa; |
12 class FindBarBridge; | 13 class FindBarBridge; |
13 class FindNotificationDetails; | 14 class FindNotificationDetails; |
| 15 @class FocusTracker; |
14 | 16 |
15 // A controller for the find bar in the browser window. Manages | 17 // A controller for the find bar in the browser window. Manages |
16 // updating the state of the find bar and provides a target for the | 18 // updating the state of the find bar and provides a target for the |
17 // next/previous/close buttons. Certain operations require a pointer | 19 // next/previous/close buttons. Certain operations require a pointer |
18 // to the cross-platform FindBarController, so be sure to call | 20 // to the cross-platform FindBarController, so be sure to call |
19 // setFindBarBridge: after creating this controller. | 21 // setFindBarBridge: after creating this controller. |
20 | 22 |
21 @interface FindBarCocoaController : NSViewController { | 23 @interface FindBarCocoaController : NSViewController { |
22 @private | 24 @private |
23 IBOutlet NSTextField* findText_; | 25 IBOutlet NSTextField* findText_; |
24 IBOutlet NSTextField* resultsLabel_; | 26 IBOutlet NSTextField* resultsLabel_; |
25 IBOutlet NSButton* nextButton_; | 27 IBOutlet NSButton* nextButton_; |
26 IBOutlet NSButton* previousButton_; | 28 IBOutlet NSButton* previousButton_; |
27 | 29 |
28 // Needed to call methods on FindBarController. | 30 // Needed to call methods on FindBarController. |
29 FindBarBridge* findBarBridge_; // weak | 31 FindBarBridge* findBarBridge_; // weak |
| 32 |
| 33 scoped_nsobject<FocusTracker> focusTracker_; |
30 }; | 34 }; |
31 | 35 |
32 // Initializes a new FindBarCocoaController. | 36 // Initializes a new FindBarCocoaController. |
33 - (id)init; | 37 - (id)init; |
34 | 38 |
35 - (void)setFindBarBridge:(FindBarBridge*)findBar; | 39 - (void)setFindBarBridge:(FindBarBridge*)findBar; |
36 | 40 |
37 - (IBAction)close:(id)sender; | 41 - (IBAction)close:(id)sender; |
38 | 42 |
39 - (IBAction)nextResult:(id)sender; | 43 - (IBAction)nextResult:(id)sender; |
40 | 44 |
41 - (IBAction)previousResult:(id)sender; | 45 - (IBAction)previousResult:(id)sender; |
42 | 46 |
43 // Positions the find bar based on the location of the infobar container. | 47 // Positions the find bar based on the location of the infobar container. |
44 // TODO(rohitrao): Move this logic into BrowserWindowController. | 48 // TODO(rohitrao): Move this logic into BrowserWindowController. |
45 - (void)positionFindBarView:(NSView*)infoBarContainerView; | 49 - (void)positionFindBarView:(NSView*)infoBarContainerView; |
46 | 50 |
47 // Methods called from FindBarBridge. | 51 // Methods called from FindBarBridge. |
48 - (void)showFindBar; | 52 - (void)showFindBar; |
49 - (void)hideFindBar; | 53 - (void)hideFindBar; |
50 - (void)setFocusAndSelection; | 54 - (void)setFocusAndSelection; |
| 55 - (void)restoreSavedFocus; |
51 - (void)setFindText:(const string16&)findText; | 56 - (void)setFindText:(const string16&)findText; |
52 | 57 |
53 - (void)clearResults:(const FindNotificationDetails&)results; | 58 - (void)clearResults:(const FindNotificationDetails&)results; |
54 - (void)updateUIForFindResult:(const FindNotificationDetails&)results | 59 - (void)updateUIForFindResult:(const FindNotificationDetails&)results |
55 withText:(const string16&)findText; | 60 withText:(const string16&)findText; |
56 - (BOOL)isFindBarVisible; | 61 - (BOOL)isFindBarVisible; |
57 | 62 |
58 @end | 63 @end |
OLD | NEW |