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 CHROME_BROWSER_UI_BROWSER_H_ | 5 #ifndef CHROME_BROWSER_UI_BROWSER_H_ |
6 #define CHROME_BROWSER_UI_BROWSER_H_ | 6 #define CHROME_BROWSER_UI_BROWSER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
(...skipping 862 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
873 const history::HistoryAddPageArgs& add_page_args, | 873 const history::HistoryAddPageArgs& add_page_args, |
874 NavigationType::Type navigation_type) OVERRIDE; | 874 NavigationType::Type navigation_type) OVERRIDE; |
875 virtual void ContentRestrictionsChanged(TabContents* source) OVERRIDE; | 875 virtual void ContentRestrictionsChanged(TabContents* source) OVERRIDE; |
876 virtual void RendererUnresponsive(TabContents* source) OVERRIDE; | 876 virtual void RendererUnresponsive(TabContents* source) OVERRIDE; |
877 virtual void RendererResponsive(TabContents* source) OVERRIDE; | 877 virtual void RendererResponsive(TabContents* source) OVERRIDE; |
878 virtual void WorkerCrashed(TabContents* source) OVERRIDE; | 878 virtual void WorkerCrashed(TabContents* source) OVERRIDE; |
879 virtual void DidNavigateMainFramePostCommit(TabContents* tab) OVERRIDE; | 879 virtual void DidNavigateMainFramePostCommit(TabContents* tab) OVERRIDE; |
880 virtual void DidNavigateToPendingEntry(TabContents* tab) OVERRIDE; | 880 virtual void DidNavigateToPendingEntry(TabContents* tab) OVERRIDE; |
881 virtual content::JavaScriptDialogCreator* | 881 virtual content::JavaScriptDialogCreator* |
882 GetJavaScriptDialogCreator() OVERRIDE; | 882 GetJavaScriptDialogCreator() OVERRIDE; |
| 883 virtual void ToggleFullscreenModeForTab(TabContents* tab, |
| 884 bool enter_fullscreen) OVERRIDE; |
883 | 885 |
884 // Overridden from TabContentsWrapperDelegate: | 886 // Overridden from TabContentsWrapperDelegate: |
885 virtual void OnDidGetApplicationInfo(TabContentsWrapper* source, | 887 virtual void OnDidGetApplicationInfo(TabContentsWrapper* source, |
886 int32 page_id) OVERRIDE; | 888 int32 page_id) OVERRIDE; |
887 virtual void OnInstallApplication( | 889 virtual void OnInstallApplication( |
888 TabContentsWrapper* source, | 890 TabContentsWrapper* source, |
889 const WebApplicationInfo& app_info) OVERRIDE; | 891 const WebApplicationInfo& app_info) OVERRIDE; |
890 | 892 |
891 // Note that the caller is responsible for deleting |old_tab_contents|. | 893 // Note that the caller is responsible for deleting |old_tab_contents|. |
892 virtual void SwapTabContents(TabContentsWrapper* old_tab_contents, | 894 virtual void SwapTabContents(TabContentsWrapper* old_tab_contents, |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
999 // this to return NULL if called before the toolbar has initialized. | 1001 // this to return NULL if called before the toolbar has initialized. |
1000 // TODO(beng): remove this. | 1002 // TODO(beng): remove this. |
1001 StatusBubble* GetStatusBubble(); | 1003 StatusBubble* GetStatusBubble(); |
1002 | 1004 |
1003 // Session restore functions //////////////////////////////////////////////// | 1005 // Session restore functions //////////////////////////////////////////////// |
1004 | 1006 |
1005 // Notifies the history database of the index for all tabs whose index is | 1007 // Notifies the history database of the index for all tabs whose index is |
1006 // >= index. | 1008 // >= index. |
1007 void SyncHistoryWithTabs(int index); | 1009 void SyncHistoryWithTabs(int index); |
1008 | 1010 |
| 1011 // Tab fullscreen functions ///////////////////////////////////////////////// |
| 1012 |
| 1013 // There are two different kinds of fullscreen mode - "tab fullscreen" and |
| 1014 // "browser fullscreen". "Tab fullscreen" refers to when a tab enters |
| 1015 // fullscreen mode via the JS fullscreen API, and "browser fullscreen" |
| 1016 // refers to the user putting the browser itself into fullscreen mode from |
| 1017 // the UI. The difference is that tab fullscreen has implications for how |
| 1018 // the contents of the tab render (eg: a video element may grow to consume |
| 1019 // the whole tab), whereas browser fullscreen mode doesn't. Therefore if a |
| 1020 // user forces an exit from fullscreen, we need to notify the tab so it can |
| 1021 // stop rendering in its fullscreen mode. |
| 1022 |
| 1023 // Make the current tab exit fullscreen mode if it is in it. |
| 1024 void ExitTabbedFullscreenModeIfNecessary(); |
| 1025 |
| 1026 // Notifies the tab that it has been forced out of fullscreen mode if |
| 1027 // necessary. |
| 1028 void NotifyTabOfFullscreenExitIfNecessary(); |
| 1029 |
| 1030 // Enters / exits fullscreen mode because a tab has requested it. |
| 1031 void EnterFullscreenModeForTab(TabContents* tab); |
| 1032 void ExitFullscreenModeForTab(TabContents* tab); |
| 1033 |
1009 // OnBeforeUnload handling ////////////////////////////////////////////////// | 1034 // OnBeforeUnload handling ////////////////////////////////////////////////// |
1010 | 1035 |
1011 typedef std::set<TabContents*> UnloadListenerSet; | 1036 typedef std::set<TabContents*> UnloadListenerSet; |
1012 | 1037 |
1013 // Processes the next tab that needs it's beforeunload/unload event fired. | 1038 // Processes the next tab that needs it's beforeunload/unload event fired. |
1014 void ProcessPendingTabs(); | 1039 void ProcessPendingTabs(); |
1015 | 1040 |
1016 // Whether we've completed firing all the tabs' beforeunload/unload events. | 1041 // Whether we've completed firing all the tabs' beforeunload/unload events. |
1017 bool HasCompletedUnloadProcessing() const; | 1042 bool HasCompletedUnloadProcessing() const; |
1018 | 1043 |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1119 | 1144 |
1120 // Retrieves the content restrictions for the currently selected tab. | 1145 // Retrieves the content restrictions for the currently selected tab. |
1121 // Returns 0 if no tab selected, which is equivalent to no content | 1146 // Returns 0 if no tab selected, which is equivalent to no content |
1122 // restrictions active. | 1147 // restrictions active. |
1123 int GetContentRestrictionsForSelectedTab(); | 1148 int GetContentRestrictionsForSelectedTab(); |
1124 | 1149 |
1125 // Resets |bookmark_bar_state_| based on the active tab. Notifies the | 1150 // Resets |bookmark_bar_state_| based on the active tab. Notifies the |
1126 // BrowserWindow if necessary. | 1151 // BrowserWindow if necessary. |
1127 void UpdateBookmarkBarState(BookmarkBarStateChangeReason reason); | 1152 void UpdateBookmarkBarState(BookmarkBarStateChangeReason reason); |
1128 | 1153 |
| 1154 |
1129 // Data members ///////////////////////////////////////////////////////////// | 1155 // Data members ///////////////////////////////////////////////////////////// |
1130 | 1156 |
1131 NotificationRegistrar registrar_; | 1157 NotificationRegistrar registrar_; |
1132 | 1158 |
1133 PrefChangeRegistrar profile_pref_registrar_; | 1159 PrefChangeRegistrar profile_pref_registrar_; |
1134 | 1160 |
1135 PrefChangeRegistrar local_pref_registrar_; | 1161 PrefChangeRegistrar local_pref_registrar_; |
1136 | 1162 |
1137 // This Browser's type. | 1163 // This Browser's type. |
1138 const Type type_; | 1164 const Type type_; |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1258 TabRestoreService* tab_restore_service_; | 1284 TabRestoreService* tab_restore_service_; |
1259 | 1285 |
1260 // Helper which implements the TabRestoreServiceDelegate interface. | 1286 // Helper which implements the TabRestoreServiceDelegate interface. |
1261 scoped_ptr<BrowserTabRestoreServiceDelegate> tab_restore_service_delegate_; | 1287 scoped_ptr<BrowserTabRestoreServiceDelegate> tab_restore_service_delegate_; |
1262 | 1288 |
1263 scoped_ptr<InstantController> instant_; | 1289 scoped_ptr<InstantController> instant_; |
1264 scoped_ptr<InstantUnloadHandler> instant_unload_handler_; | 1290 scoped_ptr<InstantUnloadHandler> instant_unload_handler_; |
1265 | 1291 |
1266 BookmarkBar::State bookmark_bar_state_; | 1292 BookmarkBar::State bookmark_bar_state_; |
1267 | 1293 |
| 1294 // Whether the current tab should be notified if the browser exits |
| 1295 // fullscreen. |
| 1296 bool notify_tab_of_fullscreen_exit_; |
| 1297 |
| 1298 // True if the current tab is in fullscreen mode. |
| 1299 bool tab_caused_fullscreen_; |
| 1300 |
1268 DISALLOW_COPY_AND_ASSIGN(Browser); | 1301 DISALLOW_COPY_AND_ASSIGN(Browser); |
1269 }; | 1302 }; |
1270 | 1303 |
1271 #endif // CHROME_BROWSER_UI_BROWSER_H_ | 1304 #endif // CHROME_BROWSER_UI_BROWSER_H_ |
OLD | NEW |