| 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 #include "webkit/plugins/webview_plugin.h" | 5 #include "webkit/plugins/webview_plugin.h" |
| 6 | 6 |
| 7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
| 8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
| 9 #include "skia/ext/platform_canvas.h" | 9 #include "skia/ext/platform_canvas.h" |
| 10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCursorInfo.h" | 10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCursorInfo.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 | 43 |
| 44 WebViewPlugin::WebViewPlugin(WebViewPlugin::Delegate* delegate) | 44 WebViewPlugin::WebViewPlugin(WebViewPlugin::Delegate* delegate) |
| 45 : delegate_(delegate), | 45 : delegate_(delegate), |
| 46 container_(NULL), | 46 container_(NULL), |
| 47 finished_loading_(false) { | 47 finished_loading_(false) { |
| 48 web_view_ = WebView::create(this); | 48 web_view_ = WebView::create(this); |
| 49 web_view_->initializeMainFrame(this); | 49 web_view_->initializeMainFrame(this); |
| 50 } | 50 } |
| 51 | 51 |
| 52 // static | 52 // static |
| 53 WebViewPlugin* WebViewPlugin::Create(WebViewPlugin::Delegate* delegate, | 53 WebViewPlugin* WebViewPlugin::Create( |
| 54 const WebPreferences& preferences, | 54 WebViewPlugin::Delegate* delegate, |
| 55 const std::string& html_data, | 55 const webkit_glue::WebPreferences& preferences, |
| 56 const GURL& url) { | 56 const std::string& html_data, |
| 57 const GURL& url) { |
| 57 WebViewPlugin* plugin = new WebViewPlugin(delegate); | 58 WebViewPlugin* plugin = new WebViewPlugin(delegate); |
| 58 WebView* web_view = plugin->web_view(); | 59 WebView* web_view = plugin->web_view(); |
| 59 preferences.Apply(web_view); | 60 preferences.Apply(web_view); |
| 60 web_view->mainFrame()->loadHTMLString(html_data, url); | 61 web_view->mainFrame()->loadHTMLString(html_data, url); |
| 61 return plugin; | 62 return plugin; |
| 62 } | 63 } |
| 63 | 64 |
| 64 WebViewPlugin::~WebViewPlugin() { | 65 WebViewPlugin::~WebViewPlugin() { |
| 65 web_view_->close(); | 66 web_view_->close(); |
| 66 } | 67 } |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 return error; | 232 return error; |
| 232 } | 233 } |
| 233 | 234 |
| 234 void WebViewPlugin::didReceiveResponse(WebFrame* frame, | 235 void WebViewPlugin::didReceiveResponse(WebFrame* frame, |
| 235 unsigned identifier, | 236 unsigned identifier, |
| 236 const WebURLResponse& response) { | 237 const WebURLResponse& response) { |
| 237 WebFrameClient::didReceiveResponse(frame, identifier, response); | 238 WebFrameClient::didReceiveResponse(frame, identifier, response); |
| 238 } | 239 } |
| 239 | 240 |
| 240 } // namespace webkit | 241 } // namespace webkit |
| OLD | NEW |