| 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/google_apis/drive_api_service.h" | 5 #include "chrome/browser/google_apis/drive_api_service.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 const char kDriveApiRootDirectoryResourceId[] = "root"; | 218 const char kDriveApiRootDirectoryResourceId[] = "root"; |
| 219 | 219 |
| 220 } // namespace | 220 } // namespace |
| 221 | 221 |
| 222 DriveAPIService::DriveAPIService( | 222 DriveAPIService::DriveAPIService( |
| 223 net::URLRequestContextGetter* url_request_context_getter, | 223 net::URLRequestContextGetter* url_request_context_getter, |
| 224 const GURL& base_url, | 224 const GURL& base_url, |
| 225 const std::string& custom_user_agent) | 225 const std::string& custom_user_agent) |
| 226 : url_request_context_getter_(url_request_context_getter), | 226 : url_request_context_getter_(url_request_context_getter), |
| 227 profile_(NULL), | 227 profile_(NULL), |
| 228 sender_(NULL), | |
| 229 url_generator_(base_url), | 228 url_generator_(base_url), |
| 230 custom_user_agent_(custom_user_agent) { | 229 custom_user_agent_(custom_user_agent) { |
| 231 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 230 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 232 } | 231 } |
| 233 | 232 |
| 234 DriveAPIService::~DriveAPIService() { | 233 DriveAPIService::~DriveAPIService() { |
| 235 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 234 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 236 if (sender_.get()) | 235 if (sender_.get()) |
| 237 sender_->auth_service()->RemoveObserver(this); | 236 sender_->auth_service()->RemoveObserver(this); |
| 238 } | 237 } |
| (...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 741 if (CanSendRequest()) { | 740 if (CanSendRequest()) { |
| 742 FOR_EACH_OBSERVER( | 741 FOR_EACH_OBSERVER( |
| 743 DriveServiceObserver, observers_, OnReadyToSendRequests()); | 742 DriveServiceObserver, observers_, OnReadyToSendRequests()); |
| 744 } else if (!HasRefreshToken()) { | 743 } else if (!HasRefreshToken()) { |
| 745 FOR_EACH_OBSERVER( | 744 FOR_EACH_OBSERVER( |
| 746 DriveServiceObserver, observers_, OnRefreshTokenInvalid()); | 745 DriveServiceObserver, observers_, OnRefreshTokenInvalid()); |
| 747 } | 746 } |
| 748 } | 747 } |
| 749 | 748 |
| 750 } // namespace google_apis | 749 } // namespace google_apis |
| OLD | NEW |