| 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 2392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2403 arrow = views::BubbleBorder::TOP_LEFT; | 2403 arrow = views::BubbleBorder::TOP_LEFT; |
| 2404 | 2404 |
| 2405 if (switches::IsNewAvatarMenu()) { | 2405 if (switches::IsNewAvatarMenu()) { |
| 2406 NewAvatarButton* button = frame_->GetNewAvatarMenuButton(); | 2406 NewAvatarButton* button = frame_->GetNewAvatarMenuButton(); |
| 2407 if (button) { | 2407 if (button) { |
| 2408 anchor_view = button; | 2408 anchor_view = button; |
| 2409 arrow = views::BubbleBorder::TOP_RIGHT; | 2409 arrow = views::BubbleBorder::TOP_RIGHT; |
| 2410 alignment = views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE; | 2410 alignment = views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE; |
| 2411 } | 2411 } |
| 2412 | 2412 |
| 2413 profiles::BubbleViewMode bubble_view_mode; |
| 2414 profiles::TutorialMode tutorial_mode; |
| 2415 profiles::BubbleViewModeFromAvatarBubbleMode( |
| 2416 mode, &bubble_view_mode, &tutorial_mode); |
| 2413 ProfileChooserView::ShowBubble( | 2417 ProfileChooserView::ShowBubble( |
| 2414 profiles::BubbleViewModeFromAvatarBubbleMode(mode), | 2418 bubble_view_mode, tutorial_mode, |
| 2415 manage_accounts_params, anchor_view, arrow, alignment, browser()); | 2419 manage_accounts_params, anchor_view, arrow, alignment, browser()); |
| 2416 } else { | 2420 } else { |
| 2417 gfx::Point origin; | 2421 gfx::Point origin; |
| 2418 views::View::ConvertPointToScreen(anchor_view, &origin); | 2422 views::View::ConvertPointToScreen(anchor_view, &origin); |
| 2419 gfx::Rect bounds(origin, anchor_view->size()); | 2423 gfx::Rect bounds(origin, anchor_view->size()); |
| 2420 views::BubbleBorder::ArrowPaintType arrow_paint_type = | 2424 views::BubbleBorder::ArrowPaintType arrow_paint_type = |
| 2421 ShouldHideUIForFullscreen() ? views::BubbleBorder::PAINT_TRANSPARENT : | 2425 ShouldHideUIForFullscreen() ? views::BubbleBorder::PAINT_TRANSPARENT : |
| 2422 views::BubbleBorder::PAINT_NORMAL; | 2426 views::BubbleBorder::PAINT_NORMAL; |
| 2423 AvatarMenuBubbleView::ShowBubble(anchor_view, arrow, arrow_paint_type, | 2427 AvatarMenuBubbleView::ShowBubble(anchor_view, arrow, arrow_paint_type, |
| 2424 alignment, bounds, browser()); | 2428 alignment, bounds, browser()); |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2547 !GetLocationBar()->GetOmniboxView()->model()->popup_model()->IsOpen()) { | 2551 !GetLocationBar()->GetOmniboxView()->model()->popup_model()->IsOpen()) { |
| 2548 gfx::Point icon_bottom( | 2552 gfx::Point icon_bottom( |
| 2549 toolbar_->location_bar()->GetLocationBarAnchorPoint()); | 2553 toolbar_->location_bar()->GetLocationBarAnchorPoint()); |
| 2550 ConvertPointToTarget(toolbar_->location_bar(), this, &icon_bottom); | 2554 ConvertPointToTarget(toolbar_->location_bar(), this, &icon_bottom); |
| 2551 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(NULL)); | 2555 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(NULL)); |
| 2552 ConvertPointToTarget(infobar_container_, this, &infobar_top); | 2556 ConvertPointToTarget(infobar_container_, this, &infobar_top); |
| 2553 top_arrow_height = infobar_top.y() - icon_bottom.y(); | 2557 top_arrow_height = infobar_top.y() - icon_bottom.y(); |
| 2554 } | 2558 } |
| 2555 return top_arrow_height; | 2559 return top_arrow_height; |
| 2556 } | 2560 } |
| OLD | NEW |