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 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
365 if ((registry_chrome_exe.size() == chrome_exe.size()) && | 365 if ((registry_chrome_exe.size() == chrome_exe.size()) && |
366 (std::equal(chrome_exe.begin(), chrome_exe.end(), | 366 (std::equal(chrome_exe.begin(), chrome_exe.end(), |
367 registry_chrome_exe.begin(), | 367 registry_chrome_exe.begin(), |
368 base::CaseInsensitiveCompare<wchar_t>()))) { | 368 base::CaseInsensitiveCompare<wchar_t>()))) { |
369 return false; | 369 return false; |
370 } | 370 } |
371 | 371 |
372 std::vector<std::wstring> v1, v2; | 372 std::vector<std::wstring> v1, v2; |
373 base::SplitString(registry_chrome_exe, L'\\', &v1); | 373 base::SplitString(registry_chrome_exe, L'\\', &v1); |
374 base::SplitString(chrome_exe, L'\\', &v2); | 374 base::SplitString(chrome_exe, L'\\', &v2); |
375 if (v1.size() == 0 || v2.size() == 0 || v1.size() != v2.size()) | 375 if (v1.empty() || v2.empty() || v1.size() != v2.size()) |
376 return false; | 376 return false; |
377 | 377 |
378 // Now check that only one of the values within two '\' chars differ. | 378 // Now check that only one of the values within two '\' chars differ. |
379 std::vector<std::wstring>::iterator itr1 = v1.begin(); | 379 std::vector<std::wstring>::iterator itr1 = v1.begin(); |
380 std::vector<std::wstring>::iterator itr2 = v2.begin(); | 380 std::vector<std::wstring>::iterator itr2 = v2.begin(); |
381 bool one_mismatch = false; | 381 bool one_mismatch = false; |
382 for ( ; itr1 < v1.end() && itr2 < v2.end(); ++itr1, ++itr2) { | 382 for ( ; itr1 < v1.end() && itr2 < v2.end(); ++itr1, ++itr2) { |
383 std::wstring s1 = *itr1; | 383 std::wstring s1 = *itr1; |
384 std::wstring s2 = *itr2; | 384 std::wstring s2 = *itr2; |
385 if ((s1.size() != s2.size()) || | 385 if ((s1.size() != s2.size()) || |
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
809 chrome_exe.c_str(), // target | 809 chrome_exe.c_str(), // target |
810 shortcut.c_str(), // shortcut | 810 shortcut.c_str(), // shortcut |
811 chrome_path.c_str(), // working dir | 811 chrome_path.c_str(), // working dir |
812 NULL, // arguments | 812 NULL, // arguments |
813 description.c_str(), // description | 813 description.c_str(), // description |
814 chrome_exe.c_str(), // icon file | 814 chrome_exe.c_str(), // icon file |
815 icon_index, // icon index | 815 icon_index, // icon index |
816 dist->GetBrowserAppId().c_str()); // app id | 816 dist->GetBrowserAppId().c_str()); // app id |
817 } | 817 } |
818 } | 818 } |
OLD | NEW |