| 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 "chrome/renderer/plugins/chrome_plugin_placeholder.h" | 5 #include "chrome/renderer/plugins/chrome_plugin_placeholder.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 | 253 |
| 254 void ChromePluginPlaceholder::OnCancelledDownloadingPlugin() { | 254 void ChromePluginPlaceholder::OnCancelledDownloadingPlugin() { |
| 255 SetMessage( | 255 SetMessage( |
| 256 l10n_util::GetStringFUTF16(IDS_PLUGIN_DOWNLOAD_CANCELLED, plugin_name_)); | 256 l10n_util::GetStringFUTF16(IDS_PLUGIN_DOWNLOAD_CANCELLED, plugin_name_)); |
| 257 } | 257 } |
| 258 #endif // defined(ENABLE_PLUGIN_INSTALLATION) | 258 #endif // defined(ENABLE_PLUGIN_INSTALLATION) |
| 259 | 259 |
| 260 void ChromePluginPlaceholder::PluginListChanged() { | 260 void ChromePluginPlaceholder::PluginListChanged() { |
| 261 if (!GetFrame() || !plugin()) | 261 if (!GetFrame() || !plugin()) |
| 262 return; | 262 return; |
| 263 blink::WebDocument document = GetFrame()->top()->document(); | |
| 264 if (document.isNull()) | |
| 265 return; | |
| 266 | 263 |
| 267 ChromeViewHostMsg_GetPluginInfo_Output output; | 264 ChromeViewHostMsg_GetPluginInfo_Output output; |
| 268 std::string mime_type(GetPluginParams().mimeType.utf8()); | 265 std::string mime_type(GetPluginParams().mimeType.utf8()); |
| 269 blink::WebString top_origin = | 266 blink::WebString top_origin = |
| 270 GetFrame()->top()->getSecurityOrigin().toString(); | 267 GetFrame()->top()->getSecurityOrigin().toString(); |
| 271 render_frame()->Send( | 268 render_frame()->Send( |
| 272 new ChromeViewHostMsg_GetPluginInfo(routing_id(), | 269 new ChromeViewHostMsg_GetPluginInfo(routing_id(), |
| 273 GURL(GetPluginParams().url), | 270 GURL(GetPluginParams().url), |
| 274 blink::WebStringToGURL(top_origin), | 271 blink::WebStringToGURL(top_origin), |
| 275 mime_type, | 272 mime_type, |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 400 | 397 |
| 401 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 398 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 402 switches::kEnablePluginPlaceholderTesting)) { | 399 switches::kEnablePluginPlaceholderTesting)) { |
| 403 builder.SetMethod<void (ChromePluginPlaceholder::*)()>( | 400 builder.SetMethod<void (ChromePluginPlaceholder::*)()>( |
| 404 "didFinishIconRepositionForTesting", | 401 "didFinishIconRepositionForTesting", |
| 405 &ChromePluginPlaceholder::DidFinishIconRepositionForTestingCallback); | 402 &ChromePluginPlaceholder::DidFinishIconRepositionForTestingCallback); |
| 406 } | 403 } |
| 407 | 404 |
| 408 return builder; | 405 return builder; |
| 409 } | 406 } |
| OLD | NEW |