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

Side by Side Diff: chrome/browser/ui/webui/ntp/new_tab_page_sync_handler.cc

Issue 1473543002: Implement newly designed sign-in related histograms for desktop platorms. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: format Created 5 years 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/ntp/new_tab_page_sync_handler.h" 5 #include "chrome/browser/ui/webui/ntp/new_tab_page_sync_handler.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 } 123 }
124 124
125 void NewTabPageSyncHandler::HandleSyncLinkClicked(const base::ListValue* args) { 125 void NewTabPageSyncHandler::HandleSyncLinkClicked(const base::ListValue* args) {
126 DCHECK(!waiting_for_initial_page_load_); 126 DCHECK(!waiting_for_initial_page_load_);
127 if (!sync_service_ || !sync_service_->IsSyncAllowedByFlag()) 127 if (!sync_service_ || !sync_service_->IsSyncAllowedByFlag())
128 return; 128 return;
129 Browser* browser = 129 Browser* browser =
130 chrome::FindBrowserWithWebContents(web_ui()->GetWebContents()); 130 chrome::FindBrowserWithWebContents(web_ui()->GetWebContents());
131 if (!browser || browser->IsAttemptingToCloseBrowser()) 131 if (!browser || browser->IsAttemptingToCloseBrowser())
132 return; 132 return;
133 chrome::ShowBrowserSignin(browser, signin_metrics::SOURCE_NTP_LINK); 133 chrome::ShowBrowserSignin(browser,
134 signin_metrics::AccessPoint::ACCESS_POINT_NTP_LINK);
134 135
135 if (sync_service_->HasSyncSetupCompleted()) { 136 if (sync_service_->HasSyncSetupCompleted()) {
136 base::string16 user = base::UTF8ToUTF16( 137 base::string16 user = base::UTF8ToUTF16(
137 SigninManagerFactory::GetForProfile(Profile::FromWebUI(web_ui())) 138 SigninManagerFactory::GetForProfile(Profile::FromWebUI(web_ui()))
138 ->GetAuthenticatedAccountInfo() 139 ->GetAuthenticatedAccountInfo()
139 .email); 140 .email);
140 base::DictionaryValue value; 141 base::DictionaryValue value;
141 value.SetString("syncEnabledMessage", 142 value.SetString("syncEnabledMessage",
142 l10n_util::GetStringFUTF16(IDS_SYNC_NTP_SYNCED_TO, 143 l10n_util::GetStringFUTF16(IDS_SYNC_NTP_SYNCED_TO,
143 user)); 144 user));
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 if (linkurl.empty()) { 197 if (linkurl.empty()) {
197 value.SetBoolean("linkurlisset", false); 198 value.SetBoolean("linkurlisset", false);
198 } else { 199 } else {
199 value.SetBoolean("linkurlisset", true); 200 value.SetBoolean("linkurlisset", true);
200 value.SetString("linkurl", linkurl); 201 value.SetString("linkurl", linkurl);
201 } 202 }
202 } 203 }
203 } 204 }
204 web_ui()->CallJavascriptFunction("ntp.syncMessageChanged", value); 205 web_ui()->CallJavascriptFunction("ntp.syncMessageChanged", value);
205 } 206 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698