| 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/metrics/histogram.h" | 11 #include "base/metrics/histogram.h" |
| 12 #include "base/strings/string_number_conversions.h" | 12 #include "base/strings/string_number_conversions.h" |
| 13 #include "base/strings/string_util.h" | 13 #include "base/strings/string_util.h" |
| 14 #include "chrome/browser/profiles/profile.h" | 14 #include "chrome/browser/profiles/profile.h" |
| 15 #include "chrome/browser/profiles/profile.h" | 15 #include "chrome/browser/profiles/profile.h" |
| 16 #include "chrome/browser/services/gcm/gcm_driver.h" | |
| 17 #include "chrome/browser/services/gcm/gcm_profile_service.h" | 16 #include "chrome/browser/services/gcm/gcm_profile_service.h" |
| 18 #include "chrome/browser/services/gcm/gcm_profile_service_factory.h" | 17 #include "chrome/browser/services/gcm/gcm_profile_service_factory.h" |
| 19 #include "chrome/common/extensions/api/gcm.h" | 18 #include "chrome/common/extensions/api/gcm.h" |
| 19 #include "components/gcm_driver/gcm_driver.h" |
| 20 #include "extensions/browser/event_router.h" | 20 #include "extensions/browser/event_router.h" |
| 21 #include "extensions/common/extension.h" | 21 #include "extensions/common/extension.h" |
| 22 | 22 |
| 23 namespace { | 23 namespace { |
| 24 | 24 |
| 25 const size_t kMaximumMessageSize = 4096; // in bytes. | 25 const size_t kMaximumMessageSize = 4096; // in bytes. |
| 26 const char kCollapseKey[] = "collapse_key"; | 26 const char kCollapseKey[] = "collapse_key"; |
| 27 const char kGoogDotRestrictedPrefix[] = "goog."; | 27 const char kGoogDotRestrictedPrefix[] = "goog."; |
| 28 const char kGoogleRestrictedPrefix[] = "google"; | 28 const char kGoogleRestrictedPrefix[] = "google"; |
| 29 | 29 |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 error.details.additional_properties = send_error_details.additional_data; | 241 error.details.additional_properties = send_error_details.additional_data; |
| 242 | 242 |
| 243 scoped_ptr<Event> event(new Event( | 243 scoped_ptr<Event> event(new Event( |
| 244 api::gcm::OnSendError::kEventName, | 244 api::gcm::OnSendError::kEventName, |
| 245 api::gcm::OnSendError::Create(error).Pass(), | 245 api::gcm::OnSendError::Create(error).Pass(), |
| 246 profile_)); | 246 profile_)); |
| 247 EventRouter::Get(profile_)->DispatchEventToExtension(app_id, event.Pass()); | 247 EventRouter::Get(profile_)->DispatchEventToExtension(app_id, event.Pass()); |
| 248 } | 248 } |
| 249 | 249 |
| 250 } // namespace extensions | 250 } // namespace extensions |
| OLD | NEW |