| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "components/plugins/renderer/webview_plugin.h" | 5 #include "components/plugins/renderer/webview_plugin.h" |
| 6 | 6 |
| 7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
| 8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
| 9 #include "base/numerics/safe_conversions.h" | 9 #include "base/numerics/safe_conversions.h" |
| 10 #include "content/public/common/web_preferences.h" | 10 #include "content/public/common/web_preferences.h" |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 | 121 |
| 122 void WebViewPlugin::destroy() { | 122 void WebViewPlugin::destroy() { |
| 123 if (delegate_) { | 123 if (delegate_) { |
| 124 delegate_->PluginDestroyed(); | 124 delegate_->PluginDestroyed(); |
| 125 delegate_ = NULL; | 125 delegate_ = NULL; |
| 126 } | 126 } |
| 127 container_ = NULL; | 127 container_ = NULL; |
| 128 base::MessageLoop::current()->DeleteSoon(FROM_HERE, this); | 128 base::MessageLoop::current()->DeleteSoon(FROM_HERE, this); |
| 129 } | 129 } |
| 130 | 130 |
| 131 NPObject* WebViewPlugin::scriptableObject() { return NULL; } | 131 v8::Local<v8::Object> WebViewPlugin::v8ScriptableObject(v8::Isolate* isolate) { |
| 132 if (!delegate_) |
| 133 return v8::Local<v8::Object>(); |
| 132 | 134 |
| 133 struct _NPP* WebViewPlugin::pluginNPP() { return NULL; } | 135 return delegate_->GetV8ScriptableObject(isolate); |
| 134 | 136 } |
| 135 bool WebViewPlugin::getFormValue(WebString& value) { return false; } | |
| 136 | 137 |
| 137 void WebViewPlugin::layoutIfNeeded() { | 138 void WebViewPlugin::layoutIfNeeded() { |
| 138 web_view_->layout(); | 139 web_view_->layout(); |
| 139 } | 140 } |
| 140 | 141 |
| 141 void WebViewPlugin::paint(WebCanvas* canvas, const WebRect& rect) { | 142 void WebViewPlugin::paint(WebCanvas* canvas, const WebRect& rect) { |
| 142 gfx::Rect paint_rect = gfx::IntersectRects(rect_, rect); | 143 gfx::Rect paint_rect = gfx::IntersectRects(rect_, rect); |
| 143 if (paint_rect.IsEmpty()) | 144 if (paint_rect.IsEmpty()) |
| 144 return; | 145 return; |
| 145 | 146 |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 void WebViewPlugin::didClearWindowObject(WebLocalFrame* frame) { | 263 void WebViewPlugin::didClearWindowObject(WebLocalFrame* frame) { |
| 263 if (delegate_) | 264 if (delegate_) |
| 264 delegate_->BindWebFrame(frame); | 265 delegate_->BindWebFrame(frame); |
| 265 } | 266 } |
| 266 | 267 |
| 267 void WebViewPlugin::didReceiveResponse(WebLocalFrame* frame, | 268 void WebViewPlugin::didReceiveResponse(WebLocalFrame* frame, |
| 268 unsigned identifier, | 269 unsigned identifier, |
| 269 const WebURLResponse& response) { | 270 const WebURLResponse& response) { |
| 270 WebFrameClient::didReceiveResponse(frame, identifier, response); | 271 WebFrameClient::didReceiveResponse(frame, identifier, response); |
| 271 } | 272 } |
| OLD | NEW |