| 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 14 matching lines...) Expand all Loading... |
| 25 #include "chrome/browser/chromeos/file_manager/volume_manager.h" | 25 #include "chrome/browser/chromeos/file_manager/volume_manager.h" |
| 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/pref_names.h" | 34 #include "chrome/common/pref_names.h" |
| 35 #include "chromeos/dbus/dbus_thread_manager.h" |
| 35 #include "chromeos/login/login_state.h" | 36 #include "chromeos/login/login_state.h" |
| 36 #include "chromeos/network/network_handler.h" | 37 #include "chromeos/network/network_handler.h" |
| 37 #include "chromeos/network/network_state_handler.h" | 38 #include "chromeos/network/network_state_handler.h" |
| 38 #include "content/public/browser/browser_thread.h" | 39 #include "content/public/browser/browser_thread.h" |
| 39 #include "content/public/browser/notification_source.h" | 40 #include "content/public/browser/notification_source.h" |
| 40 #include "webkit/common/fileapi/file_system_types.h" | 41 #include "webkit/common/fileapi/file_system_types.h" |
| 41 #include "webkit/common/fileapi/file_system_util.h" | 42 #include "webkit/common/fileapi/file_system_util.h" |
| 42 | 43 |
| 43 using chromeos::disks::DiskMountManager; | 44 using chromeos::disks::DiskMountManager; |
| 44 using chromeos::NetworkHandler; | 45 using chromeos::NetworkHandler; |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 integration_service->drive_service()->AddObserver(this); | 314 integration_service->drive_service()->AddObserver(this); |
| 314 integration_service->file_system()->AddObserver(this); | 315 integration_service->file_system()->AddObserver(this); |
| 315 integration_service->job_list()->AddObserver(this); | 316 integration_service->job_list()->AddObserver(this); |
| 316 } | 317 } |
| 317 | 318 |
| 318 if (NetworkHandler::IsInitialized()) { | 319 if (NetworkHandler::IsInitialized()) { |
| 319 NetworkHandler::Get()->network_state_handler()->AddObserver(this, | 320 NetworkHandler::Get()->network_state_handler()->AddObserver(this, |
| 320 FROM_HERE); | 321 FROM_HERE); |
| 321 } | 322 } |
| 322 | 323 |
| 323 mounted_disk_monitor_.reset(new MountedDiskMonitor()); | 324 mounted_disk_monitor_.reset(new MountedDiskMonitor( |
| 325 chromeos::DBusThreadManager::Get()->GetPowerManagerClient(), |
| 326 disk_mount_manager)); |
| 324 | 327 |
| 325 pref_change_registrar_->Init(profile_->GetPrefs()); | 328 pref_change_registrar_->Init(profile_->GetPrefs()); |
| 326 | 329 |
| 327 pref_change_registrar_->Add( | 330 pref_change_registrar_->Add( |
| 328 prefs::kExternalStorageDisabled, | 331 prefs::kExternalStorageDisabled, |
| 329 base::Bind(&EventRouter::OnExternalStorageDisabledChanged, | 332 base::Bind(&EventRouter::OnExternalStorageDisabledChanged, |
| 330 weak_factory_.GetWeakPtr())); | 333 weak_factory_.GetWeakPtr())); |
| 331 | 334 |
| 332 base::Closure callback = | 335 base::Closure callback = |
| 333 base::Bind(&EventRouter::OnFileManagerPrefsChanged, | 336 base::Bind(&EventRouter::OnFileManagerPrefsChanged, |
| (...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 840 base::TimeDelta::FromSeconds(4)); | 843 base::TimeDelta::FromSeconds(4)); |
| 841 } else { | 844 } else { |
| 842 notifications_->HideNotification(DesktopNotifications::FORMAT_START, | 845 notifications_->HideNotification(DesktopNotifications::FORMAT_START, |
| 843 device_path); | 846 device_path); |
| 844 notifications_->ShowNotification(DesktopNotifications::FORMAT_FAIL, | 847 notifications_->ShowNotification(DesktopNotifications::FORMAT_FAIL, |
| 845 device_path); | 848 device_path); |
| 846 } | 849 } |
| 847 } | 850 } |
| 848 | 851 |
| 849 } // namespace file_manager | 852 } // namespace file_manager |
| OLD | NEW |