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

Unified Diff: components/autofill/content/browser/autofill_driver_impl.h

Issue 16286020: Abstract WebContentsObserver from Autofill shared code (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Response to review Created 7 years, 6 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: components/autofill/content/browser/autofill_driver_impl.h
diff --git a/components/autofill/content/browser/autofill_driver_impl.h b/components/autofill/content/browser/autofill_driver_impl.h
new file mode 100644
index 0000000000000000000000000000000000000000..58ebcd4a56258f7560b59d9ee94c7d9a084ba958
--- /dev/null
+++ b/components/autofill/content/browser/autofill_driver_impl.h
@@ -0,0 +1,71 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef COMPONENTS_AUTOFILL_CONTENT_BROWSER_AUTOFILL_DRIVER_IMPL_H_
+#define COMPONENTS_AUTOFILL_CONTENT_BROWSER_AUTOFILL_DRIVER_IMPL_H_
+
+#include <string>
+
+#include "base/supports_user_data.h"
+#include "components/autofill/browser/autofill_driver.h"
+#include "components/autofill/browser/autofill_manager.h"
+#include "content/public/browser/web_contents_observer.h"
+
+namespace content {
+class WebContents;
+}
+
+namespace IPC {
+class Message;
+}
+
+namespace autofill {
+
+class AutofillContext;
+class AutofillExternalDelegate;
+class AutofillManager;
Ilya Sherman 2013/06/14 02:44:37 nit: This is currently both forward-declared and #
blundell 2013/06/14 09:54:08 Done.
+class AutofillManagerDelegate;
+
+// Class that drives autofill flow in the browser process based on
+// communication from the renderer and from the external world. There is one
+// instance per WebContents.
+class AutofillDriverImpl : public AutofillDriver,
+ public content::WebContentsObserver,
+ public base::SupportsUserData::Data {
+ public:
+ static void CreateForWebContentsAndDelegate(
+ content::WebContents* contents,
+ autofill::AutofillManagerDelegate* delegate,
+ const std::string& app_locale,
+ AutofillManager::AutofillDownloadManagerState enable_download_manager,
+ bool enable_native_ui);
+ static AutofillDriverImpl* FromWebContents(content::WebContents* contents);
+
+ // AutofillDriver:
+ virtual content::WebContents* GetWebContents() OVERRIDE;
+ AutofillManager* autofill_manager() { return autofill_manager_.get(); }
Ilya Sherman 2013/06/14 02:44:37 nit: Please leave a blank line above this one, as
blundell 2013/06/14 09:54:08 Done.
+
+ private:
+ AutofillDriverImpl(
+ content::WebContents* web_contents,
+ autofill::AutofillManagerDelegate* delegate,
+ const std::string& app_locale,
+ AutofillManager::AutofillDownloadManagerState enable_download_manager,
+ bool enable_native_ui);
+ virtual ~AutofillDriverImpl();
+
+ // content::WebContentsObserver:
+ virtual void DidNavigateMainFrame(
+ const content::LoadCommittedDetails& details,
+ const content::FrameNavigateParams& params) OVERRIDE;
+ virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
+
+ // AutofillManager instance via which this object drives the shared Autofill
+ // code.
+ scoped_ptr<AutofillManager> autofill_manager_;
Ilya Sherman 2013/06/14 02:44:37 Any reason not to allocate this as a direct member
blundell 2013/06/14 09:54:08 Nope! Done. On 2013/06/14 02:44:37, Ilya Sherman
+};
+
+} // namespace autofill
+
+#endif // COMPONENTS_AUTOFILL_CONTENT_BROWSER_AUTOFILL_DRIVER_IMPL_H_

Powered by Google App Engine
This is Rietveld 408576698