| 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 virtual void Layout() OVERRIDE; | 69 virtual void Layout() OVERRIDE; |
| 70 virtual gfx::Size GetPreferredSize() OVERRIDE; | 70 virtual gfx::Size GetPreferredSize() OVERRIDE; |
| 71 virtual void ViewHierarchyChanged( | 71 virtual void ViewHierarchyChanged( |
| 72 const ViewHierarchyChangedDetails& details) OVERRIDE; | 72 const ViewHierarchyChangedDetails& details) OVERRIDE; |
| 73 | 73 |
| 74 // views::ButtonListener: | 74 // views::ButtonListener: |
| 75 virtual void ButtonPressed(views::Button* sender, | 75 virtual void ButtonPressed(views::Button* sender, |
| 76 const ui::Event& event) OVERRIDE; | 76 const ui::Event& event) OVERRIDE; |
| 77 | 77 |
| 78 // views::TextfieldController: | 78 // views::TextfieldController: |
| 79 virtual void ContentsChanged(views::Textfield* sender, | |
| 80 const string16& new_contents) OVERRIDE; | |
| 81 virtual bool HandleKeyEvent(views::Textfield* sender, | 79 virtual bool HandleKeyEvent(views::Textfield* sender, |
| 82 const ui::KeyEvent& key_event) OVERRIDE; | 80 const ui::KeyEvent& key_event) OVERRIDE; |
| 81 virtual void OnAfterUserAction(views::Textfield* sender) OVERRIDE; |
| 83 virtual void OnAfterCutOrCopy() OVERRIDE; | 82 virtual void OnAfterCutOrCopy() OVERRIDE; |
| 84 | 83 |
| 85 private: | 84 private: |
| 86 // Update the appearance for the match count label. | 85 // Update the appearance for the match count label. |
| 87 void UpdateMatchCountAppearance(bool no_match); | 86 void UpdateMatchCountAppearance(bool no_match); |
| 88 | 87 |
| 89 // views::View: | 88 // views::View: |
| 90 virtual void OnThemeChanged() OVERRIDE; | 89 virtual void OnThemeChanged() OVERRIDE; |
| 91 | 90 |
| 92 // We use a hidden view to grab mouse clicks and bring focus to the find | 91 // We use a hidden view to grab mouse clicks and bring focus to the find |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 private: | 125 private: |
| 127 bool select_all_on_focus_; | 126 bool select_all_on_focus_; |
| 128 | 127 |
| 129 DISALLOW_COPY_AND_ASSIGN(SearchTextfieldView); | 128 DISALLOW_COPY_AND_ASSIGN(SearchTextfieldView); |
| 130 }; | 129 }; |
| 131 | 130 |
| 132 // Returns the OS-specific view for the find bar that acts as an intermediary | 131 // Returns the OS-specific view for the find bar that acts as an intermediary |
| 133 // between us and the WebContentsView. | 132 // between us and the WebContentsView. |
| 134 FindBarHost* find_bar_host() const; | 133 FindBarHost* find_bar_host() const; |
| 135 | 134 |
| 135 // Used to detect if the input text, not including the IME composition text, |
| 136 // has changed or not. |
| 137 string16 last_searched_text_; |
| 138 |
| 136 // The controls in the window. | 139 // The controls in the window. |
| 137 SearchTextfieldView* find_text_; | 140 SearchTextfieldView* find_text_; |
| 138 views::Label* match_count_text_; | 141 views::Label* match_count_text_; |
| 139 FocusForwarderView* focus_forwarder_view_; | 142 FocusForwarderView* focus_forwarder_view_; |
| 140 views::ImageButton* find_previous_button_; | 143 views::ImageButton* find_previous_button_; |
| 141 views::ImageButton* find_next_button_; | 144 views::ImageButton* find_next_button_; |
| 142 views::ImageButton* close_button_; | 145 views::ImageButton* close_button_; |
| 143 | 146 |
| 144 // The preferred height of the find bar. | 147 // The preferred height of the find bar. |
| 145 int preferred_height_; | 148 int preferred_height_; |
| 146 | 149 |
| 147 // The background image for the Find text box, which we draw behind the Find | 150 // The background image for the Find text box, which we draw behind the Find |
| 148 // box to provide the Chrome look to the edge of the text box. | 151 // box to provide the Chrome look to the edge of the text box. |
| 149 const gfx::ImageSkia* text_box_background_; | 152 const gfx::ImageSkia* text_box_background_; |
| 150 | 153 |
| 151 // The rounded edge on the left side of the Find text box. | 154 // The rounded edge on the left side of the Find text box. |
| 152 const gfx::ImageSkia* text_box_background_left_; | 155 const gfx::ImageSkia* text_box_background_left_; |
| 153 | 156 |
| 154 DISALLOW_COPY_AND_ASSIGN(FindBarView); | 157 DISALLOW_COPY_AND_ASSIGN(FindBarView); |
| 155 }; | 158 }; |
| 156 | 159 |
| 157 #endif // CHROME_BROWSER_UI_VIEWS_FIND_BAR_VIEW_H_ | 160 #endif // CHROME_BROWSER_UI_VIEWS_FIND_BAR_VIEW_H_ |
| OLD | NEW |