| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 AutocompleteEditView. Each toolkit | 5 // This file defines the interface class AutocompleteEditView. Each toolkit |
| 6 // will implement the edit view differently, so that code is inherently | 6 // will implement the edit view differently, so that code is inherently |
| 7 // platform specific. However, the AutocompleteEditModel needs to do some | 7 // platform specific. However, the AutocompleteEditModel needs to do some |
| 8 // communication with the view. Since the model is shared between platforms, | 8 // communication with the view. Since the model is shared between platforms, |
| 9 // we need to define an interface that all view implementations will share. | 9 // we need to define an interface that all view implementations will share. |
| 10 | 10 |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 | 154 |
| 155 // Returns the gfx::NativeView of the edit view. | 155 // Returns the gfx::NativeView of the edit view. |
| 156 virtual gfx::NativeView GetNativeView() const = 0; | 156 virtual gfx::NativeView GetNativeView() const = 0; |
| 157 | 157 |
| 158 // Returns the command updater for this view. | 158 // Returns the command updater for this view. |
| 159 virtual CommandUpdater* GetCommandUpdater() = 0; | 159 virtual CommandUpdater* GetCommandUpdater() = 0; |
| 160 | 160 |
| 161 // Shows the instant suggestion text. | 161 // Shows the instant suggestion text. |
| 162 virtual void SetInstantSuggestion(const string16& input) = 0; | 162 virtual void SetInstantSuggestion(const string16& input) = 0; |
| 163 | 163 |
| 164 // Returns the current instant suggestion text. |
| 165 virtual string16 GetInstantSuggestion() const = 0; |
| 166 |
| 164 // Returns the width in pixels needed to display the current text. The | 167 // Returns the width in pixels needed to display the current text. The |
| 165 // returned value includes margins. | 168 // returned value includes margins. |
| 166 virtual int TextWidth() const = 0; | 169 virtual int TextWidth() const = 0; |
| 167 | 170 |
| 168 // Returns true if the user is composing something in an IME. | 171 // Returns true if the user is composing something in an IME. |
| 169 virtual bool IsImeComposing() const = 0; | 172 virtual bool IsImeComposing() const = 0; |
| 170 | 173 |
| 171 #if defined(TOOLKIT_VIEWS) | 174 #if defined(TOOLKIT_VIEWS) |
| 172 // Adds the autocomplete edit view to view hierarchy and | 175 // Adds the autocomplete edit view to view hierarchy and |
| 173 // returns the views::View of the edit view. | 176 // returns the views::View of the edit view. |
| 174 virtual views::View* AddToView(views::View* parent) = 0; | 177 virtual views::View* AddToView(views::View* parent) = 0; |
| 175 | |
| 176 // Commits the suggested text. | |
| 177 virtual bool CommitInstantSuggestion(const string16& typed_text, | |
| 178 const string16& suggested_text) = 0; | |
| 179 #endif | 178 #endif |
| 180 | 179 |
| 181 virtual ~AutocompleteEditView() {} | 180 virtual ~AutocompleteEditView() {} |
| 182 }; | 181 }; |
| 183 | 182 |
| 184 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_EDIT_VIEW_H_ | 183 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_EDIT_VIEW_H_ |
| OLD | NEW |