| OLD | NEW |
| 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2014 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/settings_api_helpers.h" | 5 #include "chrome/browser/extensions/settings_api_helpers.h" |
| 6 | 6 |
| 7 #include "chrome/browser/extensions/api/preference/preference_api.h" | 7 #include "chrome/browser/extensions/api/preference/preference_api.h" |
| 8 #include "chrome/common/pref_names.h" | 8 #include "chrome/common/pref_names.h" |
| 9 #include "components/proxy_config/proxy_config_pref_names.h" |
| 9 #include "components/search_engines/search_engines_pref_names.h" | 10 #include "components/search_engines/search_engines_pref_names.h" |
| 10 #include "extensions/browser/extension_pref_value_map.h" | 11 #include "extensions/browser/extension_pref_value_map.h" |
| 11 #include "extensions/browser/extension_pref_value_map_factory.h" | 12 #include "extensions/browser/extension_pref_value_map_factory.h" |
| 12 #include "extensions/browser/extension_registry.h" | 13 #include "extensions/browser/extension_registry.h" |
| 13 #include "extensions/common/extension_set.h" | 14 #include "extensions/common/extension_set.h" |
| 14 | 15 |
| 15 namespace extensions { | 16 namespace extensions { |
| 16 | 17 |
| 17 namespace { | 18 namespace { |
| 18 | 19 |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 return FindOverridingExtension(browser_context, BUBBLE_TYPE_SEARCH_ENGINE); | 81 return FindOverridingExtension(browser_context, BUBBLE_TYPE_SEARCH_ENGINE); |
| 81 } | 82 } |
| 82 | 83 |
| 83 const Extension* GetExtensionOverridingProxy( | 84 const Extension* GetExtensionOverridingProxy( |
| 84 content::BrowserContext* browser_context) { | 85 content::BrowserContext* browser_context) { |
| 85 ExtensionPrefValueMap* extension_prefs_value_map = | 86 ExtensionPrefValueMap* extension_prefs_value_map = |
| 86 ExtensionPrefValueMapFactory::GetForBrowserContext(browser_context); | 87 ExtensionPrefValueMapFactory::GetForBrowserContext(browser_context); |
| 87 if (!extension_prefs_value_map) | 88 if (!extension_prefs_value_map) |
| 88 return NULL; // Can be null during testing. | 89 return NULL; // Can be null during testing. |
| 89 std::string extension_id = | 90 std::string extension_id = |
| 90 extension_prefs_value_map->GetExtensionControllingPref(prefs::kProxy); | 91 extension_prefs_value_map->GetExtensionControllingPref( |
| 92 proxy_config::prefs::kProxy); |
| 91 if (extension_id.empty()) | 93 if (extension_id.empty()) |
| 92 return NULL; | 94 return NULL; |
| 93 return ExtensionRegistry::Get(browser_context)->GetExtensionById( | 95 return ExtensionRegistry::Get(browser_context)->GetExtensionById( |
| 94 extension_id, ExtensionRegistry::ENABLED); | 96 extension_id, ExtensionRegistry::ENABLED); |
| 95 } | 97 } |
| 96 | 98 |
| 97 } // namespace extensions | 99 } // namespace extensions |
| OLD | NEW |