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

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

Issue 657023008: Add a new field "source" in launchData of chrome.app.runtime.onLaunched() to trace launch source. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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/chrome_pages.h" 5 #include "chrome/browser/ui/chrome_pages.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 void ShowHelpImpl(Browser* browser, 72 void ShowHelpImpl(Browser* browser,
73 Profile* profile, 73 Profile* profile,
74 HostDesktopType host_desktop_type, 74 HostDesktopType host_desktop_type,
75 HelpSource source) { 75 HelpSource source) {
76 content::RecordAction(UserMetricsAction("ShowHelpTab")); 76 content::RecordAction(UserMetricsAction("ShowHelpTab"));
77 #if defined(OS_CHROMEOS) && defined(OFFICIAL_BUILD) 77 #if defined(OS_CHROMEOS) && defined(OFFICIAL_BUILD)
78 const extensions::Extension* extension = 78 const extensions::Extension* extension =
79 extensions::ExtensionRegistry::Get(profile)->GetExtensionById( 79 extensions::ExtensionRegistry::Get(profile)->GetExtensionById(
80 genius_app::kGeniusAppId, 80 genius_app::kGeniusAppId,
81 extensions::ExtensionRegistry::EVERYTHING); 81 extensions::ExtensionRegistry::EVERYTHING);
82 OpenApplication(AppLaunchParams(profile, extension, 0, host_desktop_type)); 82 AppLaunchParams params(profile, extension, 0, host_desktop_type);
83 switch (source) {
84 case HELP_SOURCE_KEYBOARD:
85 params.source = extensions::SOURCE_KEYBOARD;
86 break;
87 case HELP_SOURCE_MENU:
88 params.source = extensions::SOURCE_SYSTEM_TRAY;
89 break;
90 case HELP_SOURCE_WEBUI:
91 params.source = extensions::SOURCE_ABOUT_PAGE;
92 break;
93 }
94 OpenApplication(params);
83 #else 95 #else
84 GURL url; 96 GURL url;
85 switch (source) { 97 switch (source) {
86 case HELP_SOURCE_KEYBOARD: 98 case HELP_SOURCE_KEYBOARD:
87 url = GURL(kChromeHelpViaKeyboardURL); 99 url = GURL(kChromeHelpViaKeyboardURL);
88 break; 100 break;
89 case HELP_SOURCE_MENU: 101 case HELP_SOURCE_MENU:
90 url = GURL(kChromeHelpViaMenuURL); 102 url = GURL(kChromeHelpViaMenuURL);
91 break; 103 break;
92 case HELP_SOURCE_WEBUI: 104 case HELP_SOURCE_WEBUI:
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 original_profile, chrome::HOST_DESKTOP_TYPE_NATIVE)); 331 original_profile, chrome::HOST_DESKTOP_TYPE_NATIVE));
320 browser = displayer->browser(); 332 browser = displayer->browser();
321 } 333 }
322 334
323 NavigateToSingletonTab(browser, GURL(signin::GetPromoURL(source, false))); 335 NavigateToSingletonTab(browser, GURL(signin::GetPromoURL(source, false)));
324 DCHECK_GT(browser->tab_strip_model()->count(), 0); 336 DCHECK_GT(browser->tab_strip_model()->count(), 0);
325 } 337 }
326 } 338 }
327 339
328 } // namespace chrome 340 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698