| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_process_impl.h" | 5 #include "chrome/browser/browser_process_impl.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 | 8 |
| 9 #include "app/clipboard/clipboard.h" | 9 #include "app/clipboard/clipboard.h" |
| 10 #include "app/l10n_util.h" | 10 #include "app/l10n_util.h" |
| (...skipping 701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 712 // pick up an automatic update, be sure to add it to this list. | 712 // pick up an automatic update, be sure to add it to this list. |
| 713 const char* const kSwitchesToRemoveOnAutorestart[] = { | 713 const char* const kSwitchesToRemoveOnAutorestart[] = { |
| 714 switches::kApp, | 714 switches::kApp, |
| 715 switches::kFirstRun, | 715 switches::kFirstRun, |
| 716 switches::kImport, | 716 switches::kImport, |
| 717 switches::kImportFromFile, | 717 switches::kImportFromFile, |
| 718 switches::kMakeDefaultBrowser | 718 switches::kMakeDefaultBrowser |
| 719 }; | 719 }; |
| 720 | 720 |
| 721 const char* const kSwitchesToAddOnAutorestart[] = { | 721 const char* const kSwitchesToAddOnAutorestart[] = { |
| 722 switches::kNoStartupWindow, | 722 switches::kNoStartupWindow |
| 723 switches::kRestoreBackgroundContents | |
| 724 }; | 723 }; |
| 725 | 724 |
| 726 void BrowserProcessImpl::RestartPersistentInstance() { | 725 void BrowserProcessImpl::RestartPersistentInstance() { |
| 727 CommandLine* old_cl = CommandLine::ForCurrentProcess(); | 726 CommandLine* old_cl = CommandLine::ForCurrentProcess(); |
| 728 scoped_ptr<CommandLine> new_cl(new CommandLine(old_cl->GetProgram())); | 727 scoped_ptr<CommandLine> new_cl(new CommandLine(old_cl->GetProgram())); |
| 729 | 728 |
| 730 std::map<std::string, CommandLine::StringType> switches = | 729 std::map<std::string, CommandLine::StringType> switches = |
| 731 old_cl->GetSwitches(); | 730 old_cl->GetSwitches(); |
| 732 | 731 |
| 733 // Remove the keys that we shouldn't pass through during restart. | 732 // Remove the keys that we shouldn't pass through during restart. |
| (...skipping 27 matching lines...) Expand all Loading... |
| 761 } | 760 } |
| 762 | 761 |
| 763 void BrowserProcessImpl::OnAutoupdateTimer() { | 762 void BrowserProcessImpl::OnAutoupdateTimer() { |
| 764 if (CanAutorestartForUpdate()) { | 763 if (CanAutorestartForUpdate()) { |
| 765 DLOG(WARNING) << "Detected update. Restarting browser."; | 764 DLOG(WARNING) << "Detected update. Restarting browser."; |
| 766 RestartPersistentInstance(); | 765 RestartPersistentInstance(); |
| 767 } | 766 } |
| 768 } | 767 } |
| 769 | 768 |
| 770 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 769 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
| OLD | NEW |