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
3 // found in the LICENSE file.
5 #ifndef APPS_UI_APPS_CLIENT_H_
6 #define APPS_UI_APPS_CLIENT_H_
10 #include "apps/app_window.h"
16 namespace extensions {
22 class NativeAppWindow;
24 // Sets up global state for the apps system. Should be Set() once in each
25 // process. This should be implemented by the client of the apps system.
28 // Get all loaded browser contexts.
29 virtual std::vector<content::BrowserContext*> GetLoadedBrowserContexts() = 0;
31 // Creates a new apps::AppWindow for the app in |extension| for |context|.
32 // Caller takes ownership.
33 virtual AppWindow* CreateAppWindow(
34 content::BrowserContext* context,
35 const extensions::Extension* extension) = 0;
37 // Creates a new apps::NativeAppWindow for |window|.
38 virtual NativeAppWindow* CreateNativeAppWindow(
40 const AppWindow::CreateParams& params) = 0;
42 // A positive keep-alive count is a request for the embedding application to
43 // keep running after all windows are closed. The count starts at zero.
44 virtual void IncrementKeepAliveCount() = 0;
45 virtual void DecrementKeepAliveCount() = 0;
47 // Return the apps client.
48 static AppsClient* Get();
50 // Initialize the apps system with this apps client.
51 static void Set(AppsClient* client);
56 #endif // APPS_UI_APPS_CLIENT_H_