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/extension_prefs.h" | 5 #include "extensions/browser/extension_prefs.h" |
6 | 6 |
7 #include <iterator> | 7 #include <iterator> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/prefs/pref_notifier.h" | 10 #include "base/prefs/pref_notifier.h" |
11 #include "base/prefs/pref_service.h" | 11 #include "base/prefs/pref_service.h" |
12 #include "base/strings/string_number_conversions.h" | 12 #include "base/strings/string_number_conversions.h" |
13 #include "base/strings/string_util.h" | 13 #include "base/strings/string_util.h" |
14 #include "base/value_conversions.h" | 14 #include "base/value_conversions.h" |
15 #include "chrome/browser/extensions/api/content_settings/content_settings_store.
h" | 15 #include "chrome/browser/extensions/api/content_settings/content_settings_store.
h" |
16 #include "chrome/browser/extensions/api/preference/preference_api.h" | 16 #include "chrome/browser/extensions/api/preference/preference_api.h" |
17 #include "chrome/browser/extensions/extension_pref_store.h" | |
18 #include "chrome/browser/extensions/extension_prefs_factory.h" | |
19 #include "components/user_prefs/pref_registry_syncable.h" | 17 #include "components/user_prefs/pref_registry_syncable.h" |
20 #include "extensions/browser/admin_policy.h" | 18 #include "extensions/browser/admin_policy.h" |
21 #include "extensions/browser/app_sorting.h" | 19 #include "extensions/browser/app_sorting.h" |
22 #include "extensions/browser/event_router.h" | 20 #include "extensions/browser/event_router.h" |
| 21 #include "extensions/browser/extension_pref_store.h" |
| 22 #include "extensions/browser/extension_prefs_factory.h" |
23 #include "extensions/browser/pref_names.h" | 23 #include "extensions/browser/pref_names.h" |
24 #include "extensions/common/feature_switch.h" | 24 #include "extensions/common/feature_switch.h" |
25 #include "extensions/common/manifest.h" | 25 #include "extensions/common/manifest.h" |
26 #include "extensions/common/permissions/permission_set.h" | 26 #include "extensions/common/permissions/permission_set.h" |
27 #include "extensions/common/permissions/permissions_info.h" | 27 #include "extensions/common/permissions/permissions_info.h" |
28 #include "extensions/common/url_pattern.h" | 28 #include "extensions/common/url_pattern.h" |
29 #include "extensions/common/user_script.h" | 29 #include "extensions/common/user_script.h" |
30 #include "grit/generated_resources.h" | |
31 #include "ui/base/l10n/l10n_util.h" | 30 #include "ui/base/l10n/l10n_util.h" |
32 | 31 |
33 using base::Value; | 32 using base::Value; |
34 using base::DictionaryValue; | 33 using base::DictionaryValue; |
35 using base::ListValue; | 34 using base::ListValue; |
36 | 35 |
37 namespace extensions { | 36 namespace extensions { |
38 | 37 |
39 namespace { | 38 namespace { |
40 | 39 |
(...skipping 1635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1676 scoped_ptr<AppSorting> app_sorting, | 1675 scoped_ptr<AppSorting> app_sorting, |
1677 scoped_ptr<TimeProvider> time_provider, | 1676 scoped_ptr<TimeProvider> time_provider, |
1678 bool extensions_disabled) | 1677 bool extensions_disabled) |
1679 : prefs_(prefs), | 1678 : prefs_(prefs), |
1680 install_directory_(root_dir), | 1679 install_directory_(root_dir), |
1681 extension_pref_value_map_(extension_pref_value_map), | 1680 extension_pref_value_map_(extension_pref_value_map), |
1682 app_sorting_(app_sorting.Pass()), | 1681 app_sorting_(app_sorting.Pass()), |
1683 content_settings_store_(new ContentSettingsStore()), | 1682 content_settings_store_(new ContentSettingsStore()), |
1684 time_provider_(time_provider.Pass()), | 1683 time_provider_(time_provider.Pass()), |
1685 extensions_disabled_(extensions_disabled) { | 1684 extensions_disabled_(extensions_disabled) { |
1686 app_sorting_->SetExtensionScopedPrefs(this), | 1685 app_sorting_->SetExtensionScopedPrefs(this); |
1687 MakePathsRelative(); | 1686 MakePathsRelative(); |
1688 InitPrefStore(); | 1687 InitPrefStore(); |
1689 } | 1688 } |
1690 | 1689 |
1691 void ExtensionPrefs::SetNeedsStorageGarbageCollection(bool value) { | 1690 void ExtensionPrefs::SetNeedsStorageGarbageCollection(bool value) { |
1692 prefs_->SetBoolean(pref_names::kStorageGarbageCollect, value); | 1691 prefs_->SetBoolean(pref_names::kStorageGarbageCollect, value); |
1693 } | 1692 } |
1694 | 1693 |
1695 bool ExtensionPrefs::NeedsStorageGarbageCollection() { | 1694 bool ExtensionPrefs::NeedsStorageGarbageCollection() { |
1696 return prefs_->GetBoolean(pref_names::kStorageGarbageCollect); | 1695 return prefs_->GetBoolean(pref_names::kStorageGarbageCollect); |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1884 is_enabled = initial_state == Extension::ENABLED; | 1883 is_enabled = initial_state == Extension::ENABLED; |
1885 } | 1884 } |
1886 | 1885 |
1887 extension_pref_value_map_->RegisterExtension(extension_id, install_time, | 1886 extension_pref_value_map_->RegisterExtension(extension_id, install_time, |
1888 is_enabled); | 1887 is_enabled); |
1889 content_settings_store_->RegisterExtension(extension_id, install_time, | 1888 content_settings_store_->RegisterExtension(extension_id, install_time, |
1890 is_enabled); | 1889 is_enabled); |
1891 } | 1890 } |
1892 | 1891 |
1893 } // namespace extensions | 1892 } // namespace extensions |
OLD | NEW |