OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/browser/plugins/plugin_observer.h" | 5 #include "chrome/browser/plugins/plugin_observer.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/debug/crash_logging.h" | 9 #include "base/debug/crash_logging.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
353 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_BlockedOutdatedPlugin, | 353 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_BlockedOutdatedPlugin, |
354 OnBlockedOutdatedPlugin) | 354 OnBlockedOutdatedPlugin) |
355 #if defined(ENABLE_PLUGIN_INSTALLATION) | 355 #if defined(ENABLE_PLUGIN_INSTALLATION) |
356 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_RemovePluginPlaceholderHost, | 356 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_RemovePluginPlaceholderHost, |
357 OnRemovePluginPlaceholderHost) | 357 OnRemovePluginPlaceholderHost) |
358 #endif | 358 #endif |
359 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_OpenAboutPlugins, | 359 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_OpenAboutPlugins, |
360 OnOpenAboutPlugins) | 360 OnOpenAboutPlugins) |
361 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_CouldNotLoadPlugin, | 361 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_CouldNotLoadPlugin, |
362 OnCouldNotLoadPlugin) | 362 OnCouldNotLoadPlugin) |
363 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_NPAPINotSupported, | |
364 OnNPAPINotSupported) | |
365 | 363 |
366 IPC_MESSAGE_UNHANDLED(return false) | 364 IPC_MESSAGE_UNHANDLED(return false) |
367 IPC_END_MESSAGE_MAP() | 365 IPC_END_MESSAGE_MAP() |
368 | 366 |
369 return true; | 367 return true; |
370 } | 368 } |
371 | 369 |
372 void PluginObserver::OnBlockedOutdatedPlugin(int placeholder_id, | 370 void PluginObserver::OnBlockedOutdatedPlugin(int placeholder_id, |
373 const std::string& identifier) { | 371 const std::string& identifier) { |
374 #if defined(ENABLE_PLUGIN_INSTALLATION) | 372 #if defined(ENABLE_PLUGIN_INSTALLATION) |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
425 IDR_INFOBAR_PLUGIN_CRASHED, | 423 IDR_INFOBAR_PLUGIN_CRASHED, |
426 #if !defined(OS_MACOSX) && !defined(OS_IOS) && !defined(OS_ANDROID) | 424 #if !defined(OS_MACOSX) && !defined(OS_IOS) && !defined(OS_ANDROID) |
427 gfx::VectorIconId::EXTENSION_CRASHED, | 425 gfx::VectorIconId::EXTENSION_CRASHED, |
428 #else | 426 #else |
429 gfx::VectorIconId::VECTOR_ICON_NONE, | 427 gfx::VectorIconId::VECTOR_ICON_NONE, |
430 #endif | 428 #endif |
431 l10n_util::GetStringFUTF16(IDS_PLUGIN_INITIALIZATION_ERROR_PROMPT, | 429 l10n_util::GetStringFUTF16(IDS_PLUGIN_INITIALIZATION_ERROR_PROMPT, |
432 plugin_name), | 430 plugin_name), |
433 true); | 431 true); |
434 } | 432 } |
435 | |
436 void PluginObserver::OnNPAPINotSupported(const std::string& identifier) { | |
437 #if defined(OS_WIN) && defined(ENABLE_PLUGIN_INSTALLATION) | |
438 scoped_ptr<PluginMetadata> plugin; | |
439 bool ret = PluginFinder::GetInstance()->FindPluginWithIdentifier( | |
440 identifier, NULL, &plugin); | |
441 DCHECK(ret); | |
442 | |
443 PluginMetroModeInfoBarDelegate::Create( | |
444 InfoBarService::FromWebContents(web_contents()), | |
445 PluginMetroModeInfoBarDelegate::DESKTOP_MODE_REQUIRED, plugin->name()); | |
446 #endif | |
447 } | |
OLD | NEW |