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 #ifndef CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_ | 5 #ifndef CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_ |
6 #define CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_ | 6 #define CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <deque> | 9 #include <deque> |
10 #include <map> | 10 #include <map> |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 int32 GetMaxPageID(); | 151 int32 GetMaxPageID(); |
152 | 152 |
153 // Updates the max PageID to be at least the given PageID. | 153 // Updates the max PageID to be at least the given PageID. |
154 void UpdateMaxPageID(int32 page_id); | 154 void UpdateMaxPageID(int32 page_id); |
155 | 155 |
156 // Returns the site instance associated with the current page. By default, | 156 // Returns the site instance associated with the current page. By default, |
157 // there is no site instance. TabContents overrides this to provide proper | 157 // there is no site instance. TabContents overrides this to provide proper |
158 // access to its site instance. | 158 // access to its site instance. |
159 virtual SiteInstance* GetSiteInstance() const; | 159 virtual SiteInstance* GetSiteInstance() const; |
160 | 160 |
| 161 // Returns the SiteInstance for the pending navigation, if any. Otherwise |
| 162 // returns the current SiteInstance. |
| 163 SiteInstance* GetPendingSiteInstance() const; |
| 164 |
161 // Defines whether this tab's URL should be displayed in the browser's URL | 165 // Defines whether this tab's URL should be displayed in the browser's URL |
162 // bar. Normally this is true so you can see the URL. This is set to false | 166 // bar. Normally this is true so you can see the URL. This is set to false |
163 // for the new tab page and related pages so that the URL bar is empty and | 167 // for the new tab page and related pages so that the URL bar is empty and |
164 // the user is invited to type into it. | 168 // the user is invited to type into it. |
165 virtual bool ShouldDisplayURL(); | 169 virtual bool ShouldDisplayURL(); |
166 | 170 |
167 // Return whether this tab contents is loading a resource, or whether its | 171 // Return whether this tab contents is loading a resource, or whether its |
168 // web_ui is. | 172 // web_ui is. |
169 bool IsLoading() const; | 173 bool IsLoading() const; |
170 | 174 |
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
606 | 610 |
607 // Causes the TabContents to navigate in the right renderer to |entry|, which | 611 // Causes the TabContents to navigate in the right renderer to |entry|, which |
608 // must be already part of the entries in the navigation controller. | 612 // must be already part of the entries in the navigation controller. |
609 // This does not change the NavigationController state. | 613 // This does not change the NavigationController state. |
610 bool NavigateToEntry(const NavigationEntry& entry, | 614 bool NavigateToEntry(const NavigationEntry& entry, |
611 NavigationController::ReloadType reload_type); | 615 NavigationController::ReloadType reload_type); |
612 | 616 |
613 // Sets the history for this tab_contents to |history_length| entries, and | 617 // Sets the history for this tab_contents to |history_length| entries, and |
614 // moves the current page_id to the last entry in the list if it's valid. | 618 // moves the current page_id to the last entry in the list if it's valid. |
615 // This is mainly used when a prerendered page is swapped into the current | 619 // This is mainly used when a prerendered page is swapped into the current |
616 // tab. | 620 // tab. The method is virtual for testing. |
617 void SetHistoryLengthAndClear(int history_length); | 621 virtual void SetHistoryLengthAndPrune(const SiteInstance* site_instance, |
618 | 622 int merge_history_length, |
| 623 int32 minimum_page_id); |
619 | 624 |
620 // Misc non-view stuff ------------------------------------------------------- | 625 // Misc non-view stuff ------------------------------------------------------- |
621 | 626 |
622 // Helper functions for sending notifications. | 627 // Helper functions for sending notifications. |
623 void NotifySwapped(); | 628 void NotifySwapped(); |
624 void NotifyConnected(); | 629 void NotifyConnected(); |
625 void NotifyDisconnected(); | 630 void NotifyDisconnected(); |
626 | 631 |
627 // RenderViewHostDelegate ---------------------------------------------------- | 632 // RenderViewHostDelegate ---------------------------------------------------- |
628 | 633 |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
850 ObserverList<TabContentsObserver> observers_; | 855 ObserverList<TabContentsObserver> observers_; |
851 | 856 |
852 // Content restrictions, used to disable print/copy etc based on content's | 857 // Content restrictions, used to disable print/copy etc based on content's |
853 // (full-page plugins for now only) permissions. | 858 // (full-page plugins for now only) permissions. |
854 int content_restrictions_; | 859 int content_restrictions_; |
855 | 860 |
856 DISALLOW_COPY_AND_ASSIGN(TabContents); | 861 DISALLOW_COPY_AND_ASSIGN(TabContents); |
857 }; | 862 }; |
858 | 863 |
859 #endif // CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_ | 864 #endif // CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_ |
OLD | NEW |