| 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_APPS_CLIENT_H_ | 5 #ifndef EXTENSIONS_BROWSER_APP_WINDOW_APPS_CLIENT_H_ |
| 6 #define EXTENSIONS_BROWSER_APP_WINDOW_APPS_CLIENT_H_ | 6 #define EXTENSIONS_BROWSER_APP_WINDOW_APPS_CLIENT_H_ |
| 7 | 7 |
| 8 #include <vector> | |
| 9 | |
| 10 #include "base/callback_forward.h" | 8 #include "base/callback_forward.h" |
| 11 #include "extensions/browser/app_window/app_window.h" | 9 #include "extensions/browser/app_window/app_window.h" |
| 12 | 10 |
| 13 namespace content { | 11 namespace content { |
| 14 class BrowserContext; | 12 class BrowserContext; |
| 15 class WebContents; | 13 class WebContents; |
| 16 } | 14 } |
| 17 | 15 |
| 18 namespace extensions { | 16 namespace extensions { |
| 19 | 17 |
| 20 class Extension; | 18 class Extension; |
| 21 class NativeAppWindow; | 19 class NativeAppWindow; |
| 22 | 20 |
| 23 // Sets up global state for the apps system. Should be Set() once in each | 21 // Sets up global state for the apps system. Should be Set() once in each |
| 24 // process. This should be implemented by the client of the apps system. | 22 // process. This should be implemented by the client of the apps system. |
| 25 // TODO(hashimoto): Move some functions to ExtensionsClient and rename this to | 23 // TODO(hashimoto): Move some functions to ExtensionsClient and rename this to |
| 26 // AppWindowClient. | 24 // AppWindowClient. |
| 27 class AppsClient { | 25 class AppsClient { |
| 28 public: | 26 public: |
| 29 virtual ~AppsClient() {} | 27 virtual ~AppsClient() {} |
| 30 | 28 |
| 31 // Get all loaded browser contexts. | |
| 32 virtual std::vector<content::BrowserContext*> GetLoadedBrowserContexts() = 0; | |
| 33 | |
| 34 // Creates a new AppWindow for the app in |extension| for |context|. | 29 // Creates a new AppWindow for the app in |extension| for |context|. |
| 35 // Caller takes ownership. | 30 // Caller takes ownership. |
| 36 virtual AppWindow* CreateAppWindow(content::BrowserContext* context, | 31 virtual AppWindow* CreateAppWindow(content::BrowserContext* context, |
| 37 const Extension* extension) = 0; | 32 const Extension* extension) = 0; |
| 38 | 33 |
| 39 // Creates a new extensions::NativeAppWindow for |window|. | 34 // Creates a new extensions::NativeAppWindow for |window|. |
| 40 virtual NativeAppWindow* CreateNativeAppWindow( | 35 virtual NativeAppWindow* CreateNativeAppWindow( |
| 41 AppWindow* window, | 36 AppWindow* window, |
| 42 const AppWindow::CreateParams& params) = 0; | 37 const AppWindow::CreateParams& params) = 0; |
| 43 | 38 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 56 // Return the apps client. | 51 // Return the apps client. |
| 57 static AppsClient* Get(); | 52 static AppsClient* Get(); |
| 58 | 53 |
| 59 // Initialize the apps system with this apps client. | 54 // Initialize the apps system with this apps client. |
| 60 static void Set(AppsClient* client); | 55 static void Set(AppsClient* client); |
| 61 }; | 56 }; |
| 62 | 57 |
| 63 } // namespace extensions | 58 } // namespace extensions |
| 64 | 59 |
| 65 #endif // EXTENSIONS_BROWSER_APP_WINDOW_APPS_CLIENT_H_ | 60 #endif // EXTENSIONS_BROWSER_APP_WINDOW_APPS_CLIENT_H_ |
| OLD | NEW |