| OLD | NEW |
| 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/cocoa/profiles/signin_view_controller_delegate_mac.h
" | 5 #include "chrome/browser/ui/cocoa/profiles/signin_view_controller_delegate_mac.h
" |
| 6 | 6 |
| 7 #import <Cocoa/Cocoa.h> | 7 #import <Cocoa/Cocoa.h> |
| 8 | 8 |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/profiles/profile_avatar_icon_util.h" | 10 #include "chrome/browser/profiles/profile_avatar_icon_util.h" |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 : SigninViewControllerDelegate(signin_view_controller, web_contents.get()), | 74 : SigninViewControllerDelegate(signin_view_controller, web_contents.get()), |
| 75 host_view_([[NSView alloc] initWithFrame:frame]), | 75 host_view_([[NSView alloc] initWithFrame:frame]), |
| 76 web_contents_(std::move(web_contents)), | 76 web_contents_(std::move(web_contents)), |
| 77 window_( | 77 window_( |
| 78 [[ConstrainedWindowCustomWindow alloc] initWithContentRect:frame]) { | 78 [[ConstrainedWindowCustomWindow alloc] initWithContentRect:frame]) { |
| 79 window_.get().contentView = host_view_; | 79 window_.get().contentView = host_view_; |
| 80 [host_view_ addSubview:web_contents_->GetNativeView()]; | 80 [host_view_ addSubview:web_contents_->GetNativeView()]; |
| 81 | 81 |
| 82 base::scoped_nsobject<CustomConstrainedWindowSheet> sheet( | 82 base::scoped_nsobject<CustomConstrainedWindowSheet> sheet( |
| 83 [[CustomConstrainedWindowSheet alloc] initWithCustomWindow:window_]); | 83 [[CustomConstrainedWindowSheet alloc] initWithCustomWindow:window_]); |
| 84 constrained_window_.reset( | 84 constrained_window_ = |
| 85 new ConstrainedWindowMac(this, host_web_contents, sheet)); | 85 CreateAndShowWebModalDialogMac(this, host_web_contents, sheet); |
| 86 } | 86 } |
| 87 | 87 |
| 88 SigninViewControllerDelegateMac::~SigninViewControllerDelegateMac() {} | 88 SigninViewControllerDelegateMac::~SigninViewControllerDelegateMac() {} |
| 89 | 89 |
| 90 SigninViewControllerDelegateMac* | 90 SigninViewControllerDelegateMac* |
| 91 SigninViewControllerDelegateMac::CreateModalSigninDelegateWithNavigation( | 91 SigninViewControllerDelegateMac::CreateModalSigninDelegateWithNavigation( |
| 92 SigninViewController* signin_view_controller, | 92 SigninViewController* signin_view_controller, |
| 93 scoped_ptr<content::WebContents> web_contents, | 93 scoped_ptr<content::WebContents> web_contents, |
| 94 content::WebContents* host_web_contents, | 94 content::WebContents* host_web_contents, |
| 95 NSRect frame) { | 95 NSRect frame) { |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 SigninViewController* signin_view_controller, | 226 SigninViewController* signin_view_controller, |
| 227 Browser* browser) { | 227 Browser* browser) { |
| 228 return new SigninViewControllerDelegateMac( | 228 return new SigninViewControllerDelegateMac( |
| 229 signin_view_controller, | 229 signin_view_controller, |
| 230 SigninViewControllerDelegateMac::CreateSyncConfirmationWebContents( | 230 SigninViewControllerDelegateMac::CreateSyncConfirmationWebContents( |
| 231 browser->profile()), | 231 browser->profile()), |
| 232 browser->tab_strip_model()->GetActiveWebContents(), | 232 browser->tab_strip_model()->GetActiveWebContents(), |
| 233 NSMakeRect(0, 0, kSyncConfirmationDialogWidth, | 233 NSMakeRect(0, 0, kSyncConfirmationDialogWidth, |
| 234 kSyncConfirmationDialogHeight)); | 234 kSyncConfirmationDialogHeight)); |
| 235 } | 235 } |
| OLD | NEW |