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 #ifndef UI_VIEWS_CONTROLS_WEBVIEW_WEBVIEW_H_ | 5 #ifndef UI_VIEWS_CONTROLS_WEBVIEW_WEBVIEW_H_ |
6 #define UI_VIEWS_CONTROLS_WEBVIEW_WEBVIEW_H_ | 6 #define UI_VIEWS_CONTROLS_WEBVIEW_WEBVIEW_H_ |
7 | 7 |
| 8 #include "base/basictypes.h" |
8 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
9 #include "content/public/browser/notification_observer.h" | 10 #include "content/public/browser/notification_observer.h" |
10 #include "content/public/browser/notification_registrar.h" | 11 #include "content/public/browser/notification_registrar.h" |
11 #include "content/public/browser/web_contents.h" | 12 #include "content/public/browser/web_contents.h" |
12 #include "content/public/browser/web_contents_delegate.h" | 13 #include "content/public/browser/web_contents_delegate.h" |
| 14 #include "ui/views/controls/webview/webview_export.h" |
13 #include "ui/views/view.h" | 15 #include "ui/views/view.h" |
14 | 16 |
15 namespace views { | 17 namespace views { |
16 | 18 |
17 class NativeViewHost; | 19 class NativeViewHost; |
18 | 20 |
19 class VIEWS_EXPORT WebView : public View, | 21 class WEBVIEW_EXPORT WebView : public View, |
20 public content::NotificationObserver, | 22 public content::NotificationObserver, |
21 public content::WebContentsDelegate { | 23 public content::WebContentsDelegate { |
22 public: | 24 public: |
23 static const char kViewClassName[]; | 25 static const char kViewClassName[]; |
24 | 26 |
25 explicit WebView(content::BrowserContext* browser_context); | 27 explicit WebView(content::BrowserContext* browser_context); |
26 virtual ~WebView(); | 28 virtual ~WebView(); |
27 | 29 |
28 // This creates a WebContents if none is yet associated with this WebView. The | 30 // This creates a WebContents if none is yet associated with this WebView. The |
29 // WebView owns this implicitly created WebContents. | 31 // WebView owns this implicitly created WebContents. |
30 content::WebContents* GetWebContents(); | 32 content::WebContents* GetWebContents(); |
31 | 33 |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 void RenderViewHostChanged(content::RenderViewHost* old_host, | 107 void RenderViewHostChanged(content::RenderViewHost* old_host, |
106 content::RenderViewHost* new_host); | 108 content::RenderViewHost* new_host); |
107 void WebContentsDestroyed(content::WebContents* web_contents); | 109 void WebContentsDestroyed(content::WebContents* web_contents); |
108 | 110 |
109 // Create a regular or test web contents (based on whether we're running | 111 // Create a regular or test web contents (based on whether we're running |
110 // in a unit test or not). | 112 // in a unit test or not). |
111 content::WebContents* CreateWebContents( | 113 content::WebContents* CreateWebContents( |
112 content::BrowserContext* browser_context, | 114 content::BrowserContext* browser_context, |
113 content::SiteInstance* site_instance); | 115 content::SiteInstance* site_instance); |
114 | 116 |
115 | |
116 NativeViewHost* wcv_holder_; | 117 NativeViewHost* wcv_holder_; |
117 scoped_ptr<content::WebContents> wc_owner_; | 118 scoped_ptr<content::WebContents> wc_owner_; |
118 content::WebContents* web_contents_; | 119 content::WebContents* web_contents_; |
119 content::BrowserContext* browser_context_; | 120 content::BrowserContext* browser_context_; |
120 content::NotificationRegistrar registrar_; | 121 content::NotificationRegistrar registrar_; |
121 bool allow_accelerators_; | 122 bool allow_accelerators_; |
122 gfx::Size preferred_size_; | 123 gfx::Size preferred_size_; |
123 | 124 |
124 DISALLOW_COPY_AND_ASSIGN(WebView); | 125 DISALLOW_COPY_AND_ASSIGN(WebView); |
125 }; | 126 }; |
126 | 127 |
127 } // namespace views | 128 } // namespace views |
128 | 129 |
129 #endif // UI_VIEWS_CONTROLS_WEBVIEW_WEBVIEW_H_ | 130 #endif // UI_VIEWS_CONTROLS_WEBVIEW_WEBVIEW_H_ |
OLD | NEW |