Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: webkit/plugins/ppapi/ppapi_webplugin_impl.cc

Issue 10274020: Revert 134620 - Show a replacement plug-in for loading errors. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « webkit/plugins/ppapi/plugin_delegate.h ('k') | webkit/support/test_webplugin_page_delegate.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/ppapi/ppapi_webplugin_impl.h" 5 #include "webkit/plugins/ppapi/ppapi_webplugin_impl.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 8
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "googleurl/src/gurl.h" 10 #include "googleurl/src/gurl.h"
11 #include "ppapi/shared_impl/ppapi_globals.h" 11 #include "ppapi/shared_impl/ppapi_globals.h"
12 #include "ppapi/shared_impl/var_tracker.h" 12 #include "ppapi/shared_impl/var_tracker.h"
13 #include "third_party/WebKit/Source/WebKit/chromium/public/WebBindings.h" 13 #include "third_party/WebKit/Source/WebKit/chromium/public/WebBindings.h"
14 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" 14 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h"
15 #include "third_party/WebKit/Source/WebKit/chromium/public/WebElement.h" 15 #include "third_party/WebKit/Source/WebKit/chromium/public/WebElement.h"
16 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" 16 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h"
17 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginContainer.h" 17 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginContainer.h"
18 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginParams.h" 18 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginParams.h"
19 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebPoint.h" 19 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebPoint.h"
20 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebRect.h" 20 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebRect.h"
21 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" 21 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h"
22 #include "webkit/plugins/ppapi/message_channel.h" 22 #include "webkit/plugins/ppapi/message_channel.h"
23 #include "webkit/plugins/ppapi/npobject_var.h" 23 #include "webkit/plugins/ppapi/npobject_var.h"
24 #include "webkit/plugins/ppapi/plugin_module.h" 24 #include "webkit/plugins/ppapi/plugin_module.h"
25 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" 25 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h"
26 #include "webkit/plugins/ppapi/ppb_url_loader_impl.h" 26 #include "webkit/plugins/ppapi/ppb_url_loader_impl.h"
27 27
28 using ppapi::NPObjectVar; 28 using ppapi::NPObjectVar;
29 using WebKit::WebCanvas; 29 using WebKit::WebCanvas;
30 using WebKit::WebPlugin;
31 using WebKit::WebPluginContainer; 30 using WebKit::WebPluginContainer;
32 using WebKit::WebPluginParams; 31 using WebKit::WebPluginParams;
33 using WebKit::WebPoint; 32 using WebKit::WebPoint;
34 using WebKit::WebRect; 33 using WebKit::WebRect;
35 using WebKit::WebString; 34 using WebKit::WebString;
36 using WebKit::WebURL; 35 using WebKit::WebURL;
37 using WebKit::WebVector; 36 using WebKit::WebVector;
38 using WebKit::WebView; 37 using WebKit::WebView;
39 38
40 namespace webkit { 39 namespace webkit {
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 return false; 77 return false;
79 78
80 bool success = instance_->Initialize(container, 79 bool success = instance_->Initialize(container,
81 init_data_->arg_names, 80 init_data_->arg_names,
82 init_data_->arg_values, 81 init_data_->arg_values,
83 init_data_->url, 82 init_data_->url,
84 full_frame_); 83 full_frame_);
85 if (!success) { 84 if (!success) {
86 instance_->Delete(); 85 instance_->Delete();
87 instance_ = NULL; 86 instance_ = NULL;
88 87 return false;
89 WebKit::WebPlugin* replacement_plugin =
90 init_data_->delegate->CreatePluginReplacement(
91 init_data_->module->path());
92 if (!replacement_plugin->initialize(container))
93 return false;
94
95 container->setPlugin(replacement_plugin);
96 return true;
97 } 88 }
98 89
99 init_data_.reset(); 90 init_data_.reset();
100 return true; 91 return true;
101 } 92 }
102 93
103 void WebPluginImpl::destroy() { 94 void WebPluginImpl::destroy() {
104 if (instance_) { 95 if (instance_) {
105 ::ppapi::PpapiGlobals::Get()->GetVarTracker()->ReleaseVar(instance_object_); 96 ::ppapi::PpapiGlobals::Get()->GetVarTracker()->ReleaseVar(instance_object_);
106 instance_object_ = PP_MakeUndefined(); 97 instance_object_ = PP_MakeUndefined();
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 bool WebPluginImpl::canRotateView() { 266 bool WebPluginImpl::canRotateView() {
276 return instance_->CanRotateView(); 267 return instance_->CanRotateView();
277 } 268 }
278 269
279 void WebPluginImpl::rotateView(RotationType type) { 270 void WebPluginImpl::rotateView(RotationType type) {
280 instance_->RotateView(type); 271 instance_->RotateView(type);
281 } 272 }
282 273
283 } // namespace ppapi 274 } // namespace ppapi
284 } // namespace webkit 275 } // namespace webkit
OLDNEW
« no previous file with comments | « webkit/plugins/ppapi/plugin_delegate.h ('k') | webkit/support/test_webplugin_page_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698