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

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

Issue 176943007: Check for Renderer in SendAutofillTypePredictionsToRenderer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/content/common/autofill_messages.h" 9 #include "components/autofill/content/common/autofill_messages.h"
10 #include "components/autofill/core/browser/autofill_external_delegate.h" 10 #include "components/autofill/core/browser/autofill_external_delegate.h"
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 host->Send( 113 host->Send(
114 new AutofillMsg_FormDataFilled(host->GetRoutingID(), query_id, data)); 114 new AutofillMsg_FormDataFilled(host->GetRoutingID(), query_id, data));
115 } 115 }
116 116
117 void AutofillDriverImpl::SendAutofillTypePredictionsToRenderer( 117 void AutofillDriverImpl::SendAutofillTypePredictionsToRenderer(
118 const std::vector<FormStructure*>& forms) { 118 const std::vector<FormStructure*>& forms) {
119 if (!CommandLine::ForCurrentProcess()->HasSwitch( 119 if (!CommandLine::ForCurrentProcess()->HasSwitch(
120 switches::kShowAutofillTypePredictions)) 120 switches::kShowAutofillTypePredictions))
121 return; 121 return;
122 122
123 if (!RendererIsAvailable())
124 return;
123 content::RenderViewHost* host = web_contents()->GetRenderViewHost(); 125 content::RenderViewHost* host = web_contents()->GetRenderViewHost();
124 if (!host)
125 return;
126 126
127 std::vector<FormDataPredictions> type_predictions; 127 std::vector<FormDataPredictions> type_predictions;
128 FormStructure::GetFieldTypePredictions(forms, &type_predictions); 128 FormStructure::GetFieldTypePredictions(forms, &type_predictions);
129 host->Send( 129 host->Send(
130 new AutofillMsg_FieldTypePredictionsAvailable(host->GetRoutingID(), 130 new AutofillMsg_FieldTypePredictionsAvailable(host->GetRoutingID(),
131 type_predictions)); 131 type_predictions));
132 } 132 }
133 133
134 void AutofillDriverImpl::RendererShouldAcceptDataListSuggestion( 134 void AutofillDriverImpl::RendererShouldAcceptDataListSuggestion(
135 const base::string16& value) { 135 const base::string16& value) {
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 void AutofillDriverImpl::NavigationEntryCommitted( 231 void AutofillDriverImpl::NavigationEntryCommitted(
232 const content::LoadCommittedDetails& load_details) { 232 const content::LoadCommittedDetails& load_details) {
233 autofill_manager_->delegate()->HideAutofillPopup(); 233 autofill_manager_->delegate()->HideAutofillPopup();
234 } 234 }
235 235
236 void AutofillDriverImpl::WasHidden() { 236 void AutofillDriverImpl::WasHidden() {
237 autofill_manager_->delegate()->HideAutofillPopup(); 237 autofill_manager_->delegate()->HideAutofillPopup();
238 } 238 }
239 239
240 } // namespace autofill 240 } // namespace autofill
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698