| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_VIEWS_FIND_BAR_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_FIND_BAR_VIEW_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_FIND_BAR_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_FIND_BAR_VIEW_H_ |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/string16.h" | 9 #include "base/string16.h" |
| 10 #include "chrome/browser/ui/views/dropdown_bar_view.h" | 10 #include "chrome/browser/ui/views/dropdown_bar_view.h" |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 : view_to_focus_on_mousedown_(view_to_focus_on_mousedown) {} | 103 : view_to_focus_on_mousedown_(view_to_focus_on_mousedown) {} |
| 104 | 104 |
| 105 private: | 105 private: |
| 106 virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE; | 106 virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE; |
| 107 | 107 |
| 108 views::Textfield* view_to_focus_on_mousedown_; | 108 views::Textfield* view_to_focus_on_mousedown_; |
| 109 | 109 |
| 110 DISALLOW_COPY_AND_ASSIGN(FocusForwarderView); | 110 DISALLOW_COPY_AND_ASSIGN(FocusForwarderView); |
| 111 }; | 111 }; |
| 112 | 112 |
| 113 // A wrapper of views::TextField that allows us to select all text when we | |
| 114 // get focus. Represents the text field where the user enters a search term. | |
| 115 class SearchTextfieldView : public views::Textfield { | |
| 116 public: | |
| 117 SearchTextfieldView(); | |
| 118 virtual ~SearchTextfieldView(); | |
| 119 | |
| 120 virtual void RequestFocus() OVERRIDE; | |
| 121 | |
| 122 private: | |
| 123 DISALLOW_COPY_AND_ASSIGN(SearchTextfieldView); | |
| 124 }; | |
| 125 | |
| 126 // Returns the OS-specific view for the find bar that acts as an intermediary | 113 // Returns the OS-specific view for the find bar that acts as an intermediary |
| 127 // between us and the WebContentsView. | 114 // between us and the WebContentsView. |
| 128 FindBarHost* find_bar_host() const; | 115 FindBarHost* find_bar_host() const; |
| 129 | 116 |
| 130 // The controls in the window. | 117 // The controls in the window. |
| 131 SearchTextfieldView* find_text_; | 118 views::Textfield* find_text_; |
| 132 views::Label* match_count_text_; | 119 views::Label* match_count_text_; |
| 133 FocusForwarderView* focus_forwarder_view_; | 120 FocusForwarderView* focus_forwarder_view_; |
| 134 views::ImageButton* find_previous_button_; | 121 views::ImageButton* find_previous_button_; |
| 135 views::ImageButton* find_next_button_; | 122 views::ImageButton* find_next_button_; |
| 136 views::ImageButton* close_button_; | 123 views::ImageButton* close_button_; |
| 137 | 124 |
| 138 // The preferred height of the find bar. | 125 // The preferred height of the find bar. |
| 139 int preferred_height_; | 126 int preferred_height_; |
| 140 | 127 |
| 141 // The background image for the Find text box, which we draw behind the Find | 128 // The background image for the Find text box, which we draw behind the Find |
| 142 // box to provide the Chrome look to the edge of the text box. | 129 // box to provide the Chrome look to the edge of the text box. |
| 143 const gfx::ImageSkia* text_box_background_; | 130 const gfx::ImageSkia* text_box_background_; |
| 144 | 131 |
| 145 // The rounded edge on the left side of the Find text box. | 132 // The rounded edge on the left side of the Find text box. |
| 146 const gfx::ImageSkia* text_box_background_left_; | 133 const gfx::ImageSkia* text_box_background_left_; |
| 147 | 134 |
| 148 DISALLOW_COPY_AND_ASSIGN(FindBarView); | 135 DISALLOW_COPY_AND_ASSIGN(FindBarView); |
| 149 }; | 136 }; |
| 150 | 137 |
| 151 #endif // CHROME_BROWSER_UI_VIEWS_FIND_BAR_VIEW_H_ | 138 #endif // CHROME_BROWSER_UI_VIEWS_FIND_BAR_VIEW_H_ |
| OLD | NEW |