summaryrefslogtreecommitdiffstats
path: root/apps/app_restore_service.h
diff options
context:
space:
mode:
authormad@chromium.org <mad@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-06 14:13:00 +0000
committermad@chromium.org <mad@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-06 14:13:00 +0000
commit4abde49fed3bb3c861be1512a0e4e8ee32818493 (patch)
tree6c3c5f5728bb782f953f36d0915070bf7128d042 /apps/app_restore_service.h
parentf80ae2cd0f480a856c8a7689d4b6f1cf547061ec (diff)
downloadchromium_src-4abde49fed3bb3c861be1512a0e4e8ee32818493.zip
chromium_src-4abde49fed3bb3c861be1512a0e4e8ee32818493.tar.gz
chromium_src-4abde49fed3bb3c861be1512a0e4e8ee32818493.tar.bz2
Revert 204487 "Factor out AppLifetimeMonitor."
Was causing BrowserCommandControllerTest.IncognitoModeOnSigninAllowedPrefChange to crash. > Factor out AppLifetimeMonitor. > > AppLifetimeMonitor listens to extension host notifications and observes > ShellWindowRegistry. It sends out notifications when: > - an app starts > - the first shell window opens > - the last shell window closes > - the app stops > > BUG= > > Review URL: https://chromiumcodereview.appspot.com/16412002 TBR=jackhou@chromium.org Review URL: https://codereview.chromium.org/16554002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@204495 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'apps/app_restore_service.h')
-rw-r--r--apps/app_restore_service.h20
1 files changed, 8 insertions, 12 deletions
diff --git a/apps/app_restore_service.h b/apps/app_restore_service.h
index d4e605f..65d3de2 100644
--- a/apps/app_restore_service.h
+++ b/apps/app_restore_service.h
@@ -8,7 +8,6 @@
#include <string>
#include <vector>
-#include "apps/app_lifetime_monitor.h"
#include "chrome/browser/extensions/shell_window_registry.h"
#include "components/browser_context_keyed_service/browser_context_keyed_service.h"
#include "content/public/browser/notification_observer.h"
@@ -25,7 +24,7 @@ namespace apps {
// Tracks what apps need to be restarted when the browser restarts.
class AppRestoreService : public BrowserContextKeyedService,
public content::NotificationObserver,
- public AppLifetimeMonitor::Observer {
+ public extensions::ShellWindowRegistry::Observer {
public:
// Returns true if apps should be restored on the current platform, given
// whether this new browser process launched due to a restart.
@@ -43,25 +42,22 @@ class AppRestoreService : public BrowserContextKeyedService,
const content::NotificationSource& source,
const content::NotificationDetails& details) OVERRIDE;
- // AppLifetimeMonitor::Observer.
- virtual void OnAppStart(Profile* profile, const std::string& app_id) OVERRIDE;
- virtual void OnAppActivated(Profile* profile,
- const std::string& app_id) OVERRIDE;
- virtual void OnAppDeactivated(Profile* profile,
- const std::string& app_id) OVERRIDE;
- virtual void OnAppStop(Profile* profile, const std::string& app_id) OVERRIDE;
+ // extensions::ShellWindowRegistry::Observer.
+ virtual void OnShellWindowAdded(ShellWindow* shell_window) OVERRIDE;
+ virtual void OnShellWindowIconChanged(ShellWindow* shell_window) OVERRIDE;
+ virtual void OnShellWindowRemoved(ShellWindow* shell_window) OVERRIDE;
// BrowserContextKeyedService.
virtual void Shutdown() OVERRIDE;
void RecordAppStart(const std::string& extension_id);
void RecordAppStop(const std::string& extension_id);
- void RecordAppActiveState(const std::string& id, bool is_active);
+ void RecordIfAppHasWindows(const std::string& id);
void RestoreApp(const extensions::Extension* extension);
- void StartObservingAppLifetime();
- void StopObservingAppLifetime();
+ void StartObservingShellWindows();
+ void StopObservingShellWindows();
content::NotificationRegistrar registrar_;
Profile* profile_;