| 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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 | 93 |
| 94 // Returns the app window for |window|, looking in all browser contexts. | 94 // Returns the app window for |window|, looking in all browser contexts. |
| 95 static apps::AppWindow* GetAppWindowForNativeWindowAnyProfile( | 95 static apps::AppWindow* GetAppWindowForNativeWindowAnyProfile( |
| 96 gfx::NativeWindow window); | 96 gfx::NativeWindow window); |
| 97 | 97 |
| 98 // Returns true if the number of app windows registered across all browser | 98 // Returns true if the number of app windows registered across all browser |
| 99 // contexts is non-zero. |window_type_mask| is a bitwise OR filter of | 99 // contexts is non-zero. |window_type_mask| is a bitwise OR filter of |
| 100 // AppWindow::WindowType, or 0 for any window type. | 100 // AppWindow::WindowType, or 0 for any window type. |
| 101 static bool IsAppWindowRegisteredInAnyProfile(int window_type_mask); | 101 static bool IsAppWindowRegisteredInAnyProfile(int window_type_mask); |
| 102 | 102 |
| 103 // Close all app windows in all profiles. |
| 104 static void CloseAllAppWindows(); |
| 105 |
| 103 class Factory : public BrowserContextKeyedServiceFactory { | 106 class Factory : public BrowserContextKeyedServiceFactory { |
| 104 public: | 107 public: |
| 105 static AppWindowRegistry* GetForBrowserContext( | 108 static AppWindowRegistry* GetForBrowserContext( |
| 106 content::BrowserContext* context, | 109 content::BrowserContext* context, |
| 107 bool create); | 110 bool create); |
| 108 | 111 |
| 109 static Factory* GetInstance(); | 112 static Factory* GetInstance(); |
| 110 | 113 |
| 111 private: | 114 private: |
| 112 friend struct DefaultSingletonTraits<Factory>; | 115 friend struct DefaultSingletonTraits<Factory>; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 138 content::BrowserContext* context_; | 141 content::BrowserContext* context_; |
| 139 AppWindowList app_windows_; | 142 AppWindowList app_windows_; |
| 140 InspectedWindowSet inspected_windows_; | 143 InspectedWindowSet inspected_windows_; |
| 141 ObserverList<Observer> observers_; | 144 ObserverList<Observer> observers_; |
| 142 base::Callback<void(content::DevToolsAgentHost*, bool)> devtools_callback_; | 145 base::Callback<void(content::DevToolsAgentHost*, bool)> devtools_callback_; |
| 143 }; | 146 }; |
| 144 | 147 |
| 145 } // namespace extensions | 148 } // namespace extensions |
| 146 | 149 |
| 147 #endif // APPS_APP_WINDOW_REGISTRY_H_ | 150 #endif // APPS_APP_WINDOW_REGISTRY_H_ |
| OLD | NEW |