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/gcm/gcm_api.h" | 5 #include "chrome/browser/extensions/api/gcm/gcm_api.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <map> | 8 #include <map> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/sha1.h" | 11 #include "base/sha1.h" |
12 #include "base/strings/string_number_conversions.h" | 12 #include "base/strings/string_number_conversions.h" |
13 #include "chrome/browser/extensions/extension_system.h" | |
14 #include "chrome/browser/profiles/profile.h" | 13 #include "chrome/browser/profiles/profile.h" |
15 #include "chrome/browser/profiles/profile.h" | 14 #include "chrome/browser/profiles/profile.h" |
16 #include "chrome/browser/services/gcm/gcm_profile_service.h" | 15 #include "chrome/browser/services/gcm/gcm_profile_service.h" |
17 #include "chrome/browser/services/gcm/gcm_profile_service_factory.h" | 16 #include "chrome/browser/services/gcm/gcm_profile_service_factory.h" |
18 #include "chrome/common/extensions/api/gcm.h" | 17 #include "chrome/common/extensions/api/gcm.h" |
19 #include "extensions/browser/event_router.h" | 18 #include "extensions/browser/event_router.h" |
| 19 #include "extensions/browser/extension_system.h" |
20 #include "extensions/common/extension.h" | 20 #include "extensions/common/extension.h" |
21 | 21 |
22 namespace { | 22 namespace { |
23 | 23 |
24 const size_t kMaximumMessageSize = 4096; // in bytes. | 24 const size_t kMaximumMessageSize = 4096; // in bytes. |
25 const char kGoogDotRestrictedPrefix[] = "goog."; | 25 const char kGoogDotRestrictedPrefix[] = "goog."; |
26 const size_t kGoogDotPrefixLength = arraysize(kGoogDotRestrictedPrefix) - 1; | 26 const size_t kGoogDotPrefixLength = arraysize(kGoogDotRestrictedPrefix) - 1; |
27 const char kGoogleRestrictedPrefix[] = "google"; | 27 const char kGoogleRestrictedPrefix[] = "google"; |
28 const size_t kGooglePrefixLength = arraysize(kGoogleRestrictedPrefix) - 1; | 28 const size_t kGooglePrefixLength = arraysize(kGoogleRestrictedPrefix) - 1; |
29 | 29 |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 | 211 |
212 scoped_ptr<Event> event(new Event( | 212 scoped_ptr<Event> event(new Event( |
213 api::gcm::OnSendError::kEventName, | 213 api::gcm::OnSendError::kEventName, |
214 api::gcm::OnSendError::Create(error).Pass(), | 214 api::gcm::OnSendError::Create(error).Pass(), |
215 profile_)); | 215 profile_)); |
216 ExtensionSystem::Get(profile_)->event_router()->DispatchEventToExtension( | 216 ExtensionSystem::Get(profile_)->event_router()->DispatchEventToExtension( |
217 app_id, event.Pass()); | 217 app_id, event.Pass()); |
218 } | 218 } |
219 | 219 |
220 } // namespace extensions | 220 } // namespace extensions |
OLD | NEW |