OLD | NEW |
---|---|
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #ifndef COMPONENTS_OMNIBOX_BROWSER_OMNIBOX_EDIT_MODEL_H_ | 5 #ifndef COMPONENTS_OMNIBOX_BROWSER_OMNIBOX_EDIT_MODEL_H_ |
6 #define COMPONENTS_OMNIBOX_BROWSER_OMNIBOX_EDIT_MODEL_H_ | 6 #define COMPONENTS_OMNIBOX_BROWSER_OMNIBOX_EDIT_MODEL_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
153 | 153 |
154 // Updates permanent_text_ to the current permanent text from the toolbar | 154 // Updates permanent_text_ to the current permanent text from the toolbar |
155 // model. Returns true if the permanent text changed and the change should be | 155 // model. Returns true if the permanent text changed and the change should be |
156 // immediately user-visible, because either the user is not editing or the | 156 // immediately user-visible, because either the user is not editing or the |
157 // edit does not have focus. | 157 // edit does not have focus. |
158 bool UpdatePermanentText(); | 158 bool UpdatePermanentText(); |
159 | 159 |
160 // Returns the URL corresponding to the permanent text. | 160 // Returns the URL corresponding to the permanent text. |
161 GURL PermanentURL() const; | 161 GURL PermanentURL() const; |
162 | 162 |
163 // Returns the raw permanent text. | |
164 base::string16 PermanentText() { return permanent_text_; } | |
Peter Kasting
2017/04/10 23:04:13
Nit: const base::string16& permanent_text() const
Kevin Bailey
2017/04/11 14:12:42
Done.
| |
165 | |
163 // Sets the user_text_ to |text|. Only the View should call this. | 166 // Sets the user_text_ to |text|. Only the View should call this. |
164 void SetUserText(const base::string16& text); | 167 void SetUserText(const base::string16& text); |
165 | 168 |
166 // Invoked any time the text may have changed in the edit. Notifies the | 169 // Invoked any time the text may have changed in the edit. Notifies the |
167 // controller. | 170 // controller. |
168 void OnChanged(); | 171 void OnChanged(); |
169 | 172 |
170 // Reverts the edit model back to its unedited state (permanent text showing, | 173 // Reverts the edit model back to its unedited state (permanent text showing, |
171 // no user input in progress). | 174 // no user input in progress). |
172 void Revert(); | 175 void Revert(); |
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
563 | 566 |
564 // The input that was sent to the AutocompleteController. Since no | 567 // The input that was sent to the AutocompleteController. Since no |
565 // autocomplete query is started after a tab switch, it is possible for this | 568 // autocomplete query is started after a tab switch, it is possible for this |
566 // |input_| to differ from the one currently stored in AutocompleteController. | 569 // |input_| to differ from the one currently stored in AutocompleteController. |
567 AutocompleteInput input_; | 570 AutocompleteInput input_; |
568 | 571 |
569 DISALLOW_COPY_AND_ASSIGN(OmniboxEditModel); | 572 DISALLOW_COPY_AND_ASSIGN(OmniboxEditModel); |
570 }; | 573 }; |
571 | 574 |
572 #endif // COMPONENTS_OMNIBOX_BROWSER_OMNIBOX_EDIT_MODEL_H_ | 575 #endif // COMPONENTS_OMNIBOX_BROWSER_OMNIBOX_EDIT_MODEL_H_ |
OLD | NEW |