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

Unified Diff: chrome/browser/ui/startup/startup_browser_creator.cc

Issue 660813002: [Win] Add a fast profile switcher to the Windows taskbar item. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: commas. commas are important Created 6 years, 1 month 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
Index: chrome/browser/ui/startup/startup_browser_creator.cc
diff --git a/chrome/browser/ui/startup/startup_browser_creator.cc b/chrome/browser/ui/startup/startup_browser_creator.cc
index a32608050b2677f21840a94941507ab76f41f1a9..ca029f9c65880cf50435c1b06e2f9ea7a7d40da1 100644
--- a/chrome/browser/ui/startup/startup_browser_creator.cc
+++ b/chrome/browser/ui/startup/startup_browser_creator.cc
@@ -87,6 +87,10 @@
#include "chrome/browser/web_applications/web_app_mac.h"
#endif
+#if defined(OS_WIN)
+#include "chrome/browser/metrics/jumplist_metrics_win.h"
+#endif
+
#if defined(ENABLE_PRINT_PREVIEW)
#include "chrome/browser/printing/cloud_print/cloud_print_proxy_service.h"
#include "chrome/browser/printing/cloud_print/cloud_print_proxy_service_factory.h"
@@ -627,6 +631,27 @@ bool StartupBrowserCreator::ProcessCmdLineImpl(
return true;
}
+#if defined(OS_WIN)
+ // Log whether this process was a result of an action in the Windows Jumplist.
+ if (command_line.HasSwitch(switches::kWinJumplistAction)) {
+ jumplist::LogJumplistActionFromSwitchValue(
+ command_line.GetSwitchValueASCII(switches::kWinJumplistAction));
+ }
+
+ // If the profile is loaded and the --activate-existing-profile-browser flag
+ // is used, activate one of the profile's browser windows, if one exists.
+ // Continuing to process the command line is not needed, since this will
+ // end up opening a new browser window.
+ if (command_line.HasSwitch(switches::kActivateExistingProfileBrowser)) {
+ Browser* browser = chrome::FindTabbedBrowser(
+ last_used_profile, false, chrome::HOST_DESKTOP_TYPE_NATIVE);
+ if (browser) {
+ browser->window()->Activate();
+ return true;
+ }
+ }
+#endif
+
VLOG(2) << "ProcessCmdLineImpl: PLACE 5";
chrome::startup::IsProcessStartup is_process_startup = process_startup ?
chrome::startup::IS_PROCESS_STARTUP :
« no previous file with comments | « chrome/browser/profiles/profile_avatar_icon_util.cc ('k') | chrome/browser/ui/startup/startup_browser_creator_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698