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 <shobjidl.h> | 8 #include <shobjidl.h> |
9 #include <propkey.h> | 9 #include <propkey.h> |
10 | 10 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
76 profile_id += basenames[i]; | 76 profile_id += basenames[i]; |
77 } | 77 } |
78 | 78 |
79 return profile_id; | 79 return profile_id; |
80 } | 80 } |
81 | 81 |
82 string16 GetAppListAppName() { | 82 string16 GetAppListAppName() { |
83 BrowserDistribution* dist = BrowserDistribution::GetDistribution(); | 83 BrowserDistribution* dist = BrowserDistribution::GetDistribution(); |
84 string16 app_name(dist->GetBaseAppId()); | 84 string16 app_name(dist->GetBaseAppId()); |
85 app_name.append(kAppListAppNameSuffix); | 85 app_name.append(kAppListAppNameSuffix); |
86 | |
87 // Append user specific suffix to app id. | |
88 base::FilePath chrome_exe; | |
89 if (!PathService::Get(base::FILE_EXE, &chrome_exe)) { | |
90 NOTREACHED(); | |
91 return app_name; | |
92 } | |
93 bool is_per_user_install = | |
94 InstallUtil::IsPerUserInstall(chrome_exe.value().c_str()); | |
95 string16 suffix; | |
96 if (is_per_user_install | |
97 && !ShellUtil::GetUserSpecificRegistrySuffix(&suffix)) { | |
98 NOTREACHED(); | |
99 return app_name; | |
100 } | |
101 app_name.append(suffix); | |
gab
2013/04/26 15:21:03
The reason for Chrome that the suffix is attached
calamity
2013/04/29 07:20:05
Ah ok, cool. Part of the reason I was asking was t
| |
86 return app_name; | 102 return app_name; |
87 } | 103 } |
88 | 104 |
89 // Gets expected app id for given Chrome (based on |command_line| and | 105 // Gets expected app id for given Chrome (based on |command_line| and |
90 // |is_per_user_install|). | 106 // |is_per_user_install|). |
91 string16 GetExpectedAppId(const CommandLine& command_line, | 107 string16 GetExpectedAppId(const CommandLine& command_line, |
92 bool is_per_user_install) { | 108 bool is_per_user_install) { |
93 base::FilePath profile_path; | 109 base::FilePath profile_path; |
94 if (command_line.HasSwitch(switches::kUserDataDir)) { | 110 if (command_line.HasSwitch(switches::kUserDataDir)) { |
95 profile_path = | 111 profile_path = |
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
510 } | 526 } |
511 | 527 |
512 shortcut = shortcut.Append(shortcut_name).Append(shortcut_name + | 528 shortcut = shortcut.Append(shortcut_name).Append(shortcut_name + |
513 installer::kLnkExt); | 529 installer::kLnkExt); |
514 if (file_util::PathExists(shortcut)) | 530 if (file_util::PathExists(shortcut)) |
515 return shortcut; | 531 return shortcut; |
516 } | 532 } |
517 | 533 |
518 return base::FilePath(); | 534 return base::FilePath(); |
519 } | 535 } |
OLD | NEW |