| 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; |
| 83 virtual void OnAfterPaste() OVERRIDE; |
| 84 | 84 |
| 85 private: | 85 private: |
| 86 // Update the appearance for the match count label. | 86 // Update the appearance for the match count label. |
| 87 void UpdateMatchCountAppearance(bool no_match); | 87 void UpdateMatchCountAppearance(bool no_match); |
| 88 | 88 |
| 89 // views::View: | 89 // views::View: |
| 90 virtual void OnThemeChanged() OVERRIDE; | 90 virtual void OnThemeChanged() OVERRIDE; |
| 91 | 91 |
| 92 // We use a hidden view to grab mouse clicks and bring focus to the find | 92 // We use a hidden view to grab mouse clicks and bring focus to the find |
| 93 // text box. This is because although the find text box may look like it | 93 // text box. This is because although the find text box may look like it |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 private: | 126 private: |
| 127 bool select_all_on_focus_; | 127 bool select_all_on_focus_; |
| 128 | 128 |
| 129 DISALLOW_COPY_AND_ASSIGN(SearchTextfieldView); | 129 DISALLOW_COPY_AND_ASSIGN(SearchTextfieldView); |
| 130 }; | 130 }; |
| 131 | 131 |
| 132 // Returns the OS-specific view for the find bar that acts as an intermediary | 132 // Returns the OS-specific view for the find bar that acts as an intermediary |
| 133 // between us and the WebContentsView. | 133 // between us and the WebContentsView. |
| 134 FindBarHost* find_bar_host() const; | 134 FindBarHost* find_bar_host() const; |
| 135 | 135 |
| 136 // Used to detect if the input text, not including the IME composition text, |
| 137 // has changed or not. |
| 138 string16 last_searched_text_; |
| 139 |
| 136 // The controls in the window. | 140 // The controls in the window. |
| 137 SearchTextfieldView* find_text_; | 141 SearchTextfieldView* find_text_; |
| 138 views::Label* match_count_text_; | 142 views::Label* match_count_text_; |
| 139 FocusForwarderView* focus_forwarder_view_; | 143 FocusForwarderView* focus_forwarder_view_; |
| 140 views::ImageButton* find_previous_button_; | 144 views::ImageButton* find_previous_button_; |
| 141 views::ImageButton* find_next_button_; | 145 views::ImageButton* find_next_button_; |
| 142 views::ImageButton* close_button_; | 146 views::ImageButton* close_button_; |
| 143 | 147 |
| 144 // The preferred height of the find bar. | 148 // The preferred height of the find bar. |
| 145 int preferred_height_; | 149 int preferred_height_; |
| 146 | 150 |
| 147 // The background image for the Find text box, which we draw behind the Find | 151 // 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. | 152 // box to provide the Chrome look to the edge of the text box. |
| 149 const gfx::ImageSkia* text_box_background_; | 153 const gfx::ImageSkia* text_box_background_; |
| 150 | 154 |
| 151 // The rounded edge on the left side of the Find text box. | 155 // The rounded edge on the left side of the Find text box. |
| 152 const gfx::ImageSkia* text_box_background_left_; | 156 const gfx::ImageSkia* text_box_background_left_; |
| 153 | 157 |
| 154 DISALLOW_COPY_AND_ASSIGN(FindBarView); | 158 DISALLOW_COPY_AND_ASSIGN(FindBarView); |
| 155 }; | 159 }; |
| 156 | 160 |
| 157 #endif // CHROME_BROWSER_UI_VIEWS_FIND_BAR_VIEW_H_ | 161 #endif // CHROME_BROWSER_UI_VIEWS_FIND_BAR_VIEW_H_ |
| OLD | NEW |