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/plugin_observer.h" | 5 #include "chrome/browser/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/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
412 } | 412 } |
413 | 413 |
414 bool PluginObserver::OnMessageReceived(const IPC::Message& message) { | 414 bool PluginObserver::OnMessageReceived(const IPC::Message& message) { |
415 IPC_BEGIN_MESSAGE_MAP(PluginObserver, message) | 415 IPC_BEGIN_MESSAGE_MAP(PluginObserver, message) |
416 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_BlockedOutdatedPlugin, | 416 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_BlockedOutdatedPlugin, |
417 OnBlockedOutdatedPlugin) | 417 OnBlockedOutdatedPlugin) |
418 #if defined(ENABLE_PLUGIN_INSTALLATION) | 418 #if defined(ENABLE_PLUGIN_INSTALLATION) |
419 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_FindMissingPlugin, | 419 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_FindMissingPlugin, |
420 OnFindMissingPlugin) | 420 OnFindMissingPlugin) |
421 #endif | 421 #endif |
| 422 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_OpenAboutPlugins, |
| 423 OnOpenAboutPlugins) |
| 424 |
422 IPC_MESSAGE_UNHANDLED(return false) | 425 IPC_MESSAGE_UNHANDLED(return false) |
423 IPC_END_MESSAGE_MAP() | 426 IPC_END_MESSAGE_MAP() |
424 | 427 |
425 return true; | 428 return true; |
426 } | 429 } |
427 | 430 |
428 void PluginObserver::OnBlockedOutdatedPlugin(const string16& name, | 431 void PluginObserver::OnBlockedOutdatedPlugin(const string16& name, |
429 const GURL& update_url) { | 432 const GURL& update_url) { |
430 InfoBarTabHelper* infobar_helper = tab_contents_->infobar_tab_helper(); | 433 InfoBarTabHelper* infobar_helper = tab_contents_->infobar_tab_helper(); |
431 infobar_helper->AddInfoBar(update_url.is_empty() ? | 434 infobar_helper->AddInfoBar(update_url.is_empty() ? |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
478 content::Referrer(web_contents()->GetURL(), | 481 content::Referrer(web_contents()->GetURL(), |
479 WebKit::WebReferrerPolicyDefault), | 482 WebKit::WebReferrerPolicyDefault), |
480 NEW_FOREGROUND_TAB, content::PAGE_TRANSITION_TYPED, false)); | 483 NEW_FOREGROUND_TAB, content::PAGE_TRANSITION_TYPED, false)); |
481 } else { | 484 } else { |
482 browser::ShowTabModalConfirmDialog( | 485 browser::ShowTabModalConfirmDialog( |
483 new ConfirmInstallDialogDelegate(web_contents(), installer), | 486 new ConfirmInstallDialogDelegate(web_contents(), installer), |
484 tab_contents_); | 487 tab_contents_); |
485 } | 488 } |
486 } | 489 } |
487 #endif // defined(ENABLE_PLUGIN_INSTALLATION) | 490 #endif // defined(ENABLE_PLUGIN_INSTALLATION) |
| 491 |
| 492 void PluginObserver::OnOpenAboutPlugins() { |
| 493 web_contents()->OpenURL(OpenURLParams( |
| 494 GURL(chrome::kAboutPluginsURL), |
| 495 content::Referrer(web_contents()->GetURL(), |
| 496 WebKit::WebReferrerPolicyDefault), |
| 497 NEW_FOREGROUND_TAB, content::PAGE_TRANSITION_TYPED, false)); |
| 498 } |
OLD | NEW |