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

Unified Diff: chrome/browser/extensions/shell_window_registry.h

Issue 11238055: Re-open DevTools windows for PackagedApps if they are reloaded with DevTools open. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: before unit test Created 8 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/shell_window_registry.h
diff --git a/chrome/browser/extensions/shell_window_registry.h b/chrome/browser/extensions/shell_window_registry.h
index 97ecc3a2ad56ce8d9b3e48b04e13ac27bcee570b..7379bf70e28b8de509f3eba636a067a98f7c1f23 100644
--- a/chrome/browser/extensions/shell_window_registry.h
+++ b/chrome/browser/extensions/shell_window_registry.h
@@ -12,6 +12,8 @@
#include "base/observer_list.h"
#include "chrome/browser/profiles/profile_keyed_service.h"
#include "chrome/browser/profiles/profile_keyed_service_factory.h"
+#include "content/public/browser/notification_observer.h"
+#include "content/public/browser/notification_registrar.h"
#include "ui/gfx/native_widget_types.h"
class Profile;
@@ -30,7 +32,8 @@ namespace extensions {
// page, shell windows, tray view, panels etc.) and other app level behaviour
// (e.g. notifications the app is interested in, lifetime of the background
// page).
-class ShellWindowRegistry : public ProfileKeyedService {
+class ShellWindowRegistry : public ProfileKeyedService,
+ public content::NotificationObserver {
public:
class Observer {
public:
@@ -45,8 +48,9 @@ class ShellWindowRegistry : public ProfileKeyedService {
typedef std::set<ShellWindow*> ShellWindowSet;
typedef ShellWindowSet::const_iterator const_iterator;
+ typedef std::set<std::string> InspectedWindowSet;
tapted 2012/10/23 06:04:15 this could be called InspectedWindowKeySet but tha
- ShellWindowRegistry();
+ explicit ShellWindowRegistry(Profile* profile);
virtual ~ShellWindowRegistry();
// Returns the instance for the given profile, or NULL if none. This is
@@ -72,6 +76,17 @@ class ShellWindowRegistry : public ProfileKeyedService {
// be returned, otherwise an arbitrary window will be returned.
ShellWindow* GetCurrentShellWindowForApp(const std::string& app_id) const;
+ // Returns whether a ShellWindow's ID was last known to have a DevToolsAgent
+ // attached to it, which should be restored during a reload of a corresponding
+ // newly created |render_view_host|.
+ bool HadDevToolsAttached(content::RenderViewHost* render_view_host) const;
benwells 2012/10/23 06:18:48 Where is the logic that tracks window positions to
tapted 2012/10/23 07:04:23 It's in extensions::ShellWindowGeometryCache and a
+
+ protected:
+ // content::NotificationObserver:
+ virtual void Observe(int type,
+ const content::NotificationSource& source,
+ const content::NotificationDetails& details) OVERRIDE;
+
private:
class Factory : public ProfileKeyedServiceFactory {
public:
@@ -93,7 +108,9 @@ class ShellWindowRegistry : public ProfileKeyedService {
};
ShellWindowSet shell_windows_;
+ InspectedWindowSet inspected_windows_;
ObserverList<Observer> observers_;
+ content::NotificationRegistrar registrar_;
};
} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698