Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(289)

Side by Side Diff: chrome/browser/chromeos/extensions/file_browser_event_router.cc

Issue 13495003: Add LoginState class to src/chromeos/login (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Feedback round 1 Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_browser_event_router.h" 5 #include "chrome/browser/chromeos/extensions/file_browser_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/json/json_writer.h" 9 #include "base/json/json_writer.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
11 #include "base/prefs/pref_change_registrar.h" 11 #include "base/prefs/pref_change_registrar.h"
12 #include "base/prefs/pref_service.h" 12 #include "base/prefs/pref_service.h"
13 #include "base/stl_util.h" 13 #include "base/stl_util.h"
14 #include "base/values.h" 14 #include "base/values.h"
15 #include "chrome/browser/chromeos/drive/drive_cache.h" 15 #include "chrome/browser/chromeos/drive/drive_cache.h"
16 #include "chrome/browser/chromeos/drive/drive_file_system_interface.h" 16 #include "chrome/browser/chromeos/drive/drive_file_system_interface.h"
17 #include "chrome/browser/chromeos/drive/drive_file_system_util.h" 17 #include "chrome/browser/chromeos/drive/drive_file_system_util.h"
18 #include "chrome/browser/chromeos/drive/drive_system_service.h" 18 #include "chrome/browser/chromeos/drive/drive_system_service.h"
19 #include "chrome/browser/chromeos/extensions/file_browser_notifications.h" 19 #include "chrome/browser/chromeos/extensions/file_browser_notifications.h"
20 #include "chrome/browser/chromeos/extensions/file_manager_util.h" 20 #include "chrome/browser/chromeos/extensions/file_manager_util.h"
21 #include "chrome/browser/chromeos/login/base_login_display_host.h" 21 #include "chrome/browser/chromeos/login/base_login_display_host.h"
22 #include "chrome/browser/chromeos/login/screen_locker.h" 22 #include "chrome/browser/chromeos/login/screen_locker.h"
23 #include "chrome/browser/chromeos/login/user_manager.h"
24 #include "chrome/browser/chromeos/net/connectivity_state_helper.h" 23 #include "chrome/browser/chromeos/net/connectivity_state_helper.h"
25 #include "chrome/browser/extensions/event_names.h" 24 #include "chrome/browser/extensions/event_names.h"
26 #include "chrome/browser/extensions/event_router.h" 25 #include "chrome/browser/extensions/event_router.h"
27 #include "chrome/browser/extensions/extension_service.h" 26 #include "chrome/browser/extensions/extension_service.h"
28 #include "chrome/browser/extensions/extension_system.h" 27 #include "chrome/browser/extensions/extension_system.h"
29 #include "chrome/browser/google_apis/drive_service_interface.h" 28 #include "chrome/browser/google_apis/drive_service_interface.h"
30 #include "chrome/browser/profiles/profile.h" 29 #include "chrome/browser/profiles/profile.h"
31 #include "chrome/common/chrome_notification_types.h" 30 #include "chrome/common/chrome_notification_types.h"
32 #include "chrome/common/pref_names.h" 31 #include "chrome/common/pref_names.h"
33 #include "chromeos/dbus/cros_disks_client.h" 32 #include "chromeos/dbus/cros_disks_client.h"
34 #include "chromeos/dbus/dbus_thread_manager.h" 33 #include "chromeos/dbus/dbus_thread_manager.h"
35 #include "chromeos/dbus/power_manager_client.h" 34 #include "chromeos/dbus/power_manager_client.h"
36 #include "chromeos/dbus/session_manager_client.h" 35 #include "chromeos/dbus/session_manager_client.h"
36 #include "chromeos/login/login_state.h"
37 #include "content/public/browser/browser_thread.h" 37 #include "content/public/browser/browser_thread.h"
38 #include "content/public/browser/notification_source.h" 38 #include "content/public/browser/notification_source.h"
39 #include "grit/generated_resources.h" 39 #include "grit/generated_resources.h"
40 #include "ui/base/l10n/l10n_util.h" 40 #include "ui/base/l10n/l10n_util.h"
41 #include "webkit/fileapi/file_system_types.h" 41 #include "webkit/fileapi/file_system_types.h"
42 #include "webkit/fileapi/file_system_util.h" 42 #include "webkit/fileapi/file_system_util.h"
43 43
44 using chromeos::DBusThreadManager; 44 using chromeos::DBusThreadManager;
45 using chromeos::disks::DiskMountManager; 45 using chromeos::disks::DiskMountManager;
46 using content::BrowserThread; 46 using content::BrowserThread;
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 RemoveNetworkManagerObserver(this); 289 RemoveNetworkManagerObserver(this);
290 } 290 }
291 profile_ = NULL; 291 profile_ = NULL;
292 } 292 }
293 293
294 void FileBrowserEventRouter::ObserveFileSystemEvents() { 294 void FileBrowserEventRouter::ObserveFileSystemEvents() {
295 if (!profile_) { 295 if (!profile_) {
296 NOTREACHED(); 296 NOTREACHED();
297 return; 297 return;
298 } 298 }
299 if (!chromeos::UserManager::Get()->IsUserLoggedIn()) 299 if (!chromeos::LoginState::Get()->IsUserLoggedIn())
300 return; 300 return;
301 301
302 DiskMountManager* disk_mount_manager = DiskMountManager::GetInstance(); 302 DiskMountManager* disk_mount_manager = DiskMountManager::GetInstance();
303 if (disk_mount_manager) { 303 if (disk_mount_manager) {
304 disk_mount_manager->RemoveObserver(this); 304 disk_mount_manager->RemoveObserver(this);
305 disk_mount_manager->AddObserver(this); 305 disk_mount_manager->AddObserver(this);
306 disk_mount_manager->RequestMountInfoRefresh(); 306 disk_mount_manager->RequestMountInfoRefresh();
307 } 307 }
308 308
309 DriveSystemService* system_service = 309 DriveSystemService* system_service =
(...skipping 661 matching lines...) Expand 10 before | Expand all | Expand 10 after
971 } 971 }
972 972
973 bool FileBrowserEventRouter::FileWatcherExtensions::Watch( 973 bool FileBrowserEventRouter::FileWatcherExtensions::Watch(
974 const base::FilePath& path, 974 const base::FilePath& path,
975 const base::FilePathWatcher::Callback& callback) { 975 const base::FilePathWatcher::Callback& callback) {
976 if (is_remote_file_system_) 976 if (is_remote_file_system_)
977 return true; 977 return true;
978 978
979 return file_watcher_->Watch(path, false, callback); 979 return file_watcher_->Watch(path, false, callback);
980 } 980 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698