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

Unified Diff: components/password_manager/content/browser/content_password_manager_driver_factory.h

Issue 707173004: Refactor Autofill for out of process iframes (OOPIF). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: mem leak Created 6 years 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/password_manager/content/browser/content_password_manager_driver_factory.h
diff --git a/components/password_manager/content/browser/content_password_manager_driver_factory.h b/components/password_manager/content/browser/content_password_manager_driver_factory.h
new file mode 100644
index 0000000000000000000000000000000000000000..9fb057335b8455a91d4a548afb5d88812f871fc3
--- /dev/null
+++ b/components/password_manager/content/browser/content_password_manager_driver_factory.h
@@ -0,0 +1,75 @@
+// Copyright 2014 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_PASSWORD_MANAGER_CONTENT_BROWSER_CONTENT_PASSWORD_MANAGER_DRIVER_FACTORY_H_
+#define COMPONENTS_PASSWORD_MANAGER_CONTENT_BROWSER_CONTENT_PASSWORD_MANAGER_DRIVER_FACTORY_H_
+
+#include "base/basictypes.h"
+#include "base/compiler_specific.h"
+#include "base/supports_user_data.h"
+#include "components/password_manager/core/browser/password_autofill_manager.h"
+#include "components/password_manager/core/browser/password_generation_manager.h"
+#include "components/password_manager/core/browser/password_manager.h"
+#include "components/password_manager/core/browser/password_manager_driver.h"
+#include "content/public/browser/web_contents_observer.h"
+
+namespace autofill {
+class AutofillManager;
+struct PasswordForm;
+}
+
+namespace content {
+class WebContents;
+}
+
+namespace password_manager {
+
+class ContentPasswordManagerDriver;
+
+// Creates and owns ContentPasswordManagerDrivers. There is one
+// factory per WebContents, and one driver per render frame.
+class ContentPasswordManagerDriverFactory
+ : public content::WebContentsObserver,
+ public base::SupportsUserData::Data {
+ public:
+ static void CreateForWebContents(content::WebContents* web_contents,
+ PasswordManagerClient* client,
+ autofill::AutofillClient* autofill_client);
+ ~ContentPasswordManagerDriverFactory() override;
+
+ static ContentPasswordManagerDriverFactory* FromWebContents(
+ content::WebContents* web_contents);
+
+ ContentPasswordManagerDriver* GetDriverForFrame(
+ content::RenderFrameHost* render_frame_host);
+
+ // content::WebContentsObserver:
+ bool OnMessageReceived(const IPC::Message& message,
+ content::RenderFrameHost* render_frame_host) override;
+ void RenderFrameCreated(content::RenderFrameHost* render_frame_host) override;
+ void RenderFrameDeleted(content::RenderFrameHost* render_frame_host) override;
+ void DidNavigateAnyFrame(content::RenderFrameHost* render_frame_host,
+ const content::LoadCommittedDetails& details,
+ const content::FrameNavigateParams& params) override;
+
+ private:
+ ContentPasswordManagerDriverFactory(
+ content::WebContents* web_contents,
+ PasswordManagerClient* client,
+ autofill::AutofillClient* autofill_client);
+
+ void CreateDriverForFrame(content::RenderFrameHost* render_frame_host);
+
+ std::map<content::RenderFrameHost*, ContentPasswordManagerDriver*>
+ frame_driver_map_;
+
+ PasswordManagerClient* password_client_;
+ autofill::AutofillClient* autofill_client_;
+
+ DISALLOW_COPY_AND_ASSIGN(ContentPasswordManagerDriverFactory);
+};
+
+} // namespace password_manager
+
+#endif // COMPONENTS_PASSWORD_MANAGER_CONTENT_BROWSER_CONTENT_PASSWORD_MANAGER_DRIVER_FACTORY_H_

Powered by Google App Engine
This is Rietveld 408576698