| 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_file_system.h" | 5 #include "chrome/browser/chromeos/drive/drive_file_system.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/json/json_file_value_serializer.h" | 9 #include "base/json/json_file_value_serializer.h" |
| 10 #include "base/message_loop_proxy.h" | 10 #include "base/message_loop_proxy.h" |
| (...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 base::TimeDelta::FromSeconds(polling_interval_sec_), | 348 base::TimeDelta::FromSeconds(polling_interval_sec_), |
| 349 base::Bind(&DriveFileSystem::CheckForUpdates, | 349 base::Bind(&DriveFileSystem::CheckForUpdates, |
| 350 weak_ptr_factory_.GetWeakPtr())); | 350 weak_ptr_factory_.GetWeakPtr())); |
| 351 } | 351 } |
| 352 | 352 |
| 353 void DriveFileSystem::StopPolling() { | 353 void DriveFileSystem::StopPolling() { |
| 354 // If unmount request comes from filesystem side, this method may be called | 354 // If unmount request comes from filesystem side, this method may be called |
| 355 // twice. First is just after unmounting on filesystem, second is after | 355 // twice. First is just after unmounting on filesystem, second is after |
| 356 // unmounting on filemanager on JS. In other words, if this is called from | 356 // unmounting on filemanager on JS. In other words, if this is called from |
| 357 // DriveSystemService::RemoveDriveMountPoint(), this will be called again from | 357 // DriveSystemService::RemoveDriveMountPoint(), this will be called again from |
| 358 // FileBrowserEventRouter::HandleRemoteUpdateRequestOnUIThread(). | 358 // FileManagerEventRouter::HandleRemoteUpdateRequestOnUIThread(). |
| 359 // We choose to stopping updates asynchronous without waiting for filemanager, | 359 // We choose to stopping updates asynchronous without waiting for filemanager, |
| 360 // rather than waiting for completion of unmounting on filemanager. | 360 // rather than waiting for completion of unmounting on filemanager. |
| 361 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 361 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 362 if (update_timer_.IsRunning()) | 362 if (update_timer_.IsRunning()) |
| 363 update_timer_.Stop(); | 363 update_timer_.Stop(); |
| 364 } | 364 } |
| 365 | 365 |
| 366 void DriveFileSystem::SetPushNotificationEnabled(bool enabled) { | 366 void DriveFileSystem::SetPushNotificationEnabled(bool enabled) { |
| 367 push_notification_enabled_ = enabled; | 367 push_notification_enabled_ = enabled; |
| 368 polling_interval_sec_ = enabled ? kSlowPollingIntervalInSec : | 368 polling_interval_sec_ = enabled ? kSlowPollingIntervalInSec : |
| (...skipping 1340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1709 return; | 1709 return; |
| 1710 } | 1710 } |
| 1711 | 1711 |
| 1712 PlatformFileInfoProto entry_file_info; | 1712 PlatformFileInfoProto entry_file_info; |
| 1713 util::ConvertPlatformFileInfoToProto(*file_info, &entry_file_info); | 1713 util::ConvertPlatformFileInfoToProto(*file_info, &entry_file_info); |
| 1714 *entry_proto->mutable_file_info() = entry_file_info; | 1714 *entry_proto->mutable_file_info() = entry_file_info; |
| 1715 callback.Run(DRIVE_FILE_OK, entry_proto.Pass()); | 1715 callback.Run(DRIVE_FILE_OK, entry_proto.Pass()); |
| 1716 } | 1716 } |
| 1717 | 1717 |
| 1718 } // namespace drive | 1718 } // namespace drive |
| OLD | NEW |