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 "base/values.h" |
17 #include "chrome/browser/profiles/profile.h" | 17 #include "chrome/browser/profiles/profile.h" |
18 #include "chrome/browser/profiles/profile_downloader_delegate.h" | 18 #include "chrome/browser/profiles/profile_downloader_delegate.h" |
19 #include "chrome/browser/signin/token_service.h" | 19 #include "chrome/browser/signin/token_service.h" |
20 #include "chrome/browser/signin/token_service_factory.h" | 20 #include "chrome/browser/signin/token_service_factory.h" |
21 #include "chrome/common/chrome_notification_types.h" | 21 #include "chrome/common/chrome_notification_types.h" |
22 #include "chrome/common/net/gaia/gaia_constants.h" | |
23 #include "chrome/common/net/gaia/gaia_urls.h" | |
24 #include "chrome/common/net/gaia/oauth2_access_token_fetcher.h" | |
25 #include "content/public/browser/browser_thread.h" | 22 #include "content/public/browser/browser_thread.h" |
26 #include "content/public/browser/notification_details.h" | 23 #include "content/public/browser/notification_details.h" |
27 #include "content/public/browser/notification_observer.h" | 24 #include "content/public/browser/notification_observer.h" |
28 #include "content/public/browser/notification_registrar.h" | 25 #include "content/public/browser/notification_registrar.h" |
29 #include "content/public/browser/notification_source.h" | 26 #include "content/public/browser/notification_source.h" |
30 #include "content/public/browser/notification_types.h" | 27 #include "content/public/browser/notification_types.h" |
| 28 #include "google_apis/gaia/gaia_constants.h" |
| 29 #include "google_apis/gaia/gaia_urls.h" |
| 30 #include "google_apis/gaia/oauth2_access_token_fetcher.h" |
31 #include "googleurl/src/gurl.h" | 31 #include "googleurl/src/gurl.h" |
32 #include "net/base/load_flags.h" | 32 #include "net/base/load_flags.h" |
33 #include "net/url_request/url_fetcher.h" | 33 #include "net/url_request/url_fetcher.h" |
34 #include "net/url_request/url_request_status.h" | 34 #include "net/url_request/url_request_status.h" |
35 #include "skia/ext/image_operations.h" | 35 #include "skia/ext/image_operations.h" |
36 | 36 |
37 using content::BrowserThread; | 37 using content::BrowserThread; |
38 | 38 |
39 namespace { | 39 namespace { |
40 | 40 |
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
385 const base::Time& expiration_time) { | 385 const base::Time& expiration_time) { |
386 auth_token_ = access_token; | 386 auth_token_ = access_token; |
387 StartFetchingImage(); | 387 StartFetchingImage(); |
388 } | 388 } |
389 | 389 |
390 // Callback for OAuth2AccessTokenFetcher on failure. | 390 // Callback for OAuth2AccessTokenFetcher on failure. |
391 void ProfileDownloader::OnGetTokenFailure(const GoogleServiceAuthError& error) { | 391 void ProfileDownloader::OnGetTokenFailure(const GoogleServiceAuthError& error) { |
392 LOG(WARNING) << "ProfileDownloader: token request using refresh token failed"; | 392 LOG(WARNING) << "ProfileDownloader: token request using refresh token failed"; |
393 delegate_->OnProfileDownloadFailure(this); | 393 delegate_->OnProfileDownloadFailure(this); |
394 } | 394 } |
OLD | NEW |