OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/event_router.h" | 5 #include "chrome/browser/chromeos/extensions/file_manager/event_router.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
12 #include "base/files/file_util.h" | 12 #include "base/files/file_util.h" |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
14 #include "base/prefs/pref_change_registrar.h" | 14 #include "base/prefs/pref_change_registrar.h" |
15 #include "base/prefs/pref_service.h" | 15 #include "base/prefs/pref_service.h" |
16 #include "base/stl_util.h" | 16 #include "base/stl_util.h" |
17 #include "base/thread_task_runner_handle.h" | 17 #include "base/thread_task_runner_handle.h" |
18 #include "base/threading/sequenced_worker_pool.h" | 18 #include "base/threading/sequenced_worker_pool.h" |
19 #include "base/values.h" | 19 #include "base/values.h" |
20 #include "chrome/browser/app_mode/app_mode_utils.h" | 20 #include "chrome/browser/app_mode/app_mode_utils.h" |
21 #include "chrome/browser/chromeos/drive/drive_integration_service.h" | 21 #include "chrome/browser/chromeos/drive/drive_integration_service.h" |
22 #include "chrome/browser/chromeos/drive/file_system_util.h" | 22 #include "chrome/browser/chromeos/drive/file_system_util.h" |
23 #include "chrome/browser/chromeos/extensions/file_manager/private_api_util.h" | 23 #include "chrome/browser/chromeos/extensions/file_manager/private_api_util.h" |
24 #include "chrome/browser/chromeos/file_manager/app_id.h" | 24 #include "chrome/browser/chromeos/file_manager/app_id.h" |
25 #include "chrome/browser/chromeos/file_manager/fileapi_util.h" | 25 #include "chrome/browser/chromeos/file_manager/fileapi_util.h" |
26 #include "chrome/browser/chromeos/file_manager/open_util.h" | 26 #include "chrome/browser/chromeos/file_manager/open_util.h" |
27 #include "chrome/browser/chromeos/file_manager/volume_manager.h" | 27 #include "chrome/browser/chromeos/file_manager/volume_manager.h" |
28 #include "chrome/browser/chromeos/login/lock/screen_locker.h" | 28 #include "chrome/browser/chromeos/login/lock/screen_locker.h" |
29 #include "chrome/browser/chromeos/login/ui/login_display_host_impl.h" | 29 #include "chrome/browser/chromeos/login/ui/login_display_host.h" |
30 #include "chrome/browser/extensions/api/file_system/file_system_api.h" | 30 #include "chrome/browser/extensions/api/file_system/file_system_api.h" |
31 #include "chrome/browser/extensions/extension_service.h" | 31 #include "chrome/browser/extensions/extension_service.h" |
32 #include "chrome/browser/extensions/extension_util.h" | 32 #include "chrome/browser/extensions/extension_util.h" |
33 #include "chrome/browser/profiles/profile.h" | 33 #include "chrome/browser/profiles/profile.h" |
34 #include "chrome/browser/profiles/profile_manager.h" | 34 #include "chrome/browser/profiles/profile_manager.h" |
35 #include "chrome/common/chrome_switches.h" | 35 #include "chrome/common/chrome_switches.h" |
36 #include "chrome/common/pref_names.h" | 36 #include "chrome/common/pref_names.h" |
37 #include "chromeos/dbus/dbus_thread_manager.h" | 37 #include "chromeos/dbus/dbus_thread_manager.h" |
38 #include "chromeos/login/login_state.h" | 38 #include "chromeos/login/login_state.h" |
39 #include "chromeos/network/network_handler.h" | 39 #include "chromeos/network/network_handler.h" |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 volume.type() != VOLUME_TYPE_REMOVABLE_DISK_PARTITION) { | 262 volume.type() != VOLUME_TYPE_REMOVABLE_DISK_PARTITION) { |
263 return false; | 263 return false; |
264 } | 264 } |
265 | 265 |
266 if (device_event_router.is_resuming() || device_event_router.is_starting_up()) | 266 if (device_event_router.is_resuming() || device_event_router.is_starting_up()) |
267 return false; | 267 return false; |
268 | 268 |
269 // Do not attempt to open File Manager while the login is in progress or | 269 // Do not attempt to open File Manager while the login is in progress or |
270 // the screen is locked or running in kiosk app mode and make sure the file | 270 // the screen is locked or running in kiosk app mode and make sure the file |
271 // manager is opened only for the active user. | 271 // manager is opened only for the active user. |
272 if (chromeos::LoginDisplayHostImpl::default_host() || | 272 if (chromeos::LoginDisplayHost::default_host() || |
273 chromeos::ScreenLocker::default_screen_locker() || | 273 chromeos::ScreenLocker::default_screen_locker() || |
274 chrome::IsRunningInForcedAppMode() || | 274 chrome::IsRunningInForcedAppMode() || |
275 profile != ProfileManager::GetActiveUserProfile()) { | 275 profile != ProfileManager::GetActiveUserProfile()) { |
276 return false; | 276 return false; |
277 } | 277 } |
278 | 278 |
279 // Do not pop-up the File Manager, if the recovery tool is running. | 279 // Do not pop-up the File Manager, if the recovery tool is running. |
280 if (IsRecoveryToolRunning(profile)) | 280 if (IsRecoveryToolRunning(profile)) |
281 return false; | 281 return false; |
282 | 282 |
(...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
976 void EventRouter::SetDispatchDirectoryChangeEventImplForTesting( | 976 void EventRouter::SetDispatchDirectoryChangeEventImplForTesting( |
977 const DispatchDirectoryChangeEventImplCallback& callback) { | 977 const DispatchDirectoryChangeEventImplCallback& callback) { |
978 dispatch_directory_change_event_impl_ = callback; | 978 dispatch_directory_change_event_impl_ = callback; |
979 } | 979 } |
980 | 980 |
981 base::WeakPtr<EventRouter> EventRouter::GetWeakPtr() { | 981 base::WeakPtr<EventRouter> EventRouter::GetWeakPtr() { |
982 return weak_factory_.GetWeakPtr(); | 982 return weak_factory_.GetWeakPtr(); |
983 } | 983 } |
984 | 984 |
985 } // namespace file_manager | 985 } // namespace file_manager |
OLD | NEW |