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

Unified Diff: apps/shell_window_registry.h

Issue 23524005: Introduce AppsClient and use it in apps to get the loaded profiles list. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 3 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
« no previous file with comments | « apps/apps_client.cc ('k') | apps/shell_window_registry.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: apps/shell_window_registry.h
diff --git a/apps/shell_window_registry.h b/apps/shell_window_registry.h
index e23c5e9ad807bd4d083c7dec983edea47ab84c34..f32b39b4702fae31ba08159d85b6774aa0fb755e 100644
--- a/apps/shell_window_registry.h
+++ b/apps/shell_window_registry.h
@@ -15,9 +15,8 @@
#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h"
#include "ui/gfx/native_widget_types.h"
-class Profile;
-
namespace content {
+class BrowserContext;
class DevToolsAgentHost;
class RenderViewHost;
}
@@ -27,12 +26,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 +46,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);
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().
+ static ShellWindowRegistry* Get(content::BrowserContext* context);
void AddShellWindow(apps::ShellWindow* shell_window);
void ShellWindowIconChanged(apps::ShellWindow* shell_window);
@@ -98,18 +93,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 +116,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 +135,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_;
« no previous file with comments | « apps/apps_client.cc ('k') | apps/shell_window_registry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698