| 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_manager/file_manager_event_rou
ter.h" | 5 #include "chrome/browser/chromeos/extensions/file_manager/file_manager_event_rou
ter.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_writer.h" | 9 #include "base/json/json_writer.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| 11 #include "base/prefs/pref_change_registrar.h" | 11 #include "base/prefs/pref_change_registrar.h" |
| 12 #include "base/prefs/pref_service.h" | 12 #include "base/prefs/pref_service.h" |
| 13 #include "base/stl_util.h" | 13 #include "base/stl_util.h" |
| 14 #include "base/values.h" | 14 #include "base/values.h" |
| 15 #include "chrome/browser/chromeos/drive/drive_cache.h" | 15 #include "chrome/browser/chromeos/drive/drive_cache.h" |
| 16 #include "chrome/browser/chromeos/drive/drive_file_system_interface.h" | 16 #include "chrome/browser/chromeos/drive/drive_file_system_interface.h" |
| 17 #include "chrome/browser/chromeos/drive/drive_file_system_util.h" | 17 #include "chrome/browser/chromeos/drive/drive_file_system_util.h" |
| 18 #include "chrome/browser/chromeos/drive/drive_system_service.h" | 18 #include "chrome/browser/chromeos/drive/drive_system_service.h" |
| 19 #include "chrome/browser/chromeos/extensions/file_manager/file_manager_notificat
ions.h" | 19 #include "chrome/browser/chromeos/extensions/file_manager/file_manager_notificat
ions.h" |
| 20 #include "chrome/browser/chromeos/extensions/file_manager/file_manager_util.h" | 20 #include "chrome/browser/chromeos/extensions/file_manager/file_manager_util.h" |
| 21 #include "chrome/browser/chromeos/login/base_login_display_host.h" | 21 #include "chrome/browser/chromeos/login/login_display_host_impl.h" |
| 22 #include "chrome/browser/chromeos/login/screen_locker.h" | 22 #include "chrome/browser/chromeos/login/screen_locker.h" |
| 23 #include "chrome/browser/chromeos/login/user_manager.h" | 23 #include "chrome/browser/chromeos/login/user_manager.h" |
| 24 #include "chrome/browser/chromeos/net/connectivity_state_helper.h" | 24 #include "chrome/browser/chromeos/net/connectivity_state_helper.h" |
| 25 #include "chrome/browser/extensions/event_names.h" | 25 #include "chrome/browser/extensions/event_names.h" |
| 26 #include "chrome/browser/extensions/event_router.h" | 26 #include "chrome/browser/extensions/event_router.h" |
| 27 #include "chrome/browser/extensions/extension_service.h" | 27 #include "chrome/browser/extensions/extension_service.h" |
| 28 #include "chrome/browser/extensions/extension_system.h" | 28 #include "chrome/browser/extensions/extension_system.h" |
| 29 #include "chrome/browser/google_apis/drive_service_interface.h" | 29 #include "chrome/browser/google_apis/drive_service_interface.h" |
| 30 #include "chrome/browser/profiles/profile.h" | 30 #include "chrome/browser/profiles/profile.h" |
| 31 #include "chrome/common/chrome_notification_types.h" | 31 #include "chrome/common/chrome_notification_types.h" |
| (...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 712 scoped_ptr<extensions::Event> extension_event(new extensions::Event( | 712 scoped_ptr<extensions::Event> extension_event(new extensions::Event( |
| 713 extensions::event_names::kOnFileBrowserMountCompleted, args.Pass())); | 713 extensions::event_names::kOnFileBrowserMountCompleted, args.Pass())); |
| 714 extensions::ExtensionSystem::Get(profile_)->event_router()-> | 714 extensions::ExtensionSystem::Get(profile_)->event_router()-> |
| 715 BroadcastEvent(extension_event.Pass()); | 715 BroadcastEvent(extension_event.Pass()); |
| 716 } | 716 } |
| 717 | 717 |
| 718 void FileManagerEventRouter::ShowRemovableDeviceInFileManager( | 718 void FileManagerEventRouter::ShowRemovableDeviceInFileManager( |
| 719 const DiskMountManager::Disk& disk, const base::FilePath& mount_path) { | 719 const DiskMountManager::Disk& disk, const base::FilePath& mount_path) { |
| 720 // Do not attempt to open File Manager while the login is in progress or | 720 // Do not attempt to open File Manager while the login is in progress or |
| 721 // the screen is locked. | 721 // the screen is locked. |
| 722 if (chromeos::BaseLoginDisplayHost::default_host() || | 722 if (chromeos::LoginDisplayHostImpl::default_host() || |
| 723 chromeos::ScreenLocker::default_screen_locker()) | 723 chromeos::ScreenLocker::default_screen_locker()) |
| 724 return; | 724 return; |
| 725 | 725 |
| 726 // According to DCF (Design rule of Camera File system) by JEITA / CP-3461 | 726 // According to DCF (Design rule of Camera File system) by JEITA / CP-3461 |
| 727 // cameras should have pictures located in the DCIM root directory. | 727 // cameras should have pictures located in the DCIM root directory. |
| 728 const base::FilePath dcim_path = mount_path.Append( | 728 const base::FilePath dcim_path = mount_path.Append( |
| 729 FILE_PATH_LITERAL("DCIM")); | 729 FILE_PATH_LITERAL("DCIM")); |
| 730 | 730 |
| 731 // TODO(mtomasz): Temporarily for M26. Remove it on M27. | 731 // TODO(mtomasz): Temporarily for M26. Remove it on M27. |
| 732 // If an external photo importer is installed, then do not show the action | 732 // If an external photo importer is installed, then do not show the action |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 989 base::FilePathWatcher* file_watcher) { | 989 base::FilePathWatcher* file_watcher) { |
| 990 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 990 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 991 | 991 |
| 992 if (file_watcher) { | 992 if (file_watcher) { |
| 993 file_watcher_ = file_watcher; | 993 file_watcher_ = file_watcher; |
| 994 callback.Run(true); | 994 callback.Run(true); |
| 995 } else { | 995 } else { |
| 996 callback.Run(false); | 996 callback.Run(false); |
| 997 } | 997 } |
| 998 } | 998 } |
| OLD | NEW |