| 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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 | 83 |
| 84 // Returns the current text of the edit control, which could be the | 84 // Returns the current text of the edit control, which could be the |
| 85 // "temporary" text set by the popup, the "permanent" text set by the | 85 // "temporary" text set by the popup, the "permanent" text set by the |
| 86 // browser, or just whatever the user has currently typed. | 86 // browser, or just whatever the user has currently typed. |
| 87 virtual base::string16 GetText() const = 0; | 87 virtual base::string16 GetText() const = 0; |
| 88 | 88 |
| 89 // |true| if the user is in the process of editing the field, or if | 89 // |true| if the user is in the process of editing the field, or if |
| 90 // the field is empty. | 90 // the field is empty. |
| 91 bool IsEditingOrEmpty() const; | 91 bool IsEditingOrEmpty() const; |
| 92 | 92 |
| 93 // Returns the resource ID of the icon to show for the current text. | |
| 94 int GetIcon() const; | |
| 95 | |
| 96 // Like GetIcon(), but returns a vector icon identifier. | 93 // Like GetIcon(), but returns a vector icon identifier. |
| 97 gfx::VectorIconId GetVectorIcon() const; | 94 gfx::VectorIconId GetVectorIcon() const; |
| 98 | 95 |
| 99 // The user text is the text the user has manually keyed in. When present, | 96 // The user text is the text the user has manually keyed in. When present, |
| 100 // this is shown in preference to the permanent text; hitting escape will | 97 // this is shown in preference to the permanent text; hitting escape will |
| 101 // revert to the permanent text. | 98 // revert to the permanent text. |
| 102 void SetUserText(const base::string16& text); | 99 void SetUserText(const base::string16& text); |
| 103 virtual void SetUserText(const base::string16& text, | 100 virtual void SetUserText(const base::string16& text, |
| 104 bool update_popup); | 101 bool update_popup); |
| 105 | 102 |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 friend class OmniboxViewMacTest; | 273 friend class OmniboxViewMacTest; |
| 277 | 274 |
| 278 // |model_| can be NULL in tests. | 275 // |model_| can be NULL in tests. |
| 279 std::unique_ptr<OmniboxEditModel> model_; | 276 std::unique_ptr<OmniboxEditModel> model_; |
| 280 OmniboxEditController* controller_; | 277 OmniboxEditController* controller_; |
| 281 | 278 |
| 282 DISALLOW_COPY_AND_ASSIGN(OmniboxView); | 279 DISALLOW_COPY_AND_ASSIGN(OmniboxView); |
| 283 }; | 280 }; |
| 284 | 281 |
| 285 #endif // COMPONENTS_OMNIBOX_BROWSER_OMNIBOX_VIEW_H_ | 282 #endif // COMPONENTS_OMNIBOX_BROWSER_OMNIBOX_VIEW_H_ |
| OLD | NEW |