Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(38)

Side by Side Diff: chrome/browser/ui/views/frame/browser_view.cc

Issue 1413533009: Make the new Gaia password separated signin flow modal. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add DCHECK Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 2539 matching lines...) Expand 10 before | Expand all | Expand 10 after
2550 #endif 2550 #endif
2551 } 2551 }
2552 2552
2553 void BrowserView::ShowAvatarBubbleFromAvatarButton( 2553 void BrowserView::ShowAvatarBubbleFromAvatarButton(
2554 AvatarBubbleMode mode, 2554 AvatarBubbleMode mode,
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 profiles::BubbleViewMode bubble_view_mode; 2561 profiles::BubbleViewMode bubble_view_mode;
2561 profiles::TutorialMode tutorial_mode; 2562 profiles::TutorialMode tutorial_mode;
2562 profiles::BubbleViewModeFromAvatarBubbleMode(mode, &bubble_view_mode, 2563 profiles::BubbleViewModeFromAvatarBubbleMode(mode, &bubble_view_mode,
2563 &tutorial_mode); 2564 &tutorial_mode);
2564 ProfileChooserView::ShowBubble( 2565
2565 bubble_view_mode, tutorial_mode, manage_accounts_params, 2566 if (SigninViewController::ShouldShowModalSigninForMode(bubble_view_mode)) {
2566 frame_->GetNewAvatarMenuButton(), views::BubbleBorder::TOP_RIGHT, 2567 ShowModalSigninWindow(mode);
2567 views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE, browser()); 2568 } else {
2568 ProfileMetrics::LogProfileOpenMethod(ProfileMetrics::ICON_AVATAR_BUBBLE); 2569 ProfileChooserView::ShowBubble(
2570 bubble_view_mode, tutorial_mode, manage_accounts_params,
2571 frame_->GetNewAvatarMenuButton(), views::BubbleBorder::TOP_RIGHT,
2572 views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE, browser());
2573 ProfileMetrics::LogProfileOpenMethod(ProfileMetrics::ICON_AVATAR_BUBBLE);
2574 }
2569 #else 2575 #else
2570 NOTREACHED(); 2576 NOTREACHED();
2571 #endif 2577 #endif
2572 } 2578 }
2573 2579
2580 void BrowserView::ShowModalSigninWindow(AvatarBubbleMode mode) {
2581 profiles::BubbleViewMode bubble_view_mode;
2582 profiles::TutorialMode tutorial_mode;
2583 profiles::BubbleViewModeFromAvatarBubbleMode(mode, &bubble_view_mode,
2584 &tutorial_mode);
2585 signin_view_controller_.ShowModalSignin(bubble_view_mode, browser());
2586 }
2587
2588 void BrowserView::CloseModalSigninWindow() {
2589 signin_view_controller_.CloseModalSignin();
2590 }
2591
2574 int BrowserView::GetRenderViewHeightInsetWithDetachedBookmarkBar() { 2592 int BrowserView::GetRenderViewHeightInsetWithDetachedBookmarkBar() {
2575 if (browser_->bookmark_bar_state() != BookmarkBar::DETACHED || 2593 if (browser_->bookmark_bar_state() != BookmarkBar::DETACHED ||
2576 !bookmark_bar_view_ || !bookmark_bar_view_->IsDetached()) { 2594 !bookmark_bar_view_ || !bookmark_bar_view_->IsDetached()) {
2577 return 0; 2595 return 0;
2578 } 2596 }
2579 // Don't use bookmark_bar_view_->height() which won't be the final height if 2597 // Don't use bookmark_bar_view_->height() which won't be the final height if
2580 // the bookmark bar is animating. 2598 // the bookmark bar is animating.
2581 return chrome::kNTPBookmarkBarHeight - 2599 return chrome::kNTPBookmarkBarHeight -
2582 views::NonClientFrameView::kClientEdgeThickness; 2600 views::NonClientFrameView::kClientEdgeThickness;
2583 } 2601 }
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
2670 return immersive_mode_controller()->IsEnabled(); 2688 return immersive_mode_controller()->IsEnabled();
2671 } 2689 }
2672 2690
2673 views::Widget* BrowserView::GetBubbleAssociatedWidget() { 2691 views::Widget* BrowserView::GetBubbleAssociatedWidget() {
2674 return GetWidget(); 2692 return GetWidget();
2675 } 2693 }
2676 2694
2677 gfx::Rect BrowserView::GetTopContainerBoundsInScreen() { 2695 gfx::Rect BrowserView::GetTopContainerBoundsInScreen() {
2678 return top_container_->GetBoundsInScreen(); 2696 return top_container_->GetBoundsInScreen();
2679 } 2697 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/frame/browser_view.h ('k') | chrome/browser/ui/views/profiles/profile_chooser_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698