summaryrefslogtreecommitdiffstats
path: root/components/autofill/content/browser
diff options
context:
space:
mode:
authoravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-09 20:35:45 +0000
committeravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-09 20:35:45 +0000
commit82ed5b14329c34fef71237182a79199e5c26355e (patch)
treea96a7f767e8b40cf2f10fc4700b931b7d7990b42 /components/autofill/content/browser
parent09449dd55e594a04e5bb82419a8ca7f8afaaeed4 (diff)
downloadchromium_src-82ed5b14329c34fef71237182a79199e5c26355e.zip
chromium_src-82ed5b14329c34fef71237182a79199e5c26355e.tar.gz
chromium_src-82ed5b14329c34fef71237182a79199e5c26355e.tar.bz2
Remove NOTIFICATION_WEB_CONTENTS_VISIBILITY_CHANGED from autofill.
BUG=170921 TEST=everything still works Review URL: https://codereview.chromium.org/26553002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@227798 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'components/autofill/content/browser')
-rw-r--r--components/autofill/content/browser/autofill_driver_impl.cc32
-rw-r--r--components/autofill/content/browser/autofill_driver_impl.h14
2 files changed, 11 insertions, 35 deletions
diff --git a/components/autofill/content/browser/autofill_driver_impl.cc b/components/autofill/content/browser/autofill_driver_impl.cc
index c63a0725..422a0e9 100644
--- a/components/autofill/content/browser/autofill_driver_impl.cc
+++ b/components/autofill/content/browser/autofill_driver_impl.cc
@@ -13,9 +13,6 @@
#include "components/autofill/core/common/autofill_switches.h"
#include "content/public/browser/navigation_controller.h"
#include "content/public/browser/navigation_details.h"
-#include "content/public/browser/notification_service.h"
-#include "content/public/browser/notification_source.h"
-#include "content/public/browser/notification_types.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/frame_navigate_params.h"
@@ -64,15 +61,6 @@ AutofillDriverImpl::AutofillDriverImpl(
SetAutofillExternalDelegate(scoped_ptr<AutofillExternalDelegate>(
new AutofillExternalDelegate(web_contents, autofill_manager_.get(),
this)));
-
- registrar_.Add(this,
- content::NOTIFICATION_WEB_CONTENTS_VISIBILITY_CHANGED,
- content::Source<content::WebContents>(web_contents));
- registrar_.Add(
- this,
- content::NOTIFICATION_NAV_ENTRY_COMMITTED,
- content::Source<content::NavigationController>(
- &(web_contents->GetController())));
}
AutofillDriverImpl::~AutofillDriverImpl() {}
@@ -207,18 +195,14 @@ void AutofillDriverImpl::SetAutofillManager(
autofill_manager_->SetExternalDelegate(autofill_external_delegate_.get());
}
-void AutofillDriverImpl::Observe(
- int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) {
- if (type == content::NOTIFICATION_WEB_CONTENTS_VISIBILITY_CHANGED) {
- if (!*content::Details<bool>(details).ptr())
- autofill_manager_->delegate()->HideAutofillPopup();
- } else if (type == content::NOTIFICATION_NAV_ENTRY_COMMITTED) {
- autofill_manager_->delegate()->HideAutofillPopup();
- } else {
- NOTREACHED();
- }
+void AutofillDriverImpl::NavigationEntryCommitted(
+ const content::LoadCommittedDetails& load_details) {
+ autofill_manager_->delegate()->HideAutofillPopup();
}
+void AutofillDriverImpl::WasHidden() {
+ autofill_manager_->delegate()->HideAutofillPopup();
+}
+
+
} // namespace autofill
diff --git a/components/autofill/content/browser/autofill_driver_impl.h b/components/autofill/content/browser/autofill_driver_impl.h
index 999822e..8135500 100644
--- a/components/autofill/content/browser/autofill_driver_impl.h
+++ b/components/autofill/content/browser/autofill_driver_impl.h
@@ -12,8 +12,6 @@
#include "components/autofill/core/browser/autofill_driver.h"
#include "components/autofill/core/browser/autofill_external_delegate.h"
#include "components/autofill/core/browser/autofill_manager.h"
-#include "content/public/browser/notification_observer.h"
-#include "content/public/browser/notification_registrar.h"
#include "content/public/browser/web_contents_observer.h"
namespace content {
@@ -33,7 +31,6 @@ class AutofillManagerDelegate;
// communication from the renderer and from the external world. There is one
// instance per WebContents.
class AutofillDriverImpl : public AutofillDriver,
- public content::NotificationObserver,
public content::WebContentsObserver,
public base::SupportsUserData::Data {
public:
@@ -79,6 +76,9 @@ class AutofillDriverImpl : public AutofillDriver,
virtual void DidNavigateMainFrame(
const content::LoadCommittedDetails& details,
const content::FrameNavigateParams& params) OVERRIDE;
+ virtual void NavigationEntryCommitted(
+ const content::LoadCommittedDetails& load_details) OVERRIDE;
+ virtual void WasHidden() OVERRIDE;
virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
// Sets the manager to |manager| and sets |manager|'s external delegate
@@ -86,14 +86,6 @@ class AutofillDriverImpl : public AutofillDriver,
void SetAutofillManager(scoped_ptr<AutofillManager> manager);
private:
- // content::NotificationObserver:
- virtual void Observe(int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) OVERRIDE;
-
- // A scoped container for notification registries.
- content::NotificationRegistrar registrar_;
-
// AutofillExternalDelegate instance that this object instantiates in the
// case where the autofill native UI is enabled.
scoped_ptr<AutofillExternalDelegate> autofill_external_delegate_;