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

Side by Side Diff: components/autofill/content/browser/autofill_driver_impl.cc

Issue 79103002: Abstracted AcceptPasswordAutofillSuggestion IPC out of core Autofill code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review fixes. Created 7 years, 1 month 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/autofill/content/browser/autofill_driver_impl.h" 5 #include "components/autofill/content/browser/autofill_driver_impl.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/threading/sequenced_worker_pool.h" 8 #include "base/threading/sequenced_worker_pool.h"
9 #include "components/autofill/core/browser/autofill_external_delegate.h" 9 #include "components/autofill/core/browser/autofill_external_delegate.h"
10 #include "components/autofill/core/browser/autofill_manager.h" 10 #include "components/autofill/core/browser/autofill_manager.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 } 54 }
55 55
56 AutofillDriverImpl::AutofillDriverImpl( 56 AutofillDriverImpl::AutofillDriverImpl(
57 content::WebContents* web_contents, 57 content::WebContents* web_contents,
58 autofill::AutofillManagerDelegate* delegate, 58 autofill::AutofillManagerDelegate* delegate,
59 const std::string& app_locale, 59 const std::string& app_locale,
60 AutofillManager::AutofillDownloadManagerState enable_download_manager) 60 AutofillManager::AutofillDownloadManagerState enable_download_manager)
61 : content::WebContentsObserver(web_contents), 61 : content::WebContentsObserver(web_contents),
62 autofill_manager_(new AutofillManager( 62 autofill_manager_(new AutofillManager(
63 this, delegate, app_locale, enable_download_manager)), 63 this, delegate, app_locale, enable_download_manager)),
64 autofill_external_delegate_(web_contents, autofill_manager_.get(), this) { 64 autofill_external_delegate_(autofill_manager_.get(), this) {
65 autofill_manager_->SetExternalDelegate(&autofill_external_delegate_); 65 autofill_manager_->SetExternalDelegate(&autofill_external_delegate_);
66 } 66 }
67 67
68 AutofillDriverImpl::~AutofillDriverImpl() {} 68 AutofillDriverImpl::~AutofillDriverImpl() {}
69 69
70 bool AutofillDriverImpl::IsOffTheRecord() const { 70 bool AutofillDriverImpl::IsOffTheRecord() const {
71 return web_contents()->GetBrowserContext()->IsOffTheRecord(); 71 return web_contents()->GetBrowserContext()->IsOffTheRecord();
72 } 72 }
73 73
74 net::URLRequestContextGetter* AutofillDriverImpl::GetURLRequestContext() { 74 net::URLRequestContextGetter* AutofillDriverImpl::GetURLRequestContext() {
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 132
133 void AutofillDriverImpl::RendererShouldAcceptDataListSuggestion( 133 void AutofillDriverImpl::RendererShouldAcceptDataListSuggestion(
134 const base::string16& value) { 134 const base::string16& value) {
135 if (!RendererIsAvailable()) 135 if (!RendererIsAvailable())
136 return; 136 return;
137 content::RenderViewHost* host = web_contents()->GetRenderViewHost(); 137 content::RenderViewHost* host = web_contents()->GetRenderViewHost();
138 host->Send(new AutofillMsg_AcceptDataListSuggestion(host->GetRoutingID(), 138 host->Send(new AutofillMsg_AcceptDataListSuggestion(host->GetRoutingID(),
139 value)); 139 value));
140 } 140 }
141 141
142 void AutofillDriverImpl::RendererShouldAcceptPasswordAutofillSuggestion(
143 const base::string16& username) {
144 if (!RendererIsAvailable())
145 return;
146 content::RenderViewHost* host = web_contents()->GetRenderViewHost();
147 host->Send(
148 new AutofillMsg_AcceptPasswordAutofillSuggestion(host->GetRoutingID(),
149 username));
150 }
151
142 void AutofillDriverImpl::RendererShouldClearFilledForm() { 152 void AutofillDriverImpl::RendererShouldClearFilledForm() {
143 if (!RendererIsAvailable()) 153 if (!RendererIsAvailable())
144 return; 154 return;
145 content::RenderViewHost* host = web_contents()->GetRenderViewHost(); 155 content::RenderViewHost* host = web_contents()->GetRenderViewHost();
146 host->Send(new AutofillMsg_ClearForm(host->GetRoutingID())); 156 host->Send(new AutofillMsg_ClearForm(host->GetRoutingID()));
147 } 157 }
148 158
149 void AutofillDriverImpl::RendererShouldClearPreviewedForm() { 159 void AutofillDriverImpl::RendererShouldClearPreviewedForm() {
150 if (!RendererIsAvailable()) 160 if (!RendererIsAvailable())
151 return; 161 return;
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 const content::LoadCommittedDetails& load_details) { 234 const content::LoadCommittedDetails& load_details) {
225 autofill_manager_->delegate()->HideAutofillPopup(); 235 autofill_manager_->delegate()->HideAutofillPopup();
226 } 236 }
227 237
228 void AutofillDriverImpl::WasHidden() { 238 void AutofillDriverImpl::WasHidden() {
229 autofill_manager_->delegate()->HideAutofillPopup(); 239 autofill_manager_->delegate()->HideAutofillPopup();
230 } 240 }
231 241
232 242
233 } // namespace autofill 243 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698