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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 plugin()->destroy(); | 120 plugin()->destroy(); |
121 } | 121 } |
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 plugin()->RestoreTitleText(); | |
131 container->invalidate(); | 130 container->invalidate(); |
132 container->reportGeometry(); | 131 container->reportGeometry(); |
133 plugin()->ReplayReceivedData(new_plugin); | 132 if (plugin()->focused()) |
| 133 new_plugin->updateFocus(true, blink::WebFocusTypeNone); |
| 134 container->element().setAttribute("title", plugin()->old_title()); |
134 plugin()->destroy(); | 135 plugin()->destroy(); |
135 } | 136 } |
136 | 137 |
137 void LoadablePluginPlaceholder::SetMessage(const base::string16& message) { | 138 void LoadablePluginPlaceholder::SetMessage(const base::string16& message) { |
138 message_ = message; | 139 message_ = message; |
139 if (finished_loading_) | 140 if (finished_loading_) |
140 UpdateMessage(); | 141 UpdateMessage(); |
141 } | 142 } |
142 | 143 |
143 void LoadablePluginPlaceholder::UpdateMessage() { | 144 void LoadablePluginPlaceholder::UpdateMessage() { |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
362 return identifier_; | 363 return identifier_; |
363 } | 364 } |
364 | 365 |
365 bool LoadablePluginPlaceholder::LoadingBlocked() const { | 366 bool LoadablePluginPlaceholder::LoadingBlocked() const { |
366 DCHECK(allow_loading_); | 367 DCHECK(allow_loading_); |
367 return is_blocked_for_tinyness_ || is_blocked_for_background_tab_ || | 368 return is_blocked_for_tinyness_ || is_blocked_for_background_tab_ || |
368 is_blocked_for_power_saver_poster_ || is_blocked_for_prerendering_; | 369 is_blocked_for_power_saver_poster_ || is_blocked_for_prerendering_; |
369 } | 370 } |
370 | 371 |
371 } // namespace plugins | 372 } // namespace plugins |
OLD | NEW |