OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/browser_shutdown.h" | 5 #include "chrome/browser/browser_shutdown.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 switches::RemoveSwitchesForAutostart(&switches); | 211 switches::RemoveSwitchesForAutostart(&switches); |
212 // Append the old switches to the new command line. | 212 // Append the old switches to the new command line. |
213 for (std::map<std::string, CommandLine::StringType>::const_iterator i = | 213 for (std::map<std::string, CommandLine::StringType>::const_iterator i = |
214 switches.begin(); i != switches.end(); ++i) { | 214 switches.begin(); i != switches.end(); ++i) { |
215 CommandLine::StringType switch_value = i->second; | 215 CommandLine::StringType switch_value = i->second; |
216 if (!switch_value.empty()) | 216 if (!switch_value.empty()) |
217 new_cl->AppendSwitchNative(i->first, i->second); | 217 new_cl->AppendSwitchNative(i->first, i->second); |
218 else | 218 else |
219 new_cl->AppendSwitch(i->first); | 219 new_cl->AppendSwitch(i->first); |
220 } | 220 } |
221 // Ensure restore last session is set. | |
222 if (!new_cl->HasSwitch(switches::kRestoreLastSession)) | |
223 new_cl->AppendSwitch(switches::kRestoreLastSession); | |
224 | |
225 upgrade_util::RelaunchChromeBrowser(*new_cl.get()); | 221 upgrade_util::RelaunchChromeBrowser(*new_cl.get()); |
226 #else | 222 #else |
227 NOTIMPLEMENTED(); | 223 NOTIMPLEMENTED(); |
228 #endif // !defined(OS_CHROMEOS) | 224 #endif // !defined(OS_CHROMEOS) |
229 } | 225 } |
230 | 226 |
231 if (shutdown_type_ > NOT_VALID && shutdown_num_processes_ > 0) { | 227 if (shutdown_type_ > NOT_VALID && shutdown_num_processes_ > 0) { |
232 // Measure total shutdown time as late in the process as possible | 228 // Measure total shutdown time as late in the process as possible |
233 // and then write it to a file to be read at startup. | 229 // and then write it to a file to be read at startup. |
234 // We can't use prefs since all services are shutdown at this point. | 230 // We can't use prefs since all services are shutdown at this point. |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 | 315 |
320 bool ShuttingDownWithoutClosingBrowsers() { | 316 bool ShuttingDownWithoutClosingBrowsers() { |
321 return g_shutting_down_without_closing_browsers; | 317 return g_shutting_down_without_closing_browsers; |
322 } | 318 } |
323 | 319 |
324 void SetShuttingDownWithoutClosingBrowsers(bool without_close) { | 320 void SetShuttingDownWithoutClosingBrowsers(bool without_close) { |
325 g_shutting_down_without_closing_browsers = without_close; | 321 g_shutting_down_without_closing_browsers = without_close; |
326 } | 322 } |
327 | 323 |
328 } // namespace browser_shutdown | 324 } // namespace browser_shutdown |
OLD | NEW |