| 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 CHROME_BROWSER_APPS_APP_WINDOW_REGISTRY_UTIL_H_ | 5 #ifndef CHROME_BROWSER_APPS_APP_WINDOW_REGISTRY_UTIL_H_ |
| 6 #define CHROME_BROWSER_APPS_APP_WINDOW_REGISTRY_UTIL_H_ | 6 #define CHROME_BROWSER_APPS_APP_WINDOW_REGISTRY_UTIL_H_ |
| 7 | 7 |
| 8 #include "ui/gfx/native_widget_types.h" | 8 #include "ui/gfx/native_widget_types.h" |
| 9 | 9 |
| 10 namespace extensions { | 10 namespace extensions { |
| 11 class AppWindow; | 11 class AppWindow; |
| 12 } | 12 } |
| 13 | 13 |
| 14 // Utility functions to interact with app windows across all profiles. | 14 // Utility functions to interact with app windows across all profiles. |
| 15 class AppWindowRegistryUtil { | 15 class AppWindowRegistryUtil { |
| 16 public: | 16 public: |
| 17 // Returns the app window for |window|, looking in all browser contexts. | 17 // Returns the app window for |window|, looking in all browser contexts. |
| 18 static extensions::AppWindow* GetAppWindowForNativeWindowAnyProfile( | 18 static extensions::AppWindow* GetAppWindowForNativeWindowAnyProfile( |
| 19 gfx::NativeWindow window); | 19 gfx::NativeWindow window); |
| 20 | 20 |
| 21 // Returns true if the number of app windows registered across all browser | 21 // Returns true if the number of visible app windows registered across all |
| 22 // contexts is non-zero. |window_type_mask| is a bitwise OR filter of | 22 // browser contexts is non-zero. |window_type_mask| is a bitwise OR filter of |
| 23 // AppWindow::WindowType, or 0 for any window type. | 23 // AppWindow::WindowType, or 0 for any window type. |
| 24 static bool IsAppWindowRegisteredInAnyProfile(int window_type_mask); | 24 static bool IsAppWindowVisibleInAnyProfile(int window_type_mask); |
| 25 | 25 |
| 26 // Close all app windows in all profiles. | 26 // Close all app windows in all profiles. |
| 27 static void CloseAllAppWindows(); | 27 static void CloseAllAppWindows(); |
| 28 }; | 28 }; |
| 29 | 29 |
| 30 #endif // CHROME_BROWSER_APPS_APP_WINDOW_REGISTRY_UTIL_H_ | 30 #endif // CHROME_BROWSER_APPS_APP_WINDOW_REGISTRY_UTIL_H_ |
| OLD | NEW |