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

Side by Side Diff: chrome/browser/ui/webui/app_launcher_login_handler.cc

Issue 2886933003: Use stricter type checking in UMA_HISTOGRAM_ENUMERATION (Closed)
Patch Set: simplify type checking Created 3 years, 5 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/webui/app_launcher_login_handler.h" 5 #include "chrome/browser/ui/webui/app_launcher_login_handler.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 132
133 // The user isn't signed in, show the sign in promo. 133 // The user isn't signed in, show the sign in promo.
134 signin_metrics::AccessPoint access_point = 134 signin_metrics::AccessPoint access_point =
135 web_contents->GetURL().spec() == chrome::kChromeUIAppsURL 135 web_contents->GetURL().spec() == chrome::kChromeUIAppsURL
136 ? signin_metrics::AccessPoint::ACCESS_POINT_APPS_PAGE_LINK 136 ? signin_metrics::AccessPoint::ACCESS_POINT_APPS_PAGE_LINK
137 : signin_metrics::AccessPoint::ACCESS_POINT_NTP_LINK; 137 : signin_metrics::AccessPoint::ACCESS_POINT_NTP_LINK;
138 chrome::ShowBrowserSignin(browser, access_point); 138 chrome::ShowBrowserSignin(browser, access_point);
139 RecordInHistogram(NTP_SIGN_IN_PROMO_CLICKED); 139 RecordInHistogram(NTP_SIGN_IN_PROMO_CLICKED);
140 } 140 }
141 141
142 void AppLauncherLoginHandler::RecordInHistogram(int type) { 142 void AppLauncherLoginHandler::RecordInHistogram(NTPSignInPromoBuckets type) {
143 // Invalid type to record. 143 UMA_HISTOGRAM_ENUMERATION("SyncPromo.NTPPromo", type,
144 if (type < NTP_SIGN_IN_PROMO_VIEWED || 144 NTP_SIGN_IN_PROMO_BUCKET_BOUNDARY);
145 type > NTP_SIGN_IN_PROMO_CLICKED) {
146 NOTREACHED();
147 } else {
148 UMA_HISTOGRAM_ENUMERATION("SyncPromo.NTPPromo", type,
149 NTP_SIGN_IN_PROMO_BUCKET_BOUNDARY);
150 }
151 } 145 }
152 146
153 void AppLauncherLoginHandler::HandleLoginMessageSeen( 147 void AppLauncherLoginHandler::HandleLoginMessageSeen(
154 const base::ListValue* args) { 148 const base::ListValue* args) {
155 Profile::FromWebUI(web_ui())->GetPrefs()->SetBoolean( 149 Profile::FromWebUI(web_ui())->GetPrefs()->SetBoolean(
156 prefs::kSignInPromoShowNTPBubble, false); 150 prefs::kSignInPromoShowNTPBubble, false);
157 } 151 }
158 152
159 void AppLauncherLoginHandler::HandleShowAdvancedLoginUI( 153 void AppLauncherLoginHandler::HandleShowAdvancedLoginUI(
160 const base::ListValue* args) { 154 const base::ListValue* args) {
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 values->SetString("login_status_message", message); 250 values->SetString("login_status_message", message);
257 values->SetString("login_status_url", 251 values->SetString("login_status_url",
258 hide_sync ? std::string() : chrome::kSyncLearnMoreURL); 252 hide_sync ? std::string() : chrome::kSyncLearnMoreURL);
259 values->SetString("login_status_advanced", 253 values->SetString("login_status_advanced",
260 hide_sync ? base::string16() : 254 hide_sync ? base::string16() :
261 l10n_util::GetStringUTF16(IDS_SYNC_PROMO_NTP_BUBBLE_ADVANCED)); 255 l10n_util::GetStringUTF16(IDS_SYNC_PROMO_NTP_BUBBLE_ADVANCED));
262 values->SetString("login_status_dismiss", 256 values->SetString("login_status_dismiss",
263 hide_sync ? base::string16() : 257 hide_sync ? base::string16() :
264 l10n_util::GetStringUTF16(IDS_SYNC_PROMO_NTP_BUBBLE_OK)); 258 l10n_util::GetStringUTF16(IDS_SYNC_PROMO_NTP_BUBBLE_OK));
265 } 259 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/app_launcher_login_handler.h ('k') | chrome/browser/ui/webui/signin/inline_login_handler_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698