| 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_MEMORY_TAB_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_MEMORY_TAB_MANAGER_H_ |
| 6 #define CHROME_BROWSER_MEMORY_TAB_MANAGER_H_ | 6 #define CHROME_BROWSER_MEMORY_TAB_MANAGER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 // TabStripModelObserver overrides. | 160 // TabStripModelObserver overrides. |
| 161 void TabChangedAt(content::WebContents* contents, | 161 void TabChangedAt(content::WebContents* contents, |
| 162 int index, | 162 int index, |
| 163 TabChangeType change_type) override; | 163 TabChangeType change_type) override; |
| 164 void ActiveTabChanged(content::WebContents* old_contents, | 164 void ActiveTabChanged(content::WebContents* old_contents, |
| 165 content::WebContents* new_contents, | 165 content::WebContents* new_contents, |
| 166 int index, | 166 int index, |
| 167 int reason) override; | 167 int reason) override; |
| 168 | 168 |
| 169 // Returns true if the tab is currently playing audio or has played audio | 169 // Returns true if the tab is currently playing audio or has played audio |
| 170 // recently. | 170 // recently, or if the tab is currently accessing the camera, microphone or |
| 171 bool IsAudioTab(content::WebContents* contents) const; | 171 // mirroring the display. |
| 172 bool IsMediaTab(content::WebContents* contents) const; |
| 172 | 173 |
| 173 // Returns the WebContentsData associated with |contents|. Also takes care of | 174 // Returns the WebContentsData associated with |contents|. Also takes care of |
| 174 // creating one if needed. | 175 // creating one if needed. |
| 175 WebContentsData* GetWebContentsData(content::WebContents* contents) const; | 176 WebContentsData* GetWebContentsData(content::WebContents* contents) const; |
| 176 | 177 |
| 177 // Returns true if |first| is considered less desirable to be killed than | 178 // Returns true if |first| is considered less desirable to be killed than |
| 178 // |second|. | 179 // |second|. |
| 179 static bool CompareTabStats(TabStats first, TabStats second); | 180 static bool CompareTabStats(TabStats first, TabStats second); |
| 180 | 181 |
| 181 // Returns either the system's clock or the test clock. See |test_tick_clock_| | 182 // Returns either the system's clock or the test clock. See |test_tick_clock_| |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 // Pointer to a test clock. If this is set, NowTicks() returns the value of | 227 // Pointer to a test clock. If this is set, NowTicks() returns the value of |
| 227 // this test clock. Otherwise it returns the system clock's value. | 228 // this test clock. Otherwise it returns the system clock's value. |
| 228 base::TickClock* test_tick_clock_; | 229 base::TickClock* test_tick_clock_; |
| 229 | 230 |
| 230 DISALLOW_COPY_AND_ASSIGN(TabManager); | 231 DISALLOW_COPY_AND_ASSIGN(TabManager); |
| 231 }; | 232 }; |
| 232 | 233 |
| 233 } // namespace memory | 234 } // namespace memory |
| 234 | 235 |
| 235 #endif // CHROME_BROWSER_MEMORY_TAB_MANAGER_H_ | 236 #endif // CHROME_BROWSER_MEMORY_TAB_MANAGER_H_ |
| OLD | NEW |