summaryrefslogtreecommitdiffstats
path: root/chrome/browser/chromeos/extensions
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/chromeos/extensions')
-rw-r--r--chrome/browser/chromeos/extensions/file_manager/event_router.cc61
-rw-r--r--chrome/browser/chromeos/extensions/file_manager/event_router.h30
-rw-r--r--chrome/browser/chromeos/extensions/file_manager/private_api_misc.cc6
3 files changed, 5 insertions, 92 deletions
diff --git a/chrome/browser/chromeos/extensions/file_manager/event_router.cc b/chrome/browser/chromeos/extensions/file_manager/event_router.cc
index c459ccb..9d85d4a 100644
--- a/chrome/browser/chromeos/extensions/file_manager/event_router.cc
+++ b/chrome/browser/chromeos/extensions/file_manager/event_router.cc
@@ -38,7 +38,6 @@
#include "chromeos/network/network_handler.h"
#include "chromeos/network/network_state_handler.h"
#include "content/public/browser/browser_thread.h"
-#include "content/public/browser/notification_source.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/storage_partition.h"
#include "extensions/browser/event_router.h"
@@ -251,22 +250,6 @@ std::string FileErrorToErrorName(base::File::Error error_code) {
}
}
-void GrantAccessForAddedProfileToRunningInstance(Profile* added_profile,
- Profile* running_profile) {
- extensions::ProcessManager* const process_manager =
- extensions::ExtensionSystem::Get(running_profile)->process_manager();
- if (!process_manager)
- return;
-
- extensions::ExtensionHost* const extension_host =
- process_manager->GetBackgroundHostForExtension(kFileManagerAppId);
- if (!extension_host || !extension_host->render_process_host())
- return;
-
- const int id = extension_host->render_process_host()->GetID();
- file_manager::util::SetupProfileFileAccessPermissions(id, added_profile);
-}
-
// Checks if we should send a progress event or not according to the
// |last_time| of sending an event. If |always| is true, the function always
// returns true. If the function returns true, the function also updates
@@ -367,7 +350,6 @@ EventRouter::DriveJobInfoWithStatus::DriveJobInfoWithStatus(
EventRouter::EventRouter(Profile* profile)
: pref_change_registrar_(new PrefChangeRegistrar),
profile_(profile),
- multi_user_window_manager_observer_registered_(false),
device_event_router_(new DeviceEventRouterImpl(profile)),
weak_factory_(this) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
@@ -413,14 +395,6 @@ void EventRouter::Shutdown() {
chromeos::DBusThreadManager::Get()->GetPowerManagerClient();
power_manager_client->RemoveObserver(device_event_router_.get());
- chrome::MultiUserWindowManager* const multi_user_window_manager =
- chrome::MultiUserWindowManager::GetInstance();
- if (multi_user_window_manager &&
- multi_user_window_manager_observer_registered_) {
- multi_user_window_manager_observer_registered_ = false;
- multi_user_window_manager->RemoveObserver(this);
- }
-
profile_ = NULL;
}
@@ -471,10 +445,6 @@ void EventRouter::ObserveEvents() {
pref_change_registrar_->Add(prefs::kDisableDriveHostedFiles, callback);
pref_change_registrar_->Add(prefs::kDisableDrive, callback);
pref_change_registrar_->Add(prefs::kUse24HourClock, callback);
-
- notification_registrar_.Add(this,
- chrome::NOTIFICATION_PROFILE_ADDED,
- content::NotificationService::AllSources());
}
// File watch setup routines.
@@ -940,35 +910,4 @@ void EventRouter::OnFormatCompleted(const std::string& device_path,
// Do nothing.
}
-void EventRouter::Observe(int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) {
- if (type == chrome::NOTIFICATION_PROFILE_ADDED) {
- Profile* const added_profile = content::Source<Profile>(source).ptr();
- if (!added_profile->IsOffTheRecord())
- GrantAccessForAddedProfileToRunningInstance(added_profile, profile_);
-
- BroadcastEvent(profile_,
- file_browser_private::OnProfileAdded::kEventName,
- file_browser_private::OnProfileAdded::Create());
- }
-}
-
-void EventRouter::RegisterMultiUserWindowManagerObserver() {
- if (multi_user_window_manager_observer_registered_)
- return;
- chrome::MultiUserWindowManager* const multi_user_window_manager =
- chrome::MultiUserWindowManager::GetInstance();
- if (multi_user_window_manager) {
- multi_user_window_manager->AddObserver(this);
- multi_user_window_manager_observer_registered_ = true;
- }
-}
-
-void EventRouter::OnOwnerEntryChanged(aura::Window* window) {
- BroadcastEvent(profile_,
- file_browser_private::OnDesktopChanged::kEventName,
- file_browser_private::OnDesktopChanged::Create());
-}
-
} // namespace file_manager
diff --git a/chrome/browser/chromeos/extensions/file_manager/event_router.h b/chrome/browser/chromeos/extensions/file_manager/event_router.h
index 7e094d6..7d187ea 100644
--- a/chrome/browser/chromeos/extensions/file_manager/event_router.h
+++ b/chrome/browser/chromeos/extensions/file_manager/event_router.h
@@ -21,12 +21,9 @@
#include "chrome/browser/chromeos/file_manager/volume_manager.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;
@@ -51,14 +48,11 @@ class DeviceEventRouter;
// Monitors changes in disk mounts, network connection state and preferences
// affecting File Manager. Dispatches appropriate File Browser events.
-class EventRouter
- : public chromeos::NetworkStateHandlerObserver,
- public drive::FileSystemObserver,
- public drive::JobListObserver,
- public drive::DriveServiceObserver,
- public VolumeManagerObserver,
- public content::NotificationObserver,
- public chrome::MultiUserWindowManager::Observer {
+class EventRouter : public chromeos::NetworkStateHandlerObserver,
+ public drive::FileSystemObserver,
+ public drive::JobListObserver,
+ public drive::DriveServiceObserver,
+ public VolumeManagerObserver {
public:
explicit EventRouter(Profile* profile);
virtual ~EventRouter();
@@ -96,9 +90,6 @@ class EventRouter
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;
@@ -135,14 +126,6 @@ class EventRouter
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;
@@ -202,9 +185,6 @@ class EventRouter
scoped_ptr<PrefChangeRegistrar> pref_change_registrar_;
Profile* profile_;
- content::NotificationRegistrar notification_registrar_;
- bool multi_user_window_manager_observer_registered_;
-
scoped_ptr<DeviceEventRouter> device_event_router_;
// Note: This should remain the last member so it'll be destroyed and
diff --git a/chrome/browser/chromeos/extensions/file_manager/private_api_misc.cc b/chrome/browser/chromeos/extensions/file_manager/private_api_misc.cc
index ed0aea0..67e57bd 100644
--- a/chrome/browser/chromeos/extensions/file_manager/private_api_misc.cc
+++ b/chrome/browser/chromeos/extensions/file_manager/private_api_misc.cc
@@ -11,7 +11,6 @@
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/chromeos/drive/file_system_util.h"
-#include "chrome/browser/chromeos/extensions/file_manager/event_router.h"
#include "chrome/browser/chromeos/extensions/file_manager/file_browser_private_api.h"
#include "chrome/browser/chromeos/extensions/file_manager/private_api_util.h"
#include "chrome/browser/chromeos/file_manager/app_installer.h"
@@ -418,11 +417,6 @@ bool FileBrowserPrivateVisitDesktopFunction::RunSync() {
return false;
}
- // Observe owner changes of windows.
- file_manager::EventRouter* const event_router =
- file_manager::FileBrowserPrivateAPI::Get(GetProfile())->event_router();
- event_router->RegisterMultiUserWindowManagerObserver();
-
// Move the window to the user's desktop.
window_manager->ShowWindowForUser(app_window->GetNativeWindow(),
params->profile_id);