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_BROWSER_WEB_CONTENTS_NAVIGATION_CONTROLLER_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_WEB_CONTENTS_NAVIGATION_CONTROLLER_IMPL_H_ |
6 #define CONTENT_BROWSER_WEB_CONTENTS_NAVIGATION_CONTROLLER_IMPL_H_ | 6 #define CONTENT_BROWSER_WEB_CONTENTS_NAVIGATION_CONTROLLER_IMPL_H_ |
7 | 7 |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/memory/linked_ptr.h" | 10 #include "base/memory/linked_ptr.h" |
11 #include "base/time.h" | 11 #include "base/time.h" |
12 #include "content/browser/ssl/ssl_manager.h" | 12 #include "content/browser/ssl/ssl_manager.h" |
13 #include "content/public/browser/android/navigation_controller_webview.h" | |
14 #include "content/public/browser/navigation_controller.h" | 13 #include "content/public/browser/navigation_controller.h" |
15 #include "content/public/browser/navigation_type.h" | 14 #include "content/public/browser/navigation_type.h" |
16 | 15 |
17 class SessionStorageNamespaceImpl; | 16 class SessionStorageNamespaceImpl; |
18 struct ViewHostMsg_FrameNavigate_Params; | 17 struct ViewHostMsg_FrameNavigate_Params; |
19 class WebContentsImpl; | 18 class WebContentsImpl; |
20 | 19 |
21 namespace content { | 20 namespace content { |
22 class NavigationEntryImpl; | 21 class NavigationEntryImpl; |
23 struct LoadCommittedDetails; | 22 struct LoadCommittedDetails; |
24 class SiteInstance; | 23 class SiteInstance; |
25 } | 24 } |
26 | 25 |
27 class CONTENT_EXPORT NavigationControllerImpl | 26 class CONTENT_EXPORT NavigationControllerImpl |
28 : public NON_EXPORTED_BASE(content::NavigationController), | 27 : public NON_EXPORTED_BASE(content::NavigationController) { |
29 public NON_EXPORTED_BASE(content::NavigationControllerWebView) { | |
30 public: | 28 public: |
31 NavigationControllerImpl( | 29 NavigationControllerImpl( |
32 WebContentsImpl* web_contents, | 30 WebContentsImpl* web_contents, |
33 content::BrowserContext* browser_context, | 31 content::BrowserContext* browser_context, |
34 SessionStorageNamespaceImpl* session_storage_namespace); | 32 SessionStorageNamespaceImpl* session_storage_namespace); |
35 virtual ~NavigationControllerImpl(); | 33 virtual ~NavigationControllerImpl(); |
36 | 34 |
37 // NavigationController implementation: | 35 // NavigationController implementation: |
38 virtual content::WebContents* GetWebContents() const OVERRIDE; | 36 virtual content::WebContents* GetWebContents() const OVERRIDE; |
39 virtual content::BrowserContext* GetBrowserContext() const OVERRIDE; | 37 virtual content::BrowserContext* GetBrowserContext() const OVERRIDE; |
(...skipping 13 matching lines...) Expand all Loading... |
53 virtual content::NavigationEntry* GetEntryAtIndex(int index) const OVERRIDE; | 51 virtual content::NavigationEntry* GetEntryAtIndex(int index) const OVERRIDE; |
54 virtual content::NavigationEntry* GetEntryAtOffset(int offset) const OVERRIDE; | 52 virtual content::NavigationEntry* GetEntryAtOffset(int offset) const OVERRIDE; |
55 virtual void DiscardNonCommittedEntries() OVERRIDE; | 53 virtual void DiscardNonCommittedEntries() OVERRIDE; |
56 virtual content::NavigationEntry* GetPendingEntry() const OVERRIDE; | 54 virtual content::NavigationEntry* GetPendingEntry() const OVERRIDE; |
57 virtual int GetPendingEntryIndex() const OVERRIDE; | 55 virtual int GetPendingEntryIndex() const OVERRIDE; |
58 virtual content::NavigationEntry* GetTransientEntry() const OVERRIDE; | 56 virtual content::NavigationEntry* GetTransientEntry() const OVERRIDE; |
59 virtual void LoadURL(const GURL& url, | 57 virtual void LoadURL(const GURL& url, |
60 const content::Referrer& referrer, | 58 const content::Referrer& referrer, |
61 content::PageTransition type, | 59 content::PageTransition type, |
62 const std::string& extra_headers) OVERRIDE; | 60 const std::string& extra_headers) OVERRIDE; |
63 virtual void LoadURLFromRenderer(const GURL& url, | 61 virtual void LoadURLWithParams(LoadURLParams& params) OVERRIDE; |
64 const content::Referrer& referrer, | |
65 content::PageTransition type, | |
66 const std::string& extra_headers) OVERRIDE; | |
67 virtual void LoadURLWithUserAgentOverride( | |
68 const GURL& url, | |
69 const content::Referrer& referrer, | |
70 content::PageTransition type, | |
71 bool is_renderer_initiated, | |
72 const std::string& extra_headers, | |
73 bool is_overriding_user_agent) OVERRIDE; | |
74 virtual void TransferURL( | |
75 const GURL& url, | |
76 const content::Referrer& referrer, | |
77 content::PageTransition transition, | |
78 const std::string& extra_headers, | |
79 const content::GlobalRequestID& transferred_global_request_id, | |
80 bool is_renderer_initiated) OVERRIDE; | |
81 virtual void LoadIfNecessary() OVERRIDE; | 62 virtual void LoadIfNecessary() OVERRIDE; |
82 virtual bool CanGoBack() const OVERRIDE; | 63 virtual bool CanGoBack() const OVERRIDE; |
83 virtual bool CanGoForward() const OVERRIDE; | 64 virtual bool CanGoForward() const OVERRIDE; |
84 virtual bool CanGoToOffset(int offset) const OVERRIDE; | 65 virtual bool CanGoToOffset(int offset) const OVERRIDE; |
85 virtual void GoBack() OVERRIDE; | 66 virtual void GoBack() OVERRIDE; |
86 virtual void GoForward() OVERRIDE; | 67 virtual void GoForward() OVERRIDE; |
87 virtual void GoToIndex(int index) OVERRIDE; | 68 virtual void GoToIndex(int index) OVERRIDE; |
88 virtual void GoToOffset(int offset) OVERRIDE; | 69 virtual void GoToOffset(int offset) OVERRIDE; |
89 virtual void RemoveEntryAtIndex(int index) OVERRIDE; | 70 virtual void RemoveEntryAtIndex(int index) OVERRIDE; |
90 virtual content::SessionStorageNamespace* | 71 virtual content::SessionStorageNamespace* |
91 GetSessionStorageNamespace() const OVERRIDE; | 72 GetSessionStorageNamespace() const OVERRIDE; |
92 virtual void SetMaxRestoredPageID(int32 max_id) OVERRIDE; | 73 virtual void SetMaxRestoredPageID(int32 max_id) OVERRIDE; |
93 virtual int32 GetMaxRestoredPageID() const OVERRIDE; | 74 virtual int32 GetMaxRestoredPageID() const OVERRIDE; |
94 virtual bool NeedsReload() const OVERRIDE; | 75 virtual bool NeedsReload() const OVERRIDE; |
95 virtual void CancelPendingReload() OVERRIDE; | 76 virtual void CancelPendingReload() OVERRIDE; |
96 virtual void ContinuePendingReload() OVERRIDE; | 77 virtual void ContinuePendingReload() OVERRIDE; |
97 virtual bool IsInitialNavigation() OVERRIDE; | 78 virtual bool IsInitialNavigation() OVERRIDE; |
98 virtual void Reload(bool check_for_repost) OVERRIDE; | 79 virtual void Reload(bool check_for_repost) OVERRIDE; |
99 virtual void ReloadIgnoringCache(bool check_for_repost) OVERRIDE; | 80 virtual void ReloadIgnoringCache(bool check_for_repost) OVERRIDE; |
100 virtual void NotifyEntryChanged(const content::NavigationEntry* entry, | 81 virtual void NotifyEntryChanged(const content::NavigationEntry* entry, |
101 int index) OVERRIDE; | 82 int index) OVERRIDE; |
102 virtual void CopyStateFrom( | 83 virtual void CopyStateFrom( |
103 const content::NavigationController& source) OVERRIDE; | 84 const content::NavigationController& source) OVERRIDE; |
104 virtual void CopyStateFromAndPrune( | 85 virtual void CopyStateFromAndPrune( |
105 content::NavigationController* source) OVERRIDE; | 86 content::NavigationController* source) OVERRIDE; |
106 virtual void PruneAllButActive() OVERRIDE; | 87 virtual void PruneAllButActive() OVERRIDE; |
107 | 88 |
108 // NavigationControllerWebView implementation. | |
109 virtual void LoadDataWithBaseURL( | |
110 const GURL& data_url, | |
111 const content::Referrer& referrer, | |
112 const GURL& base_url, | |
113 const GURL& history_url, | |
114 bool is_overriding_user_agent) OVERRIDE; | |
115 virtual void PostURL(const GURL& url, | |
116 const content::Referrer& referrer, | |
117 const base::RefCountedMemory& http_body, | |
118 bool is_overriding_user_agent) OVERRIDE; | |
119 | |
120 // Returns the index of the specified entry, or -1 if entry is not contained | 89 // Returns the index of the specified entry, or -1 if entry is not contained |
121 // in this NavigationController. | 90 // in this NavigationController. |
122 int GetIndexOfEntry(const content::NavigationEntryImpl* entry) const; | 91 int GetIndexOfEntry(const content::NavigationEntryImpl* entry) const; |
123 | 92 |
124 // Return the index of the entry with the corresponding instance and page_id, | 93 // Return the index of the entry with the corresponding instance and page_id, |
125 // or -1 if not found. | 94 // or -1 if not found. |
126 int GetEntryIndexWithPageID(content::SiteInstance* instance, | 95 int GetEntryIndexWithPageID(content::SiteInstance* instance, |
127 int32 page_id) const; | 96 int32 page_id) const; |
128 | 97 |
129 // Return the entry with the corresponding instance and page_id, or NULL if | 98 // Return the entry with the corresponding instance and page_id, or NULL if |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 static size_t max_entry_count_for_testing_; | 315 static size_t max_entry_count_for_testing_; |
347 | 316 |
348 // If a repost is pending, its type (RELOAD or RELOAD_IGNORING_CACHE), | 317 // If a repost is pending, its type (RELOAD or RELOAD_IGNORING_CACHE), |
349 // NO_RELOAD otherwise. | 318 // NO_RELOAD otherwise. |
350 ReloadType pending_reload_; | 319 ReloadType pending_reload_; |
351 | 320 |
352 DISALLOW_COPY_AND_ASSIGN(NavigationControllerImpl); | 321 DISALLOW_COPY_AND_ASSIGN(NavigationControllerImpl); |
353 }; | 322 }; |
354 | 323 |
355 #endif // CONTENT_BROWSER_WEB_CONTENTS_NAVIGATION_CONTROLLER_IMPL_H_ | 324 #endif // CONTENT_BROWSER_WEB_CONTENTS_NAVIGATION_CONTROLLER_IMPL_H_ |
OLD | NEW |