| 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 <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 434 if (it == plugin_placeholders_.end()) { | 434 if (it == plugin_placeholders_.end()) { |
| 435 NOTREACHED(); | 435 NOTREACHED(); |
| 436 return; | 436 return; |
| 437 } | 437 } |
| 438 delete it->second; | 438 delete it->second; |
| 439 plugin_placeholders_.erase(it); | 439 plugin_placeholders_.erase(it); |
| 440 } | 440 } |
| 441 #endif // defined(ENABLE_PLUGIN_INSTALLATION) | 441 #endif // defined(ENABLE_PLUGIN_INSTALLATION) |
| 442 | 442 |
| 443 void PluginObserver::OnOpenAboutPlugins() { | 443 void PluginObserver::OnOpenAboutPlugins() { |
| 444 web_contents()->OpenURL(OpenURLParams( | 444 web_contents()->OpenURL( |
| 445 GURL(chrome::kChromeUIPluginsURL), | 445 OpenURLParams(GURL(chrome::kChromeUIPluginsURL), |
| 446 content::Referrer::SanitizeForRequest( | 446 content::Referrer::SanitizeForRequest( |
| 447 GURL(chrome::kChromeUIPluginsURL), | 447 GURL(chrome::kChromeUIPluginsURL), |
| 448 content::Referrer(web_contents()->GetURL(), | 448 content::Referrer(web_contents()->GetURL(), |
| 449 blink::WebReferrerPolicyDefault)), | 449 blink::WebReferrerPolicyDefault)), |
| 450 NEW_FOREGROUND_TAB, ui::PAGE_TRANSITION_AUTO_BOOKMARK, false)); | 450 WindowOpenDisposition::NEW_FOREGROUND_TAB, |
| 451 ui::PAGE_TRANSITION_AUTO_BOOKMARK, false)); |
| 451 } | 452 } |
| 452 | 453 |
| 453 void PluginObserver::OnCouldNotLoadPlugin(const base::FilePath& plugin_path) { | 454 void PluginObserver::OnCouldNotLoadPlugin(const base::FilePath& plugin_path) { |
| 454 g_browser_process->GetMetricsServicesManager()->OnPluginLoadingError( | 455 g_browser_process->GetMetricsServicesManager()->OnPluginLoadingError( |
| 455 plugin_path); | 456 plugin_path); |
| 456 base::string16 plugin_name = | 457 base::string16 plugin_name = |
| 457 PluginService::GetInstance()->GetPluginDisplayNameByPath(plugin_path); | 458 PluginService::GetInstance()->GetPluginDisplayNameByPath(plugin_path); |
| 458 SimpleAlertInfoBarDelegate::Create( | 459 SimpleAlertInfoBarDelegate::Create( |
| 459 InfoBarService::FromWebContents(web_contents()), | 460 InfoBarService::FromWebContents(web_contents()), |
| 460 infobars::InfoBarDelegate::PLUGIN_OBSERVER, | 461 infobars::InfoBarDelegate::PLUGIN_OBSERVER, |
| 461 IDR_INFOBAR_PLUGIN_CRASHED, | 462 IDR_INFOBAR_PLUGIN_CRASHED, |
| 462 #if !defined(OS_MACOSX) && !defined(OS_ANDROID) | 463 #if !defined(OS_MACOSX) && !defined(OS_ANDROID) |
| 463 gfx::VectorIconId::EXTENSION_CRASHED, | 464 gfx::VectorIconId::EXTENSION_CRASHED, |
| 464 #else | 465 #else |
| 465 gfx::VectorIconId::VECTOR_ICON_NONE, | 466 gfx::VectorIconId::VECTOR_ICON_NONE, |
| 466 #endif | 467 #endif |
| 467 l10n_util::GetStringFUTF16(IDS_PLUGIN_INITIALIZATION_ERROR_PROMPT, | 468 l10n_util::GetStringFUTF16(IDS_PLUGIN_INITIALIZATION_ERROR_PROMPT, |
| 468 plugin_name), | 469 plugin_name), |
| 469 true); | 470 true); |
| 470 } | 471 } |
| OLD | NEW |