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 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 default: | 62 default: |
63 NOTREACHED() << "Unexpected value of result cannot be converted: " | 63 NOTREACHED() << "Unexpected value of result cannot be converted: " |
64 << result; | 64 << result; |
65 } | 65 } |
66 | 66 |
67 // Never reached, but prevents missing return statement warning. | 67 // Never reached, but prevents missing return statement warning. |
68 return ""; | 68 return ""; |
69 } | 69 } |
70 | 70 |
71 bool IsMessageKeyValid(const std::string& key) { | 71 bool IsMessageKeyValid(const std::string& key) { |
72 std::string lower = StringToLowerASCII(key); | 72 std::string lower = base::StringToLowerASCII(key); |
73 return !key.empty() && | 73 return !key.empty() && |
74 key.compare(0, arraysize(kCollapseKey) - 1, kCollapseKey) != 0 && | 74 key.compare(0, arraysize(kCollapseKey) - 1, kCollapseKey) != 0 && |
75 lower.compare(0, | 75 lower.compare(0, |
76 arraysize(kGoogleRestrictedPrefix) - 1, | 76 arraysize(kGoogleRestrictedPrefix) - 1, |
77 kGoogleRestrictedPrefix) != 0 && | 77 kGoogleRestrictedPrefix) != 0 && |
78 lower.compare(0, | 78 lower.compare(0, |
79 arraysize(kGoogDotRestrictedPrefix), | 79 arraysize(kGoogDotRestrictedPrefix), |
80 kGoogDotRestrictedPrefix) != 0; | 80 kGoogDotRestrictedPrefix) != 0; |
81 } | 81 } |
82 | 82 |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 error.details.additional_properties = send_error_details.additional_data; | 240 error.details.additional_properties = send_error_details.additional_data; |
241 | 241 |
242 scoped_ptr<Event> event(new Event( | 242 scoped_ptr<Event> event(new Event( |
243 api::gcm::OnSendError::kEventName, | 243 api::gcm::OnSendError::kEventName, |
244 api::gcm::OnSendError::Create(error).Pass(), | 244 api::gcm::OnSendError::Create(error).Pass(), |
245 profile_)); | 245 profile_)); |
246 EventRouter::Get(profile_)->DispatchEventToExtension(app_id, event.Pass()); | 246 EventRouter::Get(profile_)->DispatchEventToExtension(app_id, event.Pass()); |
247 } | 247 } |
248 | 248 |
249 } // namespace extensions | 249 } // namespace extensions |
OLD | NEW |