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

Unified Diff: chrome/browser/ui/browser_init.cc

Issue 9559020: Record taskbar launch mode in UMA histogram (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Comments plus wstring->string16 Created 8 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/browser_init.cc
diff --git a/chrome/browser/ui/browser_init.cc b/chrome/browser/ui/browser_init.cc
index 2e8a1378eb8406e72ebfc2461e2835c9595156bf..f28e0fc72fce652d196e8bfce03fc9f254e8386e 100644
--- a/chrome/browser/ui/browser_init.cc
+++ b/chrome/browser/ui/browser_init.cc
@@ -127,6 +127,7 @@
#endif
#if defined(OS_WIN)
+#include "base/win/windows_version.h"
#include "chrome/installer/util/auto_launch_util.h"
#endif
@@ -492,7 +493,7 @@ enum LaunchMode {
LM_SHORTCUT_UNKNOWN, // Launched from user-defined shortcut.
LM_SHORTCUT_QUICKLAUNCH, // Launched from the quick launch bar.
LM_SHORTCUT_DESKTOP, // Launched from a desktop shortcut.
- LM_SHORTCUT_STARTMENU, // Launched from start menu.
+ LM_SHORTCUT_TASKBAR, // Launched from the taskbar.
LM_LINUX_MAC_BEOS // Other OS buckets start here.
};
@@ -506,10 +507,14 @@ LaunchMode GetLaunchShortcutKind() {
if (si.dwFlags & 0x800) {
if (!si.lpTitle)
return LM_SHORTCUT_NONAME;
- std::wstring shortcut(si.lpTitle);
+ string16 shortcut(si.lpTitle);
// The windows quick launch path is not localized.
- if (shortcut.find(L"\\Quick Launch\\") != std::wstring::npos)
- return LM_SHORTCUT_QUICKLAUNCH;
+ if (shortcut.find(L"\\Quick Launch\\") != string16::npos) {
+ if (base::win::GetVersion() >= base::win::VERSION_WIN7)
+ return LM_SHORTCUT_TASKBAR;
+ else
+ return LM_SHORTCUT_QUICKLAUNCH;
+ }
scoped_ptr<base::Environment> env(base::Environment::Create());
std::string appdata_path;
env->GetVar("USERPROFILE", &appdata_path);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698