OLD | NEW |
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 Loading... |
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 Loading... |
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_ |
OLD | NEW |