Chromium Code Reviews| Index: chrome/browser/ui/webui/ntp/ntp_login_handler.cc |
| diff --git a/chrome/browser/ui/webui/ntp/ntp_login_handler.cc b/chrome/browser/ui/webui/ntp/ntp_login_handler.cc |
| index 16ff75ac73bc22470c52c986a028ec0524a7976f..b00682c266020db1acb4c06600e63af2ded056ec 100644 |
| --- a/chrome/browser/ui/webui/ntp/ntp_login_handler.cc |
| +++ b/chrome/browser/ui/webui/ntp/ntp_login_handler.cc |
| @@ -132,37 +132,17 @@ void NTPLoginHandler::HandleShowSyncLoginUI(const base::ListValue* args) { |
| if (!browser) |
| return; |
| - if (username.empty()) { |
| - // The user isn't signed in, show the sign in promo. |
| - if (signin::ShouldShowPromo(profile)) { |
| - signin::Source source = |
| - (web_contents->GetURL().spec() == chrome::kChromeUIAppsURL) ? |
| - signin::SOURCE_APPS_PAGE_LINK : |
| - signin::SOURCE_NTP_LINK; |
| - chrome::ShowBrowserSignin(browser, source); |
| - RecordInHistogram(NTP_SIGN_IN_PROMO_CLICKED); |
| - } |
| - } else if (args->GetSize() == 4) { |
| - // The user is signed in, show the profiles menu. |
| - double x = 0; |
| - double y = 0; |
| - double width = 0; |
| - double height = 0; |
| - bool success = args->GetDouble(0, &x); |
| - DCHECK(success); |
| - success = args->GetDouble(1, &y); |
| - DCHECK(success); |
| - success = args->GetDouble(2, &width); |
| - DCHECK(success); |
| - success = args->GetDouble(3, &height); |
| - DCHECK(success); |
| - |
| - double zoom = content::ZoomLevelToZoomFactor( |
| - ZoomController::FromWebContents(web_contents)->GetZoomLevel()); |
| - gfx::Rect rect(x * zoom, y * zoom, width * zoom, height * zoom); |
| + if (!username.empty()) |
| + return; |
| - browser->window()->ShowAvatarBubble(web_ui()->GetWebContents(), rect); |
| - ProfileMetrics::LogProfileOpenMethod(ProfileMetrics::NTP_AVATAR_BUBBLE); |
| + // The user isn't signed in, show the sign in promo. |
| + if (signin::ShouldShowPromo(profile)) { |
| + signin::Source source = |
| + (web_contents->GetURL().spec() == chrome::kChromeUIAppsURL) ? |
|
Dan Beam
2014/12/11 01:40:19
nit: unnecessary ()
noms (inactive)
2014/12/12 18:19:30
Done.
|
| + signin::SOURCE_APPS_PAGE_LINK : |
| + signin::SOURCE_NTP_LINK; |
| + chrome::ShowBrowserSignin(browser, source); |
| + RecordInHistogram(NTP_SIGN_IN_PROMO_CLICKED); |
| } |
| } |