| 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. If |invert| is true, |
| 79 gfx::VectorIconId GetVectorIcon() const; | 79 // this returns an icon suitable for display in an inverted (light-on-dark) |
| 80 // color scheme. |
| 81 gfx::VectorIconId GetVectorIcon(bool invert) const; |
| 80 | 82 |
| 81 // The user text is the text the user has manually keyed in. When present, | 83 // 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 | 84 // this is shown in preference to the permanent text; hitting escape will |
| 83 // revert to the permanent text. | 85 // revert to the permanent text. |
| 84 void SetUserText(const base::string16& text); | 86 void SetUserText(const base::string16& text); |
| 85 virtual void SetUserText(const base::string16& text, | 87 virtual void SetUserText(const base::string16& text, |
| 86 const base::string16& display_text, | 88 const base::string16& display_text, |
| 87 bool update_popup); | 89 bool update_popup); |
| 88 | 90 |
| 89 // Sets the window text and the caret position. |notify_text_changed| is true | 91 // 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); | 260 FRIEND_TEST_ALL_PREFIXES(InstantExtendedTest, ShowURL); |
| 259 | 261 |
| 260 // |model_| can be NULL in tests. | 262 // |model_| can be NULL in tests. |
| 261 scoped_ptr<OmniboxEditModel> model_; | 263 scoped_ptr<OmniboxEditModel> model_; |
| 262 OmniboxEditController* controller_; | 264 OmniboxEditController* controller_; |
| 263 | 265 |
| 264 DISALLOW_COPY_AND_ASSIGN(OmniboxView); | 266 DISALLOW_COPY_AND_ASSIGN(OmniboxView); |
| 265 }; | 267 }; |
| 266 | 268 |
| 267 #endif // COMPONENTS_OMNIBOX_BROWSER_OMNIBOX_VIEW_H_ | 269 #endif // COMPONENTS_OMNIBOX_BROWSER_OMNIBOX_VIEW_H_ |
| OLD | NEW |