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 <stdint.h> | 7 #include <stdint.h> |
8 #include <algorithm> | 8 #include <algorithm> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 2537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2548 signin_metrics::AccessPoint access_point) { | 2548 signin_metrics::AccessPoint access_point) { |
2549 #if defined(FRAME_AVATAR_BUTTON) | 2549 #if defined(FRAME_AVATAR_BUTTON) |
2550 // Do not show avatar bubble if there is no avatar menu button. | 2550 // Do not show avatar bubble if there is no avatar menu button. |
2551 if (!frame_->GetNewAvatarMenuButton()) | 2551 if (!frame_->GetNewAvatarMenuButton()) |
2552 return; | 2552 return; |
2553 | 2553 |
2554 profiles::BubbleViewMode bubble_view_mode; | 2554 profiles::BubbleViewMode bubble_view_mode; |
2555 profiles::TutorialMode tutorial_mode; | 2555 profiles::TutorialMode tutorial_mode; |
2556 profiles::BubbleViewModeFromAvatarBubbleMode(mode, &bubble_view_mode, | 2556 profiles::BubbleViewModeFromAvatarBubbleMode(mode, &bubble_view_mode, |
2557 &tutorial_mode); | 2557 &tutorial_mode); |
2558 | |
2559 if (SigninViewController::ShouldShowModalSigninForMode(bubble_view_mode)) { | 2558 if (SigninViewController::ShouldShowModalSigninForMode(bubble_view_mode)) { |
2560 ShowModalSigninWindow(mode, access_point); | 2559 ShowModalSigninWindow(mode, access_point); |
2561 } else { | 2560 } else { |
2562 ProfileChooserView::ShowBubble( | 2561 ProfileChooserView::ShowBubble( |
2563 bubble_view_mode, tutorial_mode, manage_accounts_params, access_point, | 2562 bubble_view_mode, tutorial_mode, manage_accounts_params, access_point, |
2564 frame_->GetNewAvatarMenuButton(), views::BubbleBorder::TOP_RIGHT, | 2563 frame_->GetNewAvatarMenuButton(), views::BubbleBorder::TOP_RIGHT, |
2565 views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE, browser()); | 2564 views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE, browser()); |
2566 ProfileMetrics::LogProfileOpenMethod(ProfileMetrics::ICON_AVATAR_BUBBLE); | 2565 ProfileMetrics::LogProfileOpenMethod(ProfileMetrics::ICON_AVATAR_BUBBLE); |
2567 } | 2566 } |
2568 #else | 2567 #else |
2569 NOTREACHED(); | 2568 NOTREACHED(); |
2570 #endif | 2569 #endif |
2571 } | 2570 } |
2572 | 2571 |
| 2572 void BrowserView::CloseModalSigninWindow() { |
| 2573 signin_view_controller_.CloseModalSignin(); |
| 2574 } |
| 2575 |
2573 void BrowserView::ShowModalSigninWindow( | 2576 void BrowserView::ShowModalSigninWindow( |
2574 AvatarBubbleMode mode, | 2577 AvatarBubbleMode mode, |
2575 signin_metrics::AccessPoint access_point) { | 2578 signin_metrics::AccessPoint access_point) { |
2576 profiles::BubbleViewMode bubble_view_mode; | 2579 profiles::BubbleViewMode bubble_view_mode; |
2577 profiles::TutorialMode tutorial_mode; | 2580 profiles::TutorialMode tutorial_mode; |
2578 profiles::BubbleViewModeFromAvatarBubbleMode(mode, &bubble_view_mode, | 2581 profiles::BubbleViewModeFromAvatarBubbleMode(mode, &bubble_view_mode, |
2579 &tutorial_mode); | 2582 &tutorial_mode); |
2580 signin_view_controller_.ShowModalSignin(bubble_view_mode, browser(), | 2583 signin_view_controller_.ShowModalSignin(bubble_view_mode, browser(), |
2581 access_point); | 2584 access_point); |
2582 } | 2585 } |
2583 | 2586 |
2584 void BrowserView::CloseModalSigninWindow() { | 2587 void BrowserView::ShowModalSyncConfirmationWindow() { |
2585 signin_view_controller_.CloseModalSignin(); | 2588 signin_view_controller_.ShowModalSyncConfirmationDialog(browser()); |
2586 } | 2589 } |
2587 | 2590 |
2588 int BrowserView::GetRenderViewHeightInsetWithDetachedBookmarkBar() { | 2591 int BrowserView::GetRenderViewHeightInsetWithDetachedBookmarkBar() { |
2589 if (browser_->bookmark_bar_state() != BookmarkBar::DETACHED || | 2592 if (browser_->bookmark_bar_state() != BookmarkBar::DETACHED || |
2590 !bookmark_bar_view_ || !bookmark_bar_view_->IsDetached()) { | 2593 !bookmark_bar_view_ || !bookmark_bar_view_->IsDetached()) { |
2591 return 0; | 2594 return 0; |
2592 } | 2595 } |
2593 // Don't use bookmark_bar_view_->height() which won't be the final height if | 2596 // Don't use bookmark_bar_view_->height() which won't be the final height if |
2594 // the bookmark bar is animating. | 2597 // the bookmark bar is animating. |
2595 return chrome::kNTPBookmarkBarHeight - | 2598 return chrome::kNTPBookmarkBarHeight - |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2684 return immersive_mode_controller()->IsEnabled(); | 2687 return immersive_mode_controller()->IsEnabled(); |
2685 } | 2688 } |
2686 | 2689 |
2687 views::Widget* BrowserView::GetBubbleAssociatedWidget() { | 2690 views::Widget* BrowserView::GetBubbleAssociatedWidget() { |
2688 return GetWidget(); | 2691 return GetWidget(); |
2689 } | 2692 } |
2690 | 2693 |
2691 gfx::Rect BrowserView::GetTopContainerBoundsInScreen() { | 2694 gfx::Rect BrowserView::GetTopContainerBoundsInScreen() { |
2692 return top_container_->GetBoundsInScreen(); | 2695 return top_container_->GetBoundsInScreen(); |
2693 } | 2696 } |
OLD | NEW |