#include "chrome/browser/chromeos/file_manager/file_watcher.h"
#include "chrome/browser/chromeos/file_manager/volume_manager_observer.h"
#include "chrome/browser/drive/drive_service_interface.h"
+#include "chrome/browser/ui/ash/multi_user/multi_user_window_manager.h"
#include "chrome/common/extensions/api/file_browser_private.h"
#include "chromeos/disks/disk_mount_manager.h"
#include "chromeos/network/network_state_handler_observer.h"
+#include "content/public/browser/notification_observer.h"
+#include "content/public/browser/notification_registrar.h"
#include "webkit/browser/fileapi/file_system_operation.h"
class PrefChangeRegistrar;
public drive::FileSystemObserver,
public drive::JobListObserver,
public drive::DriveServiceObserver,
- public VolumeManagerObserver {
+ public VolumeManagerObserver,
+ public content::NotificationObserver,
+ public chrome::MultiUserWindowManager::Observer {
public:
explicit EventRouter(Profile* profile);
virtual ~EventRouter();
void Shutdown();
// Starts observing file system change events.
- void ObserveFileSystemEvents();
+ void ObserveEvents();
typedef base::Callback<void(bool success)> BoolCallback;
const GURL& destination_url,
int64 size);
+ // Register observer to the multi user window manager.
+ void RegisterMultiUserWindowManagerObserver();
+
// chromeos::NetworkStateHandlerObserver overrides.
virtual void DefaultNetworkChanged(
const chromeos::NetworkState* network) OVERRIDE;
virtual void OnRefreshTokenInvalid() OVERRIDE;
// drive::FileSystemObserver overrides.
- virtual void OnDirectoryChanged(
- const base::FilePath& directory_path) OVERRIDE;
- virtual void OnDriveSyncError(
- drive::file_system::DriveSyncErrorType type,
- const base::FilePath& file_path) OVERRIDE;
+ virtual void OnDirectoryChanged(const base::FilePath& drive_path) OVERRIDE;
+ virtual void OnDriveSyncError(drive::file_system::DriveSyncErrorType type,
+ const base::FilePath& drive_path) OVERRIDE;
// VolumeManagerObserver overrides.
virtual void OnDiskAdded(
virtual void OnFormatCompleted(
const std::string& device_path, bool success) OVERRIDE;
+ // content::NotificationObserver overrides.
+ virtual void Observe(int type,
+ const content::NotificationSource& source,
+ const content::NotificationDetails& details) OVERRIDE;
+
+ // chrome::MultiUserWindowManager::Observer overrides:
+ virtual void OnOwnerEntryChanged(aura::Window* window) OVERRIDE;
+
private:
typedef std::map<base::FilePath, FileWatcher*> WatcherMap;
scoped_ptr<PrefChangeRegistrar> pref_change_registrar_;
Profile* profile_;
+ content::NotificationRegistrar notification_registrar_;
+ bool multi_user_window_manager_observer_registered_;
+
// Note: This should remain the last member so it'll be destroyed and
// invalidate the weak pointers before any other members are destroyed.
base::WeakPtrFactory<EventRouter> weak_factory_;