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

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

Issue 25034003: Moved apps metro code from apps to chrome/browser/apps. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase and fix unit test Created 7 years, 2 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/prefs/browser_prefs.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "chrome/browser/apps/chrome_apps_client.h" 5 #include "chrome/browser/apps/chrome_apps_client.h"
6 6
7 #include "base/memory/singleton.h" 7 #include "base/memory/singleton.h"
8 #include "chrome/browser/browser_process.h" 8 #include "chrome/browser/browser_process.h"
9 #include "chrome/browser/profiles/profile_manager.h" 9 #include "chrome/browser/profiles/profile_manager.h"
10 #include "chrome/browser/ui/apps/app_metro_infobar_delegate_win.h"
11 #include "chrome/common/extensions/extension.h"
12
13 #if defined(OS_WIN)
14 #include "win8/util/win8_util.h"
15 #endif
10 16
11 ChromeAppsClient::ChromeAppsClient() {} 17 ChromeAppsClient::ChromeAppsClient() {}
12 18
13 ChromeAppsClient::~ChromeAppsClient() {} 19 ChromeAppsClient::~ChromeAppsClient() {}
14 20
15 // static 21 // static
16 ChromeAppsClient* ChromeAppsClient::GetInstance() { 22 ChromeAppsClient* ChromeAppsClient::GetInstance() {
17 return Singleton<ChromeAppsClient, 23 return Singleton<ChromeAppsClient,
18 LeakySingletonTraits<ChromeAppsClient> >::get(); 24 LeakySingletonTraits<ChromeAppsClient> >::get();
19 } 25 }
20 26
21 std::vector<content::BrowserContext*> 27 std::vector<content::BrowserContext*>
22 ChromeAppsClient::GetLoadedBrowserContexts() { 28 ChromeAppsClient::GetLoadedBrowserContexts() {
23 std::vector<Profile*> profiles = 29 std::vector<Profile*> profiles =
24 g_browser_process->profile_manager()->GetLoadedProfiles(); 30 g_browser_process->profile_manager()->GetLoadedProfiles();
25 return std::vector<content::BrowserContext*>(profiles.begin(), 31 return std::vector<content::BrowserContext*>(profiles.begin(),
26 profiles.end()); 32 profiles.end());
27 } 33 }
34
35 bool ChromeAppsClient::CheckAppLaunch(content::BrowserContext* context,
36 const extensions::Extension* extension) {
37 #if defined(OS_WIN)
38 // On Windows 8's single window Metro mode we can not launch platform apps.
39 // Offer to switch Chrome to desktop mode.
40 if (win8::IsSingleWindowMetroMode()) {
41 AppMetroInfoBarDelegateWin::Create(
42 Profile::FromBrowserContext(context),
43 AppMetroInfoBarDelegateWin::LAUNCH_PACKAGED_APP,
44 extension->id());
45 return false;
46 }
47 #endif
48 return true;
49 }
OLDNEW
« no previous file with comments | « chrome/browser/apps/chrome_apps_client.h ('k') | chrome/browser/prefs/browser_prefs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698