| 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 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 &web_contents()->GetController(), | 329 &web_contents()->GetController(), |
| 330 infobar_text); | 330 infobar_text); |
| 331 } | 331 } |
| 332 | 332 |
| 333 bool PluginObserver::OnMessageReceived( | 333 bool PluginObserver::OnMessageReceived( |
| 334 const IPC::Message& message, | 334 const IPC::Message& message, |
| 335 content::RenderFrameHost* render_frame_host) { | 335 content::RenderFrameHost* render_frame_host) { |
| 336 IPC_BEGIN_MESSAGE_MAP(PluginObserver, message) | 336 IPC_BEGIN_MESSAGE_MAP(PluginObserver, message) |
| 337 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_BlockedOutdatedPlugin, | 337 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_BlockedOutdatedPlugin, |
| 338 OnBlockedOutdatedPlugin) | 338 OnBlockedOutdatedPlugin) |
| 339 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_NPAPINotSupported, | |
| 340 OnNPAPINotSupported) | |
| 341 | |
| 342 IPC_MESSAGE_UNHANDLED(return false) | |
| 343 IPC_END_MESSAGE_MAP() | |
| 344 | |
| 345 return true; | |
| 346 } | |
| 347 | |
| 348 bool PluginObserver::OnMessageReceived(const IPC::Message& message) { | |
| 349 IPC_BEGIN_MESSAGE_MAP(PluginObserver, message) | |
| 350 #if defined(ENABLE_PLUGIN_INSTALLATION) | 339 #if defined(ENABLE_PLUGIN_INSTALLATION) |
| 351 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_RemovePluginPlaceholderHost, | 340 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_RemovePluginPlaceholderHost, |
| 352 OnRemovePluginPlaceholderHost) | 341 OnRemovePluginPlaceholderHost) |
| 353 #endif | 342 #endif |
| 354 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_OpenAboutPlugins, | 343 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_OpenAboutPlugins, |
| 355 OnOpenAboutPlugins) | 344 OnOpenAboutPlugins) |
| 356 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_CouldNotLoadPlugin, | 345 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_CouldNotLoadPlugin, |
| 357 OnCouldNotLoadPlugin) | 346 OnCouldNotLoadPlugin) |
| 347 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_NPAPINotSupported, |
| 348 OnNPAPINotSupported) |
| 358 | 349 |
| 359 IPC_MESSAGE_UNHANDLED(return false) | 350 IPC_MESSAGE_UNHANDLED(return false) |
| 360 IPC_END_MESSAGE_MAP() | 351 IPC_END_MESSAGE_MAP() |
| 361 | 352 |
| 362 return true; | 353 return true; |
| 363 } | 354 } |
| 364 | 355 |
| 365 void PluginObserver::OnBlockedOutdatedPlugin(int placeholder_id, | 356 void PluginObserver::OnBlockedOutdatedPlugin(int placeholder_id, |
| 366 const std::string& identifier) { | 357 const std::string& identifier) { |
| 367 #if defined(ENABLE_PLUGIN_INSTALLATION) | 358 #if defined(ENABLE_PLUGIN_INSTALLATION) |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 442 scoped_ptr<PluginMetadata> plugin; | 433 scoped_ptr<PluginMetadata> plugin; |
| 443 bool ret = PluginFinder::GetInstance()->FindPluginWithIdentifier( | 434 bool ret = PluginFinder::GetInstance()->FindPluginWithIdentifier( |
| 444 identifier, NULL, &plugin); | 435 identifier, NULL, &plugin); |
| 445 DCHECK(ret); | 436 DCHECK(ret); |
| 446 | 437 |
| 447 PluginMetroModeInfoBarDelegate::Create( | 438 PluginMetroModeInfoBarDelegate::Create( |
| 448 InfoBarService::FromWebContents(web_contents()), | 439 InfoBarService::FromWebContents(web_contents()), |
| 449 PluginMetroModeInfoBarDelegate::DESKTOP_MODE_REQUIRED, plugin->name()); | 440 PluginMetroModeInfoBarDelegate::DESKTOP_MODE_REQUIRED, plugin->name()); |
| 450 #endif | 441 #endif |
| 451 } | 442 } |
| OLD | NEW |