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

Side by Side Diff: cloud_print/service/service_state.cc

Issue 1172183002: Move StartsWith[ASCII] to base namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@string_util3
Patch Set: merger Created 5 years, 6 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
« no previous file with comments | « chromeos/system/version_loader.cc ('k') | cloud_print/service/win/service_utils.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "cloud_print/service/service_state.h" 5 #include "cloud_print/service/service_state.h"
6 6
7 #include "base/json/json_reader.h" 7 #include "base/json/json_reader.h"
8 #include "base/json/json_writer.h" 8 #include "base/json/json_writer.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 FROM_HERE, 192 FROM_HERE,
193 base::MessageLoop::QuitClosure(), 193 base::MessageLoop::QuitClosure(),
194 base::TimeDelta::FromMilliseconds(kRequestTimeoutMs)); 194 base::TimeDelta::FromMilliseconds(kRequestTimeoutMs));
195 195
196 base::MessageLoop::current()->Run(); 196 base::MessageLoop::current()->Run();
197 197
198 const char kAuthStart[] = "Auth="; 198 const char kAuthStart[] = "Auth=";
199 std::vector<std::string> lines; 199 std::vector<std::string> lines;
200 Tokenize(fetcher_delegate.data(), "\r\n", &lines); 200 Tokenize(fetcher_delegate.data(), "\r\n", &lines);
201 for (size_t i = 0; i < lines.size(); ++i) { 201 for (size_t i = 0; i < lines.size(); ++i) {
202 if (StartsWithASCII(lines[i], kAuthStart, false)) 202 if (base::StartsWithASCII(lines[i], kAuthStart, false))
203 return lines[i].substr(arraysize(kAuthStart) - 1); 203 return lines[i].substr(arraysize(kAuthStart) - 1);
204 } 204 }
205 205
206 return std::string(); 206 return std::string();
207 } 207 }
208 208
209 bool ServiceState::Configure(const std::string& email, 209 bool ServiceState::Configure(const std::string& email,
210 const std::string& password, 210 const std::string& password,
211 const std::string& proxy_id) { 211 const std::string& proxy_id) {
212 robot_token_.clear(); 212 robot_token_.clear();
213 robot_email_.clear(); 213 robot_email_.clear();
214 email_ = email; 214 email_ = email;
215 proxy_id_ = proxy_id; 215 proxy_id_ = proxy_id;
216 auth_token_ = LoginToGoogle("cloudprint", email_, password); 216 auth_token_ = LoginToGoogle("cloudprint", email_, password);
217 xmpp_auth_token_ = LoginToGoogle("chromiumsync", email_, password); 217 xmpp_auth_token_ = LoginToGoogle("chromiumsync", email_, password);
218 return IsValid(); 218 return IsValid();
219 } 219 }
OLDNEW
« no previous file with comments | « chromeos/system/version_loader.cc ('k') | cloud_print/service/win/service_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698