| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #include "chrome/browser/ui/cocoa/find_bar/find_bar_bridge.h" | 5 #include "chrome/browser/ui/cocoa/find_bar/find_bar_bridge.h" |
| 6 | 6 |
| 7 #include "base/sys_string_conversions.h" | 7 #include "base/sys_string_conversions.h" |
| 8 #import "chrome/browser/ui/cocoa/find_bar/find_bar_cocoa_controller.h" | 8 #import "chrome/browser/ui/cocoa/find_bar/find_bar_cocoa_controller.h" |
| 9 | 9 |
| 10 // static | 10 // static |
| 11 bool FindBarBridge::disable_animations_during_testing_ = false; | 11 bool FindBarBridge::disable_animations_during_testing_ = false; |
| 12 | 12 |
| 13 FindBarBridge::FindBarBridge() | 13 FindBarBridge::FindBarBridge() |
| 14 : find_bar_controller_(NULL) { | 14 : find_bar_controller_(NULL) { |
| 15 cocoa_controller_ = [[FindBarCocoaController alloc] init]; | 15 cocoa_controller_ = [[FindBarCocoaController alloc] init]; |
| 16 [cocoa_controller_ setFindBarBridge:this]; | 16 [cocoa_controller_ setFindBarBridge:this]; |
| 17 } | 17 } |
| 18 | 18 |
| 19 FindBarBridge::~FindBarBridge() { | 19 FindBarBridge::~FindBarBridge() { |
| 20 [cocoa_controller_ release]; | 20 [cocoa_controller_ release]; |
| 21 } | 21 } |
| 22 | 22 |
| 23 void FindBarBridge::SetFindBarController( |
| 24 FindBarController* find_bar_controller) { |
| 25 find_bar_controller_ = find_bar_controller; |
| 26 } |
| 27 |
| 28 FindBarController* FindBarBridge::GetFindBarController() const { |
| 29 DCHECK(find_bar_controller_); |
| 30 return find_bar_controller_; |
| 31 } |
| 32 |
| 33 FindBarTesting* FindBarBridge::GetFindBarTesting() { |
| 34 return this; |
| 35 } |
| 36 |
| 23 void FindBarBridge::Show(bool animate) { | 37 void FindBarBridge::Show(bool animate) { |
| 24 bool really_animate = animate && !disable_animations_during_testing_; | 38 bool really_animate = animate && !disable_animations_during_testing_; |
| 25 [cocoa_controller_ showFindBar:(really_animate ? YES : NO)]; | 39 [cocoa_controller_ showFindBar:(really_animate ? YES : NO)]; |
| 26 } | 40 } |
| 27 | 41 |
| 28 void FindBarBridge::Hide(bool animate) { | 42 void FindBarBridge::Hide(bool animate) { |
| 29 bool really_animate = animate && !disable_animations_during_testing_; | 43 bool really_animate = animate && !disable_animations_during_testing_; |
| 30 [cocoa_controller_ hideFindBar:(really_animate ? YES : NO)]; | 44 [cocoa_controller_ hideFindBar:(really_animate ? YES : NO)]; |
| 31 } | 45 } |
| 32 | 46 |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 } | 119 } |
| 106 | 120 |
| 107 string16 FindBarBridge::GetMatchCountText() { | 121 string16 FindBarBridge::GetMatchCountText() { |
| 108 // This function is currently only used in Windows and Linux specific browser | 122 // This function is currently only used in Windows and Linux specific browser |
| 109 // tests (testing prepopulate values that Mac's don't rely on), but if we add | 123 // tests (testing prepopulate values that Mac's don't rely on), but if we add |
| 110 // more tests that are non-platform specific, we need to flesh out this | 124 // more tests that are non-platform specific, we need to flesh out this |
| 111 // function. | 125 // function. |
| 112 NOTIMPLEMENTED(); | 126 NOTIMPLEMENTED(); |
| 113 return string16(); | 127 return string16(); |
| 114 } | 128 } |
| OLD | NEW |