OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/preference/chrome_direct_setting_api.h" | 5 #include "chrome/browser/extensions/api/preference/chrome_direct_setting_api.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/containers/hash_tables.h" | 8 #include "base/containers/hash_tables.h" |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "base/prefs/pref_change_registrar.h" | 10 #include "base/prefs/pref_change_registrar.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 public: | 24 public: |
25 PreferenceWhitelist() { | 25 PreferenceWhitelist() { |
26 // Note: DO NOT add any setting here that does not have a UI element in | 26 // Note: DO NOT add any setting here that does not have a UI element in |
27 // chrome://settings unless you write a component extension that is always | 27 // chrome://settings unless you write a component extension that is always |
28 // installed. Otherwise, users may install your extension, the extension may | 28 // installed. Otherwise, users may install your extension, the extension may |
29 // toggle settings, and after the extension has been disabled/uninstalled | 29 // toggle settings, and after the extension has been disabled/uninstalled |
30 // the toggled setting remains in place. See http://crbug.com/164227#c157 . | 30 // the toggled setting remains in place. See http://crbug.com/164227#c157 . |
31 whitelist_.insert("googlegeolocationaccess.enabled"); | 31 whitelist_.insert("googlegeolocationaccess.enabled"); |
32 // The following settings need to be checked and probably removed. See | 32 // The following settings need to be checked and probably removed. See |
33 // http://crbug.com/164227#c157 . | 33 // http://crbug.com/164227#c157 . |
34 whitelist_.insert("spdy_proxy.enabled"); | |
35 whitelist_.insert("data_reduction.daily_original_length"); | |
36 whitelist_.insert("data_reduction.daily_received_length"); | |
37 whitelist_.insert("data_reduction.update_daily_lengths"); | 34 whitelist_.insert("data_reduction.update_daily_lengths"); |
38 whitelist_.insert("easy_unlock.proximity_required"); | 35 whitelist_.insert("easy_unlock.proximity_required"); |
39 } | 36 } |
40 | 37 |
41 ~PreferenceWhitelist() {} | 38 ~PreferenceWhitelist() {} |
42 | 39 |
43 bool IsPreferenceOnWhitelist(const std::string& pref_key){ | 40 bool IsPreferenceOnWhitelist(const std::string& pref_key){ |
44 return whitelist_.find(pref_key) != whitelist_.end(); | 41 return whitelist_.find(pref_key) != whitelist_.end(); |
45 } | 42 } |
46 | 43 |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 scoped_ptr<base::ListValue> args_copy(args.DeepCopy()); | 147 scoped_ptr<base::ListValue> args_copy(args.DeepCopy()); |
151 scoped_ptr<Event> event(new Event(event_name, args_copy.Pass())); | 148 scoped_ptr<Event> event(new Event(event_name, args_copy.Pass())); |
152 router->DispatchEventToExtension(extension_id, event.Pass()); | 149 router->DispatchEventToExtension(extension_id, event.Pass()); |
153 } | 150 } |
154 } | 151 } |
155 } | 152 } |
156 } | 153 } |
157 | 154 |
158 } // namespace chromedirectsetting | 155 } // namespace chromedirectsetting |
159 } // namespace extensions | 156 } // namespace extensions |
OLD | NEW |