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 727 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
738 for (size_t i = 0; i < arraysize(kSwitchesToRemoveOnAutorestart); i++) { | 738 for (size_t i = 0; i < arraysize(kSwitchesToRemoveOnAutorestart); i++) { |
739 switches.erase(kSwitchesToRemoveOnAutorestart[i]); | 739 switches.erase(kSwitchesToRemoveOnAutorestart[i]); |
740 } | 740 } |
741 | 741 |
742 // Append the rest of the switches (along with their values, if any) | 742 // Append the rest of the switches (along with their values, if any) |
743 // to the new command line | 743 // to the new command line |
744 for (std::map<std::string, CommandLine::StringType>::const_iterator i = | 744 for (std::map<std::string, CommandLine::StringType>::const_iterator i = |
745 switches.begin(); i != switches.end(); ++i) { | 745 switches.begin(); i != switches.end(); ++i) { |
746 CommandLine::StringType switch_value = i->second; | 746 CommandLine::StringType switch_value = i->second; |
747 if (switch_value.length() > 0) { | 747 if (switch_value.length() > 0) { |
748 new_cl->AppendSwitchWithValue(i->first, i->second); | 748 new_cl->AppendSwitchNative(i->first, i->second); |
749 } else { | 749 } else { |
750 new_cl->AppendSwitch(i->first); | 750 new_cl->AppendSwitch(i->first); |
751 } | 751 } |
752 } | 752 } |
753 | 753 |
754 if (!new_cl->HasSwitch(switches::kRestoreBackgroundContents)) | 754 if (!new_cl->HasSwitch(switches::kRestoreBackgroundContents)) |
755 new_cl->AppendSwitch(switches::kRestoreBackgroundContents); | 755 new_cl->AppendSwitch(switches::kRestoreBackgroundContents); |
756 | 756 |
757 DLOG(WARNING) << "Shutting down current instance of the browser."; | 757 DLOG(WARNING) << "Shutting down current instance of the browser."; |
758 BrowserList::CloseAllBrowsersAndExit(); | 758 BrowserList::CloseAllBrowsersAndExit(); |
759 | 759 |
760 // Transfer ownership to Upgrade. | 760 // Transfer ownership to Upgrade. |
761 Upgrade::SetNewCommandLine(new_cl.release()); | 761 Upgrade::SetNewCommandLine(new_cl.release()); |
762 } | 762 } |
763 | 763 |
764 void BrowserProcessImpl::OnAutoupdateTimer() { | 764 void BrowserProcessImpl::OnAutoupdateTimer() { |
765 if (CanAutorestartForUpdate()) { | 765 if (CanAutorestartForUpdate()) { |
766 DLOG(WARNING) << "Detected update. Restarting browser."; | 766 DLOG(WARNING) << "Detected update. Restarting browser."; |
767 RestartPersistentInstance(); | 767 RestartPersistentInstance(); |
768 } | 768 } |
769 } | 769 } |
770 | 770 |
771 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 771 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
OLD | NEW |