| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef WEBKIT_GLUE_SEARCHABLE_FORM_DATA_H__ | |
| 6 #define WEBKIT_GLUE_SEARCHABLE_FORM_DATA_H__ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 #include "googleurl/src/gurl.h" | |
| 11 | |
| 12 namespace WebKit { | |
| 13 class WebForm; | |
| 14 } | |
| 15 | |
| 16 namespace webkit_glue { | |
| 17 | |
| 18 // SearchableFormData encapsulates a URL and class name of an INPUT field | |
| 19 // that correspond to a searchable form request. | |
| 20 class SearchableFormData { | |
| 21 public: | |
| 22 // If form contains elements that constitutes a valid searchable form | |
| 23 // request, a SearchableFormData is created and returned. | |
| 24 static SearchableFormData* Create(const WebKit::WebForm& form); | |
| 25 | |
| 26 // URL for the searchable form request. | |
| 27 const GURL& url() const { return url_; } | |
| 28 | |
| 29 // Encoding used to encode the form parameters; never empty. | |
| 30 const std::string& encoding() const { return encoding_; } | |
| 31 | |
| 32 private: | |
| 33 SearchableFormData(const GURL& url, const std::string& encoding) | |
| 34 : url_(url), | |
| 35 encoding_(encoding) { | |
| 36 } | |
| 37 | |
| 38 const GURL url_; | |
| 39 const std::string encoding_; | |
| 40 | |
| 41 DISALLOW_COPY_AND_ASSIGN(SearchableFormData); | |
| 42 }; | |
| 43 | |
| 44 } // namespace webkit_glue | |
| 45 | |
| 46 #endif // WEBKIT_GLUE_SEARCHABLE_FORM_H__ | |
| OLD | NEW |