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 // 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_BROWSER_TAB_CONTENTS_PAGE_NAVIGATOR_H_ | 9 #ifndef CONTENT_BROWSER_TAB_CONTENTS_PAGE_NAVIGATOR_H_ |
10 #define CONTENT_BROWSER_TAB_CONTENTS_PAGE_NAVIGATOR_H_ | 10 #define CONTENT_BROWSER_TAB_CONTENTS_PAGE_NAVIGATOR_H_ |
11 #pragma once | 11 #pragma once |
12 | 12 |
13 #include <string> | 13 #include <string> |
14 | 14 |
15 #include "content/browser/renderer_host/global_request_id.h" | 15 #include "content/browser/renderer_host/global_request_id.h" |
16 #include "content/common/content_export.h" | 16 #include "content/common/content_export.h" |
17 #include "content/public/common/page_transition_types.h" | 17 #include "content/public/common/page_transition_types.h" |
| 18 #include "content/public/common/referrer.h" |
18 #include "googleurl/src/gurl.h" | 19 #include "googleurl/src/gurl.h" |
19 #include "webkit/glue/window_open_disposition.h" | 20 #include "webkit/glue/window_open_disposition.h" |
20 | 21 |
21 class TabContents; | 22 class TabContents; |
22 | 23 |
23 struct CONTENT_EXPORT OpenURLParams { | 24 struct CONTENT_EXPORT OpenURLParams { |
24 OpenURLParams(const GURL& url, | 25 OpenURLParams(const GURL& url, |
25 const GURL& referrer, | 26 const content::Referrer& referrer, |
26 WindowOpenDisposition disposition, | 27 WindowOpenDisposition disposition, |
27 content::PageTransition transition, | 28 content::PageTransition transition, |
28 bool is_renderer_initiated); | 29 bool is_renderer_initiated); |
29 ~OpenURLParams(); | 30 ~OpenURLParams(); |
30 | 31 |
31 // The URL/referrer to be opened. | 32 // The URL/referrer to be opened. |
32 GURL url; | 33 GURL url; |
33 GURL referrer; | 34 content::Referrer referrer; |
34 | 35 |
35 // The disposition requested by the navigation source. | 36 // The disposition requested by the navigation source. |
36 WindowOpenDisposition disposition; | 37 WindowOpenDisposition disposition; |
37 | 38 |
38 // The transition type of navigation. | 39 // The transition type of navigation. |
39 content::PageTransition transition; | 40 content::PageTransition transition; |
40 | 41 |
41 // Whether this navigation is initiated by the renderer process. | 42 // Whether this navigation is initiated by the renderer process. |
42 bool is_renderer_initiated; | 43 bool is_renderer_initiated; |
43 | 44 |
(...skipping 21 matching lines...) Expand all Loading... |
65 // navigation should be recorded in the history system (for example, typed). | 66 // navigation should be recorded in the history system (for example, typed). |
66 // Returns the TabContents the URL is opened in, or NULL if the URL wasn't | 67 // Returns the TabContents the URL is opened in, or NULL if the URL wasn't |
67 // opened immediately. | 68 // opened immediately. |
68 virtual TabContents* OpenURL(const OpenURLParams& params) = 0; | 69 virtual TabContents* OpenURL(const OpenURLParams& params) = 0; |
69 | 70 |
70 protected: | 71 protected: |
71 virtual ~PageNavigator() {} | 72 virtual ~PageNavigator() {} |
72 }; | 73 }; |
73 | 74 |
74 #endif // CONTENT_BROWSER_TAB_CONTENTS_PAGE_NAVIGATOR_H_ | 75 #endif // CONTENT_BROWSER_TAB_CONTENTS_PAGE_NAVIGATOR_H_ |
OLD | NEW |