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/api/push_messaging/push_messaging_api.h" | 5 #include "chrome/browser/extensions/api/push_messaging/push_messaging_api.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 #include "chrome/common/extensions/extension_set.h" | 30 #include "chrome/common/extensions/extension_set.h" |
31 #include "chrome/common/extensions/permissions/api_permission.h" | 31 #include "chrome/common/extensions/permissions/api_permission.h" |
32 #include "content/public/browser/browser_thread.h" | 32 #include "content/public/browser/browser_thread.h" |
33 #include "content/public/browser/notification_details.h" | 33 #include "content/public/browser/notification_details.h" |
34 #include "content/public/browser/notification_source.h" | 34 #include "content/public/browser/notification_source.h" |
35 #include "google_apis/gaia/gaia_constants.h" | 35 #include "google_apis/gaia/gaia_constants.h" |
36 #include "url/gurl.h" | 36 #include "url/gurl.h" |
37 | 37 |
38 using content::BrowserThread; | 38 using content::BrowserThread; |
39 | 39 |
40 namespace { | |
41 const char kChannelIdSeparator[] = "/"; | 40 const char kChannelIdSeparator[] = "/"; |
42 const char kUserNotSignedIn[] = "The user is not signed in."; | 41 const char kUserNotSignedIn[] = "The user is not signed in."; |
43 const char kUserAccessTokenFailure[] = | 42 const char kUserAccessTokenFailure[] = |
44 "Cannot obtain access token for the user."; | 43 "Cannot obtain access token for the user."; |
45 const char kTokenServiceNotAvailable[] = "Failed to get token service."; | |
46 const int kObfuscatedGaiaIdTimeoutInDays = 30; | 44 const int kObfuscatedGaiaIdTimeoutInDays = 30; |
47 } | |
48 | 45 |
49 namespace extensions { | 46 namespace extensions { |
50 | 47 |
51 namespace glue = api::push_messaging; | 48 namespace glue = api::push_messaging; |
52 | 49 |
53 PushMessagingEventRouter::PushMessagingEventRouter(Profile* profile) | 50 PushMessagingEventRouter::PushMessagingEventRouter(Profile* profile) |
54 : profile_(profile) { | 51 : profile_(profile) { |
55 } | 52 } |
56 | 53 |
57 PushMessagingEventRouter::~PushMessagingEventRouter() {} | 54 PushMessagingEventRouter::~PushMessagingEventRouter() {} |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 handler_ = mapper.Pass(); | 356 handler_ = mapper.Pass(); |
360 } | 357 } |
361 | 358 |
362 template <> | 359 template <> |
363 void ProfileKeyedAPIFactory<PushMessagingAPI>::DeclareFactoryDependencies() { | 360 void ProfileKeyedAPIFactory<PushMessagingAPI>::DeclareFactoryDependencies() { |
364 DependsOn(ExtensionSystemFactory::GetInstance()); | 361 DependsOn(ExtensionSystemFactory::GetInstance()); |
365 DependsOn(invalidation::InvalidationServiceFactory::GetInstance()); | 362 DependsOn(invalidation::InvalidationServiceFactory::GetInstance()); |
366 } | 363 } |
367 | 364 |
368 } // namespace extensions | 365 } // namespace extensions |
OLD | NEW |