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

Side by Side Diff: apps/app_window_registry.h

Issue 220373003: Prevent Chrome from quitting when apps are open. (Mac) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync and rebase Created 6 years, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | apps/app_window_registry.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef APPS_APP_WINDOW_REGISTRY_H_ 5 #ifndef APPS_APP_WINDOW_REGISTRY_H_
6 #define APPS_APP_WINDOW_REGISTRY_H_ 6 #define APPS_APP_WINDOW_REGISTRY_H_
7 7
8 #include <list> 8 #include <list>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 101
102 // Returns the app window for |window|, looking in all browser contexts. 102 // Returns the app window for |window|, looking in all browser contexts.
103 static apps::AppWindow* GetAppWindowForNativeWindowAnyProfile( 103 static apps::AppWindow* GetAppWindowForNativeWindowAnyProfile(
104 gfx::NativeWindow window); 104 gfx::NativeWindow window);
105 105
106 // Returns true if the number of app windows registered across all browser 106 // Returns true if the number of app windows registered across all browser
107 // contexts is non-zero. |window_type_mask| is a bitwise OR filter of 107 // contexts is non-zero. |window_type_mask| is a bitwise OR filter of
108 // AppWindow::WindowType, or 0 for any window type. 108 // AppWindow::WindowType, or 0 for any window type.
109 static bool IsAppWindowRegisteredInAnyProfile(int window_type_mask); 109 static bool IsAppWindowRegisteredInAnyProfile(int window_type_mask);
110 110
111 // Close all app windows in all profiles.
112 static void CloseAllAppWindows();
113
111 class Factory : public BrowserContextKeyedServiceFactory { 114 class Factory : public BrowserContextKeyedServiceFactory {
112 public: 115 public:
113 static AppWindowRegistry* GetForBrowserContext( 116 static AppWindowRegistry* GetForBrowserContext(
114 content::BrowserContext* context, 117 content::BrowserContext* context,
115 bool create); 118 bool create);
116 119
117 static Factory* GetInstance(); 120 static Factory* GetInstance();
118 121
119 private: 122 private:
120 friend struct DefaultSingletonTraits<Factory>; 123 friend struct DefaultSingletonTraits<Factory>;
(...skipping 25 matching lines...) Expand all
146 content::BrowserContext* context_; 149 content::BrowserContext* context_;
147 AppWindowList app_windows_; 150 AppWindowList app_windows_;
148 InspectedWindowSet inspected_windows_; 151 InspectedWindowSet inspected_windows_;
149 ObserverList<Observer> observers_; 152 ObserverList<Observer> observers_;
150 base::Callback<void(content::DevToolsAgentHost*, bool)> devtools_callback_; 153 base::Callback<void(content::DevToolsAgentHost*, bool)> devtools_callback_;
151 }; 154 };
152 155
153 } // namespace apps 156 } // namespace apps
154 157
155 #endif // APPS_APP_WINDOW_REGISTRY_H_ 158 #endif // APPS_APP_WINDOW_REGISTRY_H_
OLDNEW
« no previous file with comments | « no previous file | apps/app_window_registry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698