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

Side by Side Diff: chrome/browser/ui/views/profiles/signin_view_controller_delegate_views.cc

Issue 2594353002: Change sign-in dialogs to be browser modal. (Closed)
Patch Set: Created 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/profiles/signin_view_controller_delegate_views .h" 5 #include "chrome/browser/ui/views/profiles/signin_view_controller_delegate_views .h"
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "chrome/browser/profiles/profile.h" 8 #include "chrome/browser/profiles/profile.h"
9 #include "chrome/browser/profiles/profile_avatar_icon_util.h" 9 #include "chrome/browser/profiles/profile_avatar_icon_util.h"
10 #include "chrome/browser/signin/signin_promo.h" 10 #include "chrome/browser/signin/signin_promo.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 const views::Widget* SigninViewControllerDelegateViews::GetWidget() const { 67 const views::Widget* SigninViewControllerDelegateViews::GetWidget() const {
68 return content_view_->GetWidget(); 68 return content_view_->GetWidget();
69 } 69 }
70 70
71 void SigninViewControllerDelegateViews::DeleteDelegate() { 71 void SigninViewControllerDelegateViews::DeleteDelegate() {
72 ResetSigninViewControllerDelegate(); 72 ResetSigninViewControllerDelegate();
73 delete this; 73 delete this;
74 } 74 }
75 75
76 ui::ModalType SigninViewControllerDelegateViews::GetModalType() const { 76 ui::ModalType SigninViewControllerDelegateViews::GetModalType() const {
77 return ui::MODAL_TYPE_CHILD; 77 return ui::MODAL_TYPE_WINDOW;
78 } 78 }
79 79
80 bool SigninViewControllerDelegateViews::ShouldShowCloseButton() const { 80 bool SigninViewControllerDelegateViews::ShouldShowCloseButton() const {
81 return false; 81 return false;
82 } 82 }
83 83
84 int SigninViewControllerDelegateViews::GetDialogButtons() const { 84 int SigninViewControllerDelegateViews::GetDialogButtons() const {
85 return ui::DIALOG_BUTTON_NONE; 85 return ui::DIALOG_BUTTON_NONE;
86 } 86 }
87 87
(...skipping 12 matching lines...) Expand all
100 content_view_->Layout(); 100 content_view_->Layout();
101 101
102 if (wait_for_size_) { 102 if (wait_for_size_) {
103 // The modal wasn't displayed yet so just show it with the already resized 103 // The modal wasn't displayed yet so just show it with the already resized
104 // view. 104 // view.
105 DisplayModal(); 105 DisplayModal();
106 } 106 }
107 } 107 }
108 108
109 void SigninViewControllerDelegateViews::DisplayModal() { 109 void SigninViewControllerDelegateViews::DisplayModal() {
110 modal_signin_widget_ = constrained_window::ShowWebModalDialogViews( 110 gfx::NativeWindow window = browser_->tab_strip_model()
111 this, browser_->tab_strip_model()->GetActiveWebContents()); 111 ->GetActiveWebContents()
112 content_view_->RequestFocus(); 112 ->GetTopLevelNativeWindow();
113 modal_signin_widget_ =
114 constrained_window::CreateBrowserModalDialogViews(this, window);
115 modal_signin_widget_->Show();
113 } 116 }
114 117
115 // static 118 // static
116 std::unique_ptr<views::WebView> 119 std::unique_ptr<views::WebView>
117 SigninViewControllerDelegateViews::CreateGaiaWebView( 120 SigninViewControllerDelegateViews::CreateGaiaWebView(
118 content::WebContentsDelegate* delegate, 121 content::WebContentsDelegate* delegate,
119 profiles::BubbleViewMode mode, 122 profiles::BubbleViewMode mode,
120 Browser* browser, 123 Browser* browser,
121 signin_metrics::AccessPoint access_point) { 124 signin_metrics::AccessPoint access_point) {
122 GURL url = 125 GURL url =
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 210
208 SigninViewControllerDelegate* 211 SigninViewControllerDelegate*
209 SigninViewControllerDelegate::CreateSigninErrorDelegate( 212 SigninViewControllerDelegate::CreateSigninErrorDelegate(
210 SigninViewController* signin_view_controller, 213 SigninViewController* signin_view_controller,
211 Browser* browser) { 214 Browser* browser) {
212 return new SigninViewControllerDelegateViews( 215 return new SigninViewControllerDelegateViews(
213 signin_view_controller, 216 signin_view_controller,
214 SigninViewControllerDelegateViews::CreateSigninErrorWebView(browser), 217 SigninViewControllerDelegateViews::CreateSigninErrorWebView(browser),
215 browser, true); 218 browser, true);
216 } 219 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698