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 #ifndef CONTENT_PUBLIC_BROWSER_NAVIGATION_CONTROLLER_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_NAVIGATION_CONTROLLER_H_ |
6 #define CONTENT_PUBLIC_BROWSER_NAVIGATION_CONTROLLER_H_ | 6 #define CONTENT_PUBLIC_BROWSER_NAVIGATION_CONTROLLER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
13 #include "base/strings/string16.h" | 13 #include "base/strings/string16.h" |
14 #include "content/common/content_export.h" | 14 #include "content/common/content_export.h" |
15 #include "content/public/browser/global_request_id.h" | 15 #include "content/public/browser/global_request_id.h" |
16 #include "content/public/browser/session_storage_namespace.h" | 16 #include "content/public/browser/session_storage_namespace.h" |
17 #include "content/public/common/page_transition_types.h" | |
18 #include "content/public/common/referrer.h" | 17 #include "content/public/common/referrer.h" |
| 18 #include "ui/base/page_transition_types.h" |
19 #include "url/gurl.h" | 19 #include "url/gurl.h" |
20 | 20 |
21 namespace base { | 21 namespace base { |
22 | 22 |
23 class RefCountedMemory; | 23 class RefCountedMemory; |
24 | 24 |
25 } // namespace base | 25 } // namespace base |
26 | 26 |
27 namespace content { | 27 namespace content { |
28 | 28 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 RESTORE_LAST_SESSION_EXITED_CLEANLY, | 87 RESTORE_LAST_SESSION_EXITED_CLEANLY, |
88 RESTORE_LAST_SESSION_CRASHED, | 88 RESTORE_LAST_SESSION_CRASHED, |
89 }; | 89 }; |
90 | 90 |
91 // Creates a navigation entry and translates the virtual url to a real one. | 91 // Creates a navigation entry and translates the virtual url to a real one. |
92 // This is a general call; prefer LoadURL[FromRenderer]/TransferURL below. | 92 // This is a general call; prefer LoadURL[FromRenderer]/TransferURL below. |
93 // Extra headers are separated by \n. | 93 // Extra headers are separated by \n. |
94 CONTENT_EXPORT static NavigationEntry* CreateNavigationEntry( | 94 CONTENT_EXPORT static NavigationEntry* CreateNavigationEntry( |
95 const GURL& url, | 95 const GURL& url, |
96 const Referrer& referrer, | 96 const Referrer& referrer, |
97 PageTransition transition, | 97 ui::PageTransition transition, |
98 bool is_renderer_initiated, | 98 bool is_renderer_initiated, |
99 const std::string& extra_headers, | 99 const std::string& extra_headers, |
100 BrowserContext* browser_context); | 100 BrowserContext* browser_context); |
101 | 101 |
102 // Extra optional parameters for LoadURLWithParams. | 102 // Extra optional parameters for LoadURLWithParams. |
103 struct CONTENT_EXPORT LoadURLParams { | 103 struct CONTENT_EXPORT LoadURLParams { |
104 // The url to load. This field is required. | 104 // The url to load. This field is required. |
105 GURL url; | 105 GURL url; |
106 | 106 |
107 // See LoadURLType comments above. | 107 // See LoadURLType comments above. |
108 LoadURLType load_type; | 108 LoadURLType load_type; |
109 | 109 |
110 // PageTransition for this load. See PageTransition for details. | 110 // PageTransition for this load. See PageTransition for details. |
111 // Note the default value in constructor below. | 111 // Note the default value in constructor below. |
112 PageTransition transition_type; | 112 ui::PageTransition transition_type; |
113 | 113 |
114 // The FrameTreeNode ID for the frame to navigate, or -1 for the main frame. | 114 // The FrameTreeNode ID for the frame to navigate, or -1 for the main frame. |
115 int64 frame_tree_node_id; | 115 int64 frame_tree_node_id; |
116 | 116 |
117 // Referrer for this load. Empty if none. | 117 // Referrer for this load. Empty if none. |
118 Referrer referrer; | 118 Referrer referrer; |
119 | 119 |
120 // Any redirect URLs that occurred for this navigation before |url|. | 120 // Any redirect URLs that occurred for this navigation before |url|. |
121 // Defaults to an empty vector. | 121 // Defaults to an empty vector. |
122 std::vector<GURL> redirect_chain; | 122 std::vector<GURL> redirect_chain; |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 // from them. | 289 // from them. |
290 // Note that adding a transient entry does not change the active contents. | 290 // Note that adding a transient entry does not change the active contents. |
291 virtual void SetTransientEntry(NavigationEntry* entry) = 0; | 291 virtual void SetTransientEntry(NavigationEntry* entry) = 0; |
292 | 292 |
293 // New navigations ----------------------------------------------------------- | 293 // New navigations ----------------------------------------------------------- |
294 | 294 |
295 // Loads the specified URL, specifying extra http headers to add to the | 295 // Loads the specified URL, specifying extra http headers to add to the |
296 // request. Extra headers are separated by \n. | 296 // request. Extra headers are separated by \n. |
297 virtual void LoadURL(const GURL& url, | 297 virtual void LoadURL(const GURL& url, |
298 const Referrer& referrer, | 298 const Referrer& referrer, |
299 PageTransition type, | 299 ui::PageTransition type, |
300 const std::string& extra_headers) = 0; | 300 const std::string& extra_headers) = 0; |
301 | 301 |
302 // More general version of LoadURL. See comments in LoadURLParams for | 302 // More general version of LoadURL. See comments in LoadURLParams for |
303 // using |params|. | 303 // using |params|. |
304 virtual void LoadURLWithParams(const LoadURLParams& params) = 0; | 304 virtual void LoadURLWithParams(const LoadURLParams& params) = 0; |
305 | 305 |
306 // Loads the current page if this NavigationController was restored from | 306 // Loads the current page if this NavigationController was restored from |
307 // history and the current page has not loaded yet or if the load was | 307 // history and the current page has not loaded yet or if the load was |
308 // explicitly requested using SetNeedsReload(). | 308 // explicitly requested using SetNeedsReload(). |
309 virtual void LoadIfNecessary() = 0; | 309 virtual void LoadIfNecessary() = 0; |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
441 | 441 |
442 private: | 442 private: |
443 // This interface should only be implemented inside content. | 443 // This interface should only be implemented inside content. |
444 friend class NavigationControllerImpl; | 444 friend class NavigationControllerImpl; |
445 NavigationController() {} | 445 NavigationController() {} |
446 }; | 446 }; |
447 | 447 |
448 } // namespace content | 448 } // namespace content |
449 | 449 |
450 #endif // CONTENT_PUBLIC_BROWSER_NAVIGATION_CONTROLLER_H_ | 450 #endif // CONTENT_PUBLIC_BROWSER_NAVIGATION_CONTROLLER_H_ |
OLD | NEW |