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

Unified Diff: chrome/browser/ui/cocoa/profiles/signin_view_controller_delegate_mac.mm

Issue 2348423002: [Signin Error Dialog] (3/3) Added the triggering code (Closed)
Patch Set: Fix malformed function declaration on mac. Created 4 years, 3 months 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/cocoa/profiles/signin_view_controller_delegate_mac.mm
diff --git a/chrome/browser/ui/cocoa/profiles/signin_view_controller_delegate_mac.mm b/chrome/browser/ui/cocoa/profiles/signin_view_controller_delegate_mac.mm
index 2f10360674804bbd459bbacbd58758f0fb52b229..e085e90ab25493526cd5822cf7f8f6ed4ae45c06 100644
--- a/chrome/browser/ui/cocoa/profiles/signin_view_controller_delegate_mac.mm
+++ b/chrome/browser/ui/cocoa/profiles/signin_view_controller_delegate_mac.mm
@@ -35,9 +35,12 @@ const int kModalDialogWidth = 448;
// flow. It matches the dimensions of the server content the dialog displays.
const CGFloat kFixedGaiaViewHeight = 612;
-// Initial height of the sync confirmation t
+// Initial height of the sync confirmation modal dialog.
const int kSyncConfirmationDialogHeight = 351;
+// Initial height of the signin error modal dialog.
+const int kSigninErrorDialogHeight = 164;
+
} // namespace
SigninViewControllerDelegateMac::SigninViewControllerDelegateMac(
@@ -115,6 +118,24 @@ SigninViewControllerDelegateMac::CreateSyncConfirmationWebContents(
return web_contents;
}
+// static
+std::unique_ptr<content::WebContents>
+SigninViewControllerDelegateMac::CreateSigninErrorWebContents(
+ Profile* profile) {
+ std::unique_ptr<content::WebContents> web_contents(
+ content::WebContents::Create(
+ content::WebContents::CreateParams(profile)));
+ web_contents->GetController().LoadURL(
+ GURL(chrome::kChromeUISigninErrorURL), content::Referrer(),
+ ui::PAGE_TRANSITION_AUTO_TOPLEVEL, std::string());
+
+ NSView* webview = web_contents->GetNativeView();
+ [webview
+ setFrameSize:NSMakeSize(kModalDialogWidth, kSigninErrorDialogHeight)];
+
+ return web_contents;
+}
+
void SigninViewControllerDelegateMac::PerformClose() {
if (constrained_window_.get())
constrained_window_->CloseWebContentsModalDialog();
@@ -185,3 +206,16 @@ SigninViewControllerDelegate::CreateSyncConfirmationDelegate(
kSyncConfirmationDialogHeight),
true);
}
+
+// static
+SigninViewControllerDelegate*
+SigninViewControllerDelegate::CreateSigninErrorDelegate(
+ SigninViewController* signin_view_controller,
+ Browser* browser) {
+ return new SigninViewControllerDelegateMac(
+ signin_view_controller,
+ SigninViewControllerDelegateMac::CreateSigninErrorWebContents(
+ browser->profile()),
+ browser->tab_strip_model()->GetActiveWebContents(),
+ NSMakeRect(0, 0, kModalDialogWidth, kSigninErrorDialogHeight), true);
+}
« no previous file with comments | « chrome/browser/ui/cocoa/profiles/signin_view_controller_delegate_mac.h ('k') | chrome/browser/ui/signin_view_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698