summaryrefslogtreecommitdiffstats
path: root/apps/app_restore_service.cc
diff options
context:
space:
mode:
Diffstat (limited to 'apps/app_restore_service.cc')
-rw-r--r--apps/app_restore_service.cc45
1 files changed, 0 insertions, 45 deletions
diff --git a/apps/app_restore_service.cc b/apps/app_restore_service.cc
index a42f073..f8932fb 100644
--- a/apps/app_restore_service.cc
+++ b/apps/app_restore_service.cc
@@ -8,11 +8,9 @@
#include "chrome/browser/extensions/api/file_handlers/app_file_handler_util.h"
#include "chrome/browser/extensions/event_router.h"
#include "chrome/browser/extensions/extension_host.h"
-#include "chrome/browser/extensions/extension_prefs.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/extensions/extension_system.h"
#include "chrome/browser/extensions/platform_app_launcher.h"
-#include "chrome/browser/ui/extensions/shell_window.h"
#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/extensions/extension.h"
#include "chrome/common/extensions/extension_set.h"
@@ -57,9 +55,6 @@ AppRestoreService::AppRestoreService(Profile* profile)
registrar_.Add(
this, chrome::NOTIFICATION_APP_TERMINATING,
content::NotificationService::AllSources());
- extensions::ShellWindowRegistry* shell_window_registry =
- extensions::ShellWindowRegistry::Get(profile);
- shell_window_registry->AddObserver(this);
}
void AppRestoreService::HandleStartup(bool should_restore_apps) {
@@ -107,34 +102,11 @@ void AppRestoreService::Observe(int type,
// Stop listening to NOTIFICATION_EXTENSION_HOST_DESTROYED in particular
// as all extension hosts will be destroyed as a result of shutdown.
registrar_.RemoveAll();
- // Stop listening to the ShellWindowRegistry for window closes, because
- // all windows will be closed as a result of shutdown.
- extensions::ShellWindowRegistry* shell_window_registry =
- extensions::ShellWindowRegistry::Get(profile_);
- shell_window_registry->RemoveObserver(this);
break;
}
}
}
-void AppRestoreService::OnShellWindowAdded(ShellWindow* shell_window) {
- RecordIfAppHasWindows(shell_window->extension()->id());
-}
-
-void AppRestoreService::OnShellWindowIconChanged(ShellWindow* shell_window) {
-}
-
-void AppRestoreService::OnShellWindowRemoved(ShellWindow* shell_window) {
- // A shell window may be getting removed because its extension is uninstalled.
- if (shell_window->extension())
- RecordIfAppHasWindows(shell_window->extension()->id());
-}
-
-void AppRestoreService::Shutdown() {
- extensions::ShellWindowRegistry* shell_window_registry =
- extensions::ShellWindowRegistry::Get(profile_);
- shell_window_registry->RemoveObserver(this);
-}
void AppRestoreService::RecordAppStart(const std::string& extension_id) {
ExtensionPrefs* extension_prefs =
@@ -150,23 +122,6 @@ void AppRestoreService::RecordAppStop(const std::string& extension_id) {
extension_prefs, extension_id);
}
-void AppRestoreService::RecordIfAppHasWindows(
- const std::string& id) {
- ExtensionService* extension_service =
- ExtensionSystem::Get(profile_)->extension_service();
- ExtensionPrefs* extension_prefs = extension_service->extension_prefs();
-
- // If the extension isn't running then we will already have recorded whether
- // it had windows or not.
- if (!extension_prefs->IsExtensionRunning(id))
- return;
-
- extensions::ShellWindowRegistry* shell_window_registry =
- extensions::ShellWindowRegistry::Get(profile_);
- bool has_windows = !shell_window_registry->GetShellWindowsForApp(id).empty();
- extension_prefs->SetHasWindows(id, has_windows);
-}
-
void AppRestoreService::RestoreApp(
const Extension* extension,
const std::vector<SavedFileEntry>& file_entries) {