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 |
11 #ifndef CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_VIEW_H_ | 11 #ifndef CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_VIEW_H_ |
12 #define CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_VIEW_H_ | 12 #define CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_VIEW_H_ |
13 #pragma once | 13 #pragma once |
14 | 14 |
15 #include <string> | 15 #include <string> |
16 | 16 |
17 #include "base/string16.h" | 17 #include "base/string16.h" |
18 #include "base/string_util.h" | |
19 #include "base/utf_string_conversions.h" | |
18 #include "chrome/browser/autocomplete/autocomplete_match.h" | 20 #include "chrome/browser/autocomplete/autocomplete_match.h" |
19 #include "content/common/page_transition_types.h" | 21 #include "content/common/page_transition_types.h" |
22 #include "content/common/url_constants.h" | |
20 #include "ui/gfx/native_widget_types.h" | 23 #include "ui/gfx/native_widget_types.h" |
21 #include "webkit/glue/window_open_disposition.h" | 24 #include "webkit/glue/window_open_disposition.h" |
22 | 25 |
23 class AutocompleteEditModel; | 26 class AutocompleteEditModel; |
24 class CommandUpdater; | 27 class CommandUpdater; |
25 class GURL; | 28 class GURL; |
26 class TabContents; | 29 class TabContents; |
27 | 30 |
31 namespace views { | |
28 #if defined(TOOLKIT_VIEWS) | 32 #if defined(TOOLKIT_VIEWS) |
29 namespace views { | |
30 class DropTargetEvent; | 33 class DropTargetEvent; |
31 class View; | 34 class View; |
35 #endif | |
36 | |
37 string16 StripJavascriptSchemas(const string16&); | |
Peter Kasting
2011/05/24 00:15:18
?? Why did you move this here? It belonged in Omn
Cris Neckar
2011/05/24 05:23:33
?? It was never in OmniboxView. It can't be as I n
Peter Kasting
2011/05/24 17:40:47
I don't understand why that matters. I think this
Cris Neckar
2011/05/24 18:48:11
Done.
| |
32 } // namespace views | 38 } // namespace views |
33 #endif | |
34 | 39 |
35 class OmniboxView { | 40 class OmniboxView { |
36 public: | 41 public: |
37 // Used by the automation system for getting at the model from the view. | 42 // Used by the automation system for getting at the model from the view. |
38 virtual AutocompleteEditModel* model() = 0; | 43 virtual AutocompleteEditModel* model() = 0; |
39 virtual const AutocompleteEditModel* model() const = 0; | 44 virtual const AutocompleteEditModel* model() const = 0; |
40 | 45 |
41 // For use when switching tabs, this saves the current state onto the tab so | 46 // For use when switching tabs, this saves the current state onto the tab so |
42 // that it can be restored during a later call to Update(). | 47 // that it can be restored during a later call to Update(). |
43 virtual void SaveStateToTab(TabContents* tab) = 0; | 48 virtual void SaveStateToTab(TabContents* tab) = 0; |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
181 virtual views::View* AddToView(views::View* parent) = 0; | 186 virtual views::View* AddToView(views::View* parent) = 0; |
182 | 187 |
183 // Performs the drop of a drag and drop operation on the view. | 188 // Performs the drop of a drag and drop operation on the view. |
184 virtual int OnPerformDrop(const views::DropTargetEvent& event) = 0; | 189 virtual int OnPerformDrop(const views::DropTargetEvent& event) = 0; |
185 #endif | 190 #endif |
186 | 191 |
187 virtual ~OmniboxView() {} | 192 virtual ~OmniboxView() {} |
188 }; | 193 }; |
189 | 194 |
190 #endif // CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_VIEW_H_ | 195 #endif // CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_VIEW_H_ |
OLD | NEW |