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

Side by Side Diff: chrome/browser/ui/views/frame/browser_view.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 unified diff | Download patch
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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/views/frame/browser_view.h" 5 #include "chrome/browser/ui/views/frame/browser_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 2381 matching lines...) Expand 10 before | Expand all | Expand 10 after
2392 else if (key_code == ui::VKEY_K) 2392 else if (key_code == ui::VKEY_K)
2393 content::RecordAction(UserMetricsAction("Accel_FocusSearch_K")); 2393 content::RecordAction(UserMetricsAction("Accel_FocusSearch_K"));
2394 break; 2394 break;
2395 default: 2395 default:
2396 // Do nothing. 2396 // Do nothing.
2397 break; 2397 break;
2398 } 2398 }
2399 #endif 2399 #endif
2400 } 2400 }
2401 2401
2402 void BrowserView::ShowAvatarBubble(WebContents* web_contents,
2403 const gfx::Rect& rect) {
2404 gfx::Point origin(rect.origin());
2405 views::View::ConvertPointToScreen(GetTabContentsContainerView(), &origin);
2406 gfx::Rect bounds(origin, rect.size());
2407
2408 AvatarMenuBubbleView::ShowBubble(
2409 this, views::BubbleBorder::TOP_RIGHT, views::BubbleBorder::PAINT_NORMAL,
2410 views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE, bounds, browser_.get());
2411 }
2412
2413 void BrowserView::ShowAvatarBubbleFromAvatarButton( 2402 void BrowserView::ShowAvatarBubbleFromAvatarButton(
2414 AvatarBubbleMode mode, 2403 AvatarBubbleMode mode,
2415 const signin::ManageAccountsParams& manage_accounts_params) { 2404 const signin::ManageAccountsParams& manage_accounts_params) {
2416 views::BubbleBorder::Arrow arrow = views::BubbleBorder::TOP_RIGHT; 2405 views::BubbleBorder::Arrow arrow = views::BubbleBorder::TOP_RIGHT;
2417 views::BubbleBorder::BubbleAlignment alignment = 2406 views::BubbleBorder::BubbleAlignment alignment =
2418 views::BubbleBorder::ALIGN_ARROW_TO_MID_ANCHOR; 2407 views::BubbleBorder::ALIGN_ARROW_TO_MID_ANCHOR;
2419 views::View* anchor_view = frame_->GetAvatarMenuButton(); 2408 views::View* anchor_view = frame_->GetAvatarMenuButton();
2420 if (!anchor_view) 2409 if (!anchor_view)
2421 anchor_view = toolbar_->app_menu(); 2410 anchor_view = toolbar_->app_menu();
2422 else if (!frame_->GetAvatarMenuButton()->button_on_right()) 2411 else if (!frame_->GetAvatarMenuButton()->button_on_right())
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
2526 !GetLocationBar()->GetOmniboxView()->model()->popup_model()->IsOpen()) { 2515 !GetLocationBar()->GetOmniboxView()->model()->popup_model()->IsOpen()) {
2527 gfx::Point icon_bottom( 2516 gfx::Point icon_bottom(
2528 toolbar_->location_bar()->GetLocationBarAnchorPoint()); 2517 toolbar_->location_bar()->GetLocationBarAnchorPoint());
2529 ConvertPointToTarget(toolbar_->location_bar(), this, &icon_bottom); 2518 ConvertPointToTarget(toolbar_->location_bar(), this, &icon_bottom);
2530 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(nullptr)); 2519 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(nullptr));
2531 ConvertPointToTarget(infobar_container_, this, &infobar_top); 2520 ConvertPointToTarget(infobar_container_, this, &infobar_top);
2532 top_arrow_height = infobar_top.y() - icon_bottom.y(); 2521 top_arrow_height = infobar_top.y() - icon_bottom.y();
2533 } 2522 }
2534 return top_arrow_height; 2523 return top_arrow_height;
2535 } 2524 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698