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