| OLD | NEW |
| 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 "chrome/browser/profiles/profile_downloader.h" | 5 #include "chrome/browser/profiles/profile_downloader.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/json/json_reader.h" | 10 #include "base/json/json_reader.h" |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/message_loop.h" | 12 #include "base/message_loop.h" |
| 13 #include "base/string_split.h" | 13 #include "base/string_split.h" |
| 14 #include "base/string_util.h" | 14 #include "base/string_util.h" |
| 15 #include "base/stringprintf.h" | 15 #include "base/stringprintf.h" |
| 16 #include "base/values.h" |
| 16 #include "chrome/browser/profiles/profile.h" | 17 #include "chrome/browser/profiles/profile.h" |
| 17 #include "chrome/browser/profiles/profile_downloader_delegate.h" | 18 #include "chrome/browser/profiles/profile_downloader_delegate.h" |
| 18 #include "chrome/browser/signin/token_service.h" | 19 #include "chrome/browser/signin/token_service.h" |
| 19 #include "chrome/browser/signin/token_service_factory.h" | 20 #include "chrome/browser/signin/token_service_factory.h" |
| 20 #include "chrome/common/chrome_notification_types.h" | 21 #include "chrome/common/chrome_notification_types.h" |
| 21 #include "chrome/common/net/gaia/gaia_constants.h" | 22 #include "chrome/common/net/gaia/gaia_constants.h" |
| 22 #include "chrome/common/net/gaia/gaia_urls.h" | 23 #include "chrome/common/net/gaia/gaia_urls.h" |
| 23 #include "chrome/common/net/gaia/oauth2_access_token_fetcher.h" | 24 #include "chrome/common/net/gaia/oauth2_access_token_fetcher.h" |
| 24 #include "content/public/browser/browser_thread.h" | 25 #include "content/public/browser/browser_thread.h" |
| 25 #include "content/public/browser/notification_details.h" | 26 #include "content/public/browser/notification_details.h" |
| (...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 372 void ProfileDownloader::OnGetTokenSuccess(const std::string& access_token) { | 373 void ProfileDownloader::OnGetTokenSuccess(const std::string& access_token) { |
| 373 auth_token_ = access_token; | 374 auth_token_ = access_token; |
| 374 StartFetchingImage(); | 375 StartFetchingImage(); |
| 375 } | 376 } |
| 376 | 377 |
| 377 // Callback for OAuth2AccessTokenFetcher on failure. | 378 // Callback for OAuth2AccessTokenFetcher on failure. |
| 378 void ProfileDownloader::OnGetTokenFailure(const GoogleServiceAuthError& error) { | 379 void ProfileDownloader::OnGetTokenFailure(const GoogleServiceAuthError& error) { |
| 379 LOG(WARNING) << "ProfileDownloader: token request using refresh token failed"; | 380 LOG(WARNING) << "ProfileDownloader: token request using refresh token failed"; |
| 380 delegate_->OnDownloadComplete(this, false); | 381 delegate_->OnDownloadComplete(this, false); |
| 381 } | 382 } |
| OLD | NEW |