OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 AutocompleteEditModel needs to do some communication | 7 // specific. However, the AutocompleteEditModel needs to do some communication |
8 // with the view. Since the model is shared between platforms, we need to | 8 // with the view. Since the model is shared between platforms, we need to |
9 // define an interface that all view implementations will share. | 9 // define an interface that all view implementations will share. |
10 | 10 |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 // The user text is the text the user has manually keyed in. When present, | 102 // The user text is the text the user has manually keyed in. When present, |
103 // this is shown in preference to the permanent text; hitting escape will | 103 // this is shown in preference to the permanent text; hitting escape will |
104 // revert to the permanent text. | 104 // revert to the permanent text. |
105 virtual void SetUserText(const string16& text) = 0; | 105 virtual void SetUserText(const string16& text) = 0; |
106 virtual void SetUserText(const string16& text, | 106 virtual void SetUserText(const string16& text, |
107 const string16& display_text, | 107 const string16& display_text, |
108 bool update_popup) = 0; | 108 bool update_popup) = 0; |
109 | 109 |
110 // Sets the window text and the caret position. | 110 // Sets the window text and the caret position. |
111 virtual void SetWindowTextAndCaretPos(const string16& text, | 111 virtual void SetWindowTextAndCaretPos(const string16& text, |
112 size_t caret_pos, | 112 size_t caret_pos) = 0; |
113 bool update_popup, | |
114 bool notify_text_changed) = 0; | |
115 | 113 |
116 // Sets the edit to forced query mode. Practically speaking, this means that | 114 // Sets the edit to forced query mode. Practically speaking, this means that |
117 // if the edit is not in forced query mode, its text is set to "?" with the | 115 // if the edit is not in forced query mode, its text is set to "?" with the |
118 // cursor at the end, and if the edit is in forced query mode (its first | 116 // cursor at the end, and if the edit is in forced query mode (its first |
119 // non-whitespace character is '?'), the text after the '?' is selected. | 117 // non-whitespace character is '?'), the text after the '?' is selected. |
120 // | 118 // |
121 // In the future we should display the search engine UI for the default engine | 119 // In the future we should display the search engine UI for the default engine |
122 // rather than '?'. | 120 // rather than '?'. |
123 virtual void SetForcedQuery() = 0; | 121 virtual void SetForcedQuery() = 0; |
124 | 122 |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 #endif | 215 #endif |
218 | 216 |
219 // Returns a string with any leading javascript schemas stripped from the | 217 // Returns a string with any leading javascript schemas stripped from the |
220 // input text. | 218 // input text. |
221 static string16 StripJavascriptSchemas(const string16& text); | 219 static string16 StripJavascriptSchemas(const string16& text); |
222 | 220 |
223 virtual ~OmniboxView() {} | 221 virtual ~OmniboxView() {} |
224 }; | 222 }; |
225 | 223 |
226 #endif // CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_VIEW_H_ | 224 #endif // CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_VIEW_H_ |
OLD | NEW |