| 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 // Returns true if all text is selected or there is no text at all. | 102 // Returns true if all text is selected or there is no text at all. |
| 103 virtual bool IsSelectAll() = 0; | 103 virtual bool IsSelectAll() = 0; |
| 104 | 104 |
| 105 // Returns true if the user deleted the suggested text. | 105 // Returns true if the user deleted the suggested text. |
| 106 virtual bool DeleteAtEndPressed() = 0; | 106 virtual bool DeleteAtEndPressed() = 0; |
| 107 | 107 |
| 108 // Fills |start| and |end| with the indexes of the current selection's bounds. | 108 // Fills |start| and |end| with the indexes of the current selection's bounds. |
| 109 // It is not guaranteed that |*start < *end|, as the selection can be | 109 // It is not guaranteed that |*start < *end|, as the selection can be |
| 110 // directed. If there is no selection, |start| and |end| will both be equal | 110 // directed. If there is no selection, |start| and |end| will both be equal |
| 111 // to the current cursor position. | 111 // to the current cursor position. |
| 112 virtual void GetSelectionBounds(size_t* start, size_t* end) = 0; | 112 virtual void GetSelectionBounds(size_t* start, size_t* end) const = 0; |
| 113 | 113 |
| 114 // Selects all the text in the edit. Use this in place of SetSelAll() to | 114 // Selects all the text in the edit. Use this in place of SetSelAll() to |
| 115 // avoid selecting the "phantom newline" at the end of the edit. | 115 // avoid selecting the "phantom newline" at the end of the edit. |
| 116 virtual void SelectAll(bool reversed) = 0; | 116 virtual void SelectAll(bool reversed) = 0; |
| 117 | 117 |
| 118 // Reverts the edit and popup back to their unedited state (permanent text | 118 // Reverts the edit and popup back to their unedited state (permanent text |
| 119 // showing, popup closed, no user input in progress). | 119 // showing, popup closed, no user input in progress). |
| 120 virtual void RevertAll() = 0; | 120 virtual void RevertAll() = 0; |
| 121 | 121 |
| 122 // Updates the autocomplete popup and other state after the text has been | 122 // Updates the autocomplete popup and other state after the text has been |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 #endif | 192 #endif |
| 193 | 193 |
| 194 // Returns a string with any leading javascript schemas stripped from the | 194 // Returns a string with any leading javascript schemas stripped from the |
| 195 // input text. | 195 // input text. |
| 196 static string16 StripJavascriptSchemas(const string16& text); | 196 static string16 StripJavascriptSchemas(const string16& text); |
| 197 | 197 |
| 198 virtual ~OmniboxView() {} | 198 virtual ~OmniboxView() {} |
| 199 }; | 199 }; |
| 200 | 200 |
| 201 #endif // CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_VIEW_H_ | 201 #endif // CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_VIEW_H_ |
| OLD | NEW |