| 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/extensions/api/content_settings/content_settings_api.h" | 5 #include "chrome/browser/extensions/api/content_settings/content_settings_api.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| 11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
| 12 #include "base/values.h" | 12 #include "base/values.h" |
| 13 #include "chrome/browser/content_settings/cookie_settings.h" |
| 14 #include "chrome/browser/content_settings/host_content_settings_map.h" |
| 13 #include "chrome/browser/extensions/api/content_settings/content_settings_api_co
nstants.h" | 15 #include "chrome/browser/extensions/api/content_settings/content_settings_api_co
nstants.h" |
| 14 #include "chrome/browser/extensions/api/content_settings/content_settings_helper
s.h" | 16 #include "chrome/browser/extensions/api/content_settings/content_settings_helper
s.h" |
| 15 #include "chrome/browser/extensions/api/content_settings/content_settings_store.
h" | 17 #include "chrome/browser/extensions/api/content_settings/content_settings_store.
h" |
| 16 #include "chrome/browser/content_settings/cookie_settings.h" | 18 #include "chrome/browser/extensions/api/preference/preference_api_constants.h" |
| 17 #include "chrome/browser/content_settings/host_content_settings_map.h" | 19 #include "chrome/browser/extensions/api/preference/preference_helpers.h" |
| 18 #include "chrome/browser/extensions/extension_preference_api_constants.h" | |
| 19 #include "chrome/browser/extensions/extension_preference_helpers.h" | |
| 20 #include "chrome/browser/extensions/extension_service.h" | 20 #include "chrome/browser/extensions/extension_service.h" |
| 21 #include "chrome/browser/plugin_finder.h" | 21 #include "chrome/browser/plugin_finder.h" |
| 22 #include "chrome/browser/plugin_installer.h" | 22 #include "chrome/browser/plugin_installer.h" |
| 23 #include "chrome/browser/prefs/pref_service.h" | 23 #include "chrome/browser/prefs/pref_service.h" |
| 24 #include "chrome/browser/profiles/profile.h" | 24 #include "chrome/browser/profiles/profile.h" |
| 25 #include "chrome/common/chrome_switches.h" | 25 #include "chrome/common/chrome_switches.h" |
| 26 #include "chrome/common/extensions/api/content_settings.h" | 26 #include "chrome/common/extensions/api/content_settings.h" |
| 27 #include "chrome/common/extensions/extension_error_utils.h" | 27 #include "chrome/common/extensions/extension_error_utils.h" |
| 28 #include "content/public/browser/plugin_service.h" | 28 #include "content/public/browser/plugin_service.h" |
| 29 #include "webkit/plugins/npapi/plugin_group.h" | 29 #include "webkit/plugins/npapi/plugin_group.h" |
| 30 | 30 |
| 31 using content::BrowserThread; | 31 using content::BrowserThread; |
| 32 using content::PluginService; | 32 using content::PluginService; |
| 33 | 33 |
| 34 namespace Clear = extensions::api::content_settings::ContentSetting::Clear; | 34 namespace Clear = extensions::api::content_settings::ContentSetting::Clear; |
| 35 namespace Get = extensions::api::content_settings::ContentSetting::Get; | 35 namespace Get = extensions::api::content_settings::ContentSetting::Get; |
| 36 namespace Set = extensions::api::content_settings::ContentSetting::Set; | 36 namespace Set = extensions::api::content_settings::ContentSetting::Set; |
| 37 namespace pref_helpers = extension_preference_helpers; | 37 namespace pref_helpers = extensions::preference_helpers; |
| 38 namespace pref_keys = extension_preference_api_constants; | 38 namespace pref_keys = extensions::preference_api_constants; |
| 39 | 39 |
| 40 namespace { | 40 namespace { |
| 41 | 41 |
| 42 const std::vector<webkit::WebPluginInfo>* g_testing_plugins_; | 42 const std::vector<webkit::WebPluginInfo>* g_testing_plugins_; |
| 43 | 43 |
| 44 bool RemoveContentType(ListValue* args, ContentSettingsType* content_type) { | 44 bool RemoveContentType(ListValue* args, ContentSettingsType* content_type) { |
| 45 std::string content_type_str; | 45 std::string content_type_str; |
| 46 if (!args->GetString(0, &content_type_str)) | 46 if (!args->GetString(0, &content_type_str)) |
| 47 return false; | 47 return false; |
| 48 // We remove the ContentSettingsType parameter since this is added by the | 48 // We remove the ContentSettingsType parameter since this is added by the |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 &GetResourceIdentifiersFunction::SendResponse, this, true)); | 293 &GetResourceIdentifiersFunction::SendResponse, this, true)); |
| 294 } | 294 } |
| 295 | 295 |
| 296 // static | 296 // static |
| 297 void GetResourceIdentifiersFunction::SetPluginsForTesting( | 297 void GetResourceIdentifiersFunction::SetPluginsForTesting( |
| 298 const std::vector<webkit::WebPluginInfo>* plugins) { | 298 const std::vector<webkit::WebPluginInfo>* plugins) { |
| 299 g_testing_plugins_ = plugins; | 299 g_testing_plugins_ = plugins; |
| 300 } | 300 } |
| 301 | 301 |
| 302 } // namespace extensions | 302 } // namespace extensions |
| OLD | NEW |