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

Side by Side Diff: chrome/browser/ui/browser_init.cc

Issue 9582008: Revert r124635 "Record taskbar launch mode in UMA histogram" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/browser_init.h" 5 #include "chrome/browser/ui/browser_init.h"
6 6
7 #include <algorithm> // For max(). 7 #include <algorithm> // For max().
8 #include <set> 8 #include <set>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 #if defined(TOOLKIT_USES_GTK) 120 #if defined(TOOLKIT_USES_GTK)
121 #include "chrome/browser/chromeos/legacy_window_manager/wm_message_listener.h" 121 #include "chrome/browser/chromeos/legacy_window_manager/wm_message_listener.h"
122 #endif 122 #endif
123 #endif 123 #endif
124 124
125 #if defined(TOOLKIT_VIEWS) && defined(OS_LINUX) 125 #if defined(TOOLKIT_VIEWS) && defined(OS_LINUX)
126 #include "ui/base/touch/touch_factory.h" 126 #include "ui/base/touch/touch_factory.h"
127 #endif 127 #endif
128 128
129 #if defined(OS_WIN) 129 #if defined(OS_WIN)
130 #include "base/win/windows_version.h"
131 #include "chrome/installer/util/auto_launch_util.h" 130 #include "chrome/installer/util/auto_launch_util.h"
132 #endif 131 #endif
133 132
134 using content::BrowserThread; 133 using content::BrowserThread;
135 using content::ChildProcessSecurityPolicy; 134 using content::ChildProcessSecurityPolicy;
136 using content::OpenURLParams; 135 using content::OpenURLParams;
137 using content::Referrer; 136 using content::Referrer;
138 using content::WebContents; 137 using content::WebContents;
139 138
140 namespace { 139 namespace {
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after
486 485
487 enum LaunchMode { 486 enum LaunchMode {
488 LM_TO_BE_DECIDED = 0, // Possibly direct launch or via a shortcut. 487 LM_TO_BE_DECIDED = 0, // Possibly direct launch or via a shortcut.
489 LM_AS_WEBAPP, // Launched as a installed web application. 488 LM_AS_WEBAPP, // Launched as a installed web application.
490 LM_WITH_URLS, // Launched with urls in the cmd line. 489 LM_WITH_URLS, // Launched with urls in the cmd line.
491 LM_SHORTCUT_NONE, // Not launched from a shortcut. 490 LM_SHORTCUT_NONE, // Not launched from a shortcut.
492 LM_SHORTCUT_NONAME, // Launched from shortcut but no name available. 491 LM_SHORTCUT_NONAME, // Launched from shortcut but no name available.
493 LM_SHORTCUT_UNKNOWN, // Launched from user-defined shortcut. 492 LM_SHORTCUT_UNKNOWN, // Launched from user-defined shortcut.
494 LM_SHORTCUT_QUICKLAUNCH, // Launched from the quick launch bar. 493 LM_SHORTCUT_QUICKLAUNCH, // Launched from the quick launch bar.
495 LM_SHORTCUT_DESKTOP, // Launched from a desktop shortcut. 494 LM_SHORTCUT_DESKTOP, // Launched from a desktop shortcut.
496 LM_SHORTCUT_TASKBAR, // Launched from the taskbar. 495 LM_SHORTCUT_STARTMENU, // Launched from start menu.
497 LM_LINUX_MAC_BEOS // Other OS buckets start here. 496 LM_LINUX_MAC_BEOS // Other OS buckets start here.
498 }; 497 };
499 498
500 #if defined(OS_WIN) 499 #if defined(OS_WIN)
501 // Undocumented flag in the startup info structure tells us what shortcut was 500 // Undocumented flag in the startup info structure tells us what shortcut was
502 // used to launch the browser. See http://www.catch22.net/tuts/undoc01 for 501 // used to launch the browser. See http://www.catch22.net/tuts/undoc01 for
503 // more information. Confirmed to work on XP, Vista and Win7. 502 // more information. Confirmed to work on XP, Vista and Win7.
504 LaunchMode GetLaunchShortcutKind() { 503 LaunchMode GetLaunchShortcutKind() {
505 STARTUPINFOW si = { sizeof(si) }; 504 STARTUPINFOW si = { sizeof(si) };
506 GetStartupInfoW(&si); 505 GetStartupInfoW(&si);
507 if (si.dwFlags & 0x800) { 506 if (si.dwFlags & 0x800) {
508 if (!si.lpTitle) 507 if (!si.lpTitle)
509 return LM_SHORTCUT_NONAME; 508 return LM_SHORTCUT_NONAME;
510 string16 shortcut(si.lpTitle); 509 std::wstring shortcut(si.lpTitle);
511 // The windows quick launch path is not localized. 510 // The windows quick launch path is not localized.
512 if (shortcut.find(L"\\Quick Launch\\") != string16::npos) { 511 if (shortcut.find(L"\\Quick Launch\\") != std::wstring::npos)
513 if (base::win::GetVersion() >= base::win::VERSION_WIN7) 512 return LM_SHORTCUT_QUICKLAUNCH;
514 return LM_SHORTCUT_TASKBAR;
515 else
516 return LM_SHORTCUT_QUICKLAUNCH;
517 }
518 scoped_ptr<base::Environment> env(base::Environment::Create()); 513 scoped_ptr<base::Environment> env(base::Environment::Create());
519 std::string appdata_path; 514 std::string appdata_path;
520 env->GetVar("USERPROFILE", &appdata_path); 515 env->GetVar("USERPROFILE", &appdata_path);
521 if (!appdata_path.empty() && 516 if (!appdata_path.empty() &&
522 shortcut.find(ASCIIToWide(appdata_path)) != std::wstring::npos) 517 shortcut.find(ASCIIToWide(appdata_path)) != std::wstring::npos)
523 return LM_SHORTCUT_DESKTOP; 518 return LM_SHORTCUT_DESKTOP;
524 return LM_SHORTCUT_UNKNOWN; 519 return LM_SHORTCUT_UNKNOWN;
525 } 520 }
526 return LM_SHORTCUT_NONE; 521 return LM_SHORTCUT_NONE;
527 } 522 }
(...skipping 1397 matching lines...) Expand 10 before | Expand all | Expand 10 after
1925 1920
1926 Profile* profile = ProfileManager::GetLastUsedProfile(); 1921 Profile* profile = ProfileManager::GetLastUsedProfile();
1927 if (!profile) { 1922 if (!profile) {
1928 // We should only be able to get here if the profile already exists and 1923 // We should only be able to get here if the profile already exists and
1929 // has been created. 1924 // has been created.
1930 NOTREACHED(); 1925 NOTREACHED();
1931 return; 1926 return;
1932 } 1927 }
1933 ProcessCmdLineImpl(cmd_line, cur_dir, false, profile, Profiles(), NULL, NULL); 1928 ProcessCmdLineImpl(cmd_line, cur_dir, false, profile, Profiles(), NULL, NULL);
1934 } 1929 }
OLDNEW
« 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