| 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 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 IPC_END_MESSAGE_MAP() | 217 IPC_END_MESSAGE_MAP() |
| 218 | 218 |
| 219 return false; | 219 return false; |
| 220 } | 220 } |
| 221 | 221 |
| 222 void ChromePluginPlaceholder::OpenAboutPluginsCallback() { | 222 void ChromePluginPlaceholder::OpenAboutPluginsCallback() { |
| 223 RenderThread::Get()->Send( | 223 RenderThread::Get()->Send( |
| 224 new ChromeViewHostMsg_OpenAboutPlugins(routing_id())); | 224 new ChromeViewHostMsg_OpenAboutPlugins(routing_id())); |
| 225 } | 225 } |
| 226 | 226 |
| 227 void ChromePluginPlaceholder::ShowPermissionBubbleCallback() { |
| 228 // TODO(tommycli): Show a permission bubble in the browser process. |
| 229 } |
| 230 |
| 227 #if defined(ENABLE_PLUGIN_INSTALLATION) | 231 #if defined(ENABLE_PLUGIN_INSTALLATION) |
| 228 void ChromePluginPlaceholder::OnDidNotFindMissingPlugin() { | 232 void ChromePluginPlaceholder::OnDidNotFindMissingPlugin() { |
| 229 SetMessage(l10n_util::GetStringUTF16(IDS_PLUGIN_NOT_FOUND)); | 233 SetMessage(l10n_util::GetStringUTF16(IDS_PLUGIN_NOT_FOUND)); |
| 230 } | 234 } |
| 231 | 235 |
| 232 void ChromePluginPlaceholder::OnFoundMissingPlugin( | 236 void ChromePluginPlaceholder::OnFoundMissingPlugin( |
| 233 const base::string16& plugin_name) { | 237 const base::string16& plugin_name) { |
| 234 if (status_ == ChromeViewHostMsg_GetPluginInfo_Status::kNotFound) | 238 if (status_ == ChromeViewHostMsg_GetPluginInfo_Status::kNotFound) |
| 235 SetMessage(l10n_util::GetStringFUTF16(IDS_PLUGIN_FOUND, plugin_name)); | 239 SetMessage(l10n_util::GetStringFUTF16(IDS_PLUGIN_FOUND, plugin_name)); |
| 236 has_host_ = true; | 240 has_host_ = true; |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 410 gin::ObjectTemplateBuilder builder = | 414 gin::ObjectTemplateBuilder builder = |
| 411 gin::Wrappable<ChromePluginPlaceholder>::GetObjectTemplateBuilder(isolate) | 415 gin::Wrappable<ChromePluginPlaceholder>::GetObjectTemplateBuilder(isolate) |
| 412 .SetMethod<void (ChromePluginPlaceholder::*)()>( | 416 .SetMethod<void (ChromePluginPlaceholder::*)()>( |
| 413 "hide", &ChromePluginPlaceholder::HideCallback) | 417 "hide", &ChromePluginPlaceholder::HideCallback) |
| 414 .SetMethod<void (ChromePluginPlaceholder::*)()>( | 418 .SetMethod<void (ChromePluginPlaceholder::*)()>( |
| 415 "load", &ChromePluginPlaceholder::LoadCallback) | 419 "load", &ChromePluginPlaceholder::LoadCallback) |
| 416 .SetMethod<void (ChromePluginPlaceholder::*)()>( | 420 .SetMethod<void (ChromePluginPlaceholder::*)()>( |
| 417 "didFinishLoading", | 421 "didFinishLoading", |
| 418 &ChromePluginPlaceholder::DidFinishLoadingCallback) | 422 &ChromePluginPlaceholder::DidFinishLoadingCallback) |
| 419 .SetMethod("openAboutPlugins", | 423 .SetMethod("openAboutPlugins", |
| 420 &ChromePluginPlaceholder::OpenAboutPluginsCallback); | 424 &ChromePluginPlaceholder::OpenAboutPluginsCallback) |
| 425 .SetMethod("showPermissionBubble", |
| 426 &ChromePluginPlaceholder::ShowPermissionBubbleCallback); |
| 421 | 427 |
| 422 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 428 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 423 switches::kEnablePluginPlaceholderTesting)) { | 429 switches::kEnablePluginPlaceholderTesting)) { |
| 424 builder.SetMethod<void (ChromePluginPlaceholder::*)()>( | 430 builder.SetMethod<void (ChromePluginPlaceholder::*)()>( |
| 425 "didFinishIconRepositionForTesting", | 431 "didFinishIconRepositionForTesting", |
| 426 &ChromePluginPlaceholder::DidFinishIconRepositionForTestingCallback); | 432 &ChromePluginPlaceholder::DidFinishIconRepositionForTestingCallback); |
| 427 } | 433 } |
| 428 | 434 |
| 429 return builder; | 435 return builder; |
| 430 } | 436 } |
| OLD | NEW |