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

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

Issue 8375039: Create a content::UrlFetcher interface that lives in content/public/common and convert users to i... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: review comments Created 9 years, 2 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/cookie_fetcher.h" 5 #include "chrome/browser/chromeos/login/cookie_fetcher.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/path_service.h" 8 #include "base/path_service.h"
9 #include "chrome/browser/chromeos/login/client_login_response_handler.h" 9 #include "chrome/browser/chromeos/login/client_login_response_handler.h"
10 #include "chrome/browser/chromeos/login/issue_response_handler.h" 10 #include "chrome/browser/chromeos/login/issue_response_handler.h"
(...skipping 23 matching lines...) Expand all
34 issue_handler_(i_handler) { 34 issue_handler_(i_handler) {
35 } 35 }
36 36
37 CookieFetcher::~CookieFetcher() {} 37 CookieFetcher::~CookieFetcher() {}
38 38
39 void CookieFetcher::AttemptFetch(const std::string& credentials) { 39 void CookieFetcher::AttemptFetch(const std::string& credentials) {
40 VLOG(1) << "Getting auth token..."; 40 VLOG(1) << "Getting auth token...";
41 fetcher_.reset(client_login_handler_->Handle(credentials, this)); 41 fetcher_.reset(client_login_handler_->Handle(credentials, this));
42 } 42 }
43 43
44 void CookieFetcher::OnURLFetchComplete(const URLFetcher* source) { 44 void CookieFetcher::
45 if (source->status().is_success() && 45 OnURLFetchComplete(const content::URLFetcher* source) {
46 source->response_code() == kHttpSuccess) { 46 if (source->GetStatus().is_success() &&
47 if (issue_handler_->CanHandle(source->url())) { 47 source->GetResponseCode() == kHttpSuccess) {
48 if (issue_handler_->CanHandle(source->GetUrl())) {
48 VLOG(1) << "Handling auth token"; 49 VLOG(1) << "Handling auth token";
49 std::string data; 50 std::string data;
50 source->GetResponseAsString(&data); 51 source->GetResponseAsString(&data);
51 fetcher_.reset(issue_handler_->Handle(data, this)); 52 fetcher_.reset(issue_handler_->Handle(data, this));
52 return; 53 return;
53 } 54 }
54 } 55 }
55 delete this; 56 delete this;
56 } 57 }
57 58
58 } // namespace chromeos 59 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/cookie_fetcher.h ('k') | chrome/browser/chromeos/login/cookie_fetcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698