Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(211)

Side by Side Diff: chrome/browser/extensions/api/gcm/gcm_api.cc

Issue 448853002: Move StringToLowerASCII to base namespace (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698