| 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 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 #include <utility> | 10 #include <utility> |
| 11 | 11 |
| 12 #include "base/bind.h" | 12 #include "base/bind.h" |
| 13 #include "base/command_line.h" | 13 #include "base/command_line.h" |
| 14 #include "base/files/file_util.h" | 14 #include "base/files/file_util.h" |
| 15 #include "base/macros.h" | 15 #include "base/macros.h" |
| 16 #include "base/memory/ptr_util.h" | 16 #include "base/memory/ptr_util.h" |
| 17 #include "base/threading/sequenced_worker_pool.h" | 17 #include "base/threading/sequenced_worker_pool.h" |
| 18 #include "base/threading/thread_task_runner_handle.h" | 18 #include "base/threading/thread_task_runner_handle.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/arc/arc_util.h" | 21 #include "chrome/browser/chromeos/arc/arc_session_manager.h" |
| 22 #include "chrome/browser/chromeos/drive/drive_integration_service.h" | 22 #include "chrome/browser/chromeos/drive/drive_integration_service.h" |
| 23 #include "chrome/browser/chromeos/drive/file_system_util.h" | 23 #include "chrome/browser/chromeos/drive/file_system_util.h" |
| 24 #include "chrome/browser/chromeos/extensions/file_manager/private_api_util.h" | 24 #include "chrome/browser/chromeos/extensions/file_manager/private_api_util.h" |
| 25 #include "chrome/browser/chromeos/file_manager/app_id.h" | 25 #include "chrome/browser/chromeos/file_manager/app_id.h" |
| 26 #include "chrome/browser/chromeos/file_manager/fileapi_util.h" | 26 #include "chrome/browser/chromeos/file_manager/fileapi_util.h" |
| 27 #include "chrome/browser/chromeos/file_manager/open_util.h" | 27 #include "chrome/browser/chromeos/file_manager/open_util.h" |
| 28 #include "chrome/browser/chromeos/file_manager/volume_manager.h" | 28 #include "chrome/browser/chromeos/file_manager/volume_manager.h" |
| 29 #include "chrome/browser/chromeos/login/lock/screen_locker.h" | 29 #include "chrome/browser/chromeos/login/lock/screen_locker.h" |
| 30 #include "chrome/browser/chromeos/login/ui/login_display_host.h" | 30 #include "chrome/browser/chromeos/login/ui/login_display_host.h" |
| 31 #include "chrome/browser/extensions/api/file_system/file_system_api.h" | 31 #include "chrome/browser/extensions/api/file_system/file_system_api.h" |
| (...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 502 weak_factory_.GetWeakPtr()); | 502 weak_factory_.GetWeakPtr()); |
| 503 pref_change_registrar_->Add(drive::prefs::kDisableDriveOverCellular, | 503 pref_change_registrar_->Add(drive::prefs::kDisableDriveOverCellular, |
| 504 callback); | 504 callback); |
| 505 pref_change_registrar_->Add(drive::prefs::kDisableDriveHostedFiles, callback); | 505 pref_change_registrar_->Add(drive::prefs::kDisableDriveHostedFiles, callback); |
| 506 pref_change_registrar_->Add(drive::prefs::kDisableDrive, callback); | 506 pref_change_registrar_->Add(drive::prefs::kDisableDrive, callback); |
| 507 pref_change_registrar_->Add(prefs::kSearchSuggestEnabled, callback); | 507 pref_change_registrar_->Add(prefs::kSearchSuggestEnabled, callback); |
| 508 pref_change_registrar_->Add(prefs::kUse24HourClock, callback); | 508 pref_change_registrar_->Add(prefs::kUse24HourClock, callback); |
| 509 | 509 |
| 510 chromeos::system::TimezoneSettings::GetInstance()->AddObserver(this); | 510 chromeos::system::TimezoneSettings::GetInstance()->AddObserver(this); |
| 511 | 511 |
| 512 if (arc::IsArcAllowedForProfile(profile_)) { | 512 if (arc::ArcSessionManager::IsAllowedForProfile(profile_)) { |
| 513 auto* intent_helper = | 513 auto* intent_helper = |
| 514 arc::ArcServiceManager::GetGlobalService<arc::ArcIntentHelperBridge>(); | 514 arc::ArcServiceManager::GetGlobalService<arc::ArcIntentHelperBridge>(); |
| 515 if (intent_helper) | 515 if (intent_helper) |
| 516 intent_helper->AddObserver(this); | 516 intent_helper->AddObserver(this); |
| 517 } | 517 } |
| 518 } | 518 } |
| 519 | 519 |
| 520 // File watch setup routines. | 520 // File watch setup routines. |
| 521 void EventRouter::AddFileWatch(const base::FilePath& local_path, | 521 void EventRouter::AddFileWatch(const base::FilePath& local_path, |
| 522 const base::FilePath& virtual_path, | 522 const base::FilePath& virtual_path, |
| (...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1007 void EventRouter::SetDispatchDirectoryChangeEventImplForTesting( | 1007 void EventRouter::SetDispatchDirectoryChangeEventImplForTesting( |
| 1008 const DispatchDirectoryChangeEventImplCallback& callback) { | 1008 const DispatchDirectoryChangeEventImplCallback& callback) { |
| 1009 dispatch_directory_change_event_impl_ = callback; | 1009 dispatch_directory_change_event_impl_ = callback; |
| 1010 } | 1010 } |
| 1011 | 1011 |
| 1012 base::WeakPtr<EventRouter> EventRouter::GetWeakPtr() { | 1012 base::WeakPtr<EventRouter> EventRouter::GetWeakPtr() { |
| 1013 return weak_factory_.GetWeakPtr(); | 1013 return weak_factory_.GetWeakPtr(); |
| 1014 } | 1014 } |
| 1015 | 1015 |
| 1016 } // namespace file_manager | 1016 } // namespace file_manager |
| OLD | NEW |