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_OMNIBOX_OMNIBOX_VIEW_VIEWS_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_OMNIBOX_OMNIBOX_VIEW_VIEWS_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_OMNIBOX_OMNIBOX_VIEW_VIEWS_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_OMNIBOX_OMNIBOX_VIEW_VIEWS_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 #endif | 45 #endif |
46 public views::TextfieldController { | 46 public views::TextfieldController { |
47 public: | 47 public: |
48 // The internal view class name. | 48 // The internal view class name. |
49 static const char kViewClassName[]; | 49 static const char kViewClassName[]; |
50 | 50 |
51 OmniboxViewViews(OmniboxEditController* controller, | 51 OmniboxViewViews(OmniboxEditController* controller, |
52 ToolbarModel* toolbar_model, | 52 ToolbarModel* toolbar_model, |
53 Profile* profile, | 53 Profile* profile, |
54 CommandUpdater* command_updater, | 54 CommandUpdater* command_updater, |
55 bool popup_window_mode, | 55 WindowMode window_mode, |
56 LocationBarView* location_bar); | 56 LocationBarView* location_bar); |
57 virtual ~OmniboxViewViews(); | 57 virtual ~OmniboxViewViews(); |
58 | 58 |
59 // Initialize, create the underlying views, etc; | 59 // Initialize, create the underlying views, etc; |
60 void Init(views::View* popup_parent_view); | 60 void Init(views::View* popup_parent_view); |
61 | 61 |
62 // Sets the colors of the text view according to the theme. | 62 // Sets the colors of the text view according to the theme. |
63 void SetBaseColor(); | 63 void SetBaseColor(); |
64 | 64 |
65 // Called after key even is handled either by HandleKeyEvent or by Textfield. | 65 // Called after key even is handled either by HandleKeyEvent or by Textfield. |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 | 162 |
163 // Update the field with |text| and set the selection. | 163 // Update the field with |text| and set the selection. |
164 void SetTextAndSelectedRange(const string16& text, | 164 void SetTextAndSelectedRange(const string16& text, |
165 const ui::Range& range); | 165 const ui::Range& range); |
166 | 166 |
167 // Returns the selected text. | 167 // Returns the selected text. |
168 string16 GetSelectedText() const; | 168 string16 GetSelectedText() const; |
169 | 169 |
170 views::Textfield* textfield_; | 170 views::Textfield* textfield_; |
171 | 171 |
172 // When true, the location bar view is read only and also is has a slightly | 172 // When set to POPUP, the location bar view is read only and also has a |
173 // different presentation (smaller font size). This is used for popups. | 173 // slightly different presentation (font size / color). When set to DISABLED, |
174 bool popup_window_mode_; | 174 // the location bar looks like a POPUP type but is not selectable or |
| 175 // focusable. |
| 176 WindowMode window_mode_; |
175 | 177 |
176 scoped_ptr<OmniboxPopupView> popup_view_; | 178 scoped_ptr<OmniboxPopupView> popup_view_; |
177 | 179 |
178 ToolbarModel::SecurityLevel security_level_; | 180 ToolbarModel::SecurityLevel security_level_; |
179 | 181 |
180 // Selection at the point where the user started using the | 182 // Selection at the point where the user started using the |
181 // arrows to move around in the popup. | 183 // arrows to move around in the popup. |
182 ui::Range saved_temporary_selection_; | 184 ui::Range saved_temporary_selection_; |
183 | 185 |
184 // Tracking state before and after a possible change. | 186 // Tracking state before and after a possible change. |
(...skipping 13 matching lines...) Expand all Loading... |
198 // Should we select all the text when we see the mouse button get released? | 200 // Should we select all the text when we see the mouse button get released? |
199 // We select in response to a click that focuses the omnibox, but we defer | 201 // We select in response to a click that focuses the omnibox, but we defer |
200 // until release, setting this variable back to false if we saw a drag, to | 202 // until release, setting this variable back to false if we saw a drag, to |
201 // allow the user to select just a portion of the text. | 203 // allow the user to select just a portion of the text. |
202 bool select_all_on_mouse_release_; | 204 bool select_all_on_mouse_release_; |
203 | 205 |
204 DISALLOW_COPY_AND_ASSIGN(OmniboxViewViews); | 206 DISALLOW_COPY_AND_ASSIGN(OmniboxViewViews); |
205 }; | 207 }; |
206 | 208 |
207 #endif // CHROME_BROWSER_UI_VIEWS_OMNIBOX_OMNIBOX_VIEW_VIEWS_H_ | 209 #endif // CHROME_BROWSER_UI_VIEWS_OMNIBOX_OMNIBOX_VIEW_VIEWS_H_ |
OLD | NEW |