| OLD | NEW |
| 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 "ash/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 PrefService* pref_service = g_browser_process->local_state(); | 174 PrefService* pref_service = g_browser_process->local_state(); |
| 175 pref_service->SetBoolean(prefs::kRestartLastSessionOnShutdown, false); | 175 pref_service->SetBoolean(prefs::kRestartLastSessionOnShutdown, false); |
| 176 AttemptExitInternal(false); | 176 AttemptExitInternal(false); |
| 177 #endif | 177 #endif |
| 178 } | 178 } |
| 179 | 179 |
| 180 void StartShutdownTracing() { | 180 void StartShutdownTracing() { |
| 181 const base::CommandLine& command_line = | 181 const base::CommandLine& command_line = |
| 182 *base::CommandLine::ForCurrentProcess(); | 182 *base::CommandLine::ForCurrentProcess(); |
| 183 if (command_line.HasSwitch(switches::kTraceShutdown)) { | 183 if (command_line.HasSwitch(switches::kTraceShutdown)) { |
| 184 base::debug::CategoryFilter category_filter( | 184 base::trace_event::CategoryFilter category_filter( |
| 185 command_line.GetSwitchValueASCII(switches::kTraceShutdown)); | 185 command_line.GetSwitchValueASCII(switches::kTraceShutdown)); |
| 186 base::debug::TraceLog::GetInstance()->SetEnabled( | 186 base::trace_event::TraceLog::GetInstance()->SetEnabled( |
| 187 category_filter, | 187 category_filter, |
| 188 base::debug::TraceLog::RECORDING_MODE, | 188 base::trace_event::TraceLog::RECORDING_MODE, |
| 189 base::debug::TraceOptions()); | 189 base::trace_event::TraceOptions()); |
| 190 } | 190 } |
| 191 TRACE_EVENT0("shutdown", "StartShutdownTracing"); | 191 TRACE_EVENT0("shutdown", "StartShutdownTracing"); |
| 192 } | 192 } |
| 193 | 193 |
| 194 // The Android implementation is in application_lifetime_android.cc | 194 // The Android implementation is in application_lifetime_android.cc |
| 195 #if !defined(OS_ANDROID) | 195 #if !defined(OS_ANDROID) |
| 196 void AttemptRestart() { | 196 void AttemptRestart() { |
| 197 // TODO(beng): Can this use ProfileManager::GetLoadedProfiles instead? | 197 // TODO(beng): Can this use ProfileManager::GetLoadedProfiles instead? |
| 198 for (chrome::BrowserIterator it; !it.done(); it.Next()) | 198 for (chrome::BrowserIterator it; !it.done(); it.Next()) |
| 199 content::BrowserContext::SaveSessionState(it->profile()); | 199 content::BrowserContext::SaveSessionState(it->profile()); |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 // environment is still active. | 414 // environment is still active. |
| 415 if (browser->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_NATIVE) | 415 if (browser->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_NATIVE) |
| 416 return !ash::Shell::HasInstance(); | 416 return !ash::Shell::HasInstance(); |
| 417 else if (browser->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH) | 417 else if (browser->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH) |
| 418 return BrowserList::GetInstance(chrome::HOST_DESKTOP_TYPE_NATIVE)->empty(); | 418 return BrowserList::GetInstance(chrome::HOST_DESKTOP_TYPE_NATIVE)->empty(); |
| 419 #endif | 419 #endif |
| 420 return true; | 420 return true; |
| 421 } | 421 } |
| 422 | 422 |
| 423 } // namespace chrome | 423 } // namespace chrome |
| OLD | NEW |