| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/first_run/upgrade_util.h" | 5 #include "chrome/browser/first_run/upgrade_util.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 #include <psapi.h> | 8 #include <psapi.h> |
| 9 #include <shellapi.h> | 9 #include <shellapi.h> |
| 10 | 10 |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 if (relaunch_mode == kRelaunchModeMetro) | 111 if (relaunch_mode == kRelaunchModeMetro) |
| 112 return RELAUNCH_MODE_METRO; | 112 return RELAUNCH_MODE_METRO; |
| 113 | 113 |
| 114 if (relaunch_mode == kRelaunchModeDesktop) | 114 if (relaunch_mode == kRelaunchModeDesktop) |
| 115 return RELAUNCH_MODE_DESKTOP; | 115 return RELAUNCH_MODE_DESKTOP; |
| 116 | 116 |
| 117 // On Windows 7 if the current browser is in Chrome OS mode, then restart | 117 // On Windows 7 if the current browser is in Chrome OS mode, then restart |
| 118 // into Chrome OS mode. | 118 // into Chrome OS mode. |
| 119 if ((base::win::GetVersion() == base::win::VERSION_WIN7) && | 119 if ((base::win::GetVersion() == base::win::VERSION_WIN7) && |
| 120 CommandLine::ForCurrentProcess()->HasSwitch(switches::kViewerConnect) && | 120 CommandLine::ForCurrentProcess()->HasSwitch(switches::kViewerConnect) && |
| 121 g_browser_process->local_state()->HasPrefPath(prefs::kRelaunchMode)) { | 121 !g_browser_process->local_state()->HasPrefPath(prefs::kRelaunchMode)) { |
| 122 // TODO(ananta) | 122 // TODO(ananta) |
| 123 // On Windows 8, the delegate execute process looks up the previously | 123 // On Windows 8, the delegate execute process looks up the previously |
| 124 // launched mode from the registry and relaunches into that mode. We need | 124 // launched mode from the registry and relaunches into that mode. We need |
| 125 // something similar on Windows 7. For now, set the pref to ensure that | 125 // something similar on Windows 7. For now, set the pref to ensure that |
| 126 // we get relaunched into Chrome OS mode. | 126 // we get relaunched into Chrome OS mode. |
| 127 g_browser_process->local_state()->SetString( | 127 g_browser_process->local_state()->SetString( |
| 128 prefs::kRelaunchMode, upgrade_util::kRelaunchModeMetro); | 128 prefs::kRelaunchMode, upgrade_util::kRelaunchModeMetro); |
| 129 return RELAUNCH_MODE_METRO; | 129 return RELAUNCH_MODE_METRO; |
| 130 } | 130 } |
| 131 | 131 |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 return false; | 304 return false; |
| 305 // At this point the chrome.exe has been swapped with the new one. | 305 // At this point the chrome.exe has been swapped with the new one. |
| 306 if (!RelaunchChromeBrowser(command_line)) { | 306 if (!RelaunchChromeBrowser(command_line)) { |
| 307 // The re-launch fails. Feel free to panic now. | 307 // The re-launch fails. Feel free to panic now. |
| 308 NOTREACHED(); | 308 NOTREACHED(); |
| 309 } | 309 } |
| 310 return true; | 310 return true; |
| 311 } | 311 } |
| 312 | 312 |
| 313 } // namespace upgrade_util | 313 } // namespace upgrade_util |
| OLD | NEW |