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/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 SkColor GetTextColorForIcon(); | 109 SkColor GetTextColorForIcon(); |
110 | 110 |
111 // We use a hidden view to grab mouse clicks and bring focus to the find | 111 // We use a hidden view to grab mouse clicks and bring focus to the find |
112 // text box. This is because although the find text box may look like it | 112 // text box. This is because although the find text box may look like it |
113 // extends all the way to the find button, it only goes as far as to the | 113 // extends all the way to the find button, it only goes as far as to the |
114 // match_count label. The user, however, expects being able to click anywhere | 114 // match_count label. The user, however, expects being able to click anywhere |
115 // inside what looks like the find text box (including on or around the | 115 // inside what looks like the find text box (including on or around the |
116 // match_count label) and have focus brought to the find box. | 116 // match_count label) and have focus brought to the find box. |
117 class FocusForwarderView : public views::View { | 117 class FocusForwarderView : public views::View { |
118 public: | 118 public: |
119 explicit FocusForwarderView( | 119 explicit FocusForwarderView(views::Textfield* view_to_focus_on_mousedown); |
120 views::Textfield* view_to_focus_on_mousedown) | |
121 : view_to_focus_on_mousedown_(view_to_focus_on_mousedown) {} | |
122 | 120 |
123 private: | 121 private: |
124 bool OnMousePressed(const ui::MouseEvent& event) override; | 122 bool OnMousePressed(const ui::MouseEvent& event) override; |
125 | 123 |
126 views::Textfield* view_to_focus_on_mousedown_; | 124 views::Textfield* view_to_focus_on_mousedown_; |
127 | 125 |
128 DISALLOW_COPY_AND_ASSIGN(FocusForwarderView); | 126 DISALLOW_COPY_AND_ASSIGN(FocusForwarderView); |
129 }; | 127 }; |
130 | 128 |
131 // Returns the OS-specific view for the find bar that acts as an intermediary | 129 // Returns the OS-specific view for the find bar that acts as an intermediary |
(...skipping 14 matching lines...) Expand all Loading... |
146 views::ImageButton* find_next_button_; | 144 views::ImageButton* find_next_button_; |
147 views::ImageButton* close_button_; | 145 views::ImageButton* close_button_; |
148 | 146 |
149 // The preferred height of the find bar. | 147 // The preferred height of the find bar. |
150 int preferred_height_; | 148 int preferred_height_; |
151 | 149 |
152 DISALLOW_COPY_AND_ASSIGN(FindBarView); | 150 DISALLOW_COPY_AND_ASSIGN(FindBarView); |
153 }; | 151 }; |
154 | 152 |
155 #endif // CHROME_BROWSER_UI_VIEWS_FIND_BAR_VIEW_H_ | 153 #endif // CHROME_BROWSER_UI_VIEWS_FIND_BAR_VIEW_H_ |
OLD | NEW |