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

Side by Side Diff: Source/web/WebSelectElement.cpp

Issue 138433002: Add Autofill preview support for <select> input fields (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Update code and addressed all the review comments 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 void WebSelectElement::setValue(const WebString& value) 44 void WebSelectElement::setValue(const WebString& value)
45 { 45 {
46 unwrap<HTMLSelectElement>()->setValue(value); 46 unwrap<HTMLSelectElement>()->setValue(value);
47 } 47 }
48 48
49 WebString WebSelectElement::value() const 49 WebString WebSelectElement::value() const
50 { 50 {
51 return constUnwrap<HTMLSelectElement>()->value(); 51 return constUnwrap<HTMLSelectElement>()->value();
52 } 52 }
53 53
54 void WebSelectElement::setSuggestedValue(const WebString& value)
55 {
56 unwrap<HTMLSelectElement>()->setSuggestedValue(value);
57 }
58
59 WebString WebSelectElement::suggestedValue() const
60 {
61 return constUnwrap<HTMLSelectElement>()->suggestedValue();
62 }
63
54 WebVector<WebElement> WebSelectElement::listItems() const 64 WebVector<WebElement> WebSelectElement::listItems() const
55 { 65 {
56 const Vector<HTMLElement*>& sourceItems = constUnwrap<HTMLSelectElement>()-> listItems(); 66 const Vector<HTMLElement*>& sourceItems = constUnwrap<HTMLSelectElement>()-> listItems();
57 WebVector<WebElement> items(sourceItems.size()); 67 WebVector<WebElement> items(sourceItems.size());
58 for (size_t i = 0; i < sourceItems.size(); ++i) 68 for (size_t i = 0; i < sourceItems.size(); ++i)
59 items[i] = WebElement(sourceItems[i]); 69 items[i] = WebElement(sourceItems[i]);
60 70
61 return items; 71 return items;
62 } 72 }
63 73
64 WebSelectElement::WebSelectElement(const PassRefPtr<HTMLSelectElement>& element) 74 WebSelectElement::WebSelectElement(const PassRefPtr<HTMLSelectElement>& element)
65 : WebFormControlElement(element) 75 : WebFormControlElement(element)
66 { 76 {
67 } 77 }
68 78
69 WebSelectElement& WebSelectElement::operator=(const PassRefPtr<HTMLSelectElement >& element) 79 WebSelectElement& WebSelectElement::operator=(const PassRefPtr<HTMLSelectElement >& element)
70 { 80 {
71 m_private = element; 81 m_private = element;
72 return *this; 82 return *this;
73 } 83 }
74 84
75 WebSelectElement::operator PassRefPtr<HTMLSelectElement>() const 85 WebSelectElement::operator PassRefPtr<HTMLSelectElement>() const
76 { 86 {
77 return toHTMLSelectElement(m_private.get()); 87 return toHTMLSelectElement(m_private.get());
78 } 88 }
79 89
80 } // namespace blink 90 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698