Chromium Code Reviews| 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 CHROME_BROWSER_RESOURCE_COORDINATOR_TAB_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_RESOURCE_COORDINATOR_TAB_MANAGER_H_ |
| 6 #define CHROME_BROWSER_RESOURCE_COORDINATOR_TAB_MANAGER_H_ | 6 #define CHROME_BROWSER_RESOURCE_COORDINATOR_TAB_MANAGER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 177 FRIEND_TEST_ALL_PREFIXES(TabManagerTest, IsInternalPage); | 177 FRIEND_TEST_ALL_PREFIXES(TabManagerTest, IsInternalPage); |
| 178 FRIEND_TEST_ALL_PREFIXES(TabManagerTest, OomPressureListener); | 178 FRIEND_TEST_ALL_PREFIXES(TabManagerTest, OomPressureListener); |
| 179 FRIEND_TEST_ALL_PREFIXES(TabManagerTest, ProtectPDFPages); | 179 FRIEND_TEST_ALL_PREFIXES(TabManagerTest, ProtectPDFPages); |
| 180 FRIEND_TEST_ALL_PREFIXES(TabManagerTest, ProtectRecentlyUsedTabs); | 180 FRIEND_TEST_ALL_PREFIXES(TabManagerTest, ProtectRecentlyUsedTabs); |
| 181 FRIEND_TEST_ALL_PREFIXES(TabManagerTest, ProtectVideoTabs); | 181 FRIEND_TEST_ALL_PREFIXES(TabManagerTest, ProtectVideoTabs); |
| 182 FRIEND_TEST_ALL_PREFIXES(TabManagerTest, ReloadDiscardedTabContextMenu); | 182 FRIEND_TEST_ALL_PREFIXES(TabManagerTest, ReloadDiscardedTabContextMenu); |
| 183 FRIEND_TEST_ALL_PREFIXES(TabManagerTest, TabManagerBasics); | 183 FRIEND_TEST_ALL_PREFIXES(TabManagerTest, TabManagerBasics); |
| 184 FRIEND_TEST_ALL_PREFIXES(TabManagerTest, FastShutdownSingleTabProcess); | 184 FRIEND_TEST_ALL_PREFIXES(TabManagerTest, FastShutdownSingleTabProcess); |
| 185 FRIEND_TEST_ALL_PREFIXES(TabManagerTest, | 185 FRIEND_TEST_ALL_PREFIXES(TabManagerTest, |
| 186 GetUnsortedTabStatsIsInVisibleWindow); | 186 GetUnsortedTabStatsIsInVisibleWindow); |
| 187 FRIEND_TEST_ALL_PREFIXES(TabManagerTest, HistogramsSessionRestoreSwitchToTab); | |
| 187 | 188 |
| 188 // Information about a Browser. | 189 // Information about a Browser. |
| 189 struct BrowserInfo { | 190 struct BrowserInfo { |
| 190 TabStripModel* tab_strip_model; | 191 TabStripModel* tab_strip_model; |
| 191 bool window_is_active; | 192 bool window_is_active; |
| 192 bool window_is_minimized; | 193 bool window_is_minimized; |
| 193 gfx::Rect window_bounds; | 194 gfx::Rect window_bounds; |
| 194 bool browser_is_app; | 195 bool browser_is_app; |
| 195 }; | 196 }; |
| 196 | 197 |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 323 // Returns true if tabs can be discarded only once. | 324 // Returns true if tabs can be discarded only once. |
| 324 bool CanOnlyDiscardOnce() const; | 325 bool CanOnlyDiscardOnce() const; |
| 325 | 326 |
| 326 // Returns a list of BrowserInfo sorted in z-order from top to bottom. The | 327 // Returns a list of BrowserInfo sorted in z-order from top to bottom. The |
| 327 // list is constructed from either |test_browser_info_list_| or BrowserList. | 328 // list is constructed from either |test_browser_info_list_| or BrowserList. |
| 328 std::vector<BrowserInfo> GetBrowserInfoList() const; | 329 std::vector<BrowserInfo> GetBrowserInfoList() const; |
| 329 | 330 |
| 330 void OnSessionRestoreStartedLoadingTabs(); | 331 void OnSessionRestoreStartedLoadingTabs(); |
| 331 void OnSessionRestoreFinishedLoadingTabs(); | 332 void OnSessionRestoreFinishedLoadingTabs(); |
| 332 | 333 |
| 334 // Records UMA histograms for the tab state when switching to a different tab | |
| 335 // during session restore and background tab loading. | |
| 336 // | |
| 337 // TODO(shaseley): Add background tab loading stats when it gets integrated | |
|
lpy
2017/06/27 22:30:36
Merge this TODO into the one in .cc, it doesn't gi
shaseley
2017/06/27 23:22:10
Per fmeawad@'s comment, I was planning to remove t
| |
| 338 // into the TabManager. | |
| 339 void RecordSwitchToTab(content::WebContents* contents) const; | |
| 340 | |
| 333 // Timer to periodically update the stats of the renderers. | 341 // Timer to periodically update the stats of the renderers. |
| 334 base::RepeatingTimer update_timer_; | 342 base::RepeatingTimer update_timer_; |
| 335 | 343 |
| 336 // Timer to periodically report whether a tab has been discarded since the | 344 // Timer to periodically report whether a tab has been discarded since the |
| 337 // last time the timer has fired. | 345 // last time the timer has fired. |
| 338 base::RepeatingTimer recent_tab_discard_timer_; | 346 base::RepeatingTimer recent_tab_discard_timer_; |
| 339 | 347 |
| 340 // A listener to global memory pressure events. | 348 // A listener to global memory pressure events. |
| 341 std::unique_ptr<base::MemoryPressureListener> memory_pressure_listener_; | 349 std::unique_ptr<base::MemoryPressureListener> memory_pressure_listener_; |
| 342 | 350 |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 399 | 407 |
| 400 // Weak pointer factory used for posting delayed tasks. | 408 // Weak pointer factory used for posting delayed tasks. |
| 401 base::WeakPtrFactory<TabManager> weak_ptr_factory_; | 409 base::WeakPtrFactory<TabManager> weak_ptr_factory_; |
| 402 | 410 |
| 403 DISALLOW_COPY_AND_ASSIGN(TabManager); | 411 DISALLOW_COPY_AND_ASSIGN(TabManager); |
| 404 }; | 412 }; |
| 405 | 413 |
| 406 } // namespace resource_coordinator | 414 } // namespace resource_coordinator |
| 407 | 415 |
| 408 #endif // CHROME_BROWSER_RESOURCE_COORDINATOR_TAB_MANAGER_H_ | 416 #endif // CHROME_BROWSER_RESOURCE_COORDINATOR_TAB_MANAGER_H_ |
| OLD | NEW |