Chromium Code Reviews| Index: apps/shell_window_registry.h |
| diff --git a/apps/shell_window_registry.h b/apps/shell_window_registry.h |
| index e23c5e9ad807bd4d083c7dec983edea47ab84c34..2ee5a033d3ccb5093d99a78b15af9dc41f94212a 100644 |
| --- a/apps/shell_window_registry.h |
| +++ b/apps/shell_window_registry.h |
| @@ -15,8 +15,6 @@ |
| #include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" |
| #include "ui/gfx/native_widget_types.h" |
| -class Profile; |
| - |
| namespace content { |
| class DevToolsAgentHost; |
| class RenderViewHost; |
| @@ -27,12 +25,7 @@ namespace apps { |
| class ShellWindow; |
| // The ShellWindowRegistry tracks the ShellWindows for all platform apps for a |
| -// particular profile. |
| -// This class is planned to evolve into tracking all PlatformApps for a |
| -// particular profile, with a PlatformApp encapsulating all views (background |
| -// 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). |
| +// particular browser context. |
| class ShellWindowRegistry : public BrowserContextKeyedService { |
| public: |
| class Observer { |
| @@ -52,12 +45,13 @@ class ShellWindowRegistry : public BrowserContextKeyedService { |
| typedef ShellWindowList::const_iterator const_iterator; |
| typedef std::set<std::string> InspectedWindowSet; |
| - explicit ShellWindowRegistry(Profile* profile); |
| + explicit ShellWindowRegistry(content::BrowserContext* context); |
|
tapted
2013/09/04 01:08:35
nit: should this be forward-declared? It's probabl
benwells
2013/09/10 16:48:50
Done.
|
| virtual ~ShellWindowRegistry(); |
| - // Returns the instance for the given profile, or NULL if none. This is |
| - // a convenience wrapper around ShellWindowRegistry::Factory::GetForProfile. |
| - static ShellWindowRegistry* Get(Profile* profile); |
| + // Returns the instance for the given browser context, or NULL if none. This |
| + // is a convenience wrapper around |
| + // ShellWindowRegistry::Factory::GetForBrowserContext. |
|
tapted
2013/09/04 01:08:35
nit: usually I see ShellWindowRegistry::Factory::G
benwells
2013/09/10 16:48:50
Done.
|
| + static ShellWindowRegistry* Get(content::BrowserContext* context); |
| void AddShellWindow(apps::ShellWindow* shell_window); |
| void ShellWindowIconChanged(apps::ShellWindow* shell_window); |
| @@ -98,18 +92,19 @@ class ShellWindowRegistry : public BrowserContextKeyedService { |
| // newly created |render_view_host|. |
| bool HadDevToolsAttached(content::RenderViewHost* render_view_host) const; |
| - // Returns the shell window for |window|, looking in all profiles. |
| + // Returns the shell window for |window|, looking in all browser contexts. |
| static apps::ShellWindow* GetShellWindowForNativeWindowAnyProfile( |
| gfx::NativeWindow window); |
| - // Returns true if the number of shell windows registered across all profiles |
| - // is non-zero. |window_type_mask| is a bitwise OR filter of |
| + // Returns true if the number of shell windows registered across all browser |
| + // contexts is non-zero. |window_type_mask| is a bitwise OR filter of |
| // ShellWindow::WindowType, or 0 for any window type. |
| static bool IsShellWindowRegisteredInAnyProfile(int window_type_mask); |
| class Factory : public BrowserContextKeyedServiceFactory { |
| public: |
| - static ShellWindowRegistry* GetForProfile(Profile* profile, bool create); |
| + static ShellWindowRegistry* GetForBrowserContext( |
| + content::BrowserContext* context, bool create); |
| static Factory* GetInstance(); |
| private: |
| @@ -120,7 +115,7 @@ class ShellWindowRegistry : public BrowserContextKeyedService { |
| // BrowserContextKeyedServiceFactory |
| virtual BrowserContextKeyedService* BuildServiceInstanceFor( |
| - content::BrowserContext* profile) const OVERRIDE; |
| + content::BrowserContext* context) const OVERRIDE; |
| virtual bool ServiceIsCreatedWithBrowserContext() const OVERRIDE; |
| virtual bool ServiceIsNULLWhileTesting() const OVERRIDE; |
| virtual content::BrowserContext* GetBrowserContextToUse( |
| @@ -139,7 +134,7 @@ class ShellWindowRegistry : public BrowserContextKeyedService { |
| // list, add it first. |
| void BringToFront(apps::ShellWindow* shell_window); |
| - Profile* profile_; |
| + content::BrowserContext* context_; |
| ShellWindowList shell_windows_; |
| InspectedWindowSet inspected_windows_; |
| ObserverList<Observer> observers_; |