| 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 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 // We don't swallow these messages because multiple blocked plugins and other | 209 // We don't swallow these messages because multiple blocked plugins and other |
| 210 // objects have an interest in them. | 210 // objects have an interest in them. |
| 211 IPC_BEGIN_MESSAGE_MAP(ChromePluginPlaceholder, message) | 211 IPC_BEGIN_MESSAGE_MAP(ChromePluginPlaceholder, message) |
| 212 IPC_MESSAGE_HANDLER(PrerenderMsg_SetIsPrerendering, OnSetPrerenderMode) | 212 IPC_MESSAGE_HANDLER(PrerenderMsg_SetIsPrerendering, OnSetPrerenderMode) |
| 213 IPC_MESSAGE_HANDLER(ChromeViewMsg_LoadBlockedPlugins, OnLoadBlockedPlugins) | 213 IPC_MESSAGE_HANDLER(ChromeViewMsg_LoadBlockedPlugins, OnLoadBlockedPlugins) |
| 214 IPC_END_MESSAGE_MAP() | 214 IPC_END_MESSAGE_MAP() |
| 215 | 215 |
| 216 return false; | 216 return false; |
| 217 } | 217 } |
| 218 | 218 |
| 219 void ChromePluginPlaceholder::OpenAboutPluginsCallback() { | |
| 220 RenderThread::Get()->Send( | |
| 221 new ChromeViewHostMsg_OpenAboutPlugins(routing_id())); | |
| 222 } | |
| 223 | |
| 224 void ChromePluginPlaceholder::ShowPermissionBubbleCallback() { | 219 void ChromePluginPlaceholder::ShowPermissionBubbleCallback() { |
| 225 RenderThread::Get()->Send( | 220 RenderThread::Get()->Send( |
| 226 new ChromeViewHostMsg_ShowFlashPermissionBubble(routing_id())); | 221 new ChromeViewHostMsg_ShowFlashPermissionBubble(routing_id())); |
| 227 } | 222 } |
| 228 | 223 |
| 229 #if BUILDFLAG(ENABLE_PLUGIN_INSTALLATION) | 224 #if BUILDFLAG(ENABLE_PLUGIN_INSTALLATION) |
| 230 void ChromePluginPlaceholder::OnDidNotFindMissingPlugin() { | 225 void ChromePluginPlaceholder::OnDidNotFindMissingPlugin() { |
| 231 SetMessage(l10n_util::GetStringUTF16(IDS_PLUGIN_NOT_FOUND)); | 226 SetMessage(l10n_util::GetStringUTF16(IDS_PLUGIN_NOT_FOUND)); |
| 232 } | 227 } |
| 233 | 228 |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 406 v8::Isolate* isolate) { | 401 v8::Isolate* isolate) { |
| 407 gin::ObjectTemplateBuilder builder = | 402 gin::ObjectTemplateBuilder builder = |
| 408 gin::Wrappable<ChromePluginPlaceholder>::GetObjectTemplateBuilder(isolate) | 403 gin::Wrappable<ChromePluginPlaceholder>::GetObjectTemplateBuilder(isolate) |
| 409 .SetMethod<void (ChromePluginPlaceholder::*)()>( | 404 .SetMethod<void (ChromePluginPlaceholder::*)()>( |
| 410 "hide", &ChromePluginPlaceholder::HideCallback) | 405 "hide", &ChromePluginPlaceholder::HideCallback) |
| 411 .SetMethod<void (ChromePluginPlaceholder::*)()>( | 406 .SetMethod<void (ChromePluginPlaceholder::*)()>( |
| 412 "load", &ChromePluginPlaceholder::LoadCallback) | 407 "load", &ChromePluginPlaceholder::LoadCallback) |
| 413 .SetMethod<void (ChromePluginPlaceholder::*)()>( | 408 .SetMethod<void (ChromePluginPlaceholder::*)()>( |
| 414 "didFinishLoading", | 409 "didFinishLoading", |
| 415 &ChromePluginPlaceholder::DidFinishLoadingCallback) | 410 &ChromePluginPlaceholder::DidFinishLoadingCallback) |
| 416 .SetMethod("openAboutPlugins", | |
| 417 &ChromePluginPlaceholder::OpenAboutPluginsCallback) | |
| 418 .SetMethod("showPermissionBubble", | 411 .SetMethod("showPermissionBubble", |
| 419 &ChromePluginPlaceholder::ShowPermissionBubbleCallback); | 412 &ChromePluginPlaceholder::ShowPermissionBubbleCallback); |
| 420 | 413 |
| 421 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 414 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 422 switches::kEnablePluginPlaceholderTesting)) { | 415 switches::kEnablePluginPlaceholderTesting)) { |
| 423 builder.SetMethod<void (ChromePluginPlaceholder::*)()>( | 416 builder.SetMethod<void (ChromePluginPlaceholder::*)()>( |
| 424 "didFinishIconRepositionForTesting", | 417 "didFinishIconRepositionForTesting", |
| 425 &ChromePluginPlaceholder::DidFinishIconRepositionForTestingCallback); | 418 &ChromePluginPlaceholder::DidFinishIconRepositionForTestingCallback); |
| 426 } | 419 } |
| 427 | 420 |
| 428 return builder; | 421 return builder; |
| 429 } | 422 } |
| OLD | NEW |