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

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

Issue 2879193004: [Desktop FRE] Fix incorrect emission of histogram (Closed)
Patch Set: Created 3 years, 7 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
« 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_tab_provider.h" 5 #include "chrome/browser/ui/startup/startup_tab_provider.h"
6 6
7 #include "base/metrics/histogram_macros.h" 7 #include "base/metrics/histogram_macros.h"
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 #include "chrome/browser/first_run/first_run.h" 9 #include "chrome/browser/first_run/first_run.h"
10 #include "chrome/browser/profile_resetter/triggered_profile_resetter.h" 10 #include "chrome/browser/profile_resetter/triggered_profile_resetter.h"
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 bool is_default_browser, 164 bool is_default_browser,
165 bool is_supervised_user) { 165 bool is_supervised_user) {
166 StartupTabs tabs; 166 StartupTabs tabs;
167 167
168 if (is_supervised_user) 168 if (is_supervised_user)
169 return tabs; 169 return tabs;
170 170
171 if (set_default_browser_allowed && !has_seen_win10_promo && 171 if (set_default_browser_allowed && !has_seen_win10_promo &&
172 !is_default_browser) { 172 !is_default_browser) {
173 tabs.emplace_back(GetWin10WelcomePageUrl(!is_first_run), false); 173 tabs.emplace_back(GetWin10WelcomePageUrl(!is_first_run), false);
174 } else if (!has_seen_welcome_page && is_signin_allowed && !is_signed_in) { 174 return tabs;
175 tabs.emplace_back(GetWelcomePageUrl(!is_first_run), false);
176 } 175 }
177 return tabs; 176
177 return GetStandardOnboardingTabsForState(is_first_run, has_seen_welcome_page,
178 is_signin_allowed, is_signed_in,
179 is_supervised_user);
178 } 180 }
179 #endif 181 #endif
180 182
181 // static 183 // static
182 StartupTabs StartupTabProviderImpl::GetMasterPrefsTabsForState( 184 StartupTabs StartupTabProviderImpl::GetMasterPrefsTabsForState(
183 bool is_first_run, 185 bool is_first_run,
184 const std::vector<GURL>& first_run_tabs) { 186 const std::vector<GURL>& first_run_tabs) {
185 // Constants: Magic words used by Master Preferences files in place of a URL 187 // Constants: Magic words used by Master Preferences files in place of a URL
186 // host to indicate that internal pages should appear on first run. 188 // host to indicate that internal pages should appear on first run.
187 static constexpr char kNewTabUrlHost[] = "new_tab_page"; 189 static constexpr char kNewTabUrlHost[] = "new_tab_page";
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 StartupTabs StartupTabProviderImpl::GetNewTabPageTabsForState( 240 StartupTabs StartupTabProviderImpl::GetNewTabPageTabsForState(
239 const SessionStartupPref& pref) { 241 const SessionStartupPref& pref) {
240 StartupTabs tabs; 242 StartupTabs tabs;
241 if (pref.type != SessionStartupPref::Type::LAST) 243 if (pref.type != SessionStartupPref::Type::LAST)
242 tabs.emplace_back(GURL(chrome::kChromeUINewTabURL), false); 244 tabs.emplace_back(GURL(chrome::kChromeUINewTabURL), false);
243 return tabs; 245 return tabs;
244 } 246 }
245 247
246 // static 248 // static
247 GURL StartupTabProviderImpl::GetWelcomePageUrl(bool use_later_run_variant) { 249 GURL StartupTabProviderImpl::GetWelcomePageUrl(bool use_later_run_variant) {
248 // Record that the Welcome page was added to the startup url list.
249 UMA_HISTOGRAM_BOOLEAN("Welcome.Win10.NewPromoPageAdded", true);
250 GURL url(chrome::kChromeUIWelcomeURL); 250 GURL url(chrome::kChromeUIWelcomeURL);
251 return use_later_run_variant 251 return use_later_run_variant
252 ? net::AppendQueryParameter(url, "variant", "everywhere") 252 ? net::AppendQueryParameter(url, "variant", "everywhere")
253 : url; 253 : url;
254 } 254 }
255 255
256 #if defined(OS_WIN) 256 #if defined(OS_WIN)
257 // static 257 // static
258 GURL StartupTabProviderImpl::GetWin10WelcomePageUrl( 258 GURL StartupTabProviderImpl::GetWin10WelcomePageUrl(
259 bool use_later_run_variant) { 259 bool use_later_run_variant) {
260 // Record that the Welcome page was added to the startup url list.
261 UMA_HISTOGRAM_BOOLEAN("Welcome.Win10.NewPromoPageAdded", true);
260 GURL url(chrome::kChromeUIWelcomeWin10URL); 262 GURL url(chrome::kChromeUIWelcomeWin10URL);
261 return use_later_run_variant 263 return use_later_run_variant
262 ? net::AppendQueryParameter(url, "text", "faster") 264 ? net::AppendQueryParameter(url, "text", "faster")
263 : url; 265 : url;
264 } 266 }
265 #endif 267 #endif
266 268
267 // static 269 // static
268 GURL StartupTabProviderImpl::GetTriggeredResetSettingsUrl() { 270 GURL StartupTabProviderImpl::GetTriggeredResetSettingsUrl() {
269 return GURL( 271 return GURL(
270 chrome::GetSettingsUrl(chrome::kTriggeredResetProfileSettingsSubPage)); 272 chrome::GetSettingsUrl(chrome::kTriggeredResetProfileSettingsSubPage));
271 } 273 }
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