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

Unified Diff: chrome/browser/ui/webui/ntp/ntp_login_handler.cc

Issue 776423002: The Apps ntp page should not display an avatar menu when clicking on the username. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/views/frame/browser_view.cc ('k') | chrome/test/base/test_browser_window.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
}
« no previous file with comments | « chrome/browser/ui/views/frame/browser_view.cc ('k') | chrome/test/base/test_browser_window.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698