| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |