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

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

Issue 2784823002: Reland "Use the same browser instance in the sync confirmation dialog. (Closed)
Patch Set: Rebase and fix conflicts Created 3 years, 9 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 9741d0f197f245a1351ec5fa18b332f95cadae76..e4946ea1ab205aed841aab0ab1dda1295c6a98e4 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
@@ -15,6 +15,7 @@
#include "chrome/browser/ui/cocoa/constrained_window/constrained_window_custom_sheet.h"
#include "chrome/browser/ui/cocoa/constrained_window/constrained_window_custom_window.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
+#include "chrome/browser/ui/webui/signin/sync_confirmation_ui.h"
#include "chrome/common/url_constants.h"
#include "components/signin/core/common/profile_management_switches.h"
#include "content/public/browser/native_web_keyboard_event.h"
@@ -114,18 +115,21 @@ SigninViewControllerDelegateMac::CreateGaiaWebContents(
// static
std::unique_ptr<content::WebContents>
SigninViewControllerDelegateMac::CreateSyncConfirmationWebContents(
- Profile* profile) {
+ Browser* browser) {
std::unique_ptr<content::WebContents> web_contents(
content::WebContents::Create(
- content::WebContents::CreateParams(profile)));
+ content::WebContents::CreateParams(browser->profile())));
web_contents->GetController().LoadURL(
GURL(chrome::kChromeUISyncConfirmationURL), content::Referrer(),
ui::PAGE_TRANSITION_AUTO_TOPLEVEL, std::string());
+ SyncConfirmationUI* sync_confirmation_ui = static_cast<SyncConfirmationUI*>(
+ web_contents->GetWebUI()->GetController());
+ sync_confirmation_ui->InitializeMessageHandlerWithBrowser(browser);
NSView* webview = web_contents->GetNativeView();
- [webview setFrameSize:NSMakeSize(
- kModalDialogWidth,
- GetSyncConfirmationDialogPreferredHeight(profile))];
+ [webview setFrameSize:NSMakeSize(kModalDialogWidth,
+ GetSyncConfirmationDialogPreferredHeight(
+ browser->profile()))];
return web_contents;
}
@@ -246,7 +250,7 @@ SigninViewControllerDelegate::CreateSyncConfirmationDelegate(
return new SigninViewControllerDelegateMac(
signin_view_controller,
SigninViewControllerDelegateMac::CreateSyncConfirmationWebContents(
- browser->profile()),
+ browser),
browser,
NSMakeRect(0, 0, kModalDialogWidth,
GetSyncConfirmationDialogPreferredHeight(browser->profile())),

Powered by Google App Engine
This is Rietveld 408576698