summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/ui/cocoa/autofill/autofill_sign_in_container.mm12
-rw-r--r--chrome/browser/ui/cocoa/autofill/autofill_sign_in_container_unittest.mm15
2 files changed, 7 insertions, 20 deletions
diff --git a/chrome/browser/ui/cocoa/autofill/autofill_sign_in_container.mm b/chrome/browser/ui/cocoa/autofill/autofill_sign_in_container.mm
index 510b182..05cb12e 100644
--- a/chrome/browser/ui/cocoa/autofill/autofill_sign_in_container.mm
+++ b/chrome/browser/ui/cocoa/autofill/autofill_sign_in_container.mm
@@ -27,18 +27,18 @@
webContents_.reset(
content::WebContents::Create(
content::WebContents::CreateParams(dialog_->delegate()->profile())));
- signInDelegate_.reset(
- new autofill::AutofillDialogSignInDelegate(
- dialog_, webContents_.get(),
- dialog_->delegate()->GetWebContents()->GetDelegate(),
- // TODO(groby): Implement proper minimum and maximum sizing on Mac.
- dialog_->GetSize(), dialog_->GetSize()));
NSView* webContentView = webContents_->GetView()->GetNativeView();
[self setView:webContentView];
}
- (void)loadSignInPage {
DCHECK(webContents_.get());
+ signInDelegate_.reset(
+ new autofill::AutofillDialogSignInDelegate(
+ dialog_, webContents_.get(),
+ dialog_->delegate()->GetWebContents()->GetDelegate(),
+ // TODO(groby): Implement proper minimum and maximum sizing on Mac.
+ dialog_->GetSize(), dialog_->GetSize()));
webContents_->GetController().LoadURL(
autofill::wallet::GetSignInUrl(),
content::Referrer(),
diff --git a/chrome/browser/ui/cocoa/autofill/autofill_sign_in_container_unittest.mm b/chrome/browser/ui/cocoa/autofill/autofill_sign_in_container_unittest.mm
index 93de00c..e50c610 100644
--- a/chrome/browser/ui/cocoa/autofill/autofill_sign_in_container_unittest.mm
+++ b/chrome/browser/ui/cocoa/autofill/autofill_sign_in_container_unittest.mm
@@ -27,16 +27,6 @@
namespace {
-// A trivial concrete instance of a WebContentsDelegate.
-class TestWebContentsDelegate : public content::WebContentsDelegate {
- public:
- TestWebContentsDelegate() {}
- virtual ~TestWebContentsDelegate() {}
-
- private:
- DISALLOW_COPY_AND_ASSIGN(TestWebContentsDelegate);
-};
-
class AutofillSignInContainerTest : public ChromeRenderViewHostTestHarness {
public:
AutofillSignInContainerTest() : dialog_(&delegate_), test_window_(nil) {}
@@ -46,13 +36,10 @@ class AutofillSignInContainerTest : public ChromeRenderViewHostTestHarness {
// from from CocoaTest, so do a bootstrap and create test window.
CocoaTest::BootstrapCocoa();
- web_contents()->SetDelegate(&dummy_web_contents_delegate_);
container_.reset(
[[AutofillSignInContainer alloc] initWithDialog:&dialog_]);
EXPECT_CALL(delegate_, profile())
.WillOnce(testing::Return(this->profile()));
- EXPECT_CALL(delegate_, GetWebContents())
- .WillOnce(testing::Return(this->web_contents()));
[[test_window() contentView] addSubview:[container_ view]];
}
@@ -79,7 +66,6 @@ class AutofillSignInContainerTest : public ChromeRenderViewHostTestHarness {
base::scoped_nsobject<AutofillSignInContainer> container_;
testing::NiceMock<autofill::MockAutofillDialogViewDelegate> delegate_;
autofill::AutofillDialogCocoa dialog_;
- TestWebContentsDelegate dummy_web_contents_delegate_;
CocoaTestHelperWindow* test_window_;
};
@@ -95,3 +81,4 @@ TEST_F(AutofillSignInContainerTest, Subviews) {
EXPECT_TRUE(hasWebView);
}
+