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/safe_numerics.h" | 9 #include "base/safe_numerics.h" |
10 #include "content/public/renderer/web_preferences.h" | 10 #include "content/public/renderer/web_preferences.h" |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 WebPluginContainer* WebViewPlugin::container() const { return container_; } | 100 WebPluginContainer* WebViewPlugin::container() const { return container_; } |
101 | 101 |
102 bool WebViewPlugin::initialize(WebPluginContainer* container) { | 102 bool WebViewPlugin::initialize(WebPluginContainer* container) { |
103 container_ = container; | 103 container_ = container; |
104 if (container_) | 104 if (container_) |
105 old_title_ = container_->element().getAttribute("title"); | 105 old_title_ = container_->element().getAttribute("title"); |
106 return true; | 106 return true; |
107 } | 107 } |
108 | 108 |
109 void WebViewPlugin::destroy() { | 109 void WebViewPlugin::destroy() { |
110 if (delegate_) { | 110 if (delegate_) |
111 delegate_->WillDestroyPlugin(); | |
112 delegate_ = NULL; | 111 delegate_ = NULL; |
113 } | |
114 container_ = NULL; | 112 container_ = NULL; |
115 base::MessageLoop::current()->DeleteSoon(FROM_HERE, this); | 113 base::MessageLoop::current()->DeleteSoon(FROM_HERE, this); |
116 } | 114 } |
117 | 115 |
118 NPObject* WebViewPlugin::scriptableObject() { return NULL; } | 116 NPObject* WebViewPlugin::scriptableObject() { return NULL; } |
119 | 117 |
120 struct _NPP* WebViewPlugin::pluginNPP() { return NULL; } | 118 struct _NPP* WebViewPlugin::pluginNPP() { return NULL; } |
121 | 119 |
122 bool WebViewPlugin::getFormValue(WebString& value) { return false; } | 120 bool WebViewPlugin::getFormValue(WebString& value) { return false; } |
123 | 121 |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 void WebViewPlugin::didClearWindowObject(WebFrame* frame) { | 220 void WebViewPlugin::didClearWindowObject(WebFrame* frame) { |
223 if (delegate_) | 221 if (delegate_) |
224 delegate_->BindWebFrame(frame); | 222 delegate_->BindWebFrame(frame); |
225 } | 223 } |
226 | 224 |
227 void WebViewPlugin::didReceiveResponse(WebFrame* frame, | 225 void WebViewPlugin::didReceiveResponse(WebFrame* frame, |
228 unsigned identifier, | 226 unsigned identifier, |
229 const WebURLResponse& response) { | 227 const WebURLResponse& response) { |
230 WebFrameClient::didReceiveResponse(frame, identifier, response); | 228 WebFrameClient::didReceiveResponse(frame, identifier, response); |
231 } | 229 } |
OLD | NEW |