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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 } | 175 } |
176 | 176 |
177 void StartShutdownTracing() { | 177 void StartShutdownTracing() { |
178 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 178 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
179 if (command_line.HasSwitch(switches::kTraceShutdown)) { | 179 if (command_line.HasSwitch(switches::kTraceShutdown)) { |
180 base::debug::CategoryFilter category_filter( | 180 base::debug::CategoryFilter category_filter( |
181 command_line.GetSwitchValueASCII(switches::kTraceShutdown)); | 181 command_line.GetSwitchValueASCII(switches::kTraceShutdown)); |
182 base::debug::TraceLog::GetInstance()->SetEnabled( | 182 base::debug::TraceLog::GetInstance()->SetEnabled( |
183 category_filter, | 183 category_filter, |
184 base::debug::TraceLog::RECORDING_MODE, | 184 base::debug::TraceLog::RECORDING_MODE, |
185 base::debug::TraceLog::RECORD_UNTIL_FULL); | 185 base::debug::TraceOptions()); |
186 } | 186 } |
187 TRACE_EVENT0("shutdown", "StartShutdownTracing"); | 187 TRACE_EVENT0("shutdown", "StartShutdownTracing"); |
188 } | 188 } |
189 | 189 |
190 // The Android implementation is in application_lifetime_android.cc | 190 // The Android implementation is in application_lifetime_android.cc |
191 #if !defined(OS_ANDROID) | 191 #if !defined(OS_ANDROID) |
192 void AttemptRestart() { | 192 void AttemptRestart() { |
193 // TODO(beng): Can this use ProfileManager::GetLoadedProfiles instead? | 193 // TODO(beng): Can this use ProfileManager::GetLoadedProfiles instead? |
194 for (chrome::BrowserIterator it; !it.done(); it.Next()) | 194 for (chrome::BrowserIterator it; !it.done(); it.Next()) |
195 content::BrowserContext::SaveSessionState(it->profile()); | 195 content::BrowserContext::SaveSessionState(it->profile()); |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
419 // environment is still active. | 419 // environment is still active. |
420 if (browser->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_NATIVE) | 420 if (browser->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_NATIVE) |
421 return !ash::Shell::HasInstance(); | 421 return !ash::Shell::HasInstance(); |
422 else if (browser->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH) | 422 else if (browser->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH) |
423 return BrowserList::GetInstance(chrome::HOST_DESKTOP_TYPE_NATIVE)->empty(); | 423 return BrowserList::GetInstance(chrome::HOST_DESKTOP_TYPE_NATIVE)->empty(); |
424 #endif | 424 #endif |
425 return true; | 425 return true; |
426 } | 426 } |
427 | 427 |
428 } // namespace chrome | 428 } // namespace chrome |
OLD | NEW |