| 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 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 plugin_name); | 322 plugin_name); |
| 323 UMA_HISTOGRAM_COUNTS("Plugin.ShowCrashedInfobar", 1); | 323 UMA_HISTOGRAM_COUNTS("Plugin.ShowCrashedInfobar", 1); |
| 324 #endif | 324 #endif |
| 325 | 325 |
| 326 ReloadPluginInfoBarDelegate::Create( | 326 ReloadPluginInfoBarDelegate::Create( |
| 327 InfoBarService::FromWebContents(web_contents()), | 327 InfoBarService::FromWebContents(web_contents()), |
| 328 &web_contents()->GetController(), | 328 &web_contents()->GetController(), |
| 329 infobar_text); | 329 infobar_text); |
| 330 } | 330 } |
| 331 | 331 |
| 332 bool PluginObserver::OnMessageReceived(const IPC::Message& message) { | 332 bool PluginObserver::OnMessageReceived( |
| 333 const IPC::Message& message, |
| 334 content::RenderFrameHost* render_frame_host) { |
| 333 IPC_BEGIN_MESSAGE_MAP(PluginObserver, message) | 335 IPC_BEGIN_MESSAGE_MAP(PluginObserver, message) |
| 334 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_BlockedOutdatedPlugin, | 336 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_BlockedOutdatedPlugin, |
| 335 OnBlockedOutdatedPlugin) | 337 OnBlockedOutdatedPlugin) |
| 336 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_BlockedUnauthorizedPlugin, | 338 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_BlockedUnauthorizedPlugin, |
| 337 OnBlockedUnauthorizedPlugin) | 339 OnBlockedUnauthorizedPlugin) |
| 340 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_NPAPINotSupported, |
| 341 OnNPAPINotSupported) |
| 342 |
| 343 IPC_MESSAGE_UNHANDLED(return false) |
| 344 IPC_END_MESSAGE_MAP() |
| 345 |
| 346 return true; |
| 347 } |
| 348 |
| 349 bool PluginObserver::OnMessageReceived(const IPC::Message& message) { |
| 350 IPC_BEGIN_MESSAGE_MAP(PluginObserver, message) |
| 338 #if defined(ENABLE_PLUGIN_INSTALLATION) | 351 #if defined(ENABLE_PLUGIN_INSTALLATION) |
| 339 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_FindMissingPlugin, | 352 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_FindMissingPlugin, |
| 340 OnFindMissingPlugin) | 353 OnFindMissingPlugin) |
| 341 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_RemovePluginPlaceholderHost, | 354 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_RemovePluginPlaceholderHost, |
| 342 OnRemovePluginPlaceholderHost) | 355 OnRemovePluginPlaceholderHost) |
| 343 #endif | 356 #endif |
| 344 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_OpenAboutPlugins, | 357 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_OpenAboutPlugins, |
| 345 OnOpenAboutPlugins) | 358 OnOpenAboutPlugins) |
| 346 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_CouldNotLoadPlugin, | 359 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_CouldNotLoadPlugin, |
| 347 OnCouldNotLoadPlugin) | 360 OnCouldNotLoadPlugin) |
| 348 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_NPAPINotSupported, | |
| 349 OnNPAPINotSupported) | |
| 350 | 361 |
| 351 IPC_MESSAGE_UNHANDLED(return false) | 362 IPC_MESSAGE_UNHANDLED(return false) |
| 352 IPC_END_MESSAGE_MAP() | 363 IPC_END_MESSAGE_MAP() |
| 353 | 364 |
| 354 return true; | 365 return true; |
| 355 } | 366 } |
| 356 | 367 |
| 357 void PluginObserver::OnBlockedUnauthorizedPlugin( | 368 void PluginObserver::OnBlockedUnauthorizedPlugin( |
| 358 const base::string16& name, | 369 const base::string16& name, |
| 359 const std::string& identifier) { | 370 const std::string& identifier) { |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 478 scoped_ptr<PluginMetadata> plugin; | 489 scoped_ptr<PluginMetadata> plugin; |
| 479 bool ret = PluginFinder::GetInstance()->FindPluginWithIdentifier( | 490 bool ret = PluginFinder::GetInstance()->FindPluginWithIdentifier( |
| 480 identifier, NULL, &plugin); | 491 identifier, NULL, &plugin); |
| 481 DCHECK(ret); | 492 DCHECK(ret); |
| 482 | 493 |
| 483 PluginMetroModeInfoBarDelegate::Create( | 494 PluginMetroModeInfoBarDelegate::Create( |
| 484 InfoBarService::FromWebContents(web_contents()), | 495 InfoBarService::FromWebContents(web_contents()), |
| 485 PluginMetroModeInfoBarDelegate::DESKTOP_MODE_REQUIRED, plugin->name()); | 496 PluginMetroModeInfoBarDelegate::DESKTOP_MODE_REQUIRED, plugin->name()); |
| 486 #endif | 497 #endif |
| 487 } | 498 } |
| OLD | NEW |