| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef WEBKIT_GLUE_DOM_OPERATIONS_H__ | 5 #ifndef WEBKIT_GLUE_DOM_OPERATIONS_H__ |
| 6 #define WEBKIT_GLUE_DOM_OPERATIONS_H__ | 6 #define WEBKIT_GLUE_DOM_OPERATIONS_H__ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "googleurl/src/gurl.h" | 11 #include "googleurl/src/gurl.h" |
| 12 #include "third_party/WebKit/Source/Platform/chromium/public/WebReferrerPolicy.h
" |
| 12 #include "webkit/glue/webkit_glue_export.h" | 13 #include "webkit/glue/webkit_glue_export.h" |
| 13 | 14 |
| 14 namespace WebKit { | 15 namespace WebKit { |
| 15 class WebDocument; | 16 class WebDocument; |
| 16 class WebElement; | 17 class WebElement; |
| 17 class WebString; | 18 class WebString; |
| 18 class WebView; | 19 class WebView; |
| 19 } | 20 } |
| 20 | 21 |
| 21 // A collection of operations that access the underlying WebKit DOM directly. | 22 // A collection of operations that access the underlying WebKit DOM directly. |
| 22 namespace webkit_glue { | 23 namespace webkit_glue { |
| 23 | 24 |
| 24 // Structure for storage the result of getting all savable resource links | 25 // Structure for storage the result of getting all savable resource links |
| 25 // for current page. The consumer of the SavableResourcesResult is responsible | 26 // for current page. The consumer of the SavableResourcesResult is responsible |
| 26 // for keeping these pointers valid for the lifetime of the | 27 // for keeping these pointers valid for the lifetime of the |
| 27 // SavableResourcesResult instance. | 28 // SavableResourcesResult instance. |
| 28 struct SavableResourcesResult { | 29 struct SavableResourcesResult { |
| 29 // vector which contains all savable links of sub resource. | 30 // vector which contains all savable links of sub resource. |
| 30 std::vector<GURL>* resources_list; | 31 std::vector<GURL>* resources_list; |
| 31 // vector which contains corresponding all referral links of sub resource, | 32 // vector which contains corresponding all referral links of sub resource, |
| 32 // it matched with links one by one. | 33 // it matched with links one by one. |
| 33 std::vector<GURL>* referrers_list; | 34 std::vector<GURL>* referrer_urls_list; |
| 35 // and the corresponding referrer policies. |
| 36 std::vector<WebKit::WebReferrerPolicy>* referrer_policies_list; |
| 34 // vector which contains all savable links of main frame and sub frames. | 37 // vector which contains all savable links of main frame and sub frames. |
| 35 std::vector<GURL>* frames_list; | 38 std::vector<GURL>* frames_list; |
| 36 | 39 |
| 37 // Constructor. | 40 // Constructor. |
| 38 SavableResourcesResult(std::vector<GURL>* resources_list, | 41 SavableResourcesResult( |
| 39 std::vector<GURL>* referrers_list, | 42 std::vector<GURL>* resources_list, |
| 40 std::vector<GURL>* frames_list) | 43 std::vector<GURL>* referrer_urls_list, |
| 44 std::vector<WebKit::WebReferrerPolicy>* referrer_policies_list, |
| 45 std::vector<GURL>* frames_list) |
| 41 : resources_list(resources_list), | 46 : resources_list(resources_list), |
| 42 referrers_list(referrers_list), | 47 referrer_urls_list(referrer_urls_list), |
| 48 referrer_policies_list(referrer_policies_list), |
| 43 frames_list(frames_list) { } | 49 frames_list(frames_list) { } |
| 44 | 50 |
| 45 private: | 51 private: |
| 46 DISALLOW_COPY_AND_ASSIGN(SavableResourcesResult); | 52 DISALLOW_COPY_AND_ASSIGN(SavableResourcesResult); |
| 47 }; | 53 }; |
| 48 | 54 |
| 49 // Get all savable resource links from current webview, include main frame | 55 // Get all savable resource links from current webview, include main frame |
| 50 // and sub-frame. After collecting all savable resource links, this function | 56 // and sub-frame. After collecting all savable resource links, this function |
| 51 // will send those links to embedder. Return value indicates whether we get | 57 // will send those links to embedder. Return value indicates whether we get |
| 52 // all saved resource links successfully. | 58 // all saved resource links successfully. |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 // with a value of |attribute_value| in |meta_elements|. | 97 // with a value of |attribute_value| in |meta_elements|. |
| 92 WEBKIT_GLUE_EXPORT void GetMetaElementsWithAttribute( | 98 WEBKIT_GLUE_EXPORT void GetMetaElementsWithAttribute( |
| 93 WebKit::WebDocument* document, | 99 WebKit::WebDocument* document, |
| 94 const string16& attribute_name, | 100 const string16& attribute_name, |
| 95 const string16& atribute_value, | 101 const string16& atribute_value, |
| 96 std::vector<WebKit::WebElement>* meta_elements); | 102 std::vector<WebKit::WebElement>* meta_elements); |
| 97 | 103 |
| 98 } // namespace webkit_glue | 104 } // namespace webkit_glue |
| 99 | 105 |
| 100 #endif // WEBKIT_GLUE_DOM_OPERATIONS_H__ | 106 #endif // WEBKIT_GLUE_DOM_OPERATIONS_H__ |
| OLD | NEW |