| 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/event_router.h" | 5 #include "chrome/browser/chromeos/extensions/file_manager/event_router.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/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/prefs/pref_change_registrar.h" | 10 #include "base/prefs/pref_change_registrar.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 #include "chrome/browser/chromeos/login/login_display_host_impl.h" | 26 #include "chrome/browser/chromeos/login/login_display_host_impl.h" |
| 27 #include "chrome/browser/chromeos/login/screen_locker.h" | 27 #include "chrome/browser/chromeos/login/screen_locker.h" |
| 28 #include "chrome/browser/drive/drive_service_interface.h" | 28 #include "chrome/browser/drive/drive_service_interface.h" |
| 29 #include "chrome/browser/extensions/event_names.h" | 29 #include "chrome/browser/extensions/event_names.h" |
| 30 #include "chrome/browser/extensions/event_router.h" | 30 #include "chrome/browser/extensions/event_router.h" |
| 31 #include "chrome/browser/extensions/extension_service.h" | 31 #include "chrome/browser/extensions/extension_service.h" |
| 32 #include "chrome/browser/extensions/extension_system.h" | 32 #include "chrome/browser/extensions/extension_system.h" |
| 33 #include "chrome/browser/profiles/profile.h" | 33 #include "chrome/browser/profiles/profile.h" |
| 34 #include "chrome/common/extensions/api/file_browser_private.h" | 34 #include "chrome/common/extensions/api/file_browser_private.h" |
| 35 #include "chrome/common/pref_names.h" | 35 #include "chrome/common/pref_names.h" |
| 36 #include "chromeos/dbus/dbus_thread_manager.h" |
| 36 #include "chromeos/login/login_state.h" | 37 #include "chromeos/login/login_state.h" |
| 37 #include "chromeos/network/network_handler.h" | 38 #include "chromeos/network/network_handler.h" |
| 38 #include "chromeos/network/network_state_handler.h" | 39 #include "chromeos/network/network_state_handler.h" |
| 39 #include "content/public/browser/browser_thread.h" | 40 #include "content/public/browser/browser_thread.h" |
| 40 #include "content/public/browser/notification_source.h" | 41 #include "content/public/browser/notification_source.h" |
| 41 #include "webkit/common/fileapi/file_system_types.h" | 42 #include "webkit/common/fileapi/file_system_types.h" |
| 42 #include "webkit/common/fileapi/file_system_util.h" | 43 #include "webkit/common/fileapi/file_system_util.h" |
| 43 | 44 |
| 44 using chromeos::disks::DiskMountManager; | 45 using chromeos::disks::DiskMountManager; |
| 45 using chromeos::NetworkHandler; | 46 using chromeos::NetworkHandler; |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 integration_service->drive_service()->AddObserver(this); | 323 integration_service->drive_service()->AddObserver(this); |
| 323 integration_service->file_system()->AddObserver(this); | 324 integration_service->file_system()->AddObserver(this); |
| 324 integration_service->job_list()->AddObserver(this); | 325 integration_service->job_list()->AddObserver(this); |
| 325 } | 326 } |
| 326 | 327 |
| 327 if (NetworkHandler::IsInitialized()) { | 328 if (NetworkHandler::IsInitialized()) { |
| 328 NetworkHandler::Get()->network_state_handler()->AddObserver(this, | 329 NetworkHandler::Get()->network_state_handler()->AddObserver(this, |
| 329 FROM_HERE); | 330 FROM_HERE); |
| 330 } | 331 } |
| 331 | 332 |
| 332 mounted_disk_monitor_.reset(new MountedDiskMonitor()); | 333 mounted_disk_monitor_.reset(new MountedDiskMonitor( |
| 334 chromeos::DBusThreadManager::Get()->GetPowerManagerClient(), |
| 335 disk_mount_manager)); |
| 333 | 336 |
| 334 pref_change_registrar_->Init(profile_->GetPrefs()); | 337 pref_change_registrar_->Init(profile_->GetPrefs()); |
| 335 | 338 |
| 336 pref_change_registrar_->Add( | 339 pref_change_registrar_->Add( |
| 337 prefs::kExternalStorageDisabled, | 340 prefs::kExternalStorageDisabled, |
| 338 base::Bind(&EventRouter::OnExternalStorageDisabledChanged, | 341 base::Bind(&EventRouter::OnExternalStorageDisabledChanged, |
| 339 weak_factory_.GetWeakPtr())); | 342 weak_factory_.GetWeakPtr())); |
| 340 | 343 |
| 341 base::Closure callback = | 344 base::Closure callback = |
| 342 base::Bind(&EventRouter::OnFileManagerPrefsChanged, | 345 base::Bind(&EventRouter::OnFileManagerPrefsChanged, |
| (...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 872 base::TimeDelta::FromSeconds(4)); | 875 base::TimeDelta::FromSeconds(4)); |
| 873 } else { | 876 } else { |
| 874 notifications_->HideNotification(DesktopNotifications::FORMAT_START, | 877 notifications_->HideNotification(DesktopNotifications::FORMAT_START, |
| 875 device_path); | 878 device_path); |
| 876 notifications_->ShowNotification(DesktopNotifications::FORMAT_FAIL, | 879 notifications_->ShowNotification(DesktopNotifications::FORMAT_FAIL, |
| 877 device_path); | 880 device_path); |
| 878 } | 881 } |
| 879 } | 882 } |
| 880 | 883 |
| 881 } // namespace file_manager | 884 } // namespace file_manager |
| OLD | NEW |