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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 } | 80 } |
81 | 81 |
82 ChromeDirectSettingAPI::~ChromeDirectSettingAPI() {} | 82 ChromeDirectSettingAPI::~ChromeDirectSettingAPI() {} |
83 | 83 |
84 // BrowserContextKeyedService implementation. | 84 // BrowserContextKeyedService implementation. |
85 void ChromeDirectSettingAPI::Shutdown() {} | 85 void ChromeDirectSettingAPI::Shutdown() {} |
86 | 86 |
87 // ProfileKeyedAPI implementation. | 87 // ProfileKeyedAPI implementation. |
88 ProfileKeyedAPIFactory<ChromeDirectSettingAPI>* | 88 ProfileKeyedAPIFactory<ChromeDirectSettingAPI>* |
89 ChromeDirectSettingAPI::GetFactoryInstance() { | 89 ChromeDirectSettingAPI::GetFactoryInstance() { |
90 return &g_factory.Get(); | 90 return g_factory.Pointer(); |
91 } | 91 } |
92 | 92 |
93 // EventRouter::Observer implementation. | 93 // EventRouter::Observer implementation. |
94 void ChromeDirectSettingAPI::OnListenerAdded(const EventListenerInfo& details) { | 94 void ChromeDirectSettingAPI::OnListenerAdded(const EventListenerInfo& details) { |
95 ExtensionSystem::Get(profile_)->event_router()->UnregisterObserver(this); | 95 ExtensionSystem::Get(profile_)->event_router()->UnregisterObserver(this); |
96 registrar_.Init(profile_->GetPrefs()); | 96 registrar_.Init(profile_->GetPrefs()); |
97 preference_whitelist.Get().RegisterPropertyListeners( | 97 preference_whitelist.Get().RegisterPropertyListeners( |
98 profile_, | 98 profile_, |
99 ®istrar_, | 99 ®istrar_, |
100 base::Bind(&ChromeDirectSettingAPI::OnPrefChanged, | 100 base::Bind(&ChromeDirectSettingAPI::OnPrefChanged, |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 router->DispatchEventToExtension(extension_id, event.Pass()); | 145 router->DispatchEventToExtension(extension_id, event.Pass()); |
146 } | 146 } |
147 } | 147 } |
148 } | 148 } |
149 } | 149 } |
150 } | 150 } |
151 | 151 |
152 } // namespace chromedirectsetting | 152 } // namespace chromedirectsetting |
153 } // namespace extensions | 153 } // namespace extensions |
154 | 154 |
OLD | NEW |