OLD | NEW |
| (Empty) |
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. | |
4 | |
5 #include "chrome/browser/apps/chrome_apps_client.h" | |
6 | |
7 #include "apps/app_window.h" | |
8 #include "base/memory/singleton.h" | |
9 #include "chrome/browser/browser_process.h" | |
10 #include "chrome/browser/profiles/profile_manager.h" | |
11 #include "extensions/common/extension.h" | |
12 | |
13 // TODO(jamescook): We probably shouldn't compile this class at all on Android. | |
14 // See http://crbug.com/343612 | |
15 #if !defined(OS_ANDROID) | |
16 #include "chrome/browser/lifetime/application_lifetime.h" | |
17 #include "chrome/browser/ui/apps/chrome_app_delegate.h" | |
18 #include "chrome/browser/ui/apps/chrome_app_window_delegate.h" | |
19 #endif | |
20 | |
21 ChromeAppsClient::ChromeAppsClient() {} | |
22 | |
23 ChromeAppsClient::~ChromeAppsClient() {} | |
24 | |
25 // static | |
26 ChromeAppsClient* ChromeAppsClient::GetInstance() { | |
27 return Singleton<ChromeAppsClient, | |
28 LeakySingletonTraits<ChromeAppsClient> >::get(); | |
29 } | |
30 | |
31 std::vector<content::BrowserContext*> | |
32 ChromeAppsClient::GetLoadedBrowserContexts() { | |
33 std::vector<Profile*> profiles = | |
34 g_browser_process->profile_manager()->GetLoadedProfiles(); | |
35 return std::vector<content::BrowserContext*>(profiles.begin(), | |
36 profiles.end()); | |
37 } | |
38 | |
39 apps::AppWindow* ChromeAppsClient::CreateAppWindow( | |
40 content::BrowserContext* context, | |
41 const extensions::Extension* extension) { | |
42 #if defined(OS_ANDROID) | |
43 return NULL; | |
44 #else | |
45 return new apps::AppWindow( | |
46 context, new ChromeAppDelegate, new ChromeAppWindowDelegate, extension); | |
47 #endif | |
48 } | |
49 | |
50 void ChromeAppsClient::IncrementKeepAliveCount() { | |
51 #if !defined(OS_ANDROID) | |
52 chrome::IncrementKeepAliveCount(); | |
53 #endif | |
54 } | |
55 | |
56 void ChromeAppsClient::DecrementKeepAliveCount() { | |
57 #if !defined(OS_ANDROID) | |
58 chrome::DecrementKeepAliveCount(); | |
59 #endif | |
60 } | |
OLD | NEW |