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 11 matching lines...) Expand all Loading... |
22 "types.private.ChromeDirectSetting.%s.onChange"; | 22 "types.private.ChromeDirectSetting.%s.onChange"; |
23 | 23 |
24 class PreferenceWhitelist { | 24 class PreferenceWhitelist { |
25 public: | 25 public: |
26 PreferenceWhitelist() { | 26 PreferenceWhitelist() { |
27 whitelist_.insert("googlegeolocationaccess.enabled"); | 27 whitelist_.insert("googlegeolocationaccess.enabled"); |
28 whitelist_.insert("spdy_proxy.enabled"); | 28 whitelist_.insert("spdy_proxy.enabled"); |
29 whitelist_.insert("data_reduction.daily_original_length"); | 29 whitelist_.insert("data_reduction.daily_original_length"); |
30 whitelist_.insert("data_reduction.daily_received_length"); | 30 whitelist_.insert("data_reduction.daily_received_length"); |
31 whitelist_.insert("data_reduction.update_daily_lengths"); | 31 whitelist_.insert("data_reduction.update_daily_lengths"); |
| 32 whitelist_.insert("easy_unlock.proximity_required"); |
32 } | 33 } |
33 | 34 |
34 ~PreferenceWhitelist() {} | 35 ~PreferenceWhitelist() {} |
35 | 36 |
36 bool IsPreferenceOnWhitelist(const std::string& pref_key){ | 37 bool IsPreferenceOnWhitelist(const std::string& pref_key){ |
37 return whitelist_.find(pref_key) != whitelist_.end(); | 38 return whitelist_.find(pref_key) != whitelist_.end(); |
38 } | 39 } |
39 | 40 |
40 void RegisterEventListeners( | 41 void RegisterEventListeners( |
41 Profile* profile, | 42 Profile* profile, |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 scoped_ptr<base::ListValue> args_copy(args.DeepCopy()); | 147 scoped_ptr<base::ListValue> args_copy(args.DeepCopy()); |
147 scoped_ptr<Event> event(new Event(event_name, args_copy.Pass())); | 148 scoped_ptr<Event> event(new Event(event_name, args_copy.Pass())); |
148 router->DispatchEventToExtension(extension_id, event.Pass()); | 149 router->DispatchEventToExtension(extension_id, event.Pass()); |
149 } | 150 } |
150 } | 151 } |
151 } | 152 } |
152 } | 153 } |
153 | 154 |
154 } // namespace chromedirectsetting | 155 } // namespace chromedirectsetting |
155 } // namespace extensions | 156 } // namespace extensions |
OLD | NEW |