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/chrome_browser_main_win.h" | 5 #include "chrome/browser/chrome_browser_main_win.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 #include <shellapi.h> | 8 #include <shellapi.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 } | 289 } |
290 // We don't hide icons so we shouldn't do anything special to show them | 290 // We don't hide icons so we shouldn't do anything special to show them |
291 return chrome::RESULT_CODE_UNSUPPORTED_PARAM; | 291 return chrome::RESULT_CODE_UNSUPPORTED_PARAM; |
292 } | 292 } |
293 | 293 |
294 // static | 294 // static |
295 bool ChromeBrowserMainPartsWin::CheckMachineLevelInstall() { | 295 bool ChromeBrowserMainPartsWin::CheckMachineLevelInstall() { |
296 // TODO(tommi): Check if using the default distribution is always the right | 296 // TODO(tommi): Check if using the default distribution is always the right |
297 // thing to do. | 297 // thing to do. |
298 BrowserDistribution* dist = BrowserDistribution::GetDistribution(); | 298 BrowserDistribution* dist = BrowserDistribution::GetDistribution(); |
299 scoped_ptr<Version> version(InstallUtil::GetChromeVersion(dist, true)); | 299 Version version; |
300 if (version.get()) { | 300 InstallUtil::GetChromeVersion(dist, true, &version); |
| 301 if (version.IsValid()) { |
301 FilePath exe_path; | 302 FilePath exe_path; |
302 PathService::Get(base::DIR_EXE, &exe_path); | 303 PathService::Get(base::DIR_EXE, &exe_path); |
303 std::wstring exe = exe_path.value(); | 304 std::wstring exe = exe_path.value(); |
304 FilePath user_exe_path(installer::GetChromeInstallPath(false, dist)); | 305 FilePath user_exe_path(installer::GetChromeInstallPath(false, dist)); |
305 if (FilePath::CompareEqualIgnoreCase(exe, user_exe_path.value())) { | 306 if (FilePath::CompareEqualIgnoreCase(exe, user_exe_path.value())) { |
306 const string16 text = | 307 const string16 text = |
307 l10n_util::GetStringUTF16(IDS_MACHINE_LEVEL_INSTALL_CONFLICT); | 308 l10n_util::GetStringUTF16(IDS_MACHINE_LEVEL_INSTALL_CONFLICT); |
308 const string16 caption = l10n_util::GetStringUTF16(IDS_PRODUCT_NAME); | 309 const string16 caption = l10n_util::GetStringUTF16(IDS_PRODUCT_NAME); |
309 const UINT flags = MB_OK | MB_ICONERROR | MB_TOPMOST; | 310 const UINT flags = MB_OK | MB_ICONERROR | MB_TOPMOST; |
310 ui::MessageBox(NULL, text, caption, flags); | 311 ui::MessageBox(NULL, text, caption, flags); |
(...skipping 28 matching lines...) Expand all Loading... |
339 if (resource_id) | 340 if (resource_id) |
340 return l10n_util::GetStringUTF16(resource_id); | 341 return l10n_util::GetStringUTF16(resource_id); |
341 return string16(); | 342 return string16(); |
342 } | 343 } |
343 | 344 |
344 // static | 345 // static |
345 void ChromeBrowserMainPartsWin::SetupInstallerUtilStrings() { | 346 void ChromeBrowserMainPartsWin::SetupInstallerUtilStrings() { |
346 CR_DEFINE_STATIC_LOCAL(TranslationDelegate, delegate, ()); | 347 CR_DEFINE_STATIC_LOCAL(TranslationDelegate, delegate, ()); |
347 installer::SetTranslationDelegate(&delegate); | 348 installer::SetTranslationDelegate(&delegate); |
348 } | 349 } |
OLD | NEW |