| 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/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 #endif | 181 #endif |
| 182 } | 182 } |
| 183 | 183 |
| 184 void StartShutdownTracing() { | 184 void StartShutdownTracing() { |
| 185 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 185 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 186 if (command_line.HasSwitch(switches::kTraceShutdown)) { | 186 if (command_line.HasSwitch(switches::kTraceShutdown)) { |
| 187 base::debug::CategoryFilter category_filter( | 187 base::debug::CategoryFilter category_filter( |
| 188 command_line.GetSwitchValueASCII(switches::kTraceShutdown)); | 188 command_line.GetSwitchValueASCII(switches::kTraceShutdown)); |
| 189 base::debug::TraceLog::GetInstance()->SetEnabled( | 189 base::debug::TraceLog::GetInstance()->SetEnabled( |
| 190 category_filter, | 190 category_filter, |
| 191 base::debug::TraceLog::RECORDING_MODE, | |
| 192 base::debug::TraceLog::RECORD_UNTIL_FULL); | 191 base::debug::TraceLog::RECORD_UNTIL_FULL); |
| 193 } | 192 } |
| 194 TRACE_EVENT0("shutdown", "StartShutdownTracing"); | 193 TRACE_EVENT0("shutdown", "StartShutdownTracing"); |
| 195 } | 194 } |
| 196 | 195 |
| 197 // The Android implementation is in application_lifetime_android.cc | 196 // The Android implementation is in application_lifetime_android.cc |
| 198 #if !defined(OS_ANDROID) | 197 #if !defined(OS_ANDROID) |
| 199 void AttemptRestart() { | 198 void AttemptRestart() { |
| 200 // TODO(beng): Can this use ProfileManager::GetLoadedProfiles instead? | 199 // TODO(beng): Can this use ProfileManager::GetLoadedProfiles instead? |
| 201 for (chrome::BrowserIterator it; !it.done(); it.Next()) | 200 for (chrome::BrowserIterator it; !it.done(); it.Next()) |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 396 // environment is still active. | 395 // environment is still active. |
| 397 if (browser->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_NATIVE) | 396 if (browser->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_NATIVE) |
| 398 return !ash::Shell::HasInstance(); | 397 return !ash::Shell::HasInstance(); |
| 399 else if (browser->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH) | 398 else if (browser->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH) |
| 400 return BrowserList::GetInstance(chrome::HOST_DESKTOP_TYPE_NATIVE)->empty(); | 399 return BrowserList::GetInstance(chrome::HOST_DESKTOP_TYPE_NATIVE)->empty(); |
| 401 #endif | 400 #endif |
| 402 return true; | 401 return true; |
| 403 } | 402 } |
| 404 | 403 |
| 405 } // namespace chrome | 404 } // namespace chrome |
| OLD | NEW |