| 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 21 matching lines...) Expand all Loading... |
| 32 #include "content/public/browser/render_frame_host.h" | 32 #include "content/public/browser/render_frame_host.h" |
| 33 #include "content/public/browser/render_view_host.h" | 33 #include "content/public/browser/render_view_host.h" |
| 34 #include "content/public/browser/web_contents.h" | 34 #include "content/public/browser/web_contents.h" |
| 35 #include "content/public/browser/web_contents_delegate.h" | 35 #include "content/public/browser/web_contents_delegate.h" |
| 36 #include "content/public/common/webplugininfo.h" | 36 #include "content/public/common/webplugininfo.h" |
| 37 #include "grit/theme_resources.h" | 37 #include "grit/theme_resources.h" |
| 38 #include "ui/base/l10n/l10n_util.h" | 38 #include "ui/base/l10n/l10n_util.h" |
| 39 #include "ui/gfx/vector_icons_public.h" | 39 #include "ui/gfx/vector_icons_public.h" |
| 40 | 40 |
| 41 #if defined(ENABLE_PLUGIN_INSTALLATION) | 41 #if defined(ENABLE_PLUGIN_INSTALLATION) |
| 42 #if defined(OS_WIN) | |
| 43 #include "base/win/metro.h" | |
| 44 #endif | |
| 45 #include "chrome/browser/plugins/plugin_installer.h" | 42 #include "chrome/browser/plugins/plugin_installer.h" |
| 46 #include "chrome/browser/plugins/plugin_installer_observer.h" | 43 #include "chrome/browser/plugins/plugin_installer_observer.h" |
| 47 #include "chrome/browser/ui/tab_modal_confirm_dialog_delegate.h" | 44 #include "chrome/browser/ui/tab_modal_confirm_dialog_delegate.h" |
| 48 #endif // defined(ENABLE_PLUGIN_INSTALLATION) | 45 #endif // defined(ENABLE_PLUGIN_INSTALLATION) |
| 49 | 46 |
| 50 using content::OpenURLParams; | 47 using content::OpenURLParams; |
| 51 using content::PluginService; | 48 using content::PluginService; |
| 52 using content::Referrer; | 49 using content::Referrer; |
| 53 using content::WebContents; | 50 using content::WebContents; |
| 54 | 51 |
| (...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 431 #else | 428 #else |
| 432 gfx::VectorIconId::VECTOR_ICON_NONE, | 429 gfx::VectorIconId::VECTOR_ICON_NONE, |
| 433 #endif | 430 #endif |
| 434 l10n_util::GetStringFUTF16(IDS_PLUGIN_INITIALIZATION_ERROR_PROMPT, | 431 l10n_util::GetStringFUTF16(IDS_PLUGIN_INITIALIZATION_ERROR_PROMPT, |
| 435 plugin_name), | 432 plugin_name), |
| 436 true); | 433 true); |
| 437 } | 434 } |
| 438 | 435 |
| 439 void PluginObserver::OnNPAPINotSupported(const std::string& identifier) { | 436 void PluginObserver::OnNPAPINotSupported(const std::string& identifier) { |
| 440 #if defined(OS_WIN) && defined(ENABLE_PLUGIN_INSTALLATION) | 437 #if defined(OS_WIN) && defined(ENABLE_PLUGIN_INSTALLATION) |
| 441 #if !defined(USE_AURA) | |
| 442 DCHECK(base::win::IsMetroProcess()); | |
| 443 #endif | |
| 444 | |
| 445 scoped_ptr<PluginMetadata> plugin; | 438 scoped_ptr<PluginMetadata> plugin; |
| 446 bool ret = PluginFinder::GetInstance()->FindPluginWithIdentifier( | 439 bool ret = PluginFinder::GetInstance()->FindPluginWithIdentifier( |
| 447 identifier, NULL, &plugin); | 440 identifier, NULL, &plugin); |
| 448 DCHECK(ret); | 441 DCHECK(ret); |
| 449 | 442 |
| 450 PluginMetroModeInfoBarDelegate::Create( | 443 PluginMetroModeInfoBarDelegate::Create( |
| 451 InfoBarService::FromWebContents(web_contents()), | 444 InfoBarService::FromWebContents(web_contents()), |
| 452 PluginMetroModeInfoBarDelegate::DESKTOP_MODE_REQUIRED, plugin->name()); | 445 PluginMetroModeInfoBarDelegate::DESKTOP_MODE_REQUIRED, plugin->name()); |
| 453 #endif | 446 #endif |
| 454 } | 447 } |
| OLD | NEW |