OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 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 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 } | 228 } |
229 } | 229 } |
230 return isElementFound; | 230 return isElementFound; |
231 } | 231 } |
232 } // namespace | 232 } // namespace |
233 | 233 |
234 namespace blink { | 234 namespace blink { |
235 | 235 |
236 WebSearchableFormData::WebSearchableFormData(const WebFormElement& form, const W
ebInputElement& selectedInputElement) | 236 WebSearchableFormData::WebSearchableFormData(const WebFormElement& form, const W
ebInputElement& selectedInputElement) |
237 { | 237 { |
238 RefPtr<HTMLFormElement> formElement = form.operator PassRefPtr<HTMLFormEleme
nt>(); | 238 RefPtrWillBeRawPtr<HTMLFormElement> formElement = static_cast<PassRefPtrWill
BeRawPtr<HTMLFormElement> >(form); |
239 HTMLInputElement* inputElement = selectedInputElement.operator PassRefPtr<HT
MLInputElement>().get(); | 239 HTMLInputElement* inputElement = static_cast<PassRefPtrWillBeRawPtr<HTMLInpu
tElement> >(selectedInputElement).get(); |
240 | 240 |
241 // Only consider forms that GET data. | 241 // Only consider forms that GET data. |
242 // Allow HTTPS only when an input element is provided. | 242 // Allow HTTPS only when an input element is provided. |
243 if (equalIgnoringCase(formElement->getAttribute(methodAttr), "post") | 243 if (equalIgnoringCase(formElement->getAttribute(methodAttr), "post") |
244 || (!IsHTTPFormSubmit(formElement.get()) && !inputElement)) | 244 || (!IsHTTPFormSubmit(formElement.get()) && !inputElement)) |
245 return; | 245 return; |
246 | 246 |
247 Vector<char> encodedString; | 247 Vector<char> encodedString; |
248 WTF::TextEncoding encoding; | 248 WTF::TextEncoding encoding; |
249 | 249 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 | 284 |
285 String action(formElement->action()); | 285 String action(formElement->action()); |
286 KURL url(formElement->document().completeURL(action.isNull() ? "" : action))
; | 286 KURL url(formElement->document().completeURL(action.isNull() ? "" : action))
; |
287 RefPtr<FormData> formData = FormData::create(encodedString); | 287 RefPtr<FormData> formData = FormData::create(encodedString); |
288 url.setQuery(formData->flattenToString()); | 288 url.setQuery(formData->flattenToString()); |
289 m_url = url; | 289 m_url = url; |
290 m_encoding = String(encoding.name()); | 290 m_encoding = String(encoding.name()); |
291 } | 291 } |
292 | 292 |
293 } // namespace blink | 293 } // namespace blink |
OLD | NEW |