| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef CHROME_BROWSER_UI_COCOA_FIND_BAR_FIND_BAR_BRIDGE_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_FIND_BAR_FIND_BAR_BRIDGE_H_ |
| 6 #define CHROME_BROWSER_UI_COCOA_FIND_BAR_FIND_BAR_BRIDGE_H_ | 6 #define CHROME_BROWSER_UI_COCOA_FIND_BAR_FIND_BAR_BRIDGE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/compiler_specific.h" |
| 9 #include "base/logging.h" | 10 #include "base/logging.h" |
| 10 #include "chrome/browser/ui/find_bar/find_bar.h" | 11 #include "chrome/browser/ui/find_bar/find_bar.h" |
| 11 | 12 |
| 12 class FindBarController; | 13 class FindBarController; |
| 13 | 14 |
| 14 // This class is included by find_bar_host_browsertest.cc, so it has to be | 15 // This class is included by find_bar_host_browsertest.cc, so it has to be |
| 15 // objc-free. | 16 // objc-free. |
| 16 #ifdef __OBJC__ | 17 #ifdef __OBJC__ |
| 17 @class FindBarCocoaController; | 18 @class FindBarCocoaController; |
| 18 #else | 19 #else |
| (...skipping 18 matching lines...) Expand all Loading... |
| 37 class FindBarBridge : public FindBar, | 38 class FindBarBridge : public FindBar, |
| 38 public FindBarTesting { | 39 public FindBarTesting { |
| 39 public: | 40 public: |
| 40 FindBarBridge(); | 41 FindBarBridge(); |
| 41 virtual ~FindBarBridge(); | 42 virtual ~FindBarBridge(); |
| 42 | 43 |
| 43 FindBarCocoaController* find_bar_cocoa_controller() { | 44 FindBarCocoaController* find_bar_cocoa_controller() { |
| 44 return cocoa_controller_; | 45 return cocoa_controller_; |
| 45 } | 46 } |
| 46 | 47 |
| 47 virtual void SetFindBarController(FindBarController* find_bar_controller); | 48 virtual void SetFindBarController( |
| 49 FindBarController* find_bar_controller) OVERRIDE; |
| 48 | 50 |
| 49 virtual FindBarController* GetFindBarController() const; | 51 virtual FindBarController* GetFindBarController() const OVERRIDE; |
| 50 | 52 |
| 51 virtual FindBarTesting* GetFindBarTesting(); | 53 virtual FindBarTesting* GetFindBarTesting() OVERRIDE; |
| 52 | 54 |
| 53 // Methods from FindBar. | 55 // Methods from FindBar. |
| 54 virtual void Show(bool animate); | 56 virtual void Show(bool animate) OVERRIDE; |
| 55 virtual void Hide(bool animate); | 57 virtual void Hide(bool animate) OVERRIDE; |
| 56 virtual void SetFocusAndSelection(); | 58 virtual void SetFocusAndSelection() OVERRIDE; |
| 57 virtual void ClearResults(const FindNotificationDetails& results); | 59 virtual void ClearResults(const FindNotificationDetails& results) OVERRIDE; |
| 58 virtual void StopAnimation(); | 60 virtual void StopAnimation() OVERRIDE; |
| 59 virtual void SetFindText(const string16& find_text); | 61 virtual void SetFindText(const string16& find_text) OVERRIDE; |
| 60 virtual void UpdateUIForFindResult(const FindNotificationDetails& result, | 62 virtual void UpdateUIForFindResult(const FindNotificationDetails& result, |
| 61 const string16& find_text); | 63 const string16& find_text) OVERRIDE; |
| 62 virtual void AudibleAlert(); | 64 virtual void AudibleAlert() OVERRIDE; |
| 63 virtual bool IsFindBarVisible(); | 65 virtual bool IsFindBarVisible() OVERRIDE; |
| 64 virtual void RestoreSavedFocus(); | 66 virtual void RestoreSavedFocus() OVERRIDE; |
| 65 virtual void MoveWindowIfNecessary(const gfx::Rect& selection_rect, | 67 virtual void MoveWindowIfNecessary(const gfx::Rect& selection_rect, |
| 66 bool no_redraw); | 68 bool no_redraw) OVERRIDE; |
| 67 | 69 |
| 68 // Methods from FindBarTesting. | 70 // Methods from FindBarTesting. |
| 69 virtual bool GetFindBarWindowInfo(gfx::Point* position, | 71 virtual bool GetFindBarWindowInfo(gfx::Point* position, |
| 70 bool* fully_visible); | 72 bool* fully_visible) OVERRIDE; |
| 71 virtual string16 GetFindText(); | 73 virtual string16 GetFindText() OVERRIDE; |
| 72 virtual string16 GetFindSelectedText(); | 74 virtual string16 GetFindSelectedText() OVERRIDE; |
| 73 virtual string16 GetMatchCountText(); | 75 virtual string16 GetMatchCountText() OVERRIDE; |
| 74 virtual int GetWidth(); | 76 virtual int GetWidth() OVERRIDE; |
| 75 | 77 |
| 76 // Used to disable find bar animations when testing. | 78 // Used to disable find bar animations when testing. |
| 77 static bool disable_animations_during_testing_; | 79 static bool disable_animations_during_testing_; |
| 78 | 80 |
| 79 private: | 81 private: |
| 80 // Pointer to the cocoa controller which manages the cocoa view. Is | 82 // Pointer to the cocoa controller which manages the cocoa view. Is |
| 81 // never nil. | 83 // never nil. |
| 82 FindBarCocoaController* cocoa_controller_; | 84 FindBarCocoaController* cocoa_controller_; |
| 83 | 85 |
| 84 // Pointer back to the owning controller. | 86 // Pointer back to the owning controller. |
| 85 FindBarController* find_bar_controller_; // weak, owns us | 87 FindBarController* find_bar_controller_; // weak, owns us |
| 86 | 88 |
| 87 DISALLOW_COPY_AND_ASSIGN(FindBarBridge); | 89 DISALLOW_COPY_AND_ASSIGN(FindBarBridge); |
| 88 }; | 90 }; |
| 89 | 91 |
| 90 #endif // CHROME_BROWSER_UI_COCOA_FIND_BAR_FIND_BAR_BRIDGE_H_ | 92 #endif // CHROME_BROWSER_UI_COCOA_FIND_BAR_FIND_BAR_BRIDGE_H_ |
| OLD | NEW |