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

Unified Diff: chrome/browser/password_manager/content_password_manager_driver.cc

Issue 192633002: Move ContentAutofillDriver to the PasswordManager component. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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
« no previous file with comments | « chrome/browser/password_manager/content_password_manager_driver.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/password_manager/content_password_manager_driver.cc
diff --git a/chrome/browser/password_manager/content_password_manager_driver.cc b/chrome/browser/password_manager/content_password_manager_driver.cc
deleted file mode 100644
index b78dd8319e74162d4039179f7e0ea801654fc585..0000000000000000000000000000000000000000
--- a/chrome/browser/password_manager/content_password_manager_driver.cc
+++ /dev/null
@@ -1,107 +0,0 @@
-// 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.
-
-#include "chrome/browser/password_manager/content_password_manager_driver.h"
-
-#include "components/autofill/content/browser/autofill_driver_impl.h"
-#include "components/autofill/content/common/autofill_messages.h"
-#include "components/autofill/core/common/form_data.h"
-#include "components/autofill/core/common/password_form.h"
-#include "content/public/browser/browser_context.h"
-#include "content/public/browser/navigation_details.h"
-#include "content/public/browser/navigation_entry.h"
-#include "content/public/browser/render_view_host.h"
-#include "content/public/browser/web_contents.h"
-#include "content/public/common/page_transition_types.h"
-#include "content/public/common/ssl_status.h"
-#include "ipc/ipc_message_macros.h"
-#include "net/cert/cert_status_flags.h"
-
-ContentPasswordManagerDriver::ContentPasswordManagerDriver(
- content::WebContents* web_contents,
- PasswordManagerClient* client)
- : WebContentsObserver(web_contents),
- password_manager_(client),
- password_generation_manager_(client) {
- DCHECK(web_contents);
-}
-
-ContentPasswordManagerDriver::~ContentPasswordManagerDriver() {}
-
-void ContentPasswordManagerDriver::FillPasswordForm(
- const autofill::PasswordFormFillData& form_data) {
- DCHECK(web_contents());
- web_contents()->GetRenderViewHost()->Send(new AutofillMsg_FillPasswordForm(
- web_contents()->GetRenderViewHost()->GetRoutingID(), form_data));
-}
-
-void ContentPasswordManagerDriver::AllowPasswordGenerationForForm(
- autofill::PasswordForm* form) {
- content::RenderViewHost* host = web_contents()->GetRenderViewHost();
- host->Send(new AutofillMsg_FormNotBlacklisted(host->GetRoutingID(), *form));
-}
-
-void ContentPasswordManagerDriver::AccountCreationFormsFound(
- const std::vector<autofill::FormData>& forms) {
- content::RenderViewHost* host = web_contents()->GetRenderViewHost();
- host->Send(new AutofillMsg_AccountCreationFormsDetected(host->GetRoutingID(),
- forms));
-}
-
-bool ContentPasswordManagerDriver::DidLastPageLoadEncounterSSLErrors() {
- DCHECK(web_contents());
- content::NavigationEntry* entry =
- web_contents()->GetController().GetActiveEntry();
- if (!entry) {
- NOTREACHED();
- return false;
- }
-
- return net::IsCertStatusError(entry->GetSSL().cert_status);
-}
-
-bool ContentPasswordManagerDriver::IsOffTheRecord() {
- DCHECK(web_contents());
- return web_contents()->GetBrowserContext()->IsOffTheRecord();
-}
-
-PasswordGenerationManager*
-ContentPasswordManagerDriver::GetPasswordGenerationManager() {
- return &password_generation_manager_;
-}
-
-PasswordManager* ContentPasswordManagerDriver::GetPasswordManager() {
- return &password_manager_;
-}
-
-void ContentPasswordManagerDriver::DidNavigateMainFrame(
- const content::LoadCommittedDetails& details,
- const content::FrameNavigateParams& params) {
- password_manager_.DidNavigateMainFrame(details.is_in_page);
-}
-
-bool ContentPasswordManagerDriver::OnMessageReceived(
- const IPC::Message& message) {
- bool handled = true;
- IPC_BEGIN_MESSAGE_MAP(PasswordManager, message)
- IPC_MESSAGE_FORWARD(AutofillHostMsg_PasswordFormsParsed,
- &password_manager_,
- PasswordManager::OnPasswordFormsParsed)
- IPC_MESSAGE_FORWARD(AutofillHostMsg_PasswordFormsRendered,
- &password_manager_,
- PasswordManager::OnPasswordFormsRendered)
- IPC_MESSAGE_FORWARD(AutofillHostMsg_PasswordFormSubmitted,
- &password_manager_,
- PasswordManager::OnPasswordFormSubmitted)
- IPC_MESSAGE_UNHANDLED(handled = false)
- IPC_END_MESSAGE_MAP()
-
- return handled;
-}
-
-autofill::AutofillManager* ContentPasswordManagerDriver::GetAutofillManager() {
- autofill::AutofillDriverImpl* driver =
- autofill::AutofillDriverImpl::FromWebContents(web_contents());
- return driver ? driver->autofill_manager() : NULL;
-}
« no previous file with comments | « chrome/browser/password_manager/content_password_manager_driver.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698