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

Side by Side Diff: chrome/renderer/autofill_helper.cc

Issue 4187010: Remove a DCHECK that broke a number of text input types... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 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 | Annotate | Revision Log
« 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 (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "chrome/renderer/autofill_helper.h" 5 #include "chrome/renderer/autofill_helper.h"
6 6
7 #include "app/l10n_util.h" 7 #include "app/l10n_util.h"
8 #include "chrome/renderer/form_manager.h" 8 #include "chrome/renderer/form_manager.h"
9 #include "chrome/renderer/render_view.h" 9 #include "chrome/renderer/render_view.h"
10 #include "grit/generated_resources.h" 10 #include "grit/generated_resources.h"
(...skipping 18 matching lines...) Expand all
29 // The size above which we stop triggering autofill for an input text field 29 // The size above which we stop triggering autofill for an input text field
30 // (so to avoid sending long strings through IPC). 30 // (so to avoid sending long strings through IPC).
31 const size_t kMaximumTextSizeForAutoFill = 1000; 31 const size_t kMaximumTextSizeForAutoFill = 1000;
32 32
33 33
34 // |node| must correspond to a form field. 34 // |node| must correspond to a form field.
35 // Returns true if |node| is auto-filled. 35 // Returns true if |node| is auto-filled.
36 bool NodeIsAutoFilled(const WebKit::WebNode& node) { 36 bool NodeIsAutoFilled(const WebKit::WebNode& node) {
37 const WebFormControlElement& element = 37 const WebFormControlElement& element =
38 reinterpret_cast<const WebFormControlElement&>(node); 38 reinterpret_cast<const WebFormControlElement&>(node);
39 DCHECK(element.formControlType() == WebString::fromUTF8("text"));
40 39
41 WebInputElement input_element = 40 WebInputElement input_element =
42 const_cast<WebFormControlElement&>(element).to<WebInputElement>(); 41 const_cast<WebFormControlElement&>(element).to<WebInputElement>();
43 return input_element.isAutofilled(); 42 return input_element.isAutofilled();
44 } 43 }
45 44
46 } // namespace 45 } // namespace
47 46
48 AutoFillHelper::AutoFillHelper(RenderView* render_view) 47 AutoFillHelper::AutoFillHelper(RenderView* render_view)
49 : render_view_(render_view), 48 : render_view_(render_view),
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 web_form, FormManager::REQUIRE_NONE, false, false, &form)) { 300 web_form, FormManager::REQUIRE_NONE, false, false, &form)) {
302 forms.push_back(form); 301 forms.push_back(form);
303 } 302 }
304 } 303 }
305 304
306 if (!forms.empty()) { 305 if (!forms.empty()) {
307 render_view_->Send(new ViewHostMsg_FormsSeen(render_view_->routing_id(), 306 render_view_->Send(new ViewHostMsg_FormsSeen(render_view_->routing_id(),
308 forms)); 307 forms));
309 } 308 }
310 } 309 }
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