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/extensions/file_browser_event_router.h" | 5 #include "chrome/browser/chromeos/extensions/file_browser_event_router.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/json/json_writer.h" | 8 #include "base/json/json_writer.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/prefs/public/pref_change_registrar.h" | 10 #include "base/prefs/public/pref_change_registrar.h" |
(...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
618 // Do not attempt to open File Manager while the login is in progress or | 618 // Do not attempt to open File Manager while the login is in progress or |
619 // the screen is locked. | 619 // the screen is locked. |
620 if (chromeos::BaseLoginDisplayHost::default_host() || | 620 if (chromeos::BaseLoginDisplayHost::default_host() || |
621 chromeos::ScreenLocker::default_screen_locker()) | 621 chromeos::ScreenLocker::default_screen_locker()) |
622 return; | 622 return; |
623 | 623 |
624 if (relative_mount_path_set && | 624 if (relative_mount_path_set && |
625 mount_info.mount_type == chromeos::MOUNT_TYPE_DEVICE && | 625 mount_info.mount_type == chromeos::MOUNT_TYPE_DEVICE && |
626 !mount_info.mount_condition && | 626 !mount_info.mount_condition && |
627 event == DiskMountManager::MOUNTING) { | 627 event == DiskMountManager::MOUNTING) { |
628 file_manager_util::OpenActionChoiceDialog(FilePath(mount_info.mount_path)); | 628 // To enable Photo Import call file_manager_util::OpenActionChoiceDialog |
| 629 // instead. |
| 630 file_manager_util::ViewRemovableDrive(FilePath(mount_info.mount_path)); |
629 } | 631 } |
630 } | 632 } |
631 | 633 |
632 void FileBrowserEventRouter::OnDiskAdded( | 634 void FileBrowserEventRouter::OnDiskAdded( |
633 const DiskMountManager::Disk* disk) { | 635 const DiskMountManager::Disk* disk) { |
634 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 636 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
635 | 637 |
636 VLOG(1) << "Disk added: " << disk->device_path(); | 638 VLOG(1) << "Disk added: " << disk->device_path(); |
637 if (disk->device_path().empty()) { | 639 if (disk->device_path().empty()) { |
638 VLOG(1) << "Empty system path for " << disk->device_path(); | 640 VLOG(1) << "Empty system path for " << disk->device_path(); |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
852 return (system_service ? system_service->file_system() : NULL); | 854 return (system_service ? system_service->file_system() : NULL); |
853 } | 855 } |
854 | 856 |
855 bool FileBrowserEventRouter::FileWatcherExtensions::Watch | 857 bool FileBrowserEventRouter::FileWatcherExtensions::Watch |
856 (const FilePath& path, FileWatcherDelegate* delegate) { | 858 (const FilePath& path, FileWatcherDelegate* delegate) { |
857 if (is_remote_file_system_) | 859 if (is_remote_file_system_) |
858 return true; | 860 return true; |
859 | 861 |
860 return file_watcher_->Watch(path, delegate); | 862 return file_watcher_->Watch(path, delegate); |
861 } | 863 } |
OLD | NEW |