diff options
author | blundell@chromium.org <blundell@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-01 01:24:08 +0000 |
---|---|---|
committer | blundell@chromium.org <blundell@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-01 01:24:08 +0000 |
commit | 3ef0899167a0f5c9bb14c7e8c1c98d11541ab9cf (patch) | |
tree | 37e68940047ce5337a96ab562aab5c1ed0f08687 /components | |
parent | 9872e315d5d57f1d9c5b4901cc4e858bba8eb1fd (diff) | |
download | chromium_src-3ef0899167a0f5c9bb14c7e8c1c98d11541ab9cf.zip chromium_src-3ef0899167a0f5c9bb14c7e8c1c98d11541ab9cf.tar.gz chromium_src-3ef0899167a0f5c9bb14c7e8c1c98d11541ab9cf.tar.bz2 |
Eliminate need for AutofillInteractiveTest to know about AutofillPopupDelegate.
This CL changes the way in which AutofillInteractiveTest sends key presses to
the Autofill popup: rather than grabbing on to the callback that is passed to
the AutofillPopupDelegate, it forwards keyboard events through the active
WebContents. The intent of the CL is to (1) pave the way for a refactoring in
which registration of the callback is moved out of AutofillExternalDelegate and
(2) hopefully make the test less implementation-dependent going forward.
BUG=302499
Review URL: https://codereview.chromium.org/48363004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@232263 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'components')
-rw-r--r-- | components/autofill/content/browser/autofill_driver_impl.cc | 15 | ||||
-rw-r--r-- | components/autofill/content/browser/autofill_driver_impl.h | 15 |
2 files changed, 9 insertions, 21 deletions
diff --git a/components/autofill/content/browser/autofill_driver_impl.cc b/components/autofill/content/browser/autofill_driver_impl.cc index 099a7da..1855254 100644 --- a/components/autofill/content/browser/autofill_driver_impl.cc +++ b/components/autofill/content/browser/autofill_driver_impl.cc @@ -59,10 +59,9 @@ AutofillDriverImpl::AutofillDriverImpl( AutofillManager::AutofillDownloadManagerState enable_download_manager) : content::WebContentsObserver(web_contents), autofill_manager_(new AutofillManager( - this, delegate, app_locale, enable_download_manager)) { - SetAutofillExternalDelegate(scoped_ptr<AutofillExternalDelegate>( - new AutofillExternalDelegate(web_contents, autofill_manager_.get(), - this))); + this, delegate, app_locale, enable_download_manager)), + autofill_external_delegate_(web_contents, autofill_manager_.get(), this) { + autofill_manager_->SetExternalDelegate(&autofill_external_delegate_); } AutofillDriverImpl::~AutofillDriverImpl() {} @@ -189,16 +188,10 @@ void AutofillDriverImpl::DidNavigateMainFrame( autofill_manager_->Reset(); } -void AutofillDriverImpl::SetAutofillExternalDelegate( - scoped_ptr<AutofillExternalDelegate> delegate) { - autofill_external_delegate_ = delegate.Pass(); - autofill_manager_->SetExternalDelegate(autofill_external_delegate_.get()); -} - void AutofillDriverImpl::SetAutofillManager( scoped_ptr<AutofillManager> manager) { autofill_manager_ = manager.Pass(); - autofill_manager_->SetExternalDelegate(autofill_external_delegate_.get()); + autofill_manager_->SetExternalDelegate(&autofill_external_delegate_); } void AutofillDriverImpl::NavigationEntryCommitted( diff --git a/components/autofill/content/browser/autofill_driver_impl.h b/components/autofill/content/browser/autofill_driver_impl.h index e8fe30b..3b4a715 100644 --- a/components/autofill/content/browser/autofill_driver_impl.h +++ b/components/autofill/content/browser/autofill_driver_impl.h @@ -55,14 +55,9 @@ class AutofillDriverImpl : public AutofillDriver, virtual void RendererShouldClearPreviewedForm() OVERRIDE; AutofillExternalDelegate* autofill_external_delegate() { - return autofill_external_delegate_.get(); + return &autofill_external_delegate_; } - // Sets the external delegate to |delegate| both within this class and in the - // shared Autofill code. Takes ownership of |delegate|. - void SetAutofillExternalDelegate( - scoped_ptr<AutofillExternalDelegate> delegate); - AutofillManager* autofill_manager() { return autofill_manager_.get(); } protected: @@ -87,13 +82,13 @@ class AutofillDriverImpl : public AutofillDriver, void SetAutofillManager(scoped_ptr<AutofillManager> manager); private: - // AutofillExternalDelegate instance that this object instantiates in the - // case where the autofill native UI is enabled. - scoped_ptr<AutofillExternalDelegate> autofill_external_delegate_; - // AutofillManager instance via which this object drives the shared Autofill // code. scoped_ptr<AutofillManager> autofill_manager_; + + // AutofillExternalDelegate instance that this object instantiates in the + // case where the Autofill native UI is enabled. + AutofillExternalDelegate autofill_external_delegate_; }; } // namespace autofill |