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/plugin_placeholder.h" | 5 #include "components/plugins/renderer/plugin_placeholder.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/json/string_escape.h" | 9 #include "base/json/string_escape.h" |
10 #include "base/strings/string_piece.h" | 10 #include "base/strings/string_piece.h" |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
205 NOTREACHED(); | 205 NOTREACHED(); |
206 return; | 206 return; |
207 } | 207 } |
208 | 208 |
209 // TODO(mmenke): In the case of prerendering, feed into | 209 // TODO(mmenke): In the case of prerendering, feed into |
210 // ChromeContentRendererClient::CreatePlugin instead, to | 210 // ChromeContentRendererClient::CreatePlugin instead, to |
211 // reduce the chance of future regressions. | 211 // reduce the chance of future regressions. |
212 WebPlugin* plugin = | 212 WebPlugin* plugin = |
213 render_frame()->CreatePlugin(frame_, plugin_info_, plugin_params_); | 213 render_frame()->CreatePlugin(frame_, plugin_info_, plugin_params_); |
214 ReplacePlugin(plugin); | 214 ReplacePlugin(plugin); |
215 plugin->updateFocus(true); | |
Bernhard Bauer
2014/01/22 10:15:09
Hmm... I'm somewhat worried that this will uncondi
Ruiyi Luo
2014/01/24 13:18:22
Hello Bernhard,
Thanks. I will do more debug her
Bernhard Bauer
2014/01/24 13:37:53
Well, WebPluginContainerImpl will call WebPlugin::
| |
215 } | 216 } |
216 | 217 |
217 void PluginPlaceholder::LoadCallback() { | 218 void PluginPlaceholder::LoadCallback() { |
218 RenderThread::Get()->RecordAction(UserMetricsAction("Plugin_Load_Click")); | 219 RenderThread::Get()->RecordAction(UserMetricsAction("Plugin_Load_Click")); |
219 LoadPlugin(); | 220 LoadPlugin(); |
220 } | 221 } |
221 | 222 |
222 void PluginPlaceholder::HideCallback() { | 223 void PluginPlaceholder::HideCallback() { |
223 RenderThread::Get()->RecordAction(UserMetricsAction("Plugin_Hide_Click")); | 224 RenderThread::Get()->RecordAction(UserMetricsAction("Plugin_Hide_Click")); |
224 HidePlugin(); | 225 HidePlugin(); |
(...skipping 18 matching lines...) Expand all Loading... | |
243 identifier_ = identifier; | 244 identifier_ = identifier; |
244 } | 245 } |
245 | 246 |
246 blink::WebFrame* PluginPlaceholder::GetFrame() { return frame_; } | 247 blink::WebFrame* PluginPlaceholder::GetFrame() { return frame_; } |
247 | 248 |
248 const blink::WebPluginParams& PluginPlaceholder::GetPluginParams() const { | 249 const blink::WebPluginParams& PluginPlaceholder::GetPluginParams() const { |
249 return plugin_params_; | 250 return plugin_params_; |
250 } | 251 } |
251 | 252 |
252 } // namespace plugins | 253 } // namespace plugins |
OLD | NEW |