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/ui/startup/startup_browser_creator_impl.h" | 5 #include "chrome/browser/ui/startup/startup_browser_creator_impl.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 // used to launch the browser. See http://www.catch22.net/tuts/undoc01 for | 151 // used to launch the browser. See http://www.catch22.net/tuts/undoc01 for |
152 // more information. Confirmed to work on XP, Vista and Win7. | 152 // more information. Confirmed to work on XP, Vista and Win7. |
153 LaunchMode GetLaunchShortcutKind() { | 153 LaunchMode GetLaunchShortcutKind() { |
154 STARTUPINFOW si = { sizeof(si) }; | 154 STARTUPINFOW si = { sizeof(si) }; |
155 GetStartupInfoW(&si); | 155 GetStartupInfoW(&si); |
156 if (si.dwFlags & 0x800) { | 156 if (si.dwFlags & 0x800) { |
157 if (!si.lpTitle) | 157 if (!si.lpTitle) |
158 return LM_SHORTCUT_NONAME; | 158 return LM_SHORTCUT_NONAME; |
159 base::string16 shortcut(si.lpTitle); | 159 base::string16 shortcut(si.lpTitle); |
160 // The windows quick launch path is not localized. | 160 // The windows quick launch path is not localized. |
161 if (shortcut.find(L"\\Quick Launch\\") != base::string16::npos) { | 161 if (shortcut.find(L"\\Quick Launch\\") != base::string16::npos) |
162 if (base::win::GetVersion() >= base::win::VERSION_WIN7) | 162 return LM_SHORTCUT_TASKBAR; |
163 return LM_SHORTCUT_TASKBAR; | |
164 else | |
165 return LM_SHORTCUT_QUICKLAUNCH; | |
166 } | |
167 std::unique_ptr<base::Environment> env(base::Environment::Create()); | 163 std::unique_ptr<base::Environment> env(base::Environment::Create()); |
168 std::string appdata_path; | 164 std::string appdata_path; |
169 env->GetVar("USERPROFILE", &appdata_path); | 165 env->GetVar("USERPROFILE", &appdata_path); |
170 if (!appdata_path.empty() && | 166 if (!appdata_path.empty() && |
171 shortcut.find(base::UTF8ToUTF16(appdata_path)) != base::string16::npos) | 167 shortcut.find(base::UTF8ToUTF16(appdata_path)) != base::string16::npos) |
172 return LM_SHORTCUT_DESKTOP; | 168 return LM_SHORTCUT_DESKTOP; |
173 return LM_SHORTCUT_UNKNOWN; | 169 return LM_SHORTCUT_UNKNOWN; |
174 } | 170 } |
175 return LM_OTHER; | 171 return LM_OTHER; |
176 } | 172 } |
(...skipping 1085 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1262 #if defined(OS_WIN) | 1258 #if defined(OS_WIN) |
1263 TriggeredProfileResetter* triggered_profile_resetter = | 1259 TriggeredProfileResetter* triggered_profile_resetter = |
1264 TriggeredProfileResetterFactory::GetForBrowserContext(profile_); | 1260 TriggeredProfileResetterFactory::GetForBrowserContext(profile_); |
1265 // TriggeredProfileResetter instance will be nullptr for incognito profiles. | 1261 // TriggeredProfileResetter instance will be nullptr for incognito profiles. |
1266 if (triggered_profile_resetter) { | 1262 if (triggered_profile_resetter) { |
1267 has_reset_trigger = triggered_profile_resetter->HasResetTrigger(); | 1263 has_reset_trigger = triggered_profile_resetter->HasResetTrigger(); |
1268 } | 1264 } |
1269 #endif // defined(OS_WIN) | 1265 #endif // defined(OS_WIN) |
1270 return has_reset_trigger; | 1266 return has_reset_trigger; |
1271 } | 1267 } |
OLD | NEW |