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

Side by Side Diff: components/password_manager/content/browser/content_password_manager_driver.cc

Issue 208453002: Add "previewing on hover" support for password field. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update code as per further review comments. Created 6 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/password_manager/content/browser/content_password_manager_d river.h" 5 #include "components/password_manager/content/browser/content_password_manager_d river.h"
6 6
7 #include "components/autofill/content/browser/content_autofill_driver.h" 7 #include "components/autofill/content/browser/content_autofill_driver.h"
8 #include "components/autofill/content/common/autofill_messages.h" 8 #include "components/autofill/content/common/autofill_messages.h"
9 #include "components/autofill/core/common/form_data.h" 9 #include "components/autofill/core/common/form_data.h"
10 #include "components/autofill/core/common/password_form.h" 10 #include "components/autofill/core/common/password_form.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 host->Send(new AutofillMsg_FormNotBlacklisted(host->GetRoutingID(), *form)); 47 host->Send(new AutofillMsg_FormNotBlacklisted(host->GetRoutingID(), *form));
48 } 48 }
49 49
50 void ContentPasswordManagerDriver::AccountCreationFormsFound( 50 void ContentPasswordManagerDriver::AccountCreationFormsFound(
51 const std::vector<autofill::FormData>& forms) { 51 const std::vector<autofill::FormData>& forms) {
52 content::RenderViewHost* host = web_contents()->GetRenderViewHost(); 52 content::RenderViewHost* host = web_contents()->GetRenderViewHost();
53 host->Send(new AutofillMsg_AccountCreationFormsDetected(host->GetRoutingID(), 53 host->Send(new AutofillMsg_AccountCreationFormsDetected(host->GetRoutingID(),
54 forms)); 54 forms));
55 } 55 }
56 56
57 void ContentPasswordManagerDriver::AcceptPasswordAutofillSuggestion( 57 void ContentPasswordManagerDriver::FillSuggestion(
58 const base::string16& username, 58 const base::string16& username,
59 const base::string16& password) { 59 const base::string16& password) {
60 content::RenderViewHost* host = web_contents()->GetRenderViewHost(); 60 content::RenderViewHost* host = web_contents()->GetRenderViewHost();
61 host->Send( 61 host->Send(
62 new AutofillMsg_AcceptPasswordAutofillSuggestion(host->GetRoutingID(), 62 new AutofillMsg_FillPasswordSuggestion(host->GetRoutingID(),
63 username, 63 username,
64 password)); 64 password));
65 }
66
67 void ContentPasswordManagerDriver::PreviewSuggestion(
68 const base::string16& username,
69 const base::string16& password) {
70 content::RenderViewHost* host = web_contents()->GetRenderViewHost();
71 host->Send(
72 new AutofillMsg_PreviewPasswordSuggestion(host->GetRoutingID(),
73 username,
74 password));
75 }
76
77 void ContentPasswordManagerDriver::ClearPreviewedForm() {
78 content::RenderViewHost* host = web_contents()->GetRenderViewHost();
79 host->Send(
80 new AutofillMsg_ClearPreviewedForm(host->GetRoutingID()));
65 } 81 }
66 82
67 bool ContentPasswordManagerDriver::DidLastPageLoadEncounterSSLErrors() { 83 bool ContentPasswordManagerDriver::DidLastPageLoadEncounterSSLErrors() {
68 DCHECK(web_contents()); 84 DCHECK(web_contents());
69 content::NavigationEntry* entry = 85 content::NavigationEntry* entry =
70 web_contents()->GetController().GetLastCommittedEntry(); 86 web_contents()->GetController().GetLastCommittedEntry();
71 if (!entry) { 87 if (!entry) {
72 NOTREACHED(); 88 NOTREACHED();
73 return false; 89 return false;
74 } 90 }
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 return handled; 145 return handled;
130 } 146 }
131 147
132 autofill::AutofillManager* ContentPasswordManagerDriver::GetAutofillManager() { 148 autofill::AutofillManager* ContentPasswordManagerDriver::GetAutofillManager() {
133 autofill::ContentAutofillDriver* driver = 149 autofill::ContentAutofillDriver* driver =
134 autofill::ContentAutofillDriver::FromWebContents(web_contents()); 150 autofill::ContentAutofillDriver::FromWebContents(web_contents());
135 return driver ? driver->autofill_manager() : NULL; 151 return driver ? driver->autofill_manager() : NULL;
136 } 152 }
137 153
138 } // namespace password_manager 154 } // namespace password_manager
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698