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 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "chrome/browser/ui/find_bar/find_bar.h" | 10 #include "chrome/browser/ui/find_bar/find_bar.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 // the cocoa views hierarchy. | 32 // the cocoa views hierarchy. |
33 // | 33 // |
34 // Memory ownership is relatively straightforward. The FindBarBridge | 34 // Memory ownership is relatively straightforward. The FindBarBridge |
35 // object is owned by the Browser. FindBarCocoaController is retained | 35 // object is owned by the Browser. FindBarCocoaController is retained |
36 // by bother FindBarBridge and BrowserWindowController, since both use it. | 36 // by bother FindBarBridge and BrowserWindowController, since both use it. |
37 | 37 |
38 class FindBarBridge : public FindBar, | 38 class FindBarBridge : public FindBar, |
39 public FindBarTesting { | 39 public FindBarTesting { |
40 public: | 40 public: |
41 FindBarBridge(Browser* browser); | 41 FindBarBridge(Browser* browser); |
42 virtual ~FindBarBridge(); | 42 ~FindBarBridge() override; |
43 | 43 |
44 FindBarCocoaController* find_bar_cocoa_controller() { | 44 FindBarCocoaController* find_bar_cocoa_controller() { |
45 return cocoa_controller_; | 45 return cocoa_controller_; |
46 } | 46 } |
47 | 47 |
48 virtual void SetFindBarController( | 48 void SetFindBarController(FindBarController* find_bar_controller) override; |
49 FindBarController* find_bar_controller) override; | |
50 | 49 |
51 virtual FindBarController* GetFindBarController() const override; | 50 FindBarController* GetFindBarController() const override; |
52 | 51 |
53 virtual FindBarTesting* GetFindBarTesting() override; | 52 FindBarTesting* GetFindBarTesting() override; |
54 | 53 |
55 // Methods from FindBar. | 54 // Methods from FindBar. |
56 virtual void Show(bool animate) override; | 55 void Show(bool animate) override; |
57 virtual void Hide(bool animate) override; | 56 void Hide(bool animate) override; |
58 virtual void SetFocusAndSelection() override; | 57 void SetFocusAndSelection() override; |
59 virtual void ClearResults(const FindNotificationDetails& results) override; | 58 void ClearResults(const FindNotificationDetails& results) override; |
60 virtual void StopAnimation() override; | 59 void StopAnimation() override; |
61 virtual void SetFindTextAndSelectedRange( | 60 void SetFindTextAndSelectedRange(const base::string16& find_text, |
62 const base::string16& find_text, | 61 const gfx::Range& selected_range) override; |
63 const gfx::Range& selected_range) override; | 62 base::string16 GetFindText() override; |
64 virtual base::string16 GetFindText() override; | 63 gfx::Range GetSelectedRange() override; |
65 virtual gfx::Range GetSelectedRange() override; | 64 void UpdateUIForFindResult(const FindNotificationDetails& result, |
66 virtual void UpdateUIForFindResult(const FindNotificationDetails& result, | 65 const base::string16& find_text) override; |
67 const base::string16& find_text) override; | 66 void AudibleAlert() override; |
68 virtual void AudibleAlert() override; | 67 bool IsFindBarVisible() override; |
69 virtual bool IsFindBarVisible() override; | 68 void RestoreSavedFocus() override; |
70 virtual void RestoreSavedFocus() override; | 69 bool HasGlobalFindPasteboard() override; |
71 virtual bool HasGlobalFindPasteboard() override; | 70 void UpdateFindBarForChangedWebContents() override; |
72 virtual void UpdateFindBarForChangedWebContents() override; | 71 void MoveWindowIfNecessary(const gfx::Rect& selection_rect, |
73 virtual void MoveWindowIfNecessary(const gfx::Rect& selection_rect, | 72 bool no_redraw) override; |
74 bool no_redraw) override; | |
75 | 73 |
76 // Methods from FindBarTesting. | 74 // Methods from FindBarTesting. |
77 virtual bool GetFindBarWindowInfo(gfx::Point* position, | 75 bool GetFindBarWindowInfo(gfx::Point* position, bool* fully_visible) override; |
78 bool* fully_visible) override; | 76 base::string16 GetFindSelectedText() override; |
79 virtual base::string16 GetFindSelectedText() override; | 77 base::string16 GetMatchCountText() override; |
80 virtual base::string16 GetMatchCountText() override; | 78 int GetWidth() override; |
81 virtual int GetWidth() override; | |
82 | 79 |
83 // Used to disable find bar animations when testing. | 80 // Used to disable find bar animations when testing. |
84 static bool disable_animations_during_testing_; | 81 static bool disable_animations_during_testing_; |
85 | 82 |
86 private: | 83 private: |
87 // Pointer to the cocoa controller which manages the cocoa view. Is | 84 // Pointer to the cocoa controller which manages the cocoa view. Is |
88 // never nil. | 85 // never nil. |
89 FindBarCocoaController* cocoa_controller_; | 86 FindBarCocoaController* cocoa_controller_; |
90 | 87 |
91 // Pointer back to the owning controller. | 88 // Pointer back to the owning controller. |
92 FindBarController* find_bar_controller_; // weak, owns us | 89 FindBarController* find_bar_controller_; // weak, owns us |
93 | 90 |
94 DISALLOW_COPY_AND_ASSIGN(FindBarBridge); | 91 DISALLOW_COPY_AND_ASSIGN(FindBarBridge); |
95 }; | 92 }; |
96 | 93 |
97 #endif // CHROME_BROWSER_UI_COCOA_FIND_BAR_FIND_BAR_BRIDGE_H_ | 94 #endif // CHROME_BROWSER_UI_COCOA_FIND_BAR_FIND_BAR_BRIDGE_H_ |
OLD | NEW |