Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(127)

Side by Side Diff: chrome/browser/browser_shutdown.cc

Issue 8745015: Store the "browser autorestarted, last session must be restored" information in a preference. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Build fix (browser_tests). Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/browser_process_impl.cc ('k') | chrome/browser/chrome_browser_main_posix.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/browser_process_impl.cc ('k') | chrome/browser/chrome_browser_main_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698