| 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 EXTENSIONS_BROWSER_APP_WINDOW_APP_WINDOW_REGISTRY_H_ | 5 #ifndef EXTENSIONS_BROWSER_APP_WINDOW_APP_WINDOW_REGISTRY_H_ |
| 6 #define EXTENSIONS_BROWSER_APP_WINDOW_APP_WINDOW_REGISTRY_H_ | 6 #define EXTENSIONS_BROWSER_APP_WINDOW_APP_WINDOW_REGISTRY_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 // key that is active, that one will be returned, otherwise an arbitrary | 93 // key that is active, that one will be returned, otherwise an arbitrary |
| 94 // window will be returned. | 94 // window will be returned. |
| 95 AppWindow* GetAppWindowForAppAndKey(const std::string& app_id, | 95 AppWindow* GetAppWindowForAppAndKey(const std::string& app_id, |
| 96 const std::string& window_key) const; | 96 const std::string& window_key) const; |
| 97 | 97 |
| 98 // Returns whether a AppWindow's ID was last known to have a DevToolsAgent | 98 // Returns whether a AppWindow's ID was last known to have a DevToolsAgent |
| 99 // attached to it, which should be restored during a reload of a corresponding | 99 // attached to it, which should be restored during a reload of a corresponding |
| 100 // newly created |render_view_host|. | 100 // newly created |render_view_host|. |
| 101 bool HadDevToolsAttached(content::RenderViewHost* render_view_host) const; | 101 bool HadDevToolsAttached(content::RenderViewHost* render_view_host) const; |
| 102 | 102 |
| 103 // Returns the app window for |window|, looking in all browser contexts. | |
| 104 static AppWindow* GetAppWindowForNativeWindowAnyProfile( | |
| 105 gfx::NativeWindow window); | |
| 106 | |
| 107 // Returns true if the number of app windows registered across all browser | |
| 108 // contexts is non-zero. |window_type_mask| is a bitwise OR filter of | |
| 109 // AppWindow::WindowType, or 0 for any window type. | |
| 110 static bool IsAppWindowRegisteredInAnyProfile(int window_type_mask); | |
| 111 | |
| 112 // Close all app windows in all profiles. | |
| 113 static void CloseAllAppWindows(); | |
| 114 | |
| 115 class Factory : public BrowserContextKeyedServiceFactory { | 103 class Factory : public BrowserContextKeyedServiceFactory { |
| 116 public: | 104 public: |
| 117 static AppWindowRegistry* GetForBrowserContext( | 105 static AppWindowRegistry* GetForBrowserContext( |
| 118 content::BrowserContext* context, | 106 content::BrowserContext* context, |
| 119 bool create); | 107 bool create); |
| 120 | 108 |
| 121 static Factory* GetInstance(); | 109 static Factory* GetInstance(); |
| 122 | 110 |
| 123 private: | 111 private: |
| 124 friend struct DefaultSingletonTraits<Factory>; | 112 friend struct DefaultSingletonTraits<Factory>; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 150 content::BrowserContext* context_; | 138 content::BrowserContext* context_; |
| 151 AppWindowList app_windows_; | 139 AppWindowList app_windows_; |
| 152 InspectedWindowSet inspected_windows_; | 140 InspectedWindowSet inspected_windows_; |
| 153 ObserverList<Observer> observers_; | 141 ObserverList<Observer> observers_; |
| 154 base::Callback<void(content::DevToolsAgentHost*, bool)> devtools_callback_; | 142 base::Callback<void(content::DevToolsAgentHost*, bool)> devtools_callback_; |
| 155 }; | 143 }; |
| 156 | 144 |
| 157 } // namespace extensions | 145 } // namespace extensions |
| 158 | 146 |
| 159 #endif // EXTENSIONS_BROWSER_APP_WINDOW_APP_WINDOW_REGISTRY_H_ | 147 #endif // EXTENSIONS_BROWSER_APP_WINDOW_APP_WINDOW_REGISTRY_H_ |
| OLD | NEW |