diff options
author | vabr <vabr@chromium.org> | 2016-03-17 09:16:49 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-03-17 16:17:55 +0000 |
commit | 393a31d6c2ca9001b1985bf1cb426ca144205163 (patch) | |
tree | abed9eb32ad19acd8a0ce9276556631a76b17f5f | |
parent | 20078f72c457d9612c1e12044e7e87fc721b4397 (diff) | |
download | chromium_src-393a31d6c2ca9001b1985bf1cb426ca144205163.zip chromium_src-393a31d6c2ca9001b1985bf1cb426ca144205163.tar.gz chromium_src-393a31d6c2ca9001b1985bf1cb426ca144205163.tar.bz2 |
Autofill & passwords: Replace NavigationEntryCommitted with DidFinishNavigation
The former is a possible candidate for deletion, the latter is a suitable replacement in the new navigation API.
BUG=576287
Review URL: https://codereview.chromium.org/1806593002
Cr-Commit-Position: refs/heads/master@{#381725}
5 files changed, 17 insertions, 15 deletions
diff --git a/chrome/browser/autofill/content_autofill_driver_browsertest.cc b/chrome/browser/autofill/content_autofill_driver_browsertest.cc index 3c4eefb..e60f12c 100644 --- a/chrome/browser/autofill/content_autofill_driver_browsertest.cc +++ b/chrome/browser/autofill/content_autofill_driver_browsertest.cc @@ -98,8 +98,8 @@ class ContentAutofillDriverBrowserTest : public InProcessBrowserTest, web_contents_hidden_callback_.Run(); } - void NavigationEntryCommitted( - const content::LoadCommittedDetails& load_details) override { + void DidFinishNavigation( + content::NavigationHandle* navigation_handle) override { if (!nav_entry_committed_callback_.is_null()) nav_entry_committed_callback_.Run(); } diff --git a/chrome/browser/password_manager/password_manager_test_base.cc b/chrome/browser/password_manager/password_manager_test_base.cc index 7fdb0e2..fdc641a 100644 --- a/chrome/browser/password_manager/password_manager_test_base.cc +++ b/chrome/browser/password_manager/password_manager_test_base.cc @@ -37,6 +37,12 @@ NavigationObserver::NavigationObserver(content::WebContents* web_contents) NavigationObserver::~NavigationObserver() { } +void NavigationObserver::DidFinishNavigation( + content::NavigationHandle* navigation_handle) { + if (quit_on_entry_committed_) + message_loop_runner_->Quit(); +} + void NavigationObserver::DidFinishLoad( content::RenderFrameHost* render_frame_host, const GURL& validated_url) { @@ -49,12 +55,6 @@ void NavigationObserver::DidFinishLoad( } } -void NavigationObserver::NavigationEntryCommitted( - const content::LoadCommittedDetails& load_details) { - if (quit_on_entry_committed_) - message_loop_runner_->Quit(); -} - void NavigationObserver::Wait() { message_loop_runner_->Run(); } diff --git a/chrome/browser/password_manager/password_manager_test_base.h b/chrome/browser/password_manager/password_manager_test_base.h index b8cf4d2..b77b5fb 100644 --- a/chrome/browser/password_manager/password_manager_test_base.h +++ b/chrome/browser/password_manager/password_manager_test_base.h @@ -39,10 +39,10 @@ class NavigationObserver : public content::WebContentsObserver { content::RenderFrameHost* render_frame_host() { return render_frame_host_; } // content::WebContentsObserver: + void DidFinishNavigation( + content::NavigationHandle* navigation_handle) override; void DidFinishLoad(content::RenderFrameHost* render_frame_host, const GURL& validated_url) override; - void NavigationEntryCommitted( - const content::LoadCommittedDetails& load_details) override; private: std::string wait_for_path_; diff --git a/components/autofill/content/browser/content_autofill_driver_factory.cc b/components/autofill/content/browser/content_autofill_driver_factory.cc index f8b1f80..9e2cb55 100644 --- a/components/autofill/content/browser/content_autofill_driver_factory.cc +++ b/components/autofill/content/browser/content_autofill_driver_factory.cc @@ -10,6 +10,7 @@ #include "components/autofill/core/browser/autofill_manager.h" #include "components/autofill/core/browser/form_structure.h" #include "components/autofill/core/common/autofill_switches.h" +#include "content/public/browser/navigation_handle.h" #include "content/public/browser/render_frame_host.h" #include "content/public/browser/web_contents.h" #include "ipc/ipc_message_macros.h" @@ -95,9 +96,10 @@ void ContentAutofillDriverFactory::DidNavigateAnyFrame( frame_driver_map_[render_frame_host]->DidNavigateFrame(details, params); } -void ContentAutofillDriverFactory::NavigationEntryCommitted( - const content::LoadCommittedDetails& load_details) { - client_->HideAutofillPopup(); +void ContentAutofillDriverFactory::DidFinishNavigation( + content::NavigationHandle* navigation_handle) { + if (navigation_handle->HasCommitted()) + client_->HideAutofillPopup(); } void ContentAutofillDriverFactory::WasHidden() { diff --git a/components/autofill/content/browser/content_autofill_driver_factory.h b/components/autofill/content/browser/content_autofill_driver_factory.h index 12d36d6..1103b19 100644 --- a/components/autofill/content/browser/content_autofill_driver_factory.h +++ b/components/autofill/content/browser/content_autofill_driver_factory.h @@ -54,8 +54,8 @@ class ContentAutofillDriverFactory : public content::WebContentsObserver, content::RenderFrameHost* render_frame_host, const content::LoadCommittedDetails& details, const content::FrameNavigateParams& params) override; - void NavigationEntryCommitted( - const content::LoadCommittedDetails& load_details) override; + void DidFinishNavigation( + content::NavigationHandle* navigation_handle) override; void WasHidden() override; static const char kContentAutofillDriverFactoryWebContentsUserDataKey[]; |