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

Side by Side Diff: chrome/browser/ui/cocoa/apps/quit_with_apps_controller_mac.cc

Issue 1336823003: Move chrome::HostDesktopType to ui::HostDesktopType (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@base_session_service_delegate_impl
Patch Set: Fix build on Mac and CrOS Created 5 years, 3 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/ui/cocoa/apps/quit_with_apps_controller_mac.h" 5 #include "chrome/browser/ui/cocoa/apps/quit_with_apps_controller_mac.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/i18n/number_formatting.h" 8 #include "base/i18n/number_formatting.h"
9 #include "base/prefs/pref_registry_simple.h" 9 #include "base/prefs/pref_registry_simple.h"
10 #include "base/prefs/pref_service.h" 10 #include "base/prefs/pref_service.h"
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 128
129 // Quit immediately if Chrome is restarting. 129 // Quit immediately if Chrome is restarting.
130 if (g_browser_process->local_state()->GetBoolean( 130 if (g_browser_process->local_state()->GetBoolean(
131 prefs::kRestartLastSessionOnShutdown)) { 131 prefs::kRestartLastSessionOnShutdown)) {
132 return true; 132 return true;
133 } 133 }
134 134
135 if (hosted_app_quit_notification_) { 135 if (hosted_app_quit_notification_) {
136 bool hosted_apps_open = false; 136 bool hosted_apps_open = false;
137 const BrowserList* browser_list = 137 const BrowserList* browser_list =
138 BrowserList::GetInstance(chrome::HOST_DESKTOP_TYPE_NATIVE); 138 BrowserList::GetInstance(ui::HOST_DESKTOP_TYPE_NATIVE);
139 for (Browser* browser : *browser_list) { 139 for (Browser* browser : *browser_list) {
140 if (!browser->is_app()) 140 if (!browser->is_app())
141 continue; 141 continue;
142 142
143 ExtensionRegistry* registry = ExtensionRegistry::Get(browser->profile()); 143 ExtensionRegistry* registry = ExtensionRegistry::Get(browser->profile());
144 const extensions::Extension* extension = registry->GetExtensionById( 144 const extensions::Extension* extension = registry->GetExtensionById(
145 web_app::GetExtensionIdFromApplicationName(browser->app_name()), 145 web_app::GetExtensionIdFromApplicationName(browser->app_name()),
146 ExtensionRegistry::ENABLED); 146 ExtensionRegistry::ENABLED);
147 if (extension->is_hosted_app()) { 147 if (extension->is_hosted_app()) {
148 hosted_apps_open = true; 148 hosted_apps_open = true;
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 194
195 // Always return false, the notification UI can be used to quit all apps which 195 // Always return false, the notification UI can be used to quit all apps which
196 // will cause Chrome to quit. 196 // will cause Chrome to quit.
197 return false; 197 return false;
198 } 198 }
199 199
200 // static 200 // static
201 void QuitWithAppsController::RegisterPrefs(PrefRegistrySimple* registry) { 201 void QuitWithAppsController::RegisterPrefs(PrefRegistrySimple* registry) {
202 registry->RegisterBooleanPref(prefs::kNotifyWhenAppsKeepChromeAlive, true); 202 registry->RegisterBooleanPref(prefs::kNotifyWhenAppsKeepChromeAlive, true);
203 } 203 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698