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 2490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2501 gfx::Rect bounds(origin, anchor_view->size()); | 2501 gfx::Rect bounds(origin, anchor_view->size()); |
2502 views::BubbleBorder::ArrowPaintType arrow_paint_type = | 2502 views::BubbleBorder::ArrowPaintType arrow_paint_type = |
2503 ShouldHideUIForFullscreen() ? views::BubbleBorder::PAINT_TRANSPARENT : | 2503 ShouldHideUIForFullscreen() ? views::BubbleBorder::PAINT_TRANSPARENT : |
2504 views::BubbleBorder::PAINT_NORMAL; | 2504 views::BubbleBorder::PAINT_NORMAL; |
2505 AvatarMenuBubbleView::ShowBubble(anchor_view, arrow, arrow_paint_type, | 2505 AvatarMenuBubbleView::ShowBubble(anchor_view, arrow, arrow_paint_type, |
2506 alignment, bounds, browser()); | 2506 alignment, bounds, browser()); |
2507 } | 2507 } |
2508 ProfileMetrics::LogProfileOpenMethod(ProfileMetrics::ICON_AVATAR_BUBBLE); | 2508 ProfileMetrics::LogProfileOpenMethod(ProfileMetrics::ICON_AVATAR_BUBBLE); |
2509 } | 2509 } |
2510 | 2510 |
2511 void BrowserView::CloseAvatarBubbleFromAvatarButton() { | |
2512 if (switches::IsNewAvatarMenu()) | |
2513 ProfileChooserView::Hide(); | |
2514 else | |
2515 AvatarMenuBubbleView::Hide(); | |
2516 } | |
2517 | |
2518 int BrowserView::GetRenderViewHeightInsetWithDetachedBookmarkBar() { | 2511 int BrowserView::GetRenderViewHeightInsetWithDetachedBookmarkBar() { |
2519 if (browser_->bookmark_bar_state() != BookmarkBar::DETACHED || | 2512 if (browser_->bookmark_bar_state() != BookmarkBar::DETACHED || |
2520 !bookmark_bar_view_.get() || !bookmark_bar_view_->IsDetached()) { | 2513 !bookmark_bar_view_.get() || !bookmark_bar_view_->IsDetached()) { |
2521 return 0; | 2514 return 0; |
2522 } | 2515 } |
2523 // Don't use bookmark_bar_view_->height() which won't be the final height if | 2516 // Don't use bookmark_bar_view_->height() which won't be the final height if |
2524 // the bookmark bar is animating. | 2517 // the bookmark bar is animating. |
2525 return chrome::kNTPBookmarkBarHeight - | 2518 return chrome::kNTPBookmarkBarHeight - |
2526 bookmark_bar_view_->GetFullyDetachedToolbarOverlap(); | 2519 bookmark_bar_view_->GetFullyDetachedToolbarOverlap(); |
2527 } | 2520 } |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2613 return immersive_mode_controller()->IsEnabled(); | 2606 return immersive_mode_controller()->IsEnabled(); |
2614 } | 2607 } |
2615 | 2608 |
2616 views::Widget* BrowserView::GetBubbleAssociatedWidget() { | 2609 views::Widget* BrowserView::GetBubbleAssociatedWidget() { |
2617 return GetWidget(); | 2610 return GetWidget(); |
2618 } | 2611 } |
2619 | 2612 |
2620 gfx::Rect BrowserView::GetTopContainerBoundsInScreen() { | 2613 gfx::Rect BrowserView::GetTopContainerBoundsInScreen() { |
2621 return top_container_->GetBoundsInScreen(); | 2614 return top_container_->GetBoundsInScreen(); |
2622 } | 2615 } |
OLD | NEW |