Report errors from ChromiumEnv::GetChildren in Posix.
[chromium-blink-merge.git] / apps / apps_client.h
blobf67aad679c7f3b1af3035e7e4d1ccb0999735722
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
3 // found in the LICENSE file.
5 #ifndef APPS_APPS_CLIENT_H_
6 #define APPS_APPS_CLIENT_H_
8 #include <vector>
10 namespace content {
11 class BrowserContext;
14 namespace extensions {
15 class Extension;
18 namespace apps {
20 // Sets up global state for the apps system. Should be Set() once in each
21 // process. This should be implemented by the client of the apps system.
22 class AppsClient {
23 public:
24 // Get all loaded browser contexts.
25 virtual std::vector<content::BrowserContext*> GetLoadedBrowserContexts() = 0;
27 // Do any pre app launch checks. Returns true if the app launch should proceed
28 // or false if the launch should be prevented.
29 virtual bool CheckAppLaunch(content::BrowserContext* context,
30 const extensions::Extension* extension) = 0;
32 // Return the apps client.
33 static AppsClient* Get();
35 // Initialize the apps system with this apps client.
36 static void Set(AppsClient* client);
39 } // namespace apps
41 #endif // APPS_APPS_CLIENT_H_