OLD | NEW |
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/autofill/content/browser/content_autofill_driver.h" | 5 #include "components/autofill/content/browser/content_autofill_driver.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/content/common/autofill_messages.h" | 9 #include "components/autofill/content/common/autofill_messages.h" |
10 #include "components/autofill/core/browser/autofill_client.h" | 10 #include "components/autofill/core/browser/autofill_client.h" |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 | 131 |
132 void ContentAutofillDriver::RendererShouldFillFieldWithValue( | 132 void ContentAutofillDriver::RendererShouldFillFieldWithValue( |
133 const base::string16& value) { | 133 const base::string16& value) { |
134 if (!RendererIsAvailable()) | 134 if (!RendererIsAvailable()) |
135 return; | 135 return; |
136 render_frame_host_->Send(new AutofillMsg_FillFieldWithValue( | 136 render_frame_host_->Send(new AutofillMsg_FillFieldWithValue( |
137 render_frame_host_->GetRoutingID(), value)); | 137 render_frame_host_->GetRoutingID(), value)); |
138 } | 138 } |
139 | 139 |
140 void ContentAutofillDriver::RendererShouldPreviewFieldWithValue( | 140 void ContentAutofillDriver::RendererShouldPreviewFieldWithValue( |
141 const base::string16& value) { | 141 const base::string16& value, |
| 142 size_t match_start) { |
142 if (!RendererIsAvailable()) | 143 if (!RendererIsAvailable()) |
143 return; | 144 return; |
144 render_frame_host_->Send(new AutofillMsg_PreviewFieldWithValue( | 145 render_frame_host_->Send(new AutofillMsg_PreviewFieldWithValue( |
145 render_frame_host_->GetRoutingID(), value)); | 146 render_frame_host_->GetRoutingID(), value, match_start)); |
146 } | 147 } |
147 | 148 |
148 void ContentAutofillDriver::PopupHidden() { | 149 void ContentAutofillDriver::PopupHidden() { |
149 // If the unmask prompt is showing, keep showing the preview. The preview | 150 // If the unmask prompt is showing, keep showing the preview. The preview |
150 // will be cleared when the prompt closes. | 151 // will be cleared when the prompt closes. |
151 if (!autofill_manager_->IsShowingUnmaskPrompt()) | 152 if (!autofill_manager_->IsShowingUnmaskPrompt()) |
152 RendererShouldClearPreviewedForm(); | 153 RendererShouldClearPreviewedForm(); |
153 } | 154 } |
154 | 155 |
155 bool ContentAutofillDriver::HandleMessage(const IPC::Message& message) { | 156 bool ContentAutofillDriver::HandleMessage(const IPC::Message& message) { |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 autofill_manager_->Reset(); | 205 autofill_manager_->Reset(); |
205 } | 206 } |
206 | 207 |
207 void ContentAutofillDriver::SetAutofillManager( | 208 void ContentAutofillDriver::SetAutofillManager( |
208 scoped_ptr<AutofillManager> manager) { | 209 scoped_ptr<AutofillManager> manager) { |
209 autofill_manager_ = manager.Pass(); | 210 autofill_manager_ = manager.Pass(); |
210 autofill_manager_->SetExternalDelegate(&autofill_external_delegate_); | 211 autofill_manager_->SetExternalDelegate(&autofill_external_delegate_); |
211 } | 212 } |
212 | 213 |
213 } // namespace autofill | 214 } // namespace autofill |
OLD | NEW |