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