OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/sync_file_system/drive/api_util.h" | 5 #include "chrome/browser/sync_file_system/drive/api_util.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <functional> | 8 #include <functional> |
9 #include <sstream> | 9 #include <sstream> |
10 #include <string> | 10 #include <string> |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 drive_service_->AddObserver(this); | 178 drive_service_->AddObserver(this); |
179 net::NetworkChangeNotifier::AddConnectionTypeObserver(this); | 179 net::NetworkChangeNotifier::AddConnectionTypeObserver(this); |
180 | 180 |
181 drive_uploader_ = drive_uploader.Pass(); | 181 drive_uploader_ = drive_uploader.Pass(); |
182 } | 182 } |
183 | 183 |
184 APIUtil::~APIUtil() { | 184 APIUtil::~APIUtil() { |
185 DCHECK(CalledOnValidThread()); | 185 DCHECK(CalledOnValidThread()); |
186 net::NetworkChangeNotifier::RemoveConnectionTypeObserver(this); | 186 net::NetworkChangeNotifier::RemoveConnectionTypeObserver(this); |
187 drive_service_->RemoveObserver(this); | 187 drive_service_->RemoveObserver(this); |
188 drive_service_->CancelAll(); | |
189 } | 188 } |
190 | 189 |
191 void APIUtil::AddObserver(APIUtilObserver* observer) { | 190 void APIUtil::AddObserver(APIUtilObserver* observer) { |
192 DCHECK(CalledOnValidThread()); | 191 DCHECK(CalledOnValidThread()); |
193 observers_.AddObserver(observer); | 192 observers_.AddObserver(observer); |
194 } | 193 } |
195 | 194 |
196 void APIUtil::RemoveObserver(APIUtilObserver* observer) { | 195 void APIUtil::RemoveObserver(APIUtilObserver* observer) { |
197 DCHECK(CalledOnValidThread()); | 196 DCHECK(CalledOnValidThread()); |
198 observers_.RemoveObserver(observer); | 197 observers_.RemoveObserver(observer); |
(...skipping 870 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1069 } | 1068 } |
1070 | 1069 |
1071 std::string APIUtil::GetRootResourceId() const { | 1070 std::string APIUtil::GetRootResourceId() const { |
1072 if (IsDriveAPIDisabled()) | 1071 if (IsDriveAPIDisabled()) |
1073 return drive_service_->GetRootResourceId(); | 1072 return drive_service_->GetRootResourceId(); |
1074 return root_resource_id_; | 1073 return root_resource_id_; |
1075 } | 1074 } |
1076 | 1075 |
1077 } // namespace drive | 1076 } // namespace drive |
1078 } // namespace sync_file_system | 1077 } // namespace sync_file_system |
OLD | NEW |