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

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

Issue 136683004: Removes MessageLoop::TYPE_XXX where possible (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: resolve merge Created 6 years, 11 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 (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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 std::string json; 153 std::string json;
154 base::JSONWriter::WriteWithOptions(services.get(), 154 base::JSONWriter::WriteWithOptions(services.get(),
155 base::JSONWriter::OPTIONS_PRETTY_PRINT, 155 base::JSONWriter::OPTIONS_PRETTY_PRINT,
156 &json); 156 &json);
157 return json; 157 return json;
158 } 158 }
159 159
160 std::string ServiceState::LoginToGoogle(const std::string& service, 160 std::string ServiceState::LoginToGoogle(const std::string& service,
161 const std::string& email, 161 const std::string& email,
162 const std::string& password) { 162 const std::string& password) {
163 base::MessageLoop loop(base::MessageLoop::TYPE_IO); 163 base::MessageLoopForIO loop;
164 164
165 net::URLRequestContextBuilder builder; 165 net::URLRequestContextBuilder builder;
166 scoped_ptr<net::URLRequestContext> context(builder.Build()); 166 scoped_ptr<net::URLRequestContext> context(builder.Build());
167 167
168 ServiceStateURLRequestDelegate fetcher_delegate; 168 ServiceStateURLRequestDelegate fetcher_delegate;
169 GURL url(kClientLoginUrl); 169 GURL url(kClientLoginUrl);
170 170
171 std::string post_body; 171 std::string post_body;
172 post_body += "accountType=GOOGLE"; 172 post_body += "accountType=GOOGLE";
173 post_body += "&Email=" + net::EscapeUrlEncodedData(email, true); 173 post_body += "&Email=" + net::EscapeUrlEncodedData(email, true);
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 const std::string& password, 213 const std::string& password,
214 const std::string& proxy_id) { 214 const std::string& proxy_id) {
215 robot_token_.clear(); 215 robot_token_.clear();
216 robot_email_.clear(); 216 robot_email_.clear();
217 email_ = email; 217 email_ = email;
218 proxy_id_ = proxy_id; 218 proxy_id_ = proxy_id;
219 auth_token_ = LoginToGoogle("cloudprint", email_, password); 219 auth_token_ = LoginToGoogle("cloudprint", email_, password);
220 xmpp_auth_token_ = LoginToGoogle("chromiumsync", email_, password); 220 xmpp_auth_token_ = LoginToGoogle("chromiumsync", email_, password);
221 return IsValid(); 221 return IsValid();
222 } 222 }
OLDNEW
« no previous file with comments | « cloud_print/gcp20/prototype/gcp20_device.cc ('k') | content/browser/appcache/chrome_appcache_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698