| 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 // This file defines functions that integrate Chrome in Windows shell. These | 5 // This file defines functions that integrate Chrome in Windows shell. These |
| 6 // functions can be used by Chrome as well as Chrome installer. All of the | 6 // functions can be used by Chrome as well as Chrome installer. All of the |
| 7 // work is done by the local functions defined in anonymous namespace in | 7 // work is done by the local functions defined in anonymous namespace in |
| 8 // this class. | 8 // this class. |
| 9 | 9 |
| 10 #include "chrome/installer/util/shell_util.h" | 10 #include "chrome/installer/util/shell_util.h" |
| (...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 | 358 |
| 359 registry_chrome_exe = registry_chrome_exe.substr(1, | 359 registry_chrome_exe = registry_chrome_exe.substr(1, |
| 360 registry_chrome_exe.length() - 2); | 360 registry_chrome_exe.length() - 2); |
| 361 if ((registry_chrome_exe.size() == chrome_exe.size()) && | 361 if ((registry_chrome_exe.size() == chrome_exe.size()) && |
| 362 (std::equal(chrome_exe.begin(), chrome_exe.end(), | 362 (std::equal(chrome_exe.begin(), chrome_exe.end(), |
| 363 registry_chrome_exe.begin(), | 363 registry_chrome_exe.begin(), |
| 364 CaseInsensitiveCompare<wchar_t>()))) | 364 CaseInsensitiveCompare<wchar_t>()))) |
| 365 return false; | 365 return false; |
| 366 | 366 |
| 367 std::vector<std::wstring> v1, v2; | 367 std::vector<std::wstring> v1, v2; |
| 368 SplitString(registry_chrome_exe, L'\\', &v1); | 368 base::SplitString(registry_chrome_exe, L'\\', &v1); |
| 369 SplitString(chrome_exe, L'\\', &v2); | 369 base::SplitString(chrome_exe, L'\\', &v2); |
| 370 if (v1.size() == 0 || v2.size() == 0 || v1.size() != v2.size()) | 370 if (v1.size() == 0 || v2.size() == 0 || v1.size() != v2.size()) |
| 371 return false; | 371 return false; |
| 372 | 372 |
| 373 // Now check that only one of the values within two '\' chars differ. | 373 // Now check that only one of the values within two '\' chars differ. |
| 374 std::vector<std::wstring>::iterator itr1 = v1.begin(); | 374 std::vector<std::wstring>::iterator itr1 = v1.begin(); |
| 375 std::vector<std::wstring>::iterator itr2 = v2.begin(); | 375 std::vector<std::wstring>::iterator itr2 = v2.begin(); |
| 376 bool one_mismatch = false; | 376 bool one_mismatch = false; |
| 377 for ( ; itr1 < v1.end() && itr2 < v2.end(); ++itr1, ++itr2) { | 377 for ( ; itr1 < v1.end() && itr2 < v2.end(); ++itr1, ++itr2) { |
| 378 std::wstring s1 = *itr1; | 378 std::wstring s1 = *itr1; |
| 379 std::wstring s2 = *itr2; | 379 std::wstring s2 = *itr2; |
| (...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 798 chrome_exe.c_str(), // target | 798 chrome_exe.c_str(), // target |
| 799 shortcut.c_str(), // shortcut | 799 shortcut.c_str(), // shortcut |
| 800 chrome_path.c_str(), // working dir | 800 chrome_path.c_str(), // working dir |
| 801 NULL, // arguments | 801 NULL, // arguments |
| 802 description.c_str(), // description | 802 description.c_str(), // description |
| 803 chrome_exe.c_str(), // icon file | 803 chrome_exe.c_str(), // icon file |
| 804 icon_index, // icon index | 804 icon_index, // icon index |
| 805 dist->GetBrowserAppId().c_str()); // app id | 805 dist->GetBrowserAppId().c_str()); // app id |
| 806 } | 806 } |
| 807 } | 807 } |
| OLD | NEW |