Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(519)

Side by Side Diff: chrome/browser/apps/chrome_apps_client.cc

Issue 436503002: Moved CreateNativeAppWindow from AppWindow::Delegate to AppsClient. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/apps/chrome_apps_client.h ('k') | chrome/browser/browser_process_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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 }
OLDNEW
« no previous file with comments | « chrome/browser/apps/chrome_apps_client.h ('k') | chrome/browser/browser_process_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698