OLD | NEW |
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 2379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2390 else if (key_code == ui::VKEY_K) | 2390 else if (key_code == ui::VKEY_K) |
2391 content::RecordAction(UserMetricsAction("Accel_FocusSearch_K")); | 2391 content::RecordAction(UserMetricsAction("Accel_FocusSearch_K")); |
2392 break; | 2392 break; |
2393 default: | 2393 default: |
2394 // Do nothing. | 2394 // Do nothing. |
2395 break; | 2395 break; |
2396 } | 2396 } |
2397 #endif | 2397 #endif |
2398 } | 2398 } |
2399 | 2399 |
2400 void BrowserView::ShowAvatarBubble(WebContents* web_contents, | |
2401 const gfx::Rect& rect) { | |
2402 gfx::Point origin(rect.origin()); | |
2403 views::View::ConvertPointToScreen(GetTabContentsContainerView(), &origin); | |
2404 gfx::Rect bounds(origin, rect.size()); | |
2405 | |
2406 AvatarMenuBubbleView::ShowBubble( | |
2407 this, views::BubbleBorder::TOP_RIGHT, views::BubbleBorder::PAINT_NORMAL, | |
2408 views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE, bounds, browser_.get()); | |
2409 } | |
2410 | |
2411 void BrowserView::ShowAvatarBubbleFromAvatarButton( | 2400 void BrowserView::ShowAvatarBubbleFromAvatarButton( |
2412 AvatarBubbleMode mode, | 2401 AvatarBubbleMode mode, |
2413 const signin::ManageAccountsParams& manage_accounts_params) { | 2402 const signin::ManageAccountsParams& manage_accounts_params) { |
2414 views::BubbleBorder::Arrow arrow = views::BubbleBorder::TOP_RIGHT; | 2403 views::BubbleBorder::Arrow arrow = views::BubbleBorder::TOP_RIGHT; |
2415 views::BubbleBorder::BubbleAlignment alignment = | 2404 views::BubbleBorder::BubbleAlignment alignment = |
2416 views::BubbleBorder::ALIGN_ARROW_TO_MID_ANCHOR; | 2405 views::BubbleBorder::ALIGN_ARROW_TO_MID_ANCHOR; |
2417 views::View* anchor_view = frame_->GetAvatarMenuButton(); | 2406 views::View* anchor_view = frame_->GetAvatarMenuButton(); |
2418 if (!anchor_view) | 2407 if (!anchor_view) |
2419 anchor_view = toolbar_->app_menu(); | 2408 anchor_view = toolbar_->app_menu(); |
2420 else if (!frame_->GetAvatarMenuButton()->button_on_right()) | 2409 else if (!frame_->GetAvatarMenuButton()->button_on_right()) |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2524 !GetLocationBar()->GetOmniboxView()->model()->popup_model()->IsOpen()) { | 2513 !GetLocationBar()->GetOmniboxView()->model()->popup_model()->IsOpen()) { |
2525 gfx::Point icon_bottom( | 2514 gfx::Point icon_bottom( |
2526 toolbar_->location_bar()->GetLocationBarAnchorPoint()); | 2515 toolbar_->location_bar()->GetLocationBarAnchorPoint()); |
2527 ConvertPointToTarget(toolbar_->location_bar(), this, &icon_bottom); | 2516 ConvertPointToTarget(toolbar_->location_bar(), this, &icon_bottom); |
2528 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(nullptr)); | 2517 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(nullptr)); |
2529 ConvertPointToTarget(infobar_container_, this, &infobar_top); | 2518 ConvertPointToTarget(infobar_container_, this, &infobar_top); |
2530 top_arrow_height = infobar_top.y() - icon_bottom.y(); | 2519 top_arrow_height = infobar_top.y() - icon_bottom.y(); |
2531 } | 2520 } |
2532 return top_arrow_height; | 2521 return top_arrow_height; |
2533 } | 2522 } |
OLD | NEW |