OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_FRAME_HOST_NAVIGATION_CONTROLLER_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_FRAME_HOST_NAVIGATION_CONTROLLER_IMPL_H_ |
6 #define CONTENT_BROWSER_FRAME_HOST_NAVIGATION_CONTROLLER_IMPL_H_ | 6 #define CONTENT_BROWSER_FRAME_HOST_NAVIGATION_CONTROLLER_IMPL_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
11 #include "base/memory/linked_ptr.h" | 11 #include "base/memory/linked_ptr.h" |
12 #include "base/time/time.h" | 12 #include "base/time/time.h" |
13 #include "build/build_config.h" | 13 #include "build/build_config.h" |
14 #include "content/browser/frame_host/navigation_controller_delegate.h" | 14 #include "content/browser/frame_host/navigation_controller_delegate.h" |
15 #include "content/browser/ssl/ssl_manager.h" | 15 #include "content/browser/ssl/ssl_manager.h" |
16 #include "content/public/browser/navigation_controller.h" | 16 #include "content/public/browser/navigation_controller.h" |
17 #include "content/public/browser/navigation_type.h" | 17 #include "content/public/browser/navigation_type.h" |
18 | 18 |
19 struct ViewHostMsg_FrameNavigate_Params; | 19 struct ViewHostMsg_FrameNavigate_Params; |
20 | 20 |
21 namespace content { | 21 namespace content { |
22 class NavigationEntryImpl; | 22 class NavigationEntryImpl; |
23 class RenderViewHost; | 23 class RenderViewHost; |
24 class WebContentsScreenshotManager; | 24 class NavigationEntryScreenshotManager; |
25 class SiteInstance; | 25 class SiteInstance; |
26 struct LoadCommittedDetails; | 26 struct LoadCommittedDetails; |
27 | 27 |
28 class CONTENT_EXPORT NavigationControllerImpl | 28 class CONTENT_EXPORT NavigationControllerImpl |
29 : public NON_EXPORTED_BASE(NavigationController) { | 29 : public NON_EXPORTED_BASE(NavigationController) { |
30 public: | 30 public: |
31 NavigationControllerImpl( | 31 NavigationControllerImpl( |
32 NavigationControllerDelegate* delegate, | 32 NavigationControllerDelegate* delegate, |
33 BrowserContext* browser_context); | 33 BrowserContext* browser_context); |
34 virtual ~NavigationControllerImpl(); | 34 virtual ~NavigationControllerImpl(); |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 const base::Callback<base::Time()>& get_timestamp_callback); | 193 const base::Callback<base::Time()>& get_timestamp_callback); |
194 | 194 |
195 // Takes a screenshot of the page at the current state. | 195 // Takes a screenshot of the page at the current state. |
196 void TakeScreenshot(); | 196 void TakeScreenshot(); |
197 | 197 |
198 // Sets the screenshot manager for this NavigationControllerImpl. The | 198 // Sets the screenshot manager for this NavigationControllerImpl. The |
199 // controller takes ownership of the screenshot manager and destroys it when | 199 // controller takes ownership of the screenshot manager and destroys it when |
200 // a new screenshot-manager is set, or when the controller is destroyed. | 200 // a new screenshot-manager is set, or when the controller is destroyed. |
201 // Setting a NULL manager recreates the default screenshot manager and uses | 201 // Setting a NULL manager recreates the default screenshot manager and uses |
202 // that. | 202 // that. |
203 void SetScreenshotManager(WebContentsScreenshotManager* manager); | 203 void SetScreenshotManager(NavigationEntryScreenshotManager* manager); |
204 | 204 |
205 // Discards only the pending entry. | 205 // Discards only the pending entry. |
206 void DiscardPendingEntry(); | 206 void DiscardPendingEntry(); |
207 | 207 |
208 private: | 208 private: |
209 friend class RestoreHelper; | 209 friend class RestoreHelper; |
210 | 210 |
211 FRIEND_TEST_ALL_PREFIXES(NavigationControllerTest, | 211 FRIEND_TEST_ALL_PREFIXES(NavigationControllerTest, |
212 PurgeScreenshot); | 212 PurgeScreenshot); |
213 FRIEND_TEST_ALL_PREFIXES(TimeSmoother, Basic); | 213 FRIEND_TEST_ALL_PREFIXES(TimeSmoother, Basic); |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 // Used to get timestamps for newly-created navigation entries. | 393 // Used to get timestamps for newly-created navigation entries. |
394 base::Callback<base::Time()> get_timestamp_callback_; | 394 base::Callback<base::Time()> get_timestamp_callback_; |
395 | 395 |
396 // Used to smooth out timestamps from |get_timestamp_callback_|. | 396 // Used to smooth out timestamps from |get_timestamp_callback_|. |
397 // Without this, whenever there is a run of redirects or | 397 // Without this, whenever there is a run of redirects or |
398 // code-generated navigations, those navigations may occur within | 398 // code-generated navigations, those navigations may occur within |
399 // the timer resolution, leading to things sometimes showing up in | 399 // the timer resolution, leading to things sometimes showing up in |
400 // the wrong order in the history view. | 400 // the wrong order in the history view. |
401 TimeSmoother time_smoother_; | 401 TimeSmoother time_smoother_; |
402 | 402 |
403 scoped_ptr<WebContentsScreenshotManager> screenshot_manager_; | 403 scoped_ptr<NavigationEntryScreenshotManager> screenshot_manager_; |
404 | 404 |
405 DISALLOW_COPY_AND_ASSIGN(NavigationControllerImpl); | 405 DISALLOW_COPY_AND_ASSIGN(NavigationControllerImpl); |
406 }; | 406 }; |
407 | 407 |
408 } // namespace content | 408 } // namespace content |
409 | 409 |
410 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_CONTROLLER_IMPL_H_ | 410 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_CONTROLLER_IMPL_H_ |
OLD | NEW |