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 #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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 #if !defined(OS_CHROMEOS) | 148 #if !defined(OS_CHROMEOS) |
149 minimum_protection_time_(base::TimeDelta::FromMinutes(10)), | 149 minimum_protection_time_(base::TimeDelta::FromMinutes(10)), |
150 #endif | 150 #endif |
151 browser_tab_strip_tracker_(this, nullptr, nullptr), | 151 browser_tab_strip_tracker_(this, nullptr, nullptr), |
152 test_tick_clock_(nullptr), | 152 test_tick_clock_(nullptr), |
153 under_memory_pressure_(false), | 153 under_memory_pressure_(false), |
154 weak_ptr_factory_(this) { | 154 weak_ptr_factory_(this) { |
155 #if defined(OS_CHROMEOS) | 155 #if defined(OS_CHROMEOS) |
156 delegate_.reset(new TabManagerDelegate(weak_ptr_factory_.GetWeakPtr())); | 156 delegate_.reset(new TabManagerDelegate(weak_ptr_factory_.GetWeakPtr())); |
157 #endif | 157 #endif |
158 browser_tab_strip_tracker_.Init( | 158 browser_tab_strip_tracker_.Init(); |
159 BrowserTabStripTracker::InitWith::ALL_BROWERS); | |
160 | 159 |
161 // Set up default callbacks. These may be overridden post-construction as | 160 // Set up default callbacks. These may be overridden post-construction as |
162 // testing seams. | 161 // testing seams. |
163 get_current_pressure_level_ = base::Bind(&GetCurrentPressureLevel); | 162 get_current_pressure_level_ = base::Bind(&GetCurrentPressureLevel); |
164 notify_renderer_process_ = base::Bind(&NotifyRendererProcess); | 163 notify_renderer_process_ = base::Bind(&NotifyRendererProcess); |
165 } | 164 } |
166 | 165 |
167 TabManager::~TabManager() { | 166 TabManager::~TabManager() { |
168 Stop(); | 167 Stop(); |
169 } | 168 } |
(...skipping 861 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1031 // platform. | 1030 // platform. |
1032 std::string allow_multiple_discards = variations::GetVariationParamValue( | 1031 std::string allow_multiple_discards = variations::GetVariationParamValue( |
1033 features::kAutomaticTabDiscarding.name, "AllowMultipleDiscards"); | 1032 features::kAutomaticTabDiscarding.name, "AllowMultipleDiscards"); |
1034 return (allow_multiple_discards != "true"); | 1033 return (allow_multiple_discards != "true"); |
1035 #else | 1034 #else |
1036 return false; | 1035 return false; |
1037 #endif | 1036 #endif |
1038 } | 1037 } |
1039 | 1038 |
1040 } // namespace memory | 1039 } // namespace memory |
OLD | NEW |