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

Side by Side Diff: components/plugins/renderer/loadable_plugin_placeholder.cc

Issue 2600253003: Fix plugin placeholders not loading (Closed)
Patch Set: Address bauerb's comments Created 3 years, 11 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
« no previous file with comments | « no previous file | components/plugins/renderer/webview_plugin.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/loadable_plugin_placeholder.h" 5 #include "components/plugins/renderer/loadable_plugin_placeholder.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 return; 122 return;
123 } 123 }
124 124
125 // During initialization, the new plugin might have replaced itself in turn 125 // During initialization, the new plugin might have replaced itself in turn
126 // with another plugin. Make sure not to use the passed in |new_plugin| after 126 // with another plugin. Make sure not to use the passed in |new_plugin| after
127 // this point. 127 // this point.
128 new_plugin = container->plugin(); 128 new_plugin = container->plugin();
129 129
130 container->invalidate(); 130 container->invalidate();
131 container->reportGeometry(); 131 container->reportGeometry();
132 if (plugin()->focused())
133 new_plugin->updateFocus(true, blink::WebFocusTypeNone);
134 container->element().setAttribute("title", plugin()->old_title()); 132 container->element().setAttribute("title", plugin()->old_title());
133 plugin()->ReplayReceivedData(new_plugin);
135 plugin()->destroy(); 134 plugin()->destroy();
136 } 135 }
137 136
138 void LoadablePluginPlaceholder::SetMessage(const base::string16& message) { 137 void LoadablePluginPlaceholder::SetMessage(const base::string16& message) {
139 message_ = message; 138 message_ = message;
140 if (finished_loading_) 139 if (finished_loading_)
141 UpdateMessage(); 140 UpdateMessage();
142 } 141 }
143 142
144 void LoadablePluginPlaceholder::UpdateMessage() { 143 void LoadablePluginPlaceholder::UpdateMessage() {
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 return identifier_; 365 return identifier_;
367 } 366 }
368 367
369 bool LoadablePluginPlaceholder::LoadingBlocked() const { 368 bool LoadablePluginPlaceholder::LoadingBlocked() const {
370 DCHECK(allow_loading_); 369 DCHECK(allow_loading_);
371 return is_blocked_for_tinyness_ || is_blocked_for_background_tab_ || 370 return is_blocked_for_tinyness_ || is_blocked_for_background_tab_ ||
372 is_blocked_for_power_saver_poster_ || is_blocked_for_prerendering_; 371 is_blocked_for_power_saver_poster_ || is_blocked_for_prerendering_;
373 } 372 }
374 373
375 } // namespace plugins 374 } // namespace plugins
OLDNEW
« no previous file with comments | « no previous file | components/plugins/renderer/webview_plugin.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698