| 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/shell_integration.h" | 5 #include "chrome/browser/shell_integration.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 #include <shlwapi.h> | 8 #include <shlwapi.h> |
| 9 #include <shobjidl.h> | 9 #include <shobjidl.h> |
| 10 #include <propkey.h> // Needs to come after shobjidl.h. | 10 #include <propkey.h> // Needs to come after shobjidl.h. |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 | 66 |
| 67 // Get joined basenames of user data dir and profile. | 67 // Get joined basenames of user data dir and profile. |
| 68 base::string16 basenames = profile_path.DirName().BaseName().value() + | 68 base::string16 basenames = profile_path.DirName().BaseName().value() + |
| 69 L"." + profile_path.BaseName().value(); | 69 L"." + profile_path.BaseName().value(); |
| 70 | 70 |
| 71 base::string16 profile_id; | 71 base::string16 profile_id; |
| 72 profile_id.reserve(basenames.size()); | 72 profile_id.reserve(basenames.size()); |
| 73 | 73 |
| 74 // Generate profile_id from sanitized basenames. | 74 // Generate profile_id from sanitized basenames. |
| 75 for (size_t i = 0; i < basenames.length(); ++i) { | 75 for (size_t i = 0; i < basenames.length(); ++i) { |
| 76 if (IsAsciiAlpha(basenames[i]) || | 76 if (base::IsAsciiAlpha(basenames[i]) || |
| 77 IsAsciiDigit(basenames[i]) || | 77 base::IsAsciiDigit(basenames[i]) || |
| 78 basenames[i] == L'.') | 78 basenames[i] == L'.') |
| 79 profile_id += basenames[i]; | 79 profile_id += basenames[i]; |
| 80 } | 80 } |
| 81 | 81 |
| 82 return profile_id; | 82 return profile_id; |
| 83 } | 83 } |
| 84 | 84 |
| 85 base::string16 GetAppListAppName() { | 85 base::string16 GetAppListAppName() { |
| 86 BrowserDistribution* dist = BrowserDistribution::GetDistribution(); | 86 BrowserDistribution* dist = BrowserDistribution::GetDistribution(); |
| 87 base::string16 app_name(dist->GetBaseAppId()); | 87 base::string16 app_name(dist->GetBaseAppId()); |
| (...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 576 } | 576 } |
| 577 | 577 |
| 578 shortcut = shortcut.Append(shortcut_name).Append(shortcut_name + | 578 shortcut = shortcut.Append(shortcut_name).Append(shortcut_name + |
| 579 installer::kLnkExt); | 579 installer::kLnkExt); |
| 580 if (base::PathExists(shortcut)) | 580 if (base::PathExists(shortcut)) |
| 581 return shortcut; | 581 return shortcut; |
| 582 } | 582 } |
| 583 | 583 |
| 584 return base::FilePath(); | 584 return base::FilePath(); |
| 585 } | 585 } |
| OLD | NEW |