| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 CHROME_BROWSER_TAB_CONTENTS_NAVIGATION_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_TAB_CONTENTS_NAVIGATION_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_TAB_CONTENTS_NAVIGATION_CONTROLLER_H_ | 6 #define CHROME_BROWSER_TAB_CONTENTS_NAVIGATION_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| 11 | 11 |
| 12 #include "base/linked_ptr.h" | 12 #include "base/linked_ptr.h" |
| 13 #include "base/string16.h" | 13 #include "base/string16.h" |
| 14 #include "googleurl/src/gurl.h" | 14 #include "googleurl/src/gurl.h" |
| 15 #include "chrome/browser/sessions/session_id.h" | 15 #include "chrome/browser/sessions/session_id.h" |
| 16 #include "chrome/browser/ssl/ssl_manager.h" | 16 #include "chrome/browser/ssl/ssl_manager.h" |
| 17 #include "chrome/browser/tab_contents/tab_contents_type.h" | 17 #include "chrome/browser/tab_contents/tab_contents_type.h" |
| 18 #include "chrome/common/navigation_types.h" | 18 #include "chrome/common/navigation_types.h" |
| 19 #include "chrome/common/page_transition_types.h" | 19 #include "chrome/common/page_transition_types.h" |
| 20 | 20 |
| 21 class NavigationEntry; | 21 class NavigationEntry; |
| 22 class GURL; | 22 class GURL; |
| 23 class Profile; | 23 class Profile; |
| 24 class RenderViewHostFactory; | |
| 25 class TabContents; | 24 class TabContents; |
| 26 class SiteInstance; | 25 class SiteInstance; |
| 27 class SkBitmap; | 26 class SkBitmap; |
| 28 class WebContents; | 27 class WebContents; |
| 29 class TabContentsCollector; | 28 class TabContentsCollector; |
| 30 class TabNavigation; | 29 class TabNavigation; |
| 31 struct ViewHostMsg_FrameNavigate_Params; | 30 struct ViewHostMsg_FrameNavigate_Params; |
| 32 | 31 |
| 33 // A NavigationController maintains the back-forward list for a single tab and | 32 // A NavigationController maintains the back-forward list for a single tab and |
| 34 // manages all navigation within that list. | 33 // manages all navigation within that list. |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 // Number of items removed. | 121 // Number of items removed. |
| 123 int count; | 122 int count; |
| 124 }; | 123 }; |
| 125 | 124 |
| 126 // --------------------------------------------------------------------------- | 125 // --------------------------------------------------------------------------- |
| 127 | 126 |
| 128 NavigationController(TabContents* initial_contents, Profile* profile); | 127 NavigationController(TabContents* initial_contents, Profile* profile); |
| 129 | 128 |
| 130 // Creates a NavigationController from the specified history. Processing | 129 // Creates a NavigationController from the specified history. Processing |
| 131 // for this is asynchronous and handled via the RestoreHelper (in | 130 // for this is asynchronous and handled via the RestoreHelper (in |
| 132 // navigation_controller.cc). The RenderViewHostFactory will be passed to | 131 // navigation_controller.cc). |
| 133 // new TabContentses, it is non-NULL only for testing. | |
| 134 NavigationController( | 132 NavigationController( |
| 135 Profile* profile, | 133 Profile* profile, |
| 136 const std::vector<TabNavigation>& navigations, | 134 const std::vector<TabNavigation>& navigations, |
| 137 int selected_navigation, | 135 int selected_navigation); |
| 138 RenderViewHostFactory* rvh_factory); | |
| 139 ~NavigationController(); | 136 ~NavigationController(); |
| 140 | 137 |
| 141 // Begin the destruction sequence for this NavigationController and all its | 138 // Begin the destruction sequence for this NavigationController and all its |
| 142 // registered tabs. The sequence is as follows: | 139 // registered tabs. The sequence is as follows: |
| 143 // 1. All tabs are asked to Destroy themselves. | 140 // 1. All tabs are asked to Destroy themselves. |
| 144 // 2. When each tab is finished Destroying, it will notify the controller. | 141 // 2. When each tab is finished Destroying, it will notify the controller. |
| 145 // 3. Once all tabs are Destroyed, the NavigationController deletes itself. | 142 // 3. Once all tabs are Destroyed, the NavigationController deletes itself. |
| 146 // This ensures that all the TabContents outlive the NavigationController. | 143 // This ensures that all the TabContents outlive the NavigationController. |
| 147 void Destroy(); | 144 void Destroy(); |
| 148 | 145 |
| (...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 487 void DiscardNonCommittedEntriesInternal(); | 484 void DiscardNonCommittedEntriesInternal(); |
| 488 | 485 |
| 489 // Discards the transient entry without updating active_contents_. | 486 // Discards the transient entry without updating active_contents_. |
| 490 void DiscardTransientEntry(); | 487 void DiscardTransientEntry(); |
| 491 | 488 |
| 492 // --------------------------------------------------------------------------- | 489 // --------------------------------------------------------------------------- |
| 493 | 490 |
| 494 // The user profile associated with this controller | 491 // The user profile associated with this controller |
| 495 Profile* profile_; | 492 Profile* profile_; |
| 496 | 493 |
| 497 // Non-owning pointer to the factory to pass to new TabContentes. This will be | |
| 498 // NULL except in testing, where it is used to create mock RVH's. | |
| 499 RenderViewHostFactory* rvh_factory_; | |
| 500 | |
| 501 // List of NavigationEntry for this tab | 494 // List of NavigationEntry for this tab |
| 502 typedef std::vector<linked_ptr<NavigationEntry> > NavigationEntries; | 495 typedef std::vector<linked_ptr<NavigationEntry> > NavigationEntries; |
| 503 NavigationEntries entries_; | 496 NavigationEntries entries_; |
| 504 | 497 |
| 505 // An entry we haven't gotten a response for yet. This will be discarded | 498 // An entry we haven't gotten a response for yet. This will be discarded |
| 506 // when we navigate again. It's used only so we know what the currently | 499 // when we navigate again. It's used only so we know what the currently |
| 507 // displayed tab is. | 500 // displayed tab is. |
| 508 // | 501 // |
| 509 // This may refer to an item in the entries_ list if the pending_entry_index_ | 502 // This may refer to an item in the entries_ list if the pending_entry_index_ |
| 510 // == -1, or it may be its own entry that should be deleted. Be careful with | 503 // == -1, or it may be its own entry that should be deleted. Be careful with |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 568 // when testing. | 561 // when testing. |
| 569 static bool check_for_repost_; | 562 static bool check_for_repost_; |
| 570 | 563 |
| 571 // The maximum number of entries that a navigation controller can store. | 564 // The maximum number of entries that a navigation controller can store. |
| 572 static size_t max_entry_count_; | 565 static size_t max_entry_count_; |
| 573 | 566 |
| 574 DISALLOW_COPY_AND_ASSIGN(NavigationController); | 567 DISALLOW_COPY_AND_ASSIGN(NavigationController); |
| 575 }; | 568 }; |
| 576 | 569 |
| 577 #endif // CHROME_BROWSER_TAB_CONTENTS_NAVIGATION_CONTROLLER_H_ | 570 #endif // CHROME_BROWSER_TAB_CONTENTS_NAVIGATION_CONTROLLER_H_ |
| OLD | NEW |