| 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 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 | 182 |
| 183 // Returns the gfx::NativeView of the edit view. | 183 // Returns the gfx::NativeView of the edit view. |
| 184 virtual gfx::NativeView GetNativeView() const = 0; | 184 virtual gfx::NativeView GetNativeView() const = 0; |
| 185 | 185 |
| 186 // Gets the relative window for the pop up window of OmniboxPopupView. The pop | 186 // Gets the relative window for the pop up window of OmniboxPopupView. The pop |
| 187 // up window will be shown under the relative window. When an IME is attached | 187 // up window will be shown under the relative window. When an IME is attached |
| 188 // to the rich edit control, the IME window is the relative window. Otherwise, | 188 // to the rich edit control, the IME window is the relative window. Otherwise, |
| 189 // the top-most window is the relative window. | 189 // the top-most window is the relative window. |
| 190 virtual gfx::NativeView GetRelativeWindowForPopup() const = 0; | 190 virtual gfx::NativeView GetRelativeWindowForPopup() const = 0; |
| 191 | 191 |
| 192 // Shows |input| as gray suggested text after what the user has typed. | |
| 193 virtual void SetGrayTextAutocompletion(const base::string16& input) = 0; | |
| 194 | |
| 195 // Returns the current gray suggested text. | |
| 196 virtual base::string16 GetGrayTextAutocompletion() const = 0; | |
| 197 | |
| 198 // Returns the width in pixels needed to display the current text. The | 192 // Returns the width in pixels needed to display the current text. The |
| 199 // returned value includes margins. | 193 // returned value includes margins. |
| 200 virtual int GetTextWidth() const = 0; | 194 virtual int GetTextWidth() const = 0; |
| 201 | 195 |
| 202 // Returns the omnibox's width in pixels. | 196 // Returns the omnibox's width in pixels. |
| 203 virtual int GetWidth() const = 0; | 197 virtual int GetWidth() const = 0; |
| 204 | 198 |
| 205 // Returns true if the user is composing something in an IME. | 199 // Returns true if the user is composing something in an IME. |
| 206 virtual bool IsImeComposing() const = 0; | 200 virtual bool IsImeComposing() const = 0; |
| 207 | 201 |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 friend class OmniboxViewMacTest; | 267 friend class OmniboxViewMacTest; |
| 274 | 268 |
| 275 // |model_| can be NULL in tests. | 269 // |model_| can be NULL in tests. |
| 276 std::unique_ptr<OmniboxEditModel> model_; | 270 std::unique_ptr<OmniboxEditModel> model_; |
| 277 OmniboxEditController* controller_; | 271 OmniboxEditController* controller_; |
| 278 | 272 |
| 279 DISALLOW_COPY_AND_ASSIGN(OmniboxView); | 273 DISALLOW_COPY_AND_ASSIGN(OmniboxView); |
| 280 }; | 274 }; |
| 281 | 275 |
| 282 #endif // COMPONENTS_OMNIBOX_BROWSER_OMNIBOX_VIEW_H_ | 276 #endif // COMPONENTS_OMNIBOX_BROWSER_OMNIBOX_VIEW_H_ |
| OLD | NEW |