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 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
411 plugin_name), | 411 plugin_name), |
412 true); | 412 true); |
413 } | 413 } |
414 | 414 |
415 void PluginObserver::OnNPAPINotSupported(const std::string& identifier) { | 415 void PluginObserver::OnNPAPINotSupported(const std::string& identifier) { |
416 #if defined(OS_WIN) && defined(ENABLE_PLUGIN_INSTALLATION) | 416 #if defined(OS_WIN) && defined(ENABLE_PLUGIN_INSTALLATION) |
417 #if !defined(USE_AURA) | 417 #if !defined(USE_AURA) |
418 DCHECK(base::win::IsMetroProcess()); | 418 DCHECK(base::win::IsMetroProcess()); |
419 #endif | 419 #endif |
420 | 420 |
421 Profile* profile = | |
422 Profile::FromBrowserContext(web_contents()->GetBrowserContext()); | |
423 if (profile->IsOffTheRecord()) | |
424 return; | |
425 HostContentSettingsMap* content_settings = | |
426 profile->GetHostContentSettingsMap(); | |
427 if (content_settings->GetContentSetting( | |
428 web_contents()->GetURL(), | |
429 web_contents()->GetURL(), | |
430 CONTENT_SETTINGS_TYPE_METRO_SWITCH_TO_DESKTOP, | |
431 std::string()) == CONTENT_SETTING_BLOCK) | |
432 return; | |
433 | |
434 scoped_ptr<PluginMetadata> plugin; | 421 scoped_ptr<PluginMetadata> plugin; |
435 bool ret = PluginFinder::GetInstance()->FindPluginWithIdentifier( | 422 bool ret = PluginFinder::GetInstance()->FindPluginWithIdentifier( |
436 identifier, NULL, &plugin); | 423 identifier, NULL, &plugin); |
437 DCHECK(ret); | 424 DCHECK(ret); |
438 | 425 |
439 PluginMetroModeInfoBarDelegate::Create( | 426 PluginMetroModeInfoBarDelegate::Create( |
440 InfoBarService::FromWebContents(web_contents()), | 427 InfoBarService::FromWebContents(web_contents()), |
441 PluginMetroModeInfoBarDelegate::DESKTOP_MODE_REQUIRED, plugin->name()); | 428 PluginMetroModeInfoBarDelegate::DESKTOP_MODE_REQUIRED, plugin->name()); |
442 #endif | 429 #endif |
443 } | 430 } |
OLD | NEW |