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