| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_APPS_CLIENT_H_ | 5 #ifndef APPS_UI_APPS_CLIENT_H_ |
| 6 #define APPS_APPS_CLIENT_H_ | 6 #define APPS_UI_APPS_CLIENT_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "apps/app_window.h" |
| 11 |
| 10 namespace content { | 12 namespace content { |
| 11 class BrowserContext; | 13 class BrowserContext; |
| 12 } | 14 } |
| 13 | 15 |
| 14 namespace extensions { | 16 namespace extensions { |
| 15 class Extension; | 17 class Extension; |
| 16 } | 18 } |
| 17 | 19 |
| 18 namespace apps { | 20 namespace apps { |
| 19 | 21 |
| 20 class AppWindow; | 22 class NativeAppWindow; |
| 21 | 23 |
| 22 // Sets up global state for the apps system. Should be Set() once in each | 24 // Sets up global state for the apps system. Should be Set() once in each |
| 23 // process. This should be implemented by the client of the apps system. | 25 // process. This should be implemented by the client of the apps system. |
| 24 class AppsClient { | 26 class AppsClient { |
| 25 public: | 27 public: |
| 26 // Get all loaded browser contexts. | 28 // Get all loaded browser contexts. |
| 27 virtual std::vector<content::BrowserContext*> GetLoadedBrowserContexts() = 0; | 29 virtual std::vector<content::BrowserContext*> GetLoadedBrowserContexts() = 0; |
| 28 | 30 |
| 29 // Creates a new apps::AppWindow for the app in |extension| for |context|. | 31 // Creates a new apps::AppWindow for the app in |extension| for |context|. |
| 30 // Caller takes ownership. | 32 // Caller takes ownership. |
| 31 virtual AppWindow* CreateAppWindow( | 33 virtual AppWindow* CreateAppWindow( |
| 32 content::BrowserContext* context, | 34 content::BrowserContext* context, |
| 33 const extensions::Extension* extension) = 0; | 35 const extensions::Extension* extension) = 0; |
| 34 | 36 |
| 37 // Creates a new apps::NativeAppWindow for |window|. |
| 38 virtual NativeAppWindow* CreateNativeAppWindow( |
| 39 AppWindow* window, |
| 40 const AppWindow::CreateParams& params) = 0; |
| 41 |
| 35 // A positive keep-alive count is a request for the embedding application to | 42 // A positive keep-alive count is a request for the embedding application to |
| 36 // keep running after all windows are closed. The count starts at zero. | 43 // keep running after all windows are closed. The count starts at zero. |
| 37 virtual void IncrementKeepAliveCount() = 0; | 44 virtual void IncrementKeepAliveCount() = 0; |
| 38 virtual void DecrementKeepAliveCount() = 0; | 45 virtual void DecrementKeepAliveCount() = 0; |
| 39 | 46 |
| 40 // Return the apps client. | 47 // Return the apps client. |
| 41 static AppsClient* Get(); | 48 static AppsClient* Get(); |
| 42 | 49 |
| 43 // Initialize the apps system with this apps client. | 50 // Initialize the apps system with this apps client. |
| 44 static void Set(AppsClient* client); | 51 static void Set(AppsClient* client); |
| 45 }; | 52 }; |
| 46 | 53 |
| 47 } // namespace apps | 54 } // namespace apps |
| 48 | 55 |
| 49 #endif // APPS_APPS_CLIENT_H_ | 56 #endif // APPS_UI_APPS_CLIENT_H_ |
| OLD | NEW |