| 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_shutdown.h" | 5 #include "chrome/browser/browser_shutdown.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "app/resource_bundle.h" | 9 #include "app/resource_bundle.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 // at the switch argument terminator). | 174 // at the switch argument terminator). |
| 175 CommandLine old_cl(*CommandLine::ForCurrentProcess()); | 175 CommandLine old_cl(*CommandLine::ForCurrentProcess()); |
| 176 scoped_ptr<CommandLine> new_cl(new CommandLine(old_cl.GetProgram())); | 176 scoped_ptr<CommandLine> new_cl(new CommandLine(old_cl.GetProgram())); |
| 177 std::map<std::string, CommandLine::StringType> switches = | 177 std::map<std::string, CommandLine::StringType> switches = |
| 178 old_cl.GetSwitches(); | 178 old_cl.GetSwitches(); |
| 179 // Append the old switches to the new command line. | 179 // Append the old switches to the new command line. |
| 180 for (std::map<std::string, CommandLine::StringType>::const_iterator i = | 180 for (std::map<std::string, CommandLine::StringType>::const_iterator i = |
| 181 switches.begin(); i != switches.end(); ++i) { | 181 switches.begin(); i != switches.end(); ++i) { |
| 182 CommandLine::StringType switch_value = i->second; | 182 CommandLine::StringType switch_value = i->second; |
| 183 if (!switch_value.empty()) | 183 if (!switch_value.empty()) |
| 184 new_cl->AppendSwitchWithValue(i->first, i->second); | 184 new_cl->AppendSwitchNative(i->first, i->second); |
| 185 else | 185 else |
| 186 new_cl->AppendSwitch(i->first); | 186 new_cl->AppendSwitch(i->first); |
| 187 } | 187 } |
| 188 // Ensure restore last session is set. | 188 // Ensure restore last session is set. |
| 189 if (!new_cl->HasSwitch(switches::kRestoreLastSession)) | 189 if (!new_cl->HasSwitch(switches::kRestoreLastSession)) |
| 190 new_cl->AppendSwitch(switches::kRestoreLastSession); | 190 new_cl->AppendSwitch(switches::kRestoreLastSession); |
| 191 | 191 |
| 192 #if defined(OS_WIN) || defined(OS_LINUX) | 192 #if defined(OS_WIN) || defined(OS_LINUX) |
| 193 Upgrade::RelaunchChromeBrowser(*new_cl.get()); | 193 Upgrade::RelaunchChromeBrowser(*new_cl.get()); |
| 194 #endif // defined(OS_WIN) || defined(OS_LINUX) | 194 #endif // defined(OS_WIN) || defined(OS_LINUX) |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 | 282 |
| 283 void SetTryingToQuit(bool quitting) { | 283 void SetTryingToQuit(bool quitting) { |
| 284 g_trying_to_quit = quitting; | 284 g_trying_to_quit = quitting; |
| 285 } | 285 } |
| 286 | 286 |
| 287 bool IsTryingToQuit() { | 287 bool IsTryingToQuit() { |
| 288 return g_trying_to_quit; | 288 return g_trying_to_quit; |
| 289 } | 289 } |
| 290 | 290 |
| 291 } // namespace browser_shutdown | 291 } // namespace browser_shutdown |
| OLD | NEW |