OLD | NEW |
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/first_run/upgrade_util.h" | 5 #include "chrome/browser/first_run/upgrade_util.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/base_paths.h" | 10 #include "base/base_paths.h" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 return false; | 57 return false; |
58 } | 58 } |
59 | 59 |
60 } // namespace | 60 } // namespace |
61 | 61 |
62 namespace upgrade_util { | 62 namespace upgrade_util { |
63 | 63 |
64 bool RelaunchChromeBrowser(const CommandLine& command_line) { | 64 bool RelaunchChromeBrowser(const CommandLine& command_line) { |
65 scoped_ptr<base::Environment> env(base::Environment::Create()); | 65 scoped_ptr<base::Environment> env(base::Environment::Create()); |
66 env->UnSetVar(chrome::kChromeVersionEnvVar); | 66 env->UnSetVar(chrome::kChromeVersionEnvVar); |
67 return base::LaunchProcess(command_line, base::LaunchOptions()); | 67 return base::LaunchProcess(command_line, base::LaunchOptions(), NULL); |
68 } | 68 } |
69 | 69 |
70 bool IsUpdatePendingRestart() { | 70 bool IsUpdatePendingRestart() { |
71 FilePath new_chrome_exe; | 71 FilePath new_chrome_exe; |
72 if (!GetNewerChromeFile(&new_chrome_exe)) | 72 if (!GetNewerChromeFile(&new_chrome_exe)) |
73 return false; | 73 return false; |
74 return file_util::PathExists(new_chrome_exe); | 74 return file_util::PathExists(new_chrome_exe); |
75 } | 75 } |
76 | 76 |
77 bool SwapNewChromeExeIfPresent() { | 77 bool SwapNewChromeExeIfPresent() { |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 return false; | 114 return false; |
115 // At this point the chrome.exe has been swapped with the new one. | 115 // At this point the chrome.exe has been swapped with the new one. |
116 if (!RelaunchChromeBrowser(command_line)) { | 116 if (!RelaunchChromeBrowser(command_line)) { |
117 // The re-launch fails. Feel free to panic now. | 117 // The re-launch fails. Feel free to panic now. |
118 NOTREACHED(); | 118 NOTREACHED(); |
119 } | 119 } |
120 return true; | 120 return true; |
121 } | 121 } |
122 | 122 |
123 } // namespace upgrade_util | 123 } // namespace upgrade_util |
OLD | NEW |