OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 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/api/copresence/copresence_api.h" | 5 #include "chrome/browser/extensions/api/copresence/copresence_api.h" |
6 | 6 |
7 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
8 #include "base/memory/linked_ptr.h" | 8 #include "base/memory/linked_ptr.h" |
9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
10 #include "chrome/browser/copresence/chrome_whispernet_client.h" | 10 #include "chrome/browser/copresence/chrome_whispernet_client.h" |
11 #include "chrome/browser/profiles/profile.h" | 11 #include "chrome/browser/profiles/profile.h" |
12 #include "chrome/browser/services/gcm/gcm_profile_service.h" | |
13 #include "chrome/browser/services/gcm/gcm_profile_service_factory.h" | 12 #include "chrome/browser/services/gcm/gcm_profile_service_factory.h" |
14 #include "chrome/common/channel_info.h" | 13 #include "chrome/common/channel_info.h" |
15 #include "chrome/common/extensions/api/copresence.h" | 14 #include "chrome/common/extensions/api/copresence.h" |
16 #include "chrome/common/extensions/manifest_handlers/copresence_manifest.h" | 15 #include "chrome/common/extensions/manifest_handlers/copresence_manifest.h" |
17 #include "chrome/common/pref_names.h" | 16 #include "chrome/common/pref_names.h" |
18 #include "components/copresence/copresence_manager_impl.h" | 17 #include "components/copresence/copresence_manager_impl.h" |
19 #include "components/copresence/proto/data.pb.h" | 18 #include "components/copresence/proto/data.pb.h" |
20 #include "components/copresence/proto/enums.pb.h" | 19 #include "components/copresence/proto/enums.pb.h" |
21 #include "components/copresence/proto/rpcs.pb.h" | 20 #include "components/copresence/proto/rpcs.pb.h" |
| 21 #include "components/gcm_driver/gcm_profile_service.h" |
22 #include "components/pref_registry/pref_registry_syncable.h" | 22 #include "components/pref_registry/pref_registry_syncable.h" |
23 #include "content/public/browser/browser_context.h" | 23 #include "content/public/browser/browser_context.h" |
24 #include "extensions/browser/event_router.h" | 24 #include "extensions/browser/event_router.h" |
25 #include "extensions/browser/extension_registry.h" | 25 #include "extensions/browser/extension_registry.h" |
26 #include "extensions/common/extension.h" | 26 #include "extensions/common/extension.h" |
27 #include "extensions/common/manifest_constants.h" | 27 #include "extensions/common/manifest_constants.h" |
28 | 28 |
29 using user_prefs::PrefRegistrySyncable; | 29 using user_prefs::PrefRegistrySyncable; |
30 | 30 |
31 namespace extensions { | 31 namespace extensions { |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 scoped_ptr<SetAuthToken::Params> params(SetAuthToken::Params::Create(*args_)); | 294 scoped_ptr<SetAuthToken::Params> params(SetAuthToken::Params::Create(*args_)); |
295 EXTENSION_FUNCTION_VALIDATE(params.get()); | 295 EXTENSION_FUNCTION_VALIDATE(params.get()); |
296 | 296 |
297 // The token may be set to empty, to clear it. | 297 // The token may be set to empty, to clear it. |
298 CopresenceService::GetFactoryInstance()->Get(browser_context()) | 298 CopresenceService::GetFactoryInstance()->Get(browser_context()) |
299 ->set_auth_token(extension_id(), params->token); | 299 ->set_auth_token(extension_id(), params->token); |
300 return RespondNow(NoArguments()); | 300 return RespondNow(NoArguments()); |
301 } | 301 } |
302 | 302 |
303 } // namespace extensions | 303 } // namespace extensions |
OLD | NEW |