Chromium Code Reviews| 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 // This file defines the interface class OmniboxView. Each toolkit will | 5 // This file defines the interface class OmniboxView. Each toolkit will |
| 6 // implement the edit view differently, so that code is inherently platform | 6 // implement the edit view differently, so that code is inherently platform |
| 7 // specific. However, the OmniboxEditModel needs to do some communication with | 7 // specific. However, the OmniboxEditModel needs to do some communication with |
| 8 // the view. Since the model is shared between platforms, we need to define an | 8 // the view. Since the model is shared between platforms, we need to define an |
| 9 // interface that all view implementations will share. | 9 // interface that all view implementations will share. |
| 10 | 10 |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 68 // browser, or just whatever the user has currently typed. | 68 // browser, or just whatever the user has currently typed. |
| 69 virtual base::string16 GetText() const = 0; | 69 virtual base::string16 GetText() const = 0; |
| 70 | 70 |
| 71 // |true| if the user is in the process of editing the field, or if | 71 // |true| if the user is in the process of editing the field, or if |
| 72 // the field is empty. | 72 // the field is empty. |
| 73 bool IsEditingOrEmpty() const; | 73 bool IsEditingOrEmpty() const; |
| 74 | 74 |
| 75 // Returns the resource ID of the icon to show for the current text. | 75 // Returns the resource ID of the icon to show for the current text. |
| 76 int GetIcon() const; | 76 int GetIcon() const; |
| 77 | 77 |
| 78 // Like GetIcon(), but returns a vector icon identifier. | 78 // Like GetIcon(), but returns a vector icon identifier. The icon may |
| 79 gfx::VectorIconId GetVectorIcon() const; | 79 // change in a dark theme, hence |invert|. |
|
Peter Kasting
2015/11/17 21:27:03
Nit: Maybe this second sentence: "If |invert| is t
Evan Stade
2015/11/17 22:57:21
Done.
| |
| 80 gfx::VectorIconId GetVectorIcon(bool invert) const; | |
| 80 | 81 |
| 81 // The user text is the text the user has manually keyed in. When present, | 82 // The user text is the text the user has manually keyed in. When present, |
| 82 // this is shown in preference to the permanent text; hitting escape will | 83 // this is shown in preference to the permanent text; hitting escape will |
| 83 // revert to the permanent text. | 84 // revert to the permanent text. |
| 84 void SetUserText(const base::string16& text); | 85 void SetUserText(const base::string16& text); |
| 85 virtual void SetUserText(const base::string16& text, | 86 virtual void SetUserText(const base::string16& text, |
| 86 const base::string16& display_text, | 87 const base::string16& display_text, |
| 87 bool update_popup); | 88 bool update_popup); |
| 88 | 89 |
| 89 // Sets the window text and the caret position. |notify_text_changed| is true | 90 // Sets the window text and the caret position. |notify_text_changed| is true |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 258 FRIEND_TEST_ALL_PREFIXES(InstantExtendedTest, ShowURL); | 259 FRIEND_TEST_ALL_PREFIXES(InstantExtendedTest, ShowURL); |
| 259 | 260 |
| 260 // |model_| can be NULL in tests. | 261 // |model_| can be NULL in tests. |
| 261 scoped_ptr<OmniboxEditModel> model_; | 262 scoped_ptr<OmniboxEditModel> model_; |
| 262 OmniboxEditController* controller_; | 263 OmniboxEditController* controller_; |
| 263 | 264 |
| 264 DISALLOW_COPY_AND_ASSIGN(OmniboxView); | 265 DISALLOW_COPY_AND_ASSIGN(OmniboxView); |
| 265 }; | 266 }; |
| 266 | 267 |
| 267 #endif // COMPONENTS_OMNIBOX_BROWSER_OMNIBOX_VIEW_H_ | 268 #endif // COMPONENTS_OMNIBOX_BROWSER_OMNIBOX_VIEW_H_ |
| OLD | NEW |