| 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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 | 82 |
| 83 // Returns the current text of the edit control, which could be the | 83 // Returns the current text of the edit control, which could be the |
| 84 // "temporary" text set by the popup, the "permanent" text set by the | 84 // "temporary" text set by the popup, the "permanent" text set by the |
| 85 // browser, or just whatever the user has currently typed. | 85 // browser, or just whatever the user has currently typed. |
| 86 virtual base::string16 GetText() const = 0; | 86 virtual base::string16 GetText() const = 0; |
| 87 | 87 |
| 88 // |true| if the user is in the process of editing the field, or if | 88 // |true| if the user is in the process of editing the field, or if |
| 89 // the field is empty. | 89 // the field is empty. |
| 90 bool IsEditingOrEmpty() const; | 90 bool IsEditingOrEmpty() const; |
| 91 | 91 |
| 92 // Like GetIcon(), but returns a vector icon identifier. | 92 // Returns the vector icon to display as the location icon. |
| 93 gfx::VectorIconId GetVectorIcon() const; | 93 const gfx::VectorIcon& GetVectorIcon() const; |
| 94 | 94 |
| 95 // The user text is the text the user has manually keyed in. When present, | 95 // The user text is the text the user has manually keyed in. When present, |
| 96 // this is shown in preference to the permanent text; hitting escape will | 96 // this is shown in preference to the permanent text; hitting escape will |
| 97 // revert to the permanent text. | 97 // revert to the permanent text. |
| 98 void SetUserText(const base::string16& text); | 98 void SetUserText(const base::string16& text); |
| 99 virtual void SetUserText(const base::string16& text, | 99 virtual void SetUserText(const base::string16& text, |
| 100 bool update_popup); | 100 bool update_popup); |
| 101 | 101 |
| 102 // Sets the window text and the caret position. |notify_text_changed| is true | 102 // Sets the window text and the caret position. |notify_text_changed| is true |
| 103 // if the model should be notified of the change. | 103 // if the model should be notified of the change. |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 friend class OmniboxViewMacTest; | 266 friend class OmniboxViewMacTest; |
| 267 | 267 |
| 268 // |model_| can be NULL in tests. | 268 // |model_| can be NULL in tests. |
| 269 std::unique_ptr<OmniboxEditModel> model_; | 269 std::unique_ptr<OmniboxEditModel> model_; |
| 270 OmniboxEditController* controller_; | 270 OmniboxEditController* controller_; |
| 271 | 271 |
| 272 DISALLOW_COPY_AND_ASSIGN(OmniboxView); | 272 DISALLOW_COPY_AND_ASSIGN(OmniboxView); |
| 273 }; | 273 }; |
| 274 | 274 |
| 275 #endif // COMPONENTS_OMNIBOX_BROWSER_OMNIBOX_VIEW_H_ | 275 #endif // COMPONENTS_OMNIBOX_BROWSER_OMNIBOX_VIEW_H_ |
| OLD | NEW |