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 "chrome/browser/cocoa/find_bar_bridge.h" | 5 #import "chrome/browser/cocoa/find_bar_bridge.h" |
6 #import "chrome/browser/cocoa/find_bar_cocoa_controller.h" | 6 #import "chrome/browser/cocoa/find_bar_cocoa_controller.h" |
7 | 7 |
8 FindBarBridge::FindBarBridge() { | 8 FindBarBridge::FindBarBridge() { |
9 cocoa_controller_.reset([[FindBarCocoaController alloc] init]); | 9 cocoa_controller_.reset([[FindBarCocoaController alloc] init]); |
10 [cocoa_controller_ setFindBarBridge:this]; | 10 [cocoa_controller_ setFindBarBridge:this]; |
11 } | 11 } |
12 | 12 |
13 FindBarBridge::~FindBarBridge() { | 13 FindBarBridge::~FindBarBridge() { |
14 } | 14 } |
15 | 15 |
16 void FindBarBridge::Show() { | 16 void FindBarBridge::Show() { |
17 [cocoa_controller_ showFindBar]; | 17 [cocoa_controller_ showFindBar:YES]; // with animation. |
18 } | 18 } |
19 | 19 |
20 void FindBarBridge::Hide(bool animate) { | 20 void FindBarBridge::Hide(bool animate) { |
21 [cocoa_controller_ hideFindBar]; | 21 [cocoa_controller_ hideFindBar:(animate ? YES : NO)]; |
22 } | 22 } |
23 | 23 |
24 void FindBarBridge::SetFocusAndSelection() { | 24 void FindBarBridge::SetFocusAndSelection() { |
25 [cocoa_controller_ setFocusAndSelection]; | 25 [cocoa_controller_ setFocusAndSelection]; |
26 } | 26 } |
27 | 27 |
28 void FindBarBridge::ClearResults(const FindNotificationDetails& results) { | 28 void FindBarBridge::ClearResults(const FindNotificationDetails& results) { |
29 [cocoa_controller_ clearResults:results]; | 29 [cocoa_controller_ clearResults:results]; |
30 } | 30 } |
31 | 31 |
(...skipping 13 matching lines...) Expand all Loading... |
45 bool FindBarBridge::IsFindBarVisible() { | 45 bool FindBarBridge::IsFindBarVisible() { |
46 return [cocoa_controller_ isFindBarVisible] ? true : false; | 46 return [cocoa_controller_ isFindBarVisible] ? true : false; |
47 } | 47 } |
48 | 48 |
49 void FindBarBridge::MoveWindowIfNecessary(const gfx::Rect& selection_rect, | 49 void FindBarBridge::MoveWindowIfNecessary(const gfx::Rect& selection_rect, |
50 bool no_redraw) { | 50 bool no_redraw) { |
51 // http://crbug.com/11084 | 51 // http://crbug.com/11084 |
52 } | 52 } |
53 | 53 |
54 void FindBarBridge::StopAnimation() { | 54 void FindBarBridge::StopAnimation() { |
55 // Do nothing here, this appears necessary only for the windows impl. | 55 [cocoa_controller_ stopAnimation]; |
56 } | 56 } |
57 | 57 |
58 gfx::Rect FindBarBridge::GetDialogPosition(gfx::Rect avoid_overlapping_rect) { | 58 gfx::Rect FindBarBridge::GetDialogPosition(gfx::Rect avoid_overlapping_rect) { |
59 NOTIMPLEMENTED(); | 59 // http://crbug.com/22036 |
60 return gfx::Rect(); | 60 return gfx::Rect(); |
61 } | 61 } |
62 | 62 |
63 void FindBarBridge::SetDialogPosition(const gfx::Rect& new_pos, | 63 void FindBarBridge::SetDialogPosition(const gfx::Rect& new_pos, |
64 bool no_redraw) { | 64 bool no_redraw) { |
65 // TODO(rohitrao): Do something useful here. For now, just show the findbar. | 65 // TODO(rohitrao): Do something useful here. For now, just show the findbar. |
66 Show(); | 66 // http://crbug.com/22036 |
| 67 [cocoa_controller_ showFindBar:NO]; // Do not animate. |
67 } | 68 } |
68 | 69 |
69 void FindBarBridge::RestoreSavedFocus() { | 70 void FindBarBridge::RestoreSavedFocus() { |
70 [cocoa_controller_ restoreSavedFocus]; | 71 [cocoa_controller_ restoreSavedFocus]; |
71 } | 72 } |
OLD | NEW |