Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(61)

Side by Side Diff: chrome/browser/ui/startup/startup_browser_creator_impl.cc

Issue 2909943003: Removing useless Win7 checks + standardize its use (Closed)
Patch Set: Fix unreachable code Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 // used to launch the browser. See http://www.catch22.net/tuts/undoc01 for 150 // used to launch the browser. See http://www.catch22.net/tuts/undoc01 for
151 // more information. Confirmed to work on XP, Vista and Win7. 151 // more information. Confirmed to work on XP, Vista and Win7.
152 LaunchMode GetLaunchShortcutKind() { 152 LaunchMode GetLaunchShortcutKind() {
153 STARTUPINFOW si = { sizeof(si) }; 153 STARTUPINFOW si = { sizeof(si) };
154 GetStartupInfoW(&si); 154 GetStartupInfoW(&si);
155 if (si.dwFlags & 0x800) { 155 if (si.dwFlags & 0x800) {
156 if (!si.lpTitle) 156 if (!si.lpTitle)
157 return LM_SHORTCUT_NONAME; 157 return LM_SHORTCUT_NONAME;
158 base::string16 shortcut(si.lpTitle); 158 base::string16 shortcut(si.lpTitle);
159 // The windows quick launch path is not localized. 159 // The windows quick launch path is not localized.
160 if (shortcut.find(L"\\Quick Launch\\") != base::string16::npos) { 160 if (shortcut.find(L"\\Quick Launch\\") != base::string16::npos)
161 if (base::win::GetVersion() >= base::win::VERSION_WIN7) 161 return LM_SHORTCUT_TASKBAR;
162 return LM_SHORTCUT_TASKBAR;
163 else
164 return LM_SHORTCUT_QUICKLAUNCH;
165 }
166 std::unique_ptr<base::Environment> env(base::Environment::Create()); 162 std::unique_ptr<base::Environment> env(base::Environment::Create());
167 std::string appdata_path; 163 std::string appdata_path;
168 env->GetVar("USERPROFILE", &appdata_path); 164 env->GetVar("USERPROFILE", &appdata_path);
169 if (!appdata_path.empty() && 165 if (!appdata_path.empty() &&
170 shortcut.find(base::UTF8ToUTF16(appdata_path)) != base::string16::npos) 166 shortcut.find(base::UTF8ToUTF16(appdata_path)) != base::string16::npos)
171 return LM_SHORTCUT_DESKTOP; 167 return LM_SHORTCUT_DESKTOP;
172 return LM_SHORTCUT_UNKNOWN; 168 return LM_SHORTCUT_UNKNOWN;
173 } 169 }
174 return LM_SHORTCUT_NONE; 170 return LM_SHORTCUT_NONE;
175 } 171 }
(...skipping 1079 matching lines...) Expand 10 before | Expand all | Expand 10 after
1255 #if defined(OS_WIN) 1251 #if defined(OS_WIN)
1256 TriggeredProfileResetter* triggered_profile_resetter = 1252 TriggeredProfileResetter* triggered_profile_resetter =
1257 TriggeredProfileResetterFactory::GetForBrowserContext(profile_); 1253 TriggeredProfileResetterFactory::GetForBrowserContext(profile_);
1258 // TriggeredProfileResetter instance will be nullptr for incognito profiles. 1254 // TriggeredProfileResetter instance will be nullptr for incognito profiles.
1259 if (triggered_profile_resetter) { 1255 if (triggered_profile_resetter) {
1260 has_reset_trigger = triggered_profile_resetter->HasResetTrigger(); 1256 has_reset_trigger = triggered_profile_resetter->HasResetTrigger();
1261 } 1257 }
1262 #endif // defined(OS_WIN) 1258 #endif // defined(OS_WIN)
1263 return has_reset_trigger; 1259 return has_reset_trigger;
1264 } 1260 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698