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

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

Issue 2625813003: MacViews: Allow the toolkit-views Enterprise Signin Confirmation Dialog to be used (Closed)
Patch Set: Rebase (DID NOT LAND) Created 3 years, 11 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/profile_signin_confirmation_dialog_cocoa.mm
diff --git a/chrome/browser/ui/cocoa/profiles/profile_signin_confirmation_dialog_cocoa.mm b/chrome/browser/ui/cocoa/profiles/profile_signin_confirmation_dialog_cocoa.mm
index dbd031b3db76e374708ded57782f5c7cec5c094c..eab52ff12bf3ea6c637b2e1dd80f6b1d81c18cca 100644
--- a/chrome/browser/ui/cocoa/profiles/profile_signin_confirmation_dialog_cocoa.mm
+++ b/chrome/browser/ui/cocoa/profiles/profile_signin_confirmation_dialog_cocoa.mm
@@ -16,19 +16,15 @@
namespace {
// static
-void ShowDialog(
- Browser* browser,
- content::WebContents* web_contents,
- Profile* profile,
- const std::string& username,
- ui::ProfileSigninConfirmationDelegate* delegate,
- bool offer_profile_creation) {
+void ShowDialog(Browser* browser,
+ content::WebContents* web_contents,
+ Profile* profile,
+ const std::string& username,
+ std::unique_ptr<ui::ProfileSigninConfirmationDelegate> delegate,
+ bool offer_profile_creation) {
// The dialog owns itself.
- new ProfileSigninConfirmationDialogCocoa(browser,
- web_contents,
- profile,
- username,
- delegate,
+ new ProfileSigninConfirmationDialogCocoa(browser, web_contents, profile,
+ username, std::move(delegate),
offer_profile_creation);
}
@@ -39,19 +35,18 @@ ProfileSigninConfirmationDialogCocoa::ProfileSigninConfirmationDialogCocoa(
content::WebContents* web_contents,
Profile* profile,
const std::string& username,
- ui::ProfileSigninConfirmationDelegate* delegate,
+ std::unique_ptr<ui::ProfileSigninConfirmationDelegate> delegate,
bool offer_profile_creation) {
// Setup the dialog view controller.
const base::Closure& closeDialogCallback =
base::Bind(&ProfileSigninConfirmationDialogCocoa::Close,
base::Unretained(this));
- controller_.reset(
- [[ProfileSigninConfirmationViewController alloc]
- initWithBrowser:browser
- username:username
- delegate:delegate
- closeDialogCallback:closeDialogCallback
- offerProfileCreation:offer_profile_creation]);
+ controller_.reset([[ProfileSigninConfirmationViewController alloc]
+ initWithBrowser:browser
+ username:username
+ delegate:std::move(delegate)
+ closeDialogCallback:closeDialogCallback
+ offerProfileCreation:offer_profile_creation]);
// Setup the constrained window that will show the view.
base::scoped_nsobject<NSWindow> window([[ConstrainedWindowCustomWindow alloc]
@@ -71,10 +66,10 @@ void ProfileSigninConfirmationDialogCocoa::Show(
content::WebContents* web_contents,
Profile* profile,
const std::string& username,
- ui::ProfileSigninConfirmationDelegate* delegate) {
+ std::unique_ptr<ui::ProfileSigninConfirmationDelegate> delegate) {
ui::CheckShouldPromptForNewProfile(
profile, base::Bind(ShowDialog, browser, web_contents, profile, username,
- delegate));
+ base::Passed(std::move(delegate))));
}
void ProfileSigninConfirmationDialogCocoa::Close() {

Powered by Google App Engine
This is Rietveld 408576698