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

Side by Side Diff: chrome/browser/chromeos/login/issue_response_handler.cc

Issue 7006005: Move UrlFetcher to content. I originally thought that it's only used by chrome code, but turns o... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix linux Created 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/chromeos/login/issue_response_handler.h" 5 #include "chrome/browser/chromeos/login/issue_response_handler.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/stringprintf.h" 9 #include "base/stringprintf.h"
10 #include "chrome/browser/net/chrome_url_request_context.h" 10 #include "chrome/browser/net/chrome_url_request_context.h"
11 #include "chrome/common/net/url_fetcher.h" 11 #include "content/common/url_fetcher.h"
12 #include "net/base/load_flags.h" 12 #include "net/base/load_flags.h"
13 13
14 namespace chromeos { 14 namespace chromeos {
15 15
16 // Overridden from AuthResponseHandler. 16 // Overridden from AuthResponseHandler.
17 bool IssueResponseHandler::CanHandle(const GURL& url) { 17 bool IssueResponseHandler::CanHandle(const GURL& url) {
18 return (url.spec().find(AuthResponseHandler::kIssueAuthTokenUrl) != 18 return (url.spec().find(AuthResponseHandler::kIssueAuthTokenUrl) !=
19 std::string::npos); 19 std::string::npos);
20 } 20 }
21 21
22 // Overridden from AuthResponseHandler. 22 // Overridden from AuthResponseHandler.
23 URLFetcher* IssueResponseHandler::Handle( 23 URLFetcher* IssueResponseHandler::Handle(
24 const std::string& to_process, 24 const std::string& to_process,
25 URLFetcher::Delegate* catcher) { 25 URLFetcher::Delegate* catcher) {
26 VLOG(1) << "Handling IssueAuthToken response"; 26 VLOG(1) << "Handling IssueAuthToken response";
27 token_url_.assign(base::StringPrintf("%s%s", 27 token_url_.assign(base::StringPrintf("%s%s",
28 AuthResponseHandler::kTokenAuthUrl, to_process.c_str())); 28 AuthResponseHandler::kTokenAuthUrl, to_process.c_str()));
29 URLFetcher* fetcher = 29 URLFetcher* fetcher =
30 new URLFetcher(GURL(token_url_), URLFetcher::GET, catcher); 30 new URLFetcher(GURL(token_url_), URLFetcher::GET, catcher);
31 fetcher->set_load_flags(net::LOAD_DO_NOT_SEND_COOKIES); 31 fetcher->set_load_flags(net::LOAD_DO_NOT_SEND_COOKIES);
32 if (getter_) { 32 if (getter_) {
33 VLOG(1) << "Fetching " << AuthResponseHandler::kTokenAuthUrl; 33 VLOG(1) << "Fetching " << AuthResponseHandler::kTokenAuthUrl;
34 fetcher->set_request_context(getter_); 34 fetcher->set_request_context(getter_);
35 fetcher->Start(); 35 fetcher->Start();
36 } 36 }
37 return fetcher; 37 return fetcher;
38 } 38 }
39 39
40 } // namespace chromeos 40 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/image_downloader.cc ('k') | chrome/browser/chromeos/login/mock_auth_response_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698