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

Unified Diff: chrome/browser/lifetime/application_lifetime.cc

Issue 1388303002: Move assorted function in application_lifetime to where they are used. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/lifetime/application_lifetime.h ('k') | chrome/browser/ui/browser.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/lifetime/application_lifetime.cc
diff --git a/chrome/browser/lifetime/application_lifetime.cc b/chrome/browser/lifetime/application_lifetime.cc
index 06a90086966872e50350023e9c41475b19ea1ef8..448b4929e72b2968a41d4739511e53b869035dff 100644
--- a/chrome/browser/lifetime/application_lifetime.cc
+++ b/chrome/browser/lifetime/application_lifetime.cc
@@ -5,14 +5,12 @@
#include "chrome/browser/lifetime/application_lifetime.h"
#include "base/bind.h"
-#include "base/command_line.h"
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
#include "base/message_loop/message_loop.h"
#include "base/prefs/pref_service.h"
#include "base/process/process.h"
#include "base/process/process_handle.h"
-#include "base/trace_event/trace_event.h"
#include "build/build_config.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/browser_process_platform_part.h"
@@ -31,9 +29,7 @@
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/browser/ui/user_manager.h"
#include "chrome/common/chrome_constants.h"
-#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
-#include "components/tracing/tracing_switches.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/navigation_details.h"
#include "content/public/browser/notification_service.h"
@@ -50,10 +46,6 @@
#include "base/win/win_util.h"
#endif
-#if defined(USE_ASH)
-#include "ash/shell.h"
-#endif
-
namespace chrome {
namespace {
@@ -148,7 +140,7 @@ void CloseAllBrowsers() {
void AttemptUserExit() {
#if defined(OS_CHROMEOS)
- StartShutdownTracing();
+ browser_shutdown::StartShutdownTracing();
chromeos::BootTimesRecorder::Get()->AddLogoutTimeMarker("LogoutStarted",
false);
@@ -180,19 +172,6 @@ void AttemptUserExit() {
#endif
}
-void StartShutdownTracing() {
- const base::CommandLine& command_line =
- *base::CommandLine::ForCurrentProcess();
- if (command_line.HasSwitch(switches::kTraceShutdown)) {
- base::trace_event::TraceConfig trace_config(
- command_line.GetSwitchValueASCII(switches::kTraceShutdown), "");
- base::trace_event::TraceLog::GetInstance()->SetEnabled(
- trace_config,
- base::trace_event::TraceLog::RECORDING_MODE);
- }
- TRACE_EVENT0("shutdown", "StartShutdownTracing");
-}
-
// The Android implementation is in application_lifetime_android.cc
#if !defined(OS_ANDROID)
void AttemptRestart() {
@@ -388,25 +367,6 @@ void OnAppExiting() {
HandleAppExitingForPlatform();
}
-bool ShouldStartShutdown(Browser* browser) {
- if (BrowserList::GetInstance(browser->host_desktop_type())->size() > 1)
- return false;
-#if defined(OS_WIN)
- // On Windows 8 the desktop and ASH environments could be active
- // at the same time.
- // We should not start the shutdown process in the following cases:-
- // 1. If the desktop type of the browser going away is ASH and there
- // are browser windows open in the desktop.
- // 2. If the desktop type of the browser going away is desktop and the ASH
- // environment is still active.
- if (browser->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_NATIVE)
- return !ash::Shell::HasInstance();
- else if (browser->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH)
- return BrowserList::GetInstance(chrome::HOST_DESKTOP_TYPE_NATIVE)->empty();
-#endif
- return true;
-}
-
void DisableShutdownForTesting(bool disable_shutdown_for_testing) {
g_disable_shutdown_for_testing = disable_shutdown_for_testing;
if (!g_disable_shutdown_for_testing && !WillKeepAlive())
« no previous file with comments | « chrome/browser/lifetime/application_lifetime.h ('k') | chrome/browser/ui/browser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698