| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // PageNavigator defines an interface that can be used to express the user's | 5 // PageNavigator defines an interface that can be used to express the user's |
| 6 // intention to navigate to a particular URL. The implementing class should | 6 // intention to navigate to a particular URL. The implementing class should |
| 7 // perform the navigation. | 7 // perform the navigation. |
| 8 | 8 |
| 9 #ifndef CONTENT_PUBLIC_BROWSER_PAGE_NAVIGATOR_H_ | 9 #ifndef CONTENT_PUBLIC_BROWSER_PAGE_NAVIGATOR_H_ |
| 10 #define CONTENT_PUBLIC_BROWSER_PAGE_NAVIGATOR_H_ | 10 #define CONTENT_PUBLIC_BROWSER_PAGE_NAVIGATOR_H_ |
| 11 | 11 |
| 12 #include <string> | 12 #include <string> |
| 13 | 13 |
| 14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
| 15 #include "base/memory/ref_counted_memory.h" | 15 #include "base/memory/ref_counted_memory.h" |
| 16 #include "content/common/content_export.h" | 16 #include "content/common/content_export.h" |
| 17 #include "content/public/browser/global_request_id.h" | 17 #include "content/public/browser/global_request_id.h" |
| 18 #include "content/public/browser/site_instance.h" |
| 18 #include "content/public/common/referrer.h" | 19 #include "content/public/common/referrer.h" |
| 19 #include "ui/base/page_transition_types.h" | 20 #include "ui/base/page_transition_types.h" |
| 20 #include "ui/base/window_open_disposition.h" | 21 #include "ui/base/window_open_disposition.h" |
| 21 #include "url/gurl.h" | 22 #include "url/gurl.h" |
| 22 | 23 |
| 23 namespace content { | 24 namespace content { |
| 24 | 25 |
| 25 class WebContents; | 26 class WebContents; |
| 26 | 27 |
| 27 struct CONTENT_EXPORT OpenURLParams { | 28 struct CONTENT_EXPORT OpenURLParams { |
| 28 OpenURLParams(const GURL& url, | 29 OpenURLParams(const GURL& url, |
| 29 const Referrer& referrer, | 30 const Referrer& referrer, |
| 30 WindowOpenDisposition disposition, | 31 WindowOpenDisposition disposition, |
| 31 ui::PageTransition transition, | 32 ui::PageTransition transition, |
| 32 bool is_renderer_initiated); | 33 bool is_renderer_initiated); |
| 33 OpenURLParams(const GURL& url, | 34 OpenURLParams(const GURL& url, |
| 34 const Referrer& referrer, | 35 const Referrer& referrer, |
| 35 int64 frame_tree_node_id, | 36 int64 frame_tree_node_id, |
| 36 WindowOpenDisposition disposition, | 37 WindowOpenDisposition disposition, |
| 37 ui::PageTransition transition, | 38 ui::PageTransition transition, |
| 38 bool is_renderer_initiated); | 39 bool is_renderer_initiated); |
| 39 ~OpenURLParams(); | 40 ~OpenURLParams(); |
| 40 | 41 |
| 41 // The URL/referrer to be opened. | 42 // The URL/referrer to be opened. |
| 42 GURL url; | 43 GURL url; |
| 43 Referrer referrer; | 44 Referrer referrer; |
| 44 | 45 |
| 46 // Site instance of the frame that initiated the navigation or null if we |
| 47 // don't know it. |
| 48 scoped_refptr<content::SiteInstance> source_site_instance; |
| 49 |
| 45 // Any redirect URLs that occurred for this navigation before |url|. | 50 // Any redirect URLs that occurred for this navigation before |url|. |
| 46 std::vector<GURL> redirect_chain; | 51 std::vector<GURL> redirect_chain; |
| 47 | 52 |
| 48 // Indicates whether this navigation will be sent using POST. | 53 // Indicates whether this navigation will be sent using POST. |
| 49 // The POST method is limited support for basic POST data by leveraging | 54 // The POST method is limited support for basic POST data by leveraging |
| 50 // NavigationController::LOAD_TYPE_BROWSER_INITIATED_HTTP_POST. | 55 // NavigationController::LOAD_TYPE_BROWSER_INITIATED_HTTP_POST. |
| 51 // It is not for things like file uploads. | 56 // It is not for things like file uploads. |
| 52 bool uses_post; | 57 bool uses_post; |
| 53 | 58 |
| 54 // The post data when the navigation uses POST. | 59 // The post data when the navigation uses POST. |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 // Opens a URL with the given disposition. The transition specifies how this | 99 // Opens a URL with the given disposition. The transition specifies how this |
| 95 // navigation should be recorded in the history system (for example, typed). | 100 // navigation should be recorded in the history system (for example, typed). |
| 96 // Returns the WebContents the URL is opened in, or NULL if the URL wasn't | 101 // Returns the WebContents the URL is opened in, or NULL if the URL wasn't |
| 97 // opened immediately. | 102 // opened immediately. |
| 98 virtual WebContents* OpenURL(const OpenURLParams& params) = 0; | 103 virtual WebContents* OpenURL(const OpenURLParams& params) = 0; |
| 99 }; | 104 }; |
| 100 | 105 |
| 101 } // namespace content | 106 } // namespace content |
| 102 | 107 |
| 103 #endif // CONTENT_PUBLIC_BROWSER_PAGE_NAVIGATOR_H_ | 108 #endif // CONTENT_PUBLIC_BROWSER_PAGE_NAVIGATOR_H_ |
| OLD | NEW |