Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(833)

Side by Side Diff: chrome/browser/memory/tab_manager.cc

Issue 2167843004: Discardable property support on TabManager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #include "chrome/browser/memory/tab_manager.h" 5 #include "chrome/browser/memory/tab_manager.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <set> 10 #include <set>
(...skipping 888 matching lines...) Expand 10 before | Expand all | Expand 10 after
899 void TabManager::RemoveObserver(TabManagerObserver* observer) { 899 void TabManager::RemoveObserver(TabManagerObserver* observer) {
900 observers_.RemoveObserver(observer); 900 observers_.RemoveObserver(observer);
901 } 901 }
902 902
903 void TabManager::OnDiscardedStateChange(content::WebContents* contents, 903 void TabManager::OnDiscardedStateChange(content::WebContents* contents,
904 bool is_discarded) { 904 bool is_discarded) {
905 FOR_EACH_OBSERVER(TabManagerObserver, observers_, 905 FOR_EACH_OBSERVER(TabManagerObserver, observers_,
906 OnDiscardedStateChange(contents, is_discarded)); 906 OnDiscardedStateChange(contents, is_discarded));
907 } 907 }
908 908
909 void TabManager::OnAutoDiscardableStateChange(content::WebContents* contents,
910 bool is_auto_discardable) {
911 FOR_EACH_OBSERVER(
912 TabManagerObserver, observers_,
913 OnAutoDiscardableStateChange(contents, is_auto_discardable));
914 }
915
916 bool TabManager::IsTabAutoDiscardable(content::WebContents* contents) const {
917 return GetWebContentsData(contents)->IsAutoDiscardable();
918 }
919
920 void TabManager::SetTabAutoDiscardableState(content::WebContents* contents,
921 bool state) {
922 GetWebContentsData(contents)->SetAutoDiscardableState(state);
923 }
924
909 } // namespace memory 925 } // namespace memory
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698