OLD | NEW |
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 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 web_ui()->GetWebContents()->GetURL().spec() == | 213 web_ui()->GetWebContents()->GetURL().spec() == |
214 chrome::kChromeUIAppsURL | 214 chrome::kChromeUIAppsURL |
215 ? base::UserMetricsAction("Signin_Impression_FromAppsPageLink") | 215 ? base::UserMetricsAction("Signin_Impression_FromAppsPageLink") |
216 : base::UserMetricsAction("Signin_Impression_FromNTP")); | 216 : base::UserMetricsAction("Signin_Impression_FromNTP")); |
217 // Record that the user was shown the promo. | 217 // Record that the user was shown the promo. |
218 RecordInHistogram(NTP_SIGN_IN_PROMO_VIEWED); | 218 RecordInHistogram(NTP_SIGN_IN_PROMO_VIEWED); |
219 } | 219 } |
220 #endif | 220 #endif |
221 } | 221 } |
222 | 222 |
223 base::StringValue header_value(header); | 223 base::Value header_value(header); |
224 base::StringValue sub_header_value(sub_header); | 224 base::Value sub_header_value(sub_header); |
225 base::StringValue icon_url_value(icon_url); | 225 base::Value icon_url_value(icon_url); |
226 base::Value is_user_signed_in(!username.empty()); | 226 base::Value is_user_signed_in(!username.empty()); |
227 web_ui()->CallJavascriptFunctionUnsafe("ntp.updateLogin", header_value, | 227 web_ui()->CallJavascriptFunctionUnsafe("ntp.updateLogin", header_value, |
228 sub_header_value, icon_url_value, | 228 sub_header_value, icon_url_value, |
229 is_user_signed_in); | 229 is_user_signed_in); |
230 } | 230 } |
231 | 231 |
232 // static | 232 // static |
233 bool AppLauncherLoginHandler::ShouldShow(Profile* profile) { | 233 bool AppLauncherLoginHandler::ShouldShow(Profile* profile) { |
234 #if defined(OS_CHROMEOS) | 234 #if defined(OS_CHROMEOS) |
235 // For now we don't care about showing sync status on Chrome OS. The promo | 235 // For now we don't care about showing sync status on Chrome OS. The promo |
(...skipping 18 matching lines...) Expand all Loading... |
254 values->SetString("login_status_message", message); | 254 values->SetString("login_status_message", message); |
255 values->SetString("login_status_url", | 255 values->SetString("login_status_url", |
256 hide_sync ? std::string() : chrome::kSyncLearnMoreURL); | 256 hide_sync ? std::string() : chrome::kSyncLearnMoreURL); |
257 values->SetString("login_status_advanced", | 257 values->SetString("login_status_advanced", |
258 hide_sync ? base::string16() : | 258 hide_sync ? base::string16() : |
259 l10n_util::GetStringUTF16(IDS_SYNC_PROMO_NTP_BUBBLE_ADVANCED)); | 259 l10n_util::GetStringUTF16(IDS_SYNC_PROMO_NTP_BUBBLE_ADVANCED)); |
260 values->SetString("login_status_dismiss", | 260 values->SetString("login_status_dismiss", |
261 hide_sync ? base::string16() : | 261 hide_sync ? base::string16() : |
262 l10n_util::GetStringUTF16(IDS_SYNC_PROMO_NTP_BUBBLE_OK)); | 262 l10n_util::GetStringUTF16(IDS_SYNC_PROMO_NTP_BUBBLE_OK)); |
263 } | 263 } |
OLD | NEW |