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, |
191 base::debug::TraceLog::RECORD_UNTIL_FULL); | 192 base::debug::TraceLog::RECORD_UNTIL_FULL); |
192 } | 193 } |
193 TRACE_EVENT0("shutdown", "StartShutdownTracing"); | 194 TRACE_EVENT0("shutdown", "StartShutdownTracing"); |
194 } | 195 } |
195 | 196 |
196 // The Android implementation is in application_lifetime_android.cc | 197 // The Android implementation is in application_lifetime_android.cc |
197 #if !defined(OS_ANDROID) | 198 #if !defined(OS_ANDROID) |
198 void AttemptRestart() { | 199 void AttemptRestart() { |
199 // TODO(beng): Can this use ProfileManager::GetLoadedProfiles instead? | 200 // TODO(beng): Can this use ProfileManager::GetLoadedProfiles instead? |
200 for (chrome::BrowserIterator it; !it.done(); it.Next()) | 201 for (chrome::BrowserIterator it; !it.done(); it.Next()) |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 // environment is still active. | 394 // environment is still active. |
394 if (browser->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_NATIVE) | 395 if (browser->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_NATIVE) |
395 return !ash::Shell::HasInstance(); | 396 return !ash::Shell::HasInstance(); |
396 else if (browser->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH) | 397 else if (browser->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH) |
397 return BrowserList::GetInstance(chrome::HOST_DESKTOP_TYPE_NATIVE)->empty(); | 398 return BrowserList::GetInstance(chrome::HOST_DESKTOP_TYPE_NATIVE)->empty(); |
398 #endif | 399 #endif |
399 return true; | 400 return true; |
400 } | 401 } |
401 | 402 |
402 } // namespace chrome | 403 } // namespace chrome |
OLD | NEW |