| 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 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 13 matching lines...) Expand all Loading... |
| 24 | 24 |
| 25 class AutocompleteEditModel; | 25 class AutocompleteEditModel; |
| 26 class CommandUpdater; | 26 class CommandUpdater; |
| 27 class GURL; | 27 class GURL; |
| 28 | 28 |
| 29 namespace content { | 29 namespace content { |
| 30 class WebContents; | 30 class WebContents; |
| 31 } | 31 } |
| 32 | 32 |
| 33 #if defined(TOOLKIT_VIEWS) | 33 #if defined(TOOLKIT_VIEWS) |
| 34 | |
| 35 // TODO(beng): Move all views-related code to a views-specific sub-interface. | 34 // TODO(beng): Move all views-related code to a views-specific sub-interface. |
| 36 | |
| 37 class AutocompleteEditController; | |
| 38 class LocationBarView; | |
| 39 class Profile; | |
| 40 class ToolbarModel; | |
| 41 | |
| 42 namespace gfx { | 35 namespace gfx { |
| 43 class Font; | 36 class Font; |
| 44 } | 37 } |
| 45 | 38 |
| 46 namespace views { | 39 namespace views { |
| 47 class DropTargetEvent; | 40 class DropTargetEvent; |
| 48 class View; | 41 class View; |
| 49 } | 42 } |
| 50 | |
| 51 #endif | 43 #endif |
| 52 | 44 |
| 53 class OmniboxView { | 45 class OmniboxView { |
| 54 public: | 46 public: |
| 55 #if defined(TOOLKIT_VIEWS) | |
| 56 static OmniboxView* CreateOmniboxView(AutocompleteEditController* controller, | |
| 57 ToolbarModel* toolbar_model, | |
| 58 Profile* profile, | |
| 59 CommandUpdater* command_updater, | |
| 60 bool popup_window_mode, | |
| 61 LocationBarView* location_bar); | |
| 62 #endif | |
| 63 | |
| 64 // Used by the automation system for getting at the model from the view. | 47 // Used by the automation system for getting at the model from the view. |
| 65 virtual AutocompleteEditModel* model() = 0; | 48 virtual AutocompleteEditModel* model() = 0; |
| 66 virtual const AutocompleteEditModel* model() const = 0; | 49 virtual const AutocompleteEditModel* model() const = 0; |
| 67 | 50 |
| 68 // For use when switching tabs, this saves the current state onto the tab so | 51 // For use when switching tabs, this saves the current state onto the tab so |
| 69 // that it can be restored during a later call to Update(). | 52 // that it can be restored during a later call to Update(). |
| 70 virtual void SaveStateToTab(content::WebContents* tab) = 0; | 53 virtual void SaveStateToTab(content::WebContents* tab) = 0; |
| 71 | 54 |
| 72 // Called when any LocationBarView state changes. If | 55 // Called when any LocationBarView state changes. If |
| 73 // |tab_for_state_restoring| is non-NULL, it points to a WebContents whose | 56 // |tab_for_state_restoring| is non-NULL, it points to a WebContents whose |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 | 213 |
| 231 // Returns the current clipboard contents as a string that can be pasted in. | 214 // Returns the current clipboard contents as a string that can be pasted in. |
| 232 // In addition to just getting CF_UNICODETEXT out, this can also extract URLs | 215 // In addition to just getting CF_UNICODETEXT out, this can also extract URLs |
| 233 // from bookmarks on the clipboard. | 216 // from bookmarks on the clipboard. |
| 234 static string16 GetClipboardText(); | 217 static string16 GetClipboardText(); |
| 235 | 218 |
| 236 virtual ~OmniboxView() {} | 219 virtual ~OmniboxView() {} |
| 237 }; | 220 }; |
| 238 | 221 |
| 239 #endif // CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_VIEW_H_ | 222 #endif // CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_VIEW_H_ |
| OLD | NEW |