Chromium Code Reviews| 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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 97 virtual void SetUserText(const base::string16& text, | 97 virtual void SetUserText(const base::string16& text, |
| 98 bool update_popup); | 98 bool update_popup); |
| 99 | 99 |
| 100 // Sets the window text and the caret position. |notify_text_changed| is true | 100 // Sets the window text and the caret position. |notify_text_changed| is true |
| 101 // if the model should be notified of the change. | 101 // if the model should be notified of the change. |
| 102 virtual void SetWindowTextAndCaretPos(const base::string16& text, | 102 virtual void SetWindowTextAndCaretPos(const base::string16& text, |
| 103 size_t caret_pos, | 103 size_t caret_pos, |
| 104 bool update_popup, | 104 bool update_popup, |
| 105 bool notify_text_changed) = 0; | 105 bool notify_text_changed) = 0; |
| 106 | 106 |
| 107 // Sets the caret position. Removes any selection. Will not put caret | |
| 108 // past the current text. | |
|
Peter Kasting
2017/05/18 18:38:34
Nit: This last sentence isn't perfectly clear abou
Kevin Bailey
2017/05/18 19:48:17
Done. ("Removes..." probably isn't necessary. Let
| |
| 109 virtual void SetCaretPos(size_t caret_pos) = 0; | |
| 110 | |
| 107 // Transitions the user into keyword mode with their default search provider, | 111 // Transitions the user into keyword mode with their default search provider, |
| 108 // preserving and selecting the user's text if they already typed in a query. | 112 // preserving and selecting the user's text if they already typed in a query. |
| 109 virtual void EnterKeywordModeForDefaultSearchProvider() = 0; | 113 virtual void EnterKeywordModeForDefaultSearchProvider() = 0; |
| 110 | 114 |
| 111 // Returns true if all text is selected or there is no text at all. | 115 // Returns true if all text is selected or there is no text at all. |
| 112 virtual bool IsSelectAll() const = 0; | 116 virtual bool IsSelectAll() const = 0; |
| 113 | 117 |
| 114 // Returns true if the user deleted the suggested text. | 118 // Returns true if the user deleted the suggested text. |
| 115 virtual bool DeleteAtEndPressed() = 0; | 119 virtual bool DeleteAtEndPressed() = 0; |
| 116 | 120 |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 282 friend class OmniboxViewMacTest; | 286 friend class OmniboxViewMacTest; |
| 283 | 287 |
| 284 // |model_| can be NULL in tests. | 288 // |model_| can be NULL in tests. |
| 285 std::unique_ptr<OmniboxEditModel> model_; | 289 std::unique_ptr<OmniboxEditModel> model_; |
| 286 OmniboxEditController* controller_; | 290 OmniboxEditController* controller_; |
| 287 | 291 |
| 288 DISALLOW_COPY_AND_ASSIGN(OmniboxView); | 292 DISALLOW_COPY_AND_ASSIGN(OmniboxView); |
| 289 }; | 293 }; |
| 290 | 294 |
| 291 #endif // COMPONENTS_OMNIBOX_BROWSER_OMNIBOX_VIEW_H_ | 295 #endif // COMPONENTS_OMNIBOX_BROWSER_OMNIBOX_VIEW_H_ |
| OLD | NEW |