| 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 encodedString->append("{searchTerms}", 13); | 228 encodedString->append("{searchTerms}", 13); |
| 229 isElementFound = true; | 229 isElementFound = true; |
| 230 } else | 230 } else |
| 231 FormDataBuilder::encodeStringAsFormData(*encodedString, j->data(
)); | 231 FormDataBuilder::encodeStringAsFormData(*encodedString, j->data(
)); |
| 232 } | 232 } |
| 233 } | 233 } |
| 234 return isElementFound; | 234 return isElementFound; |
| 235 } | 235 } |
| 236 } // namespace | 236 } // namespace |
| 237 | 237 |
| 238 namespace WebKit { | 238 namespace blink { |
| 239 | 239 |
| 240 WebSearchableFormData::WebSearchableFormData(const WebFormElement& form, const W
ebInputElement& selectedInputElement) | 240 WebSearchableFormData::WebSearchableFormData(const WebFormElement& form, const W
ebInputElement& selectedInputElement) |
| 241 { | 241 { |
| 242 RefPtr<HTMLFormElement> formElement = form.operator PassRefPtr<HTMLFormEleme
nt>(); | 242 RefPtr<HTMLFormElement> formElement = form.operator PassRefPtr<HTMLFormEleme
nt>(); |
| 243 HTMLInputElement* inputElement = selectedInputElement.operator PassRefPtr<HT
MLInputElement>().get(); | 243 HTMLInputElement* inputElement = selectedInputElement.operator PassRefPtr<HT
MLInputElement>().get(); |
| 244 | 244 |
| 245 // Only consider forms that GET data. | 245 // Only consider forms that GET data. |
| 246 // Allow HTTPS only when an input element is provided. | 246 // Allow HTTPS only when an input element is provided. |
| 247 if (equalIgnoringCase(formElement->getAttribute(methodAttr), "post") | 247 if (equalIgnoringCase(formElement->getAttribute(methodAttr), "post") |
| 248 || (!IsHTTPFormSubmit(formElement.get()) && !inputElement)) | 248 || (!IsHTTPFormSubmit(formElement.get()) && !inputElement)) |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 return; | 287 return; |
| 288 | 288 |
| 289 String action(formElement->action()); | 289 String action(formElement->action()); |
| 290 KURL url(formElement->document().completeURL(action.isNull() ? "" : action))
; | 290 KURL url(formElement->document().completeURL(action.isNull() ? "" : action))
; |
| 291 RefPtr<FormData> formData = FormData::create(encodedString); | 291 RefPtr<FormData> formData = FormData::create(encodedString); |
| 292 url.setQuery(formData->flattenToString()); | 292 url.setQuery(formData->flattenToString()); |
| 293 m_url = url; | 293 m_url = url; |
| 294 m_encoding = String(encoding.name()); | 294 m_encoding = String(encoding.name()); |
| 295 } | 295 } |
| 296 | 296 |
| 297 } // namespace WebKit | 297 } // namespace blink |
| OLD | NEW |