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

Side by Side Diff: chrome/browser/lifetime/application_lifetime.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 (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 "chrome/browser/lifetime/application_lifetime.h" 5 #include "chrome/browser/lifetime/application_lifetime.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 if (BrowserList::GetInstance(browser->host_desktop_type())->size() > 1) 409 if (BrowserList::GetInstance(browser->host_desktop_type())->size() > 1)
410 return false; 410 return false;
411 #if defined(OS_WIN) 411 #if defined(OS_WIN)
412 // On Windows 8 the desktop and ASH environments could be active 412 // On Windows 8 the desktop and ASH environments could be active
413 // at the same time. 413 // at the same time.
414 // We should not start the shutdown process in the following cases:- 414 // We should not start the shutdown process in the following cases:-
415 // 1. If the desktop type of the browser going away is ASH and there 415 // 1. If the desktop type of the browser going away is ASH and there
416 // are browser windows open in the desktop. 416 // are browser windows open in the desktop.
417 // 2. If the desktop type of the browser going away is desktop and the ASH 417 // 2. If the desktop type of the browser going away is desktop and the ASH
418 // environment is still active. 418 // environment is still active.
419 if (browser->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_NATIVE) 419 if (browser->host_desktop_type() == ui::HOST_DESKTOP_TYPE_NATIVE)
420 return !ash::Shell::HasInstance(); 420 return !ash::Shell::HasInstance();
421 else if (browser->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH) 421 else if (browser->host_desktop_type() == ui::HOST_DESKTOP_TYPE_ASH)
422 return BrowserList::GetInstance(chrome::HOST_DESKTOP_TYPE_NATIVE)->empty(); 422 return BrowserList::GetInstance(ui::HOST_DESKTOP_TYPE_NATIVE)->empty();
423 #endif 423 #endif
424 return true; 424 return true;
425 } 425 }
426 426
427 void DisableShutdownForTesting(bool disable_shutdown_for_testing) { 427 void DisableShutdownForTesting(bool disable_shutdown_for_testing) {
428 g_disable_shutdown_for_testing = disable_shutdown_for_testing; 428 g_disable_shutdown_for_testing = disable_shutdown_for_testing;
429 if (!g_disable_shutdown_for_testing && !WillKeepAlive()) 429 if (!g_disable_shutdown_for_testing && !WillKeepAlive())
430 CloseAllBrowsersIfNeeded(); 430 CloseAllBrowsersIfNeeded();
431 } 431 }
432 432
433 } // namespace chrome 433 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698