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

Side by Side Diff: apps/app_restore_service.cc

Issue 226283003: Remove single-window-metro-mode code paths for the app launcher and apps. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Thought I deleted this already Created 6 years, 8 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
« no previous file with comments | « no previous file | apps/apps_client.h » ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "apps/app_restore_service.h" 5 #include "apps/app_restore_service.h"
6 6
7 #include "apps/app_lifetime_monitor_factory.h" 7 #include "apps/app_lifetime_monitor_factory.h"
8 #include "apps/app_restore_service_factory.h" 8 #include "apps/app_restore_service_factory.h"
9 #include "apps/app_window.h" 9 #include "apps/app_window.h"
10 #include "apps/browser/api/app_runtime/app_runtime_api.h" 10 #include "apps/browser/api/app_runtime/app_runtime_api.h"
11 #include "apps/launcher.h" 11 #include "apps/launcher.h"
12 #include "apps/saved_files_service.h" 12 #include "apps/saved_files_service.h"
13 #include "chrome/browser/chrome_notification_types.h" 13 #include "chrome/browser/chrome_notification_types.h"
14 #include "chrome/browser/profiles/profile.h" 14 #include "chrome/browser/profiles/profile.h"
15 #include "extensions/browser/extension_host.h" 15 #include "extensions/browser/extension_host.h"
16 #include "extensions/browser/extension_prefs.h" 16 #include "extensions/browser/extension_prefs.h"
17 #include "extensions/browser/extension_registry.h" 17 #include "extensions/browser/extension_registry.h"
18 #include "extensions/common/extension.h" 18 #include "extensions/common/extension.h"
19 #include "extensions/common/extension_set.h" 19 #include "extensions/common/extension_set.h"
20 20
21 #if defined(OS_WIN)
22 #include "win8/util/win8_util.h"
23 #endif
24
25 using extensions::Extension; 21 using extensions::Extension;
26 using extensions::ExtensionHost; 22 using extensions::ExtensionHost;
27 using extensions::ExtensionPrefs; 23 using extensions::ExtensionPrefs;
28 using extensions::ExtensionRegistry; 24 using extensions::ExtensionRegistry;
29 25
30 namespace apps { 26 namespace apps {
31 27
32 // static 28 // static
33 bool AppRestoreService::ShouldRestoreApps(bool is_browser_restart) { 29 bool AppRestoreService::ShouldRestoreApps(bool is_browser_restart) {
34 bool should_restore_apps = is_browser_restart; 30 bool should_restore_apps = is_browser_restart;
35 #if defined(OS_CHROMEOS) 31 #if defined(OS_CHROMEOS)
36 // Chromeos always restarts apps, even if it was a regular shutdown. 32 // Chromeos always restarts apps, even if it was a regular shutdown.
37 should_restore_apps = true; 33 should_restore_apps = true;
38 #elif defined(OS_WIN)
39 // Packaged apps are not supported in Metro mode, so don't try to start them.
40 if (win8::IsSingleWindowMetroMode())
41 should_restore_apps = false;
42 #endif 34 #endif
43 return should_restore_apps; 35 return should_restore_apps;
44 } 36 }
45 37
46 AppRestoreService::AppRestoreService(Profile* profile) 38 AppRestoreService::AppRestoreService(Profile* profile)
47 : profile_(profile) { 39 : profile_(profile) {
48 StartObservingAppLifetime(); 40 StartObservingAppLifetime();
49 } 41 }
50 42
51 void AppRestoreService::HandleStartup(bool should_restore_apps) { 43 void AppRestoreService::HandleStartup(bool should_restore_apps) {
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 134
143 void AppRestoreService::StopObservingAppLifetime() { 135 void AppRestoreService::StopObservingAppLifetime() {
144 AppLifetimeMonitor* app_lifetime_monitor = 136 AppLifetimeMonitor* app_lifetime_monitor =
145 AppLifetimeMonitorFactory::GetForProfile(profile_); 137 AppLifetimeMonitorFactory::GetForProfile(profile_);
146 // This might be NULL in tests. 138 // This might be NULL in tests.
147 if (app_lifetime_monitor) 139 if (app_lifetime_monitor)
148 app_lifetime_monitor->RemoveObserver(this); 140 app_lifetime_monitor->RemoveObserver(this);
149 } 141 }
150 142
151 } // namespace apps 143 } // namespace apps
OLDNEW
« no previous file with comments | « no previous file | apps/apps_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698