OLD | NEW |
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 26 matching lines...) Expand all Loading... |
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 content::URLFetcher* source) { | 44 void CookieFetcher::OnURLFetchComplete(const content::URLFetcher* source) { |
45 if (source->GetStatus().is_success() && | 45 if (source->GetStatus().is_success() && |
46 source->GetResponseCode() == kHttpSuccess) { | 46 source->GetResponseCode() == kHttpSuccess) { |
47 if (issue_handler_->CanHandle(source->GetUrl())) { | 47 if (issue_handler_->CanHandle(source->GetURL())) { |
48 VLOG(1) << "Handling auth token"; | 48 VLOG(1) << "Handling auth token"; |
49 std::string data; | 49 std::string data; |
50 source->GetResponseAsString(&data); | 50 source->GetResponseAsString(&data); |
51 fetcher_.reset(issue_handler_->Handle(data, this)); | 51 fetcher_.reset(issue_handler_->Handle(data, this)); |
52 return; | 52 return; |
53 } | 53 } |
54 } | 54 } |
55 delete this; | 55 delete this; |
56 } | 56 } |
57 | 57 |
58 } // namespace chromeos | 58 } // namespace chromeos |
OLD | NEW |