| 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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 // Returns the current instant suggestion text. | 175 // Returns the current instant suggestion text. |
| 176 virtual string16 GetInstantSuggestion() const = 0; | 176 virtual string16 GetInstantSuggestion() const = 0; |
| 177 | 177 |
| 178 // Returns the width in pixels needed to display the current text. The | 178 // Returns the width in pixels needed to display the current text. The |
| 179 // returned value includes margins. | 179 // returned value includes margins. |
| 180 virtual int TextWidth() const = 0; | 180 virtual int TextWidth() const = 0; |
| 181 | 181 |
| 182 // Returns true if the user is composing something in an IME. | 182 // Returns true if the user is composing something in an IME. |
| 183 virtual bool IsImeComposing() const = 0; | 183 virtual bool IsImeComposing() const = 0; |
| 184 | 184 |
| 185 // Returns true if the autocomplete popup should not be shown, for example, |
| 186 // because the IME candidate window is open. |
| 187 virtual bool ShouldHideAutocompletePopup() const; |
| 188 |
| 185 #if defined(TOOLKIT_VIEWS) | 189 #if defined(TOOLKIT_VIEWS) |
| 186 // Adds the autocomplete edit view to view hierarchy and | 190 // Adds the autocomplete edit view to view hierarchy and |
| 187 // returns the views::View of the edit view. | 191 // returns the views::View of the edit view. |
| 188 virtual views::View* AddToView(views::View* parent) = 0; | 192 virtual views::View* AddToView(views::View* parent) = 0; |
| 189 | 193 |
| 190 // Performs the drop of a drag and drop operation on the view. | 194 // Performs the drop of a drag and drop operation on the view. |
| 191 virtual int OnPerformDrop(const views::DropTargetEvent& event) = 0; | 195 virtual int OnPerformDrop(const views::DropTargetEvent& event) = 0; |
| 192 #endif | 196 #endif |
| 193 | 197 |
| 194 // Returns a string with any leading javascript schemas stripped from the | 198 // Returns a string with any leading javascript schemas stripped from the |
| 195 // input text. | 199 // input text. |
| 196 static string16 StripJavascriptSchemas(const string16& text); | 200 static string16 StripJavascriptSchemas(const string16& text); |
| 197 | 201 |
| 198 virtual ~OmniboxView() {} | 202 virtual ~OmniboxView() {} |
| 199 }; | 203 }; |
| 200 | 204 |
| 201 #endif // CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_VIEW_H_ | 205 #endif // CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_VIEW_H_ |
| OLD | NEW |