| 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_prefs.h" | 5 #include "chrome/browser/plugin_prefs.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 #include "chrome/browser/profiles/profile_keyed_service.h" | 22 #include "chrome/browser/profiles/profile_keyed_service.h" |
| 23 #include "chrome/common/chrome_constants.h" | 23 #include "chrome/common/chrome_constants.h" |
| 24 #include "chrome/common/chrome_content_client.h" | 24 #include "chrome/common/chrome_content_client.h" |
| 25 #include "chrome/common/chrome_notification_types.h" | 25 #include "chrome/common/chrome_notification_types.h" |
| 26 #include "chrome/common/chrome_paths.h" | 26 #include "chrome/common/chrome_paths.h" |
| 27 #include "chrome/common/chrome_switches.h" | 27 #include "chrome/common/chrome_switches.h" |
| 28 #include "chrome/common/pref_names.h" | 28 #include "chrome/common/pref_names.h" |
| 29 #include "content/public/browser/browser_thread.h" | 29 #include "content/public/browser/browser_thread.h" |
| 30 #include "content/public/browser/notification_service.h" | 30 #include "content/public/browser/notification_service.h" |
| 31 #include "content/public/browser/plugin_service.h" | 31 #include "content/public/browser/plugin_service.h" |
| 32 #include "webkit/plugins/npapi/plugin_group.h" | |
| 33 #include "webkit/plugins/npapi/plugin_list.h" | 32 #include "webkit/plugins/npapi/plugin_list.h" |
| 34 #include "webkit/plugins/webplugininfo.h" | 33 #include "webkit/plugins/webplugininfo.h" |
| 35 | 34 |
| 36 using content::BrowserThread; | 35 using content::BrowserThread; |
| 37 using content::PluginService; | 36 using content::PluginService; |
| 38 | 37 |
| 39 namespace { | 38 namespace { |
| 40 | 39 |
| 41 // How long to wait to save the plugin enabled information, which might need to | 40 // How long to wait to save the plugin enabled information, which might need to |
| 42 // go to disk. | 41 // go to disk. |
| (...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 492 &policy_enabled_plugin_patterns_); | 491 &policy_enabled_plugin_patterns_); |
| 493 | 492 |
| 494 registrar_.Init(prefs_); | 493 registrar_.Init(prefs_); |
| 495 registrar_.Add(prefs::kPluginsDisabledPlugins, this); | 494 registrar_.Add(prefs::kPluginsDisabledPlugins, this); |
| 496 registrar_.Add(prefs::kPluginsDisabledPluginsExceptions, this); | 495 registrar_.Add(prefs::kPluginsDisabledPluginsExceptions, this); |
| 497 registrar_.Add(prefs::kPluginsEnabledPlugins, this); | 496 registrar_.Add(prefs::kPluginsEnabledPlugins, this); |
| 498 | 497 |
| 499 if (force_enable_internal_pdf || internal_pdf_enabled) { | 498 if (force_enable_internal_pdf || internal_pdf_enabled) { |
| 500 // See http://crbug.com/50105 for background. | 499 // See http://crbug.com/50105 for background. |
| 501 plugin_group_state_[ASCIIToUTF16( | 500 plugin_group_state_[ASCIIToUTF16( |
| 502 webkit::npapi::PluginGroup::kAdobeReaderGroupName)] = false; | 501 PluginMetadata::kAdobeReaderGroupName)] = false; |
| 503 } | 502 } |
| 504 | 503 |
| 505 if (force_enable_internal_pdf || force_enable_nacl) { | 504 if (force_enable_internal_pdf || force_enable_nacl) { |
| 506 // We want to save this, but doing so requires loading the list of plugins, | 505 // We want to save this, but doing so requires loading the list of plugins, |
| 507 // so do it after a minute as to not impact startup performance. Note that | 506 // so do it after a minute as to not impact startup performance. Note that |
| 508 // plugins are loaded after 30s by the metrics service. | 507 // plugins are loaded after 30s by the metrics service. |
| 509 BrowserThread::PostDelayedTask( | 508 BrowserThread::PostDelayedTask( |
| 510 BrowserThread::FILE, | 509 BrowserThread::FILE, |
| 511 FROM_HERE, | 510 FROM_HERE, |
| 512 base::Bind(&PluginPrefs::GetPreferencesDataOnFileThread, this), | 511 base::Bind(&PluginPrefs::GetPreferencesDataOnFileThread, this), |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 601 } | 600 } |
| 602 } | 601 } |
| 603 | 602 |
| 604 void PluginPrefs::NotifyPluginStatusChanged() { | 603 void PluginPrefs::NotifyPluginStatusChanged() { |
| 605 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 604 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 606 content::NotificationService::current()->Notify( | 605 content::NotificationService::current()->Notify( |
| 607 chrome::NOTIFICATION_PLUGIN_ENABLE_STATUS_CHANGED, | 606 chrome::NOTIFICATION_PLUGIN_ENABLE_STATUS_CHANGED, |
| 608 content::Source<Profile>(profile_), | 607 content::Source<Profile>(profile_), |
| 609 content::NotificationService::NoDetails()); | 608 content::NotificationService::NoDetails()); |
| 610 } | 609 } |
| OLD | NEW |