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/chromeos/drive/drive_feed_loader.h" | 5 #include "chrome/browser/chromeos/drive/drive_feed_loader.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 // Sets the refreshing flag, so that the caller does not send refresh requests | 293 // Sets the refreshing flag, so that the caller does not send refresh requests |
294 // in parallel (see DriveFileSystem::CheckForUpdates). Corresponding | 294 // in parallel (see DriveFileSystem::CheckForUpdates). Corresponding |
295 // "refresh_ = false" is in OnGetAccountMetadata when the cached feed is up to | 295 // "refresh_ = false" is in OnGetAccountMetadata when the cached feed is up to |
296 // date, or in OnFeedFromServerLoaded called back from LoadFromServer(). | 296 // date, or in OnFeedFromServerLoaded called back from LoadFromServer(). |
297 refreshing_ = true; | 297 refreshing_ = true; |
298 | 298 |
299 if (google_apis::util::IsDriveV2ApiEnabled()) { | 299 if (google_apis::util::IsDriveV2ApiEnabled()) { |
300 // Drive v2 needs a separate application list fetch operation. | 300 // Drive v2 needs a separate application list fetch operation. |
301 // TODO(haruki): Application list rarely changes and is not necessarily | 301 // TODO(haruki): Application list rarely changes and is not necessarily |
302 // refreshed as often as files. | 302 // refreshed as often as files. |
303 drive_service_->GetApplicationInfo( | 303 scheduler_->GetApplicationInfo( |
304 base::Bind(&DriveFeedLoader::OnGetApplicationList, | 304 base::Bind(&DriveFeedLoader::OnGetApplicationList, |
305 weak_ptr_factory_.GetWeakPtr())); | 305 weak_ptr_factory_.GetWeakPtr())); |
306 } | 306 } |
307 | 307 |
308 // First fetch the latest changestamp to see if there were any new changes | 308 // First fetch the latest changestamp to see if there were any new changes |
309 // there at all. | 309 // there at all. |
310 drive_service_->GetAccountMetadata( | 310 drive_service_->GetAccountMetadata( |
311 base::Bind(&DriveFeedLoader::OnGetAccountMetadata, | 311 base::Bind(&DriveFeedLoader::OnGetAccountMetadata, |
312 weak_ptr_factory_.GetWeakPtr(), | 312 weak_ptr_factory_.GetWeakPtr(), |
313 callback)); | 313 callback)); |
(...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
896 | 896 |
897 // Run the callback now that the filesystem is ready. | 897 // Run the callback now that the filesystem is ready. |
898 load_finished_callback.Run(DRIVE_FILE_OK); | 898 load_finished_callback.Run(DRIVE_FILE_OK); |
899 | 899 |
900 FOR_EACH_OBSERVER(DriveFeedLoaderObserver, | 900 FOR_EACH_OBSERVER(DriveFeedLoaderObserver, |
901 observers_, | 901 observers_, |
902 OnFeedFromServerLoaded()); | 902 OnFeedFromServerLoaded()); |
903 } | 903 } |
904 | 904 |
905 } // namespace drive | 905 } // namespace drive |
OLD | NEW |