| 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/drive/gdata_wapi_service.h" | 5 #include "chrome/browser/drive/gdata_wapi_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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 154 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 155 | 155 |
| 156 std::vector<std::string> scopes; | 156 std::vector<std::string> scopes; |
| 157 scopes.push_back(kDocsListScope); | 157 scopes.push_back(kDocsListScope); |
| 158 scopes.push_back(kSpreadsheetsScope); | 158 scopes.push_back(kSpreadsheetsScope); |
| 159 scopes.push_back(kUserContentScope); | 159 scopes.push_back(kUserContentScope); |
| 160 // Drive App scope is required for even WAPI v3 apps access. | 160 // Drive App scope is required for even WAPI v3 apps access. |
| 161 scopes.push_back(kDriveAppsScope); | 161 scopes.push_back(kDriveAppsScope); |
| 162 sender_.reset(new RequestSender(profile, | 162 sender_.reset(new RequestSender(profile, |
| 163 url_request_context_getter_, | 163 url_request_context_getter_, |
| 164 blocking_task_runner_.get(), |
| 164 scopes, | 165 scopes, |
| 165 custom_user_agent_)); | 166 custom_user_agent_)); |
| 166 sender_->Initialize(); | 167 sender_->Initialize(); |
| 167 | 168 |
| 168 sender_->auth_service()->AddObserver(this); | 169 sender_->auth_service()->AddObserver(this); |
| 169 } | 170 } |
| 170 | 171 |
| 171 void GDataWapiService::AddObserver(DriveServiceObserver* observer) { | 172 void GDataWapiService::AddObserver(DriveServiceObserver* observer) { |
| 172 observers_.AddObserver(observer); | 173 observers_.AddObserver(observer); |
| 173 } | 174 } |
| (...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 598 if (CanSendRequest()) { | 599 if (CanSendRequest()) { |
| 599 FOR_EACH_OBSERVER( | 600 FOR_EACH_OBSERVER( |
| 600 DriveServiceObserver, observers_, OnReadyToSendRequests()); | 601 DriveServiceObserver, observers_, OnReadyToSendRequests()); |
| 601 } else if (!HasRefreshToken()) { | 602 } else if (!HasRefreshToken()) { |
| 602 FOR_EACH_OBSERVER( | 603 FOR_EACH_OBSERVER( |
| 603 DriveServiceObserver, observers_, OnRefreshTokenInvalid()); | 604 DriveServiceObserver, observers_, OnRefreshTokenInvalid()); |
| 604 } | 605 } |
| 605 } | 606 } |
| 606 | 607 |
| 607 } // namespace drive | 608 } // namespace drive |
| OLD | NEW |