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

Unified 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: Address feedback and added some comments. 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/frame/browser_view.cc
diff --git a/chrome/browser/ui/views/frame/browser_view.cc b/chrome/browser/ui/views/frame/browser_view.cc
index 59aea6ac6e39f4e95b93043c69e60b4a6ca87760..a4b44c72f475d0979698f5fdc8553080609e14a7 100644
--- a/chrome/browser/ui/views/frame/browser_view.cc
+++ b/chrome/browser/ui/views/frame/browser_view.cc
@@ -2554,20 +2554,38 @@ void BrowserView::ShowAvatarBubbleFromAvatarButton(
// Do not show avatar bubble if there is no avatar menu button.
if (!frame_->GetNewAvatarMenuButton())
return;
+
profiles::BubbleViewMode bubble_view_mode;
profiles::TutorialMode tutorial_mode;
profiles::BubbleViewModeFromAvatarBubbleMode(mode, &bubble_view_mode,
&tutorial_mode);
- ProfileChooserView::ShowBubble(
- bubble_view_mode, tutorial_mode, manage_accounts_params,
- frame_->GetNewAvatarMenuButton(), views::BubbleBorder::TOP_RIGHT,
- views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE, browser());
- ProfileMetrics::LogProfileOpenMethod(ProfileMetrics::ICON_AVATAR_BUBBLE);
+
+ if (SigninViewController::ShouldShowModalSigninForMode(bubble_view_mode)) {
+ ShowModalSigninWindow(mode);
+ } else {
+ ProfileChooserView::ShowBubble(
+ bubble_view_mode, tutorial_mode, manage_accounts_params,
+ frame_->GetNewAvatarMenuButton(), views::BubbleBorder::TOP_RIGHT,
+ views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE, browser());
+ ProfileMetrics::LogProfileOpenMethod(ProfileMetrics::ICON_AVATAR_BUBBLE);
+ }
#else
NOTREACHED();
#endif
}
+void BrowserView::ShowModalSigninWindow(AvatarBubbleMode mode) {
+ profiles::BubbleViewMode bubble_view_mode;
+ profiles::TutorialMode tutorial_mode;
+ profiles::BubbleViewModeFromAvatarBubbleMode(mode, &bubble_view_mode,
+ &tutorial_mode);
+ signin_view_controller_.ShowModalSignin(bubble_view_mode, browser());
+}
+
+void BrowserView::CloseModalSigninWindow() {
+ signin_view_controller_.CloseModalSignin();
+}
+
int BrowserView::GetRenderViewHeightInsetWithDetachedBookmarkBar() {
if (browser_->bookmark_bar_state() != BookmarkBar::DETACHED ||
!bookmark_bar_view_ || !bookmark_bar_view_->IsDetached()) {

Powered by Google App Engine
This is Rietveld 408576698