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/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/prefs/pref_change_registrar.h" | 10 #include "base/prefs/pref_change_registrar.h" |
(...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
571 NOTREACHED(); | 571 NOTREACHED(); |
572 return; | 572 return; |
573 } | 573 } |
574 scoped_ptr<extensions::Event> event(new extensions::Event( | 574 scoped_ptr<extensions::Event> event(new extensions::Event( |
575 extensions::event_names::kOnFileBrowserDriveConnectionStatusChanged, | 575 extensions::event_names::kOnFileBrowserDriveConnectionStatusChanged, |
576 scoped_ptr<ListValue>(new ListValue()))); | 576 scoped_ptr<ListValue>(new ListValue()))); |
577 extensions::ExtensionSystem::Get(profile_)->event_router()-> | 577 extensions::ExtensionSystem::Get(profile_)->event_router()-> |
578 BroadcastEvent(event.Pass()); | 578 BroadcastEvent(event.Pass()); |
579 } | 579 } |
580 | 580 |
| 581 void FileManagerEventRouter::DefaultNetworkChanged() { |
| 582 NetworkManagerChanged(); |
| 583 } |
| 584 |
581 void FileManagerEventRouter::OnExternalStorageDisabledChanged() { | 585 void FileManagerEventRouter::OnExternalStorageDisabledChanged() { |
582 // If the policy just got disabled we have to unmount every device currently | 586 // If the policy just got disabled we have to unmount every device currently |
583 // mounted. The opposite is fine - we can let the user re-plug her device to | 587 // mounted. The opposite is fine - we can let the user re-plug her device to |
584 // make it available. | 588 // make it available. |
585 if (profile_->GetPrefs()->GetBoolean(prefs::kExternalStorageDisabled)) { | 589 if (profile_->GetPrefs()->GetBoolean(prefs::kExternalStorageDisabled)) { |
586 DiskMountManager* manager = DiskMountManager::GetInstance(); | 590 DiskMountManager* manager = DiskMountManager::GetInstance(); |
587 DiskMountManager::MountPointMap mounts(manager->mount_points()); | 591 DiskMountManager::MountPointMap mounts(manager->mount_points()); |
588 for (DiskMountManager::MountPointMap::const_iterator it = mounts.begin(); | 592 for (DiskMountManager::MountPointMap::const_iterator it = mounts.begin(); |
589 it != mounts.end(); ++it) { | 593 it != mounts.end(); ++it) { |
590 LOG(INFO) << "Unmounting " << it->second.mount_path | 594 LOG(INFO) << "Unmounting " << it->second.mount_path |
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1083 base::FilePathWatcher* file_watcher) { | 1087 base::FilePathWatcher* file_watcher) { |
1084 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 1088 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
1085 | 1089 |
1086 if (file_watcher) { | 1090 if (file_watcher) { |
1087 file_watcher_ = file_watcher; | 1091 file_watcher_ = file_watcher; |
1088 callback.Run(true); | 1092 callback.Run(true); |
1089 } else { | 1093 } else { |
1090 callback.Run(false); | 1094 callback.Run(false); |
1091 } | 1095 } |
1092 } | 1096 } |
OLD | NEW |