Rename remaining instances of high efficiency to memory saver
This is one of a set of CLs to rename the "high efficiency" feature to
"memory saver" to match the branding we launched with and resolve
confusion when searching for code. All CLs are tagged with
#rename-high-efficiency. I plan to wait for most of them to be
approved before starting to submit these changes to ensure the code
remains in a consistent state. After submitting these CLs I'll make
another pass to capture any remaining references that can be changed.
#rename-high-efficiency
Bug: 1493843
Change-Id: I7f36f6eb836032cd3718fc672731f2b1199e2a76
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5117972
Commit-Queue: Alison Gale <agale@chromium.org>
Code-Coverage: findit-for-me@appspot.gserviceaccount.com <findit-for-me@appspot.gserviceaccount.com>
Reviewed-by: Joe Mason <joenotcharles@google.com>
Cr-Commit-Position: refs/heads/main@{#1237539}
diff --git a/chrome/app/settings_chromium_strings.grdp b/chrome/app/settings_chromium_strings.grdp
index 2f4db9f..460c69b 100644
--- a/chrome/app/settings_chromium_strings.grdp
+++ b/chrome/app/settings_chromium_strings.grdp
@@ -327,7 +327,7 @@
</message>
<!-- Performance Page -->
- <message name="IDS_SETTINGS_PERFORMANCE_HIGH_EFFICIENCY_MODE_SETTING_DESCRIPTION" desc="Description for the memory saver mode setting">
+ <message name="IDS_SETTINGS_PERFORMANCE_MEMORY_SAVER_MODE_SETTING_DESCRIPTION" desc="Description for the memory saver mode setting">
When on, Chromium frees up memory from inactive tabs. This gives active tabs and other apps more computer resources and keeps Chromium fast. Your inactive tabs automatically become active again when you go back to them.
</message>
<message name="IDS_SETTINGS_PERFORMANCE_BATTERY_SAVER_MODE_SETTING_DESCRIPTION" desc="Description for the energy saver mode setting">
diff --git a/chrome/app/settings_chromium_strings_grdp/IDS_SETTINGS_PERFORMANCE_HIGH_EFFICIENCY_MODE_SETTING_DESCRIPTION.png.sha1 b/chrome/app/settings_chromium_strings_grdp/IDS_SETTINGS_PERFORMANCE_MEMORY_SAVER_MODE_SETTING_DESCRIPTION.png.sha1
similarity index 100%
rename from chrome/app/settings_chromium_strings_grdp/IDS_SETTINGS_PERFORMANCE_HIGH_EFFICIENCY_MODE_SETTING_DESCRIPTION.png.sha1
rename to chrome/app/settings_chromium_strings_grdp/IDS_SETTINGS_PERFORMANCE_MEMORY_SAVER_MODE_SETTING_DESCRIPTION.png.sha1
diff --git a/chrome/app/settings_google_chrome_strings.grdp b/chrome/app/settings_google_chrome_strings.grdp
index 7877e01..033e3cf 100644
--- a/chrome/app/settings_google_chrome_strings.grdp
+++ b/chrome/app/settings_google_chrome_strings.grdp
@@ -320,7 +320,7 @@
</message>
<!-- Performance Page -->
- <message name="IDS_SETTINGS_PERFORMANCE_HIGH_EFFICIENCY_MODE_SETTING_DESCRIPTION" desc="Description for the memory saver mode setting">
+ <message name="IDS_SETTINGS_PERFORMANCE_MEMORY_SAVER_MODE_SETTING_DESCRIPTION" desc="Description for the memory saver mode setting">
When on, Chrome frees up memory from inactive tabs. This gives active tabs and other apps more computer resources and keeps Chrome fast. Your inactive tabs automatically become active again when you go back to them.
</message>
<message name="IDS_SETTINGS_PERFORMANCE_BATTERY_SAVER_MODE_SETTING_DESCRIPTION" desc="Description for the energy saver mode setting">
diff --git a/chrome/app/settings_google_chrome_strings_grdp/IDS_SETTINGS_PERFORMANCE_HIGH_EFFICIENCY_MODE_SETTING_DESCRIPTION.png.sha1 b/chrome/app/settings_google_chrome_strings_grdp/IDS_SETTINGS_PERFORMANCE_MEMORY_SAVER_MODE_SETTING_DESCRIPTION.png.sha1
similarity index 100%
rename from chrome/app/settings_google_chrome_strings_grdp/IDS_SETTINGS_PERFORMANCE_HIGH_EFFICIENCY_MODE_SETTING_DESCRIPTION.png.sha1
rename to chrome/app/settings_google_chrome_strings_grdp/IDS_SETTINGS_PERFORMANCE_MEMORY_SAVER_MODE_SETTING_DESCRIPTION.png.sha1
diff --git a/chrome/app/settings_strings.grdp b/chrome/app/settings_strings.grdp
index 2a4934d..5e9033f 100644
--- a/chrome/app/settings_strings.grdp
+++ b/chrome/app/settings_strings.grdp
@@ -1114,22 +1114,22 @@
<message name="IDS_SETTINGS_SPEED_PAGE_TITLE" desc="Title of the speed section on the performance settings page.">
Speed
</message>
- <message name="IDS_SETTINGS_PERFORMANCE_HIGH_EFFICIENCY_MODE_SETTING" desc="Memory saver mode setting label. This mode allows the browser to save memory from background tabs">
+ <message name="IDS_SETTINGS_PERFORMANCE_MEMORY_SAVER_MODE_SETTING" desc="Memory saver mode setting label. This mode allows the browser to save memory from background tabs">
Memory Saver
</message>
- <message name="IDS_SETTINGS_PERFORMANCE_HIGH_EFFICIENCY_MODE_HEURISTICS_LABEL" desc="Label for the memory saver mode to discard tabs based on a set of heuristics">
+ <message name="IDS_SETTINGS_PERFORMANCE_MEMORY_SAVER_MODE_HEURISTICS_LABEL" desc="Label for the memory saver mode to discard tabs based on a set of heuristics">
Free up memory based on usage
</message>
- <message name="IDS_SETTINGS_PERFORMANCE_HIGH_EFFICIENCY_MODE_RECOMMENDED_BADGE" desc="Label for the recommended badge for the heuristics based memory saver option">
+ <message name="IDS_SETTINGS_PERFORMANCE_MEMORY_SAVER_MODE_RECOMMENDED_BADGE" desc="Label for the recommended badge for the heuristics based memory saver option">
Recommended
</message>
- <message name="IDS_SETTINGS_PERFORMANCE_HIGH_EFFICIENCY_MODE_ON_TIMER_LABEL" desc="Label for the memory saver mode to discard tabs on a timer">
+ <message name="IDS_SETTINGS_PERFORMANCE_MEMORY_SAVER_MODE_ON_TIMER_LABEL" desc="Label for the memory saver mode to discard tabs on a timer">
Free up memory based on tab inactivity
</message>
- <message name="IDS_SETTINGS_PERFORMANCE_HIGH_EFFICIENCY_MODE_RADIO_GROUP_ARIA_LABEL" desc="Accessibility label which will be read by screen readers when focus enters the memory saver mode radio group. When memory saver mode is enabled, this radio group will be expanded and allow the user to choose between different tab discarding policies.">
+ <message name="IDS_SETTINGS_PERFORMANCE_MEMORY_SAVER_MODE_RADIO_GROUP_ARIA_LABEL" desc="Accessibility label which will be read by screen readers when focus enters the memory saver mode radio group. When memory saver mode is enabled, this radio group will be expanded and allow the user to choose between different tab discarding policies.">
Memory saver options
</message>
- <message name="IDS_SETTINGS_PERFORMANCE_HIGH_EFFICIENCY_MODE_CHOOSE_DISCARD_TIME_ARIA_LABEL" desc="Accessibility label which will be read by screen readers when focus enters the dropdown menu in the second option of the memory saver radio group. The dropdown allows the user to select the time before a tab is discarded by memory saver.">
+ <message name="IDS_SETTINGS_PERFORMANCE_MEMORY_SAVER_MODE_CHOOSE_DISCARD_TIME_ARIA_LABEL" desc="Accessibility label which will be read by screen readers when focus enters the dropdown menu in the second option of the memory saver radio group. The dropdown allows the user to select the time before a tab is discarded by memory saver.">
Choose time range
</message>
<message name="IDS_SETTINGS_PERFORMANCE_TAB_DISCARDING_EXCEPTIONS_ADD_BUTTON_ARIA_LABEL" desc="Accessibility label which will be read by screen readers when focusing the tab discarding exceptions list add button. Sites added to the list will not be discarded by memory saver.">
diff --git a/chrome/app/settings_strings_grdp/IDS_SETTINGS_PERFORMANCE_HIGH_EFFICIENCY_MODE_CHOOSE_DISCARD_TIME_ARIA_LABEL.png.sha1 b/chrome/app/settings_strings_grdp/IDS_SETTINGS_PERFORMANCE_MEMORY_SAVER_MODE_CHOOSE_DISCARD_TIME_ARIA_LABEL.png.sha1
similarity index 100%
rename from chrome/app/settings_strings_grdp/IDS_SETTINGS_PERFORMANCE_HIGH_EFFICIENCY_MODE_CHOOSE_DISCARD_TIME_ARIA_LABEL.png.sha1
rename to chrome/app/settings_strings_grdp/IDS_SETTINGS_PERFORMANCE_MEMORY_SAVER_MODE_CHOOSE_DISCARD_TIME_ARIA_LABEL.png.sha1
diff --git a/chrome/app/settings_strings_grdp/IDS_SETTINGS_PERFORMANCE_HIGH_EFFICIENCY_MODE_HEURISTICS_LABEL.png.sha1 b/chrome/app/settings_strings_grdp/IDS_SETTINGS_PERFORMANCE_MEMORY_SAVER_MODE_HEURISTICS_LABEL.png.sha1
similarity index 100%
rename from chrome/app/settings_strings_grdp/IDS_SETTINGS_PERFORMANCE_HIGH_EFFICIENCY_MODE_HEURISTICS_LABEL.png.sha1
rename to chrome/app/settings_strings_grdp/IDS_SETTINGS_PERFORMANCE_MEMORY_SAVER_MODE_HEURISTICS_LABEL.png.sha1
diff --git a/chrome/app/settings_strings_grdp/IDS_SETTINGS_PERFORMANCE_HIGH_EFFICIENCY_MODE_ON_TIMER_LABEL.png.sha1 b/chrome/app/settings_strings_grdp/IDS_SETTINGS_PERFORMANCE_MEMORY_SAVER_MODE_ON_TIMER_LABEL.png.sha1
similarity index 100%
rename from chrome/app/settings_strings_grdp/IDS_SETTINGS_PERFORMANCE_HIGH_EFFICIENCY_MODE_ON_TIMER_LABEL.png.sha1
rename to chrome/app/settings_strings_grdp/IDS_SETTINGS_PERFORMANCE_MEMORY_SAVER_MODE_ON_TIMER_LABEL.png.sha1
diff --git a/chrome/app/settings_strings_grdp/IDS_SETTINGS_PERFORMANCE_HIGH_EFFICIENCY_MODE_RADIO_GROUP_ARIA_LABEL.png.sha1 b/chrome/app/settings_strings_grdp/IDS_SETTINGS_PERFORMANCE_MEMORY_SAVER_MODE_RADIO_GROUP_ARIA_LABEL.png.sha1
similarity index 100%
rename from chrome/app/settings_strings_grdp/IDS_SETTINGS_PERFORMANCE_HIGH_EFFICIENCY_MODE_RADIO_GROUP_ARIA_LABEL.png.sha1
rename to chrome/app/settings_strings_grdp/IDS_SETTINGS_PERFORMANCE_MEMORY_SAVER_MODE_RADIO_GROUP_ARIA_LABEL.png.sha1
diff --git a/chrome/app/settings_strings_grdp/IDS_SETTINGS_PERFORMANCE_HIGH_EFFICIENCY_MODE_RECOMMENDED_BADGE.png.sha1 b/chrome/app/settings_strings_grdp/IDS_SETTINGS_PERFORMANCE_MEMORY_SAVER_MODE_RECOMMENDED_BADGE.png.sha1
similarity index 100%
rename from chrome/app/settings_strings_grdp/IDS_SETTINGS_PERFORMANCE_HIGH_EFFICIENCY_MODE_RECOMMENDED_BADGE.png.sha1
rename to chrome/app/settings_strings_grdp/IDS_SETTINGS_PERFORMANCE_MEMORY_SAVER_MODE_RECOMMENDED_BADGE.png.sha1
diff --git a/chrome/app/settings_strings_grdp/IDS_SETTINGS_PERFORMANCE_HIGH_EFFICIENCY_MODE_SETTING.png.sha1 b/chrome/app/settings_strings_grdp/IDS_SETTINGS_PERFORMANCE_MEMORY_SAVER_MODE_SETTING.png.sha1
similarity index 100%
rename from chrome/app/settings_strings_grdp/IDS_SETTINGS_PERFORMANCE_HIGH_EFFICIENCY_MODE_SETTING.png.sha1
rename to chrome/app/settings_strings_grdp/IDS_SETTINGS_PERFORMANCE_MEMORY_SAVER_MODE_SETTING.png.sha1
diff --git a/chrome/browser/extensions/api/settings_private/prefs_util.cc b/chrome/browser/extensions/api/settings_private/prefs_util.cc
index c43071a..95e96cf3 100644
--- a/chrome/browser/extensions/api/settings_private/prefs_util.cc
+++ b/chrome/browser/extensions/api/settings_private/prefs_util.cc
@@ -1073,7 +1073,7 @@
[performance_manager::user_tuning::prefs::kMemorySaverModeState] =
settings_api::PrefType::kNumber;
(*s_allowlist)[performance_manager::user_tuning::prefs::
- kHighEfficiencyModeTimeBeforeDiscardInMinutes] =
+ kMemorySaverModeTimeBeforeDiscardInMinutes] =
settings_api::PrefType::kNumber;
(*s_allowlist)
[performance_manager::user_tuning::prefs::kBatterySaverModeState] =
diff --git a/chrome/browser/feedback/system_logs/log_sources/performance_log_source_unittest.cc b/chrome/browser/feedback/system_logs/log_sources/performance_log_source_unittest.cc
index 1045488..3bf5a34 100644
--- a/chrome/browser/feedback/system_logs/log_sources/performance_log_source_unittest.cc
+++ b/chrome/browser/feedback/system_logs/log_sources/performance_log_source_unittest.cc
@@ -37,7 +37,7 @@
namespace {
-constexpr char kHighEfficiencyModeActiveKey[] = "high_efficiency_mode_active";
+constexpr char kMemorySaverModeActiveKey[] = "high_efficiency_mode_active";
constexpr char kBatterySaverModeStateKey[] = "battery_saver_state";
constexpr char kBatterySaverModeActiveKey[] = "battery_saver_mode_active";
constexpr char kBatterySaverModeDisabledForSessionKey[] =
@@ -88,7 +88,7 @@
static_cast<int>(mode));
}
- void SetHighEfficiencyModeEnabled(bool enabled) {
+ void SetMemorySaverModeEnabled(bool enabled) {
performance_manager::user_tuning::UserPerformanceTuningManager::
GetInstance()
->SetMemorySaverModeEnabled(enabled);
@@ -113,14 +113,14 @@
raw_ptr<TestingPrefServiceSimple> local_state_ = nullptr;
};
-TEST_F(PerformanceLogSourceTest, CheckHighEfficiencyModeLogs) {
- SetHighEfficiencyModeEnabled(true);
+TEST_F(PerformanceLogSourceTest, CheckMemorySaverModeLogs) {
+ SetMemorySaverModeEnabled(true);
auto response = GetPerformanceLogs();
- EXPECT_EQ("true", response->at(kHighEfficiencyModeActiveKey));
+ EXPECT_EQ("true", response->at(kMemorySaverModeActiveKey));
- SetHighEfficiencyModeEnabled(false);
+ SetMemorySaverModeEnabled(false);
response = GetPerformanceLogs();
- EXPECT_EQ("false", response->at(kHighEfficiencyModeActiveKey));
+ EXPECT_EQ("false", response->at(kMemorySaverModeActiveKey));
}
TEST_F(PerformanceLogSourceTest, CheckBatterySaverModeLogs) {
diff --git a/chrome/browser/performance_manager/metrics/metrics_provider_desktop.cc b/chrome/browser/performance_manager/metrics/metrics_provider_desktop.cc
index 6f7870a..4cd4475 100644
--- a/chrome/browser/performance_manager/metrics/metrics_provider_desktop.cc
+++ b/chrome/browser/performance_manager/metrics/metrics_provider_desktop.cc
@@ -152,7 +152,7 @@
void MetricsProviderDesktop::ProvideCurrentSessionData(
metrics::ChromeUserMetricsExtension* uma_proto) {
// It's valid for this to be called when `initialized_` is false if the finch
- // features controlling battery saver and high efficiency are disabled.
+ // features controlling battery saver and memory saver are disabled.
// TODO(crbug.com/1348590): CHECK(initialized_) when the features are enabled
// and removed.
base::UmaHistogramEnumeration("PerformanceManager.UserTuning.EfficiencyMode",
diff --git a/chrome/browser/performance_manager/metrics/metrics_provider_desktop.h b/chrome/browser/performance_manager/metrics/metrics_provider_desktop.h
index 850bbc3..804faa80 100644
--- a/chrome/browser/performance_manager/metrics/metrics_provider_desktop.h
+++ b/chrome/browser/performance_manager/metrics/metrics_provider_desktop.h
@@ -28,7 +28,7 @@
enum class EfficiencyMode {
// No efficiency mode for the entire upload window
kNormal = 0,
- // In high efficiency mode for the entire upload window
+ // In memory saver mode for the entire upload window
kHighEfficiency = 1,
// In battery saver mode for the entire upload window
kBatterySaver = 2,
diff --git a/chrome/browser/performance_manager/metrics/page_timeline_monitor_unittest.cc b/chrome/browser/performance_manager/metrics/page_timeline_monitor_unittest.cc
index 1fcd4f787..5065f15 100644
--- a/chrome/browser/performance_manager/metrics/page_timeline_monitor_unittest.cc
+++ b/chrome/browser/performance_manager/metrics/page_timeline_monitor_unittest.cc
@@ -516,7 +516,7 @@
performance_manager::policies::MemorySaverModePolicy* policy =
performance_manager::policies::MemorySaverModePolicy::GetInstance();
policy->SetTimeBeforeDiscard(base::Hours(2));
- policy->OnHighEfficiencyModeChanged(true);
+ policy->OnMemorySaverModeChanged(true);
TriggerCollectSlice();
entries = test_ukm_recorder()->GetEntriesByName(
diff --git a/chrome/browser/performance_manager/policies/memory_saver_mode_policy.cc b/chrome/browser/performance_manager/policies/memory_saver_mode_policy.cc
index f3266c8..d508f16 100644
--- a/chrome/browser/performance_manager/policies/memory_saver_mode_policy.cc
+++ b/chrome/browser/performance_manager/policies/memory_saver_mode_policy.cc
@@ -64,7 +64,7 @@
// Some mechanisms (like "session restore" and "open all bookmarks") can
// create pages that are non-visible. If that happens, start a discard timer
// so that the pages are discarded if they don't ever become visible.
- // TODO(crbug.com/1510539): High Efficiency Mode should make it so
+ // TODO(crbug.com/1510539): Memory Saver Mode should make it so
// non-visible pages are simply not loaded until they become visible.
StartDiscardTimerIfEnabled(tab_handle,
GetTimeBeforeDiscardForCurrentMode());
@@ -100,7 +100,7 @@
graph_ = nullptr;
}
-void MemorySaverModePolicy::OnHighEfficiencyModeChanged(bool enabled) {
+void MemorySaverModePolicy::OnMemorySaverModeChanged(bool enabled) {
high_efficiency_mode_enabled_ = enabled;
if (high_efficiency_mode_enabled_) {
@@ -159,7 +159,7 @@
return;
}
- // High Efficiency mode is enabled, so the tab should be discarded after the
+ // Memory Saver mode is enabled, so the tab should be discarded after the
// amount of time specified by finch is elapsed.
CHECK_NE(time_before_discard, base::TimeDelta::Max());
active_discard_timers_[tab_handle].Start(
@@ -186,8 +186,8 @@
// timer destroyed.
RemoveActiveTimer(tab_handle);
- // Turning off High Efficiency Mode would delete the timer, so it's not
- // possible to get here and for High Efficiency Mode to be off.
+ // Turning off Memory Saver Mode would delete the timer, so it's not
+ // possible to get here and for Memory Saver Mode to be off.
DCHECK(IsHighEfficiencyDiscardingEnabled());
// If the time elapsed according to `LiveTicks` is shorter than
diff --git a/chrome/browser/performance_manager/policies/memory_saver_mode_policy.h b/chrome/browser/performance_manager/policies/memory_saver_mode_policy.h
index 9f8e615..32ddfe7 100644
--- a/chrome/browser/performance_manager/policies/memory_saver_mode_policy.h
+++ b/chrome/browser/performance_manager/policies/memory_saver_mode_policy.h
@@ -16,7 +16,7 @@
namespace performance_manager::policies {
// This policy is responsible for discarding tabs after they have been
-// backgrounded for a certain amount of time, when High Efficiency Mode is
+// backgrounded for a certain amount of time, when Memory Saver Mode is
// enabled by the user.
class MemorySaverModePolicy : public GraphOwned,
public PageNode::ObserverDefaultImpl,
@@ -46,11 +46,11 @@
void OnPassedToGraph(Graph* graph) override;
void OnTakenFromGraph(Graph* graph) override;
- void OnHighEfficiencyModeChanged(bool enabled);
+ void OnMemorySaverModeChanged(bool enabled);
base::TimeDelta GetTimeBeforeDiscardForTesting() const;
void SetTimeBeforeDiscard(base::TimeDelta time_before_discard);
- // Returns true if High Efficiency mode is enabled, false otherwise. Useful to
+ // Returns true if Memory Saver mode is enabled, false otherwise. Useful to
// get the state of the mode from the Performance Manager sequence.
bool IsHighEfficiencyDiscardingEnabled() const;
diff --git a/chrome/browser/performance_manager/policies/memory_saver_mode_policy_unittest.cc b/chrome/browser/performance_manager/policies/memory_saver_mode_policy_unittest.cc
index 1339bfe..43342d1 100644
--- a/chrome/browser/performance_manager/policies/memory_saver_mode_policy_unittest.cc
+++ b/chrome/browser/performance_manager/policies/memory_saver_mode_policy_unittest.cc
@@ -117,7 +117,7 @@
TEST_F(MemorySaverModeTest, DiscardAfterBackgrounded) {
page_node()->SetType(PageType::kTab);
page_node()->SetIsVisible(true);
- policy()->OnHighEfficiencyModeChanged(true);
+ policy()->OnMemorySaverModeChanged(true);
EXPECT_CALL(*discarder(), DiscardPageNodeImpl(page_node()))
.WillOnce(::testing::Return(true));
@@ -131,7 +131,7 @@
policy()->SetTimeBeforeDiscard(base::Hours(2));
page_node()->SetType(PageType::kTab);
page_node()->SetIsVisible(true);
- policy()->OnHighEfficiencyModeChanged(true);
+ policy()->OnMemorySaverModeChanged(true);
page_node()->SetIsVisible(false);
EXPECT_EQ(policy()->GetTimeBeforeDiscardForTesting(), base::Hours(2));
@@ -160,7 +160,7 @@
TEST_F(MemorySaverModeTest, DontDiscardIfPageIsNotATab) {
page_node()->SetType(PageType::kUnknown);
- policy()->OnHighEfficiencyModeChanged(true);
+ policy()->OnMemorySaverModeChanged(true);
page_node()->SetIsVisible(true);
page_node()->SetIsVisible(false);
@@ -174,7 +174,7 @@
TEST_F(MemorySaverModeTest, DontDiscardIfPlayingAudio) {
page_node()->SetType(PageType::kTab);
page_node()->SetIsVisible(true);
- policy()->OnHighEfficiencyModeChanged(true);
+ policy()->OnMemorySaverModeChanged(true);
page_node()->SetIsAudible(true);
@@ -193,7 +193,7 @@
page_node()->SetType(PageType::kTab);
page_node()->SetIsVisible(true);
page_node()->SetIsVisible(false);
- policy()->OnHighEfficiencyModeChanged(true);
+ policy()->OnMemorySaverModeChanged(true);
task_env().FastForwardBy(original_time_before_discard);
::testing::Mock::VerifyAndClearExpectations(discarder());
@@ -216,7 +216,7 @@
page_node()->SetType(PageType::kTab);
page_node()->SetIsVisible(true);
page_node()->SetIsVisible(false);
- policy()->OnHighEfficiencyModeChanged(true);
+ policy()->OnMemorySaverModeChanged(true);
task_env().FastForwardBy(kInitialBackgroundTime);
::testing::Mock::VerifyAndClearExpectations(discarder());
@@ -248,7 +248,7 @@
page_node()->SetType(PageType::kTab);
page_node()->SetIsVisible(true);
page_node()->SetIsVisible(false);
- policy()->OnHighEfficiencyModeChanged(true);
+ policy()->OnMemorySaverModeChanged(true);
task_env().FastForwardBy(kInitialBackgroundTime);
::testing::Mock::VerifyAndClearExpectations(discarder());
@@ -278,7 +278,7 @@
page_node()->SetType(PageType::kTab);
page_node()->SetIsVisible(true);
page_node()->SetIsVisible(false);
- policy()->OnHighEfficiencyModeChanged(true);
+ policy()->OnMemorySaverModeChanged(true);
task_env().FastForwardBy(kInitialBackgroundTime);
::testing::Mock::VerifyAndClearExpectations(discarder());
@@ -323,7 +323,7 @@
base::Seconds(10));
::testing::Mock::VerifyAndClearExpectations(discarder());
- policy()->OnHighEfficiencyModeChanged(true);
+ policy()->OnMemorySaverModeChanged(true);
// The page should not be discarded 10 seconds after the mode is changed.
task_env().FastForwardBy(base::Seconds(10));
@@ -341,7 +341,7 @@
// This case will be using a different page node, so make the default one
// visible so it's not discarded.
page_node()->SetIsVisible(true);
- policy()->OnHighEfficiencyModeChanged(true);
+ policy()->OnMemorySaverModeChanged(true);
PageNodeImpl* page_node = CreateOtherPageNode();
EXPECT_EQ(PageType::kUnknown, page_node->GetType());
@@ -359,7 +359,7 @@
// This case will be using a different page node, so make the default one
// visible so it's not discarded.
page_node()->SetIsVisible(true);
- policy()->OnHighEfficiencyModeChanged(true);
+ policy()->OnMemorySaverModeChanged(true);
PageNodeImpl* page_node = CreateOtherPageNode();
EXPECT_EQ(PageType::kUnknown, page_node->GetType());
@@ -375,7 +375,7 @@
// This case will be using a different page node, so make the default one
// visible so it's not discarded.
page_node()->SetIsVisible(true);
- policy()->OnHighEfficiencyModeChanged(true);
+ policy()->OnMemorySaverModeChanged(true);
PageNodeImpl* page_node = CreateOtherPageNode();
EXPECT_EQ(PageType::kUnknown, page_node->GetType());
@@ -394,7 +394,7 @@
DiscardAfterTimeForCurrentModeIfNumRevisitsUnderMax) {
page_node()->SetType(PageType::kTab);
page_node()->SetIsVisible(true);
- policy()->OnHighEfficiencyModeChanged(true);
+ policy()->OnMemorySaverModeChanged(true);
base::test::ScopedFeatureList feature_list;
// 1 is "conservative, so 6 hours and max_num_revisits == 5"
@@ -418,7 +418,7 @@
TEST_F(MemorySaverModeTest, DontDiscardIfAboveMaxNumRevisits) {
page_node()->SetType(PageType::kTab);
page_node()->SetIsVisible(true);
- policy()->OnHighEfficiencyModeChanged(true);
+ policy()->OnMemorySaverModeChanged(true);
base::test::ScopedFeatureList feature_list;
// 1 is "conservative, so 6 hours and max_num_revisits == 5"
diff --git a/chrome/browser/performance_manager/user_tuning/user_performance_tuning_manager.cc b/chrome/browser/performance_manager/user_tuning/user_performance_tuning_manager.cc
index a0d87e9..b5595c2 100644
--- a/chrome/browser/performance_manager/user_tuning/user_performance_tuning_manager.cc
+++ b/chrome/browser/performance_manager/user_tuning/user_performance_tuning_manager.cc
@@ -56,15 +56,15 @@
CHECK(memory_saver_mode_policy);
switch (state) {
case MemorySaverModeState::kDisabled:
- memory_saver_mode_policy->OnHighEfficiencyModeChanged(false);
+ memory_saver_mode_policy->OnMemorySaverModeChanged(false);
return;
case MemorySaverModeState::kEnabled:
// TODO(crbug.com/1492508): This setting should enable the
// non-timer Memory Saver policy.
- memory_saver_mode_policy->OnHighEfficiencyModeChanged(false);
+ memory_saver_mode_policy->OnMemorySaverModeChanged(false);
return;
case MemorySaverModeState::kEnabledOnTimer:
- memory_saver_mode_policy->OnHighEfficiencyModeChanged(true);
+ memory_saver_mode_policy->OnMemorySaverModeChanged(true);
return;
}
NOTREACHED_NORETURN();
@@ -242,7 +242,7 @@
std::move(notifier));
}
- performance_manager::user_tuning::prefs::MigrateHighEfficiencyModePref(
+ performance_manager::user_tuning::prefs::MigrateMemorySaverModePref(
local_state);
pref_change_registrar_.Init(local_state);
@@ -251,7 +251,7 @@
void UserPerformanceTuningManager::Start() {
pref_change_registrar_.Add(
performance_manager::user_tuning::prefs::
- kHighEfficiencyModeTimeBeforeDiscardInMinutes,
+ kMemorySaverModeTimeBeforeDiscardInMinutes,
base::BindRepeating(&UserPerformanceTuningManager::
OnMemorySaverModeTimeBeforeDiscardChanged,
base::Unretained(this)));
@@ -275,7 +275,7 @@
prefs::GetCurrentMemorySaverModeState(pref_change_registrar_.prefs());
if (!base::FeatureList::IsEnabled(features::kMemorySaverMultistateMode)) {
if (state != MemorySaverModeState::kDisabled) {
- // The user has enabled high efficiency mode, but without the multistate
+ // The user has enabled memory saver mode, but without the multistate
// UI they didn't choose a policy. The feature controls which policy to
// use.
state = MemorySaverModeState::kEnabledOnTimer;
@@ -293,7 +293,7 @@
void UserPerformanceTuningManager::OnMemorySaverModeTimeBeforeDiscardChanged() {
base::TimeDelta time_before_discard = performance_manager::user_tuning::
- prefs::GetCurrentHighEfficiencyModeTimeBeforeDiscard(
+ prefs::GetCurrentMemorySaverModeTimeBeforeDiscard(
pref_change_registrar_.prefs());
memory_saver_mode_delegate_->SetTimeBeforeDiscard(time_before_discard);
}
diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc
index 6774e3f2..207f74c 100644
--- a/chrome/browser/prefs/browser_prefs.cc
+++ b/chrome/browser/prefs/browser_prefs.cc
@@ -2010,8 +2010,8 @@
RegisterProfilePrefsForMigration(registry);
#if !BUILDFLAG(IS_ANDROID)
- registry->RegisterIntegerPref(prefs::kHighEfficiencyChipExpandedCount, 0);
- registry->RegisterTimePref(prefs::kLastHighEfficiencyChipExpandedTimestamp,
+ registry->RegisterIntegerPref(prefs::kMemorySaverChipExpandedCount, 0);
+ registry->RegisterTimePref(prefs::kLastMemorySaverChipExpandedTimestamp,
base::Time());
#endif
diff --git a/chrome/browser/ui/performance_controls/memory_saver_bubble_delegate.cc b/chrome/browser/ui/performance_controls/memory_saver_bubble_delegate.cc
index a8621d5..d27218f 100644
--- a/chrome/browser/ui/performance_controls/memory_saver_bubble_delegate.cc
+++ b/chrome/browser/ui/performance_controls/memory_saver_bubble_delegate.cc
@@ -32,7 +32,7 @@
CHECK(web_contents);
const std::string host = web_contents->GetURL().host();
PrefService* const pref_service = browser_->profile()->GetPrefs();
- high_efficiency::AddSiteToExceptionsList(pref_service, host);
+ memory_saver::AddSiteToExceptionsList(pref_service, host);
close_action_ = MemorySaverBubbleActionType::kAddException;
}
diff --git a/chrome/browser/ui/performance_controls/memory_saver_bubble_delegate.h b/chrome/browser/ui/performance_controls/memory_saver_bubble_delegate.h
index 597ab246..5efd6b9 100644
--- a/chrome/browser/ui/performance_controls/memory_saver_bubble_delegate.h
+++ b/chrome/browser/ui/performance_controls/memory_saver_bubble_delegate.h
@@ -11,7 +11,7 @@
#include "chrome/browser/ui/performance_controls/performance_controls_metrics.h"
#include "ui/base/models/dialog_model.h"
-// This class is the delegate for the high efficiency bubble dialog that handles
+// This class is the delegate for the memory saver bubble dialog that handles
// the events raised from the dialog.
class MemorySaverBubbleDelegate : public ui::DialogModelDelegate {
public:
diff --git a/chrome/browser/ui/performance_controls/memory_saver_bubble_observer.h b/chrome/browser/ui/performance_controls/memory_saver_bubble_observer.h
index 44fe3f2..283758d 100644
--- a/chrome/browser/ui/performance_controls/memory_saver_bubble_observer.h
+++ b/chrome/browser/ui/performance_controls/memory_saver_bubble_observer.h
@@ -5,12 +5,12 @@
#ifndef CHROME_BROWSER_UI_PERFORMANCE_CONTROLS_MEMORY_SAVER_BUBBLE_OBSERVER_H_
#define CHROME_BROWSER_UI_PERFORMANCE_CONTROLS_MEMORY_SAVER_BUBBLE_OBSERVER_H_
-// This observer interface for the high efficiency bubble dialog.
+// This observer interface for the memory saver bubble dialog.
class MemorySaverBubbleObserver {
public:
- // Called when the high efficiency dialog is opened.
+ // Called when the memory saver dialog is opened.
virtual void OnBubbleShown() = 0;
- // Called when the high efficiency dialog is closed.
+ // Called when the memory saver dialog is closed.
virtual void OnBubbleHidden() = 0;
protected:
diff --git a/chrome/browser/ui/performance_controls/memory_saver_chip_tab_helper.cc b/chrome/browser/ui/performance_controls/memory_saver_chip_tab_helper.cc
index 8ae6702a..da8d6660 100644
--- a/chrome/browser/ui/performance_controls/memory_saver_chip_tab_helper.cc
+++ b/chrome/browser/ui/performance_controls/memory_saver_chip_tab_helper.cc
@@ -41,9 +41,9 @@
content::Visibility visibility) {
if (visibility == content::Visibility::HIDDEN) {
was_rendered_ = false;
- if (chip_state_ == high_efficiency::ChipState::EXPANDED_WITH_SAVINGS ||
- chip_state_ == high_efficiency::ChipState::EXPANDED_EDUCATION) {
- chip_state_ = high_efficiency::ChipState::COLLAPSED_FROM_EXPANDED;
+ if (chip_state_ == memory_saver::ChipState::EXPANDED_WITH_SAVINGS ||
+ chip_state_ == memory_saver::ChipState::EXPANDED_EDUCATION) {
+ chip_state_ = memory_saver::ChipState::COLLAPSED_FROM_EXPANDED;
}
}
}
@@ -69,13 +69,13 @@
}
bool const savings_over_threshold =
- static_cast<int>(high_efficiency::GetDiscardedMemorySavingsInBytes(
- &GetWebContents())) >
+ static_cast<int>(
+ memory_saver::GetDiscardedMemorySavingsInBytes(&GetWebContents())) >
performance_manager::features::kExpandedMemorySaverChipThresholdBytes
.Get();
base::Time const last_expanded_timestamp =
- pref_service_->GetTime(prefs::kLastHighEfficiencyChipExpandedTimestamp);
+ pref_service_->GetTime(prefs::kLastMemorySaverChipExpandedTimestamp);
bool const expanded_chip_not_shown_recently =
(base::Time::Now() - last_expanded_timestamp) >
performance_manager::features::kExpandedMemorySaverChipFrequency.Get();
@@ -92,7 +92,7 @@
if (savings_over_threshold && expanded_chip_not_shown_recently &&
tab_discard_time_over_threshold) {
- pref_service_->SetTime(prefs::kLastHighEfficiencyChipExpandedTimestamp,
+ pref_service_->SetTime(prefs::kLastMemorySaverChipExpandedTimestamp,
base::Time::Now());
return true;
}
@@ -101,9 +101,9 @@
bool MemorySaverChipTabHelper::ComputeShouldEducateAboutMemorySavings() {
int times_rendered =
- pref_service_->GetInteger(prefs::kHighEfficiencyChipExpandedCount);
+ pref_service_->GetInteger(prefs::kMemorySaverChipExpandedCount);
if (times_rendered < kChipAnimationCount) {
- pref_service_->SetInteger(prefs::kHighEfficiencyChipExpandedCount,
+ pref_service_->SetInteger(prefs::kMemorySaverChipExpandedCount,
times_rendered + 1);
return true;
}
@@ -112,24 +112,24 @@
void MemorySaverChipTabHelper::ComputeChipState(
content::NavigationHandle* navigation_handle) {
- // This high efficiency chip only appears for eligible sites that have been
+ // This memory saver chip only appears for eligible sites that have been
// proactively discarded.
bool const was_discarded = navigation_handle->ExistingDocumentWasDiscarded();
std::optional<mojom::LifecycleUnitDiscardReason> const discard_reason =
- high_efficiency::GetDiscardReason(navigation_handle->GetWebContents());
+ memory_saver::GetDiscardReason(navigation_handle->GetWebContents());
bool const is_site_supported =
- high_efficiency::IsURLSupported(navigation_handle->GetURL());
+ memory_saver::IsURLSupported(navigation_handle->GetURL());
if (!(was_discarded &&
discard_reason == mojom::LifecycleUnitDiscardReason::PROACTIVE &&
is_site_supported)) {
- chip_state_ = high_efficiency::ChipState::HIDDEN;
+ chip_state_ = memory_saver::ChipState::HIDDEN;
} else if (ComputeShouldEducateAboutMemorySavings()) {
- chip_state_ = high_efficiency::ChipState::EXPANDED_EDUCATION;
+ chip_state_ = memory_saver::ChipState::EXPANDED_EDUCATION;
} else if (ComputeShouldHighlightMemorySavings()) {
- chip_state_ = high_efficiency::ChipState::EXPANDED_WITH_SAVINGS;
+ chip_state_ = memory_saver::ChipState::EXPANDED_WITH_SAVINGS;
} else {
- chip_state_ = high_efficiency::ChipState::COLLAPSED;
+ chip_state_ = memory_saver::ChipState::COLLAPSED;
}
}
diff --git a/chrome/browser/ui/performance_controls/memory_saver_chip_tab_helper.h b/chrome/browser/ui/performance_controls/memory_saver_chip_tab_helper.h
index 5390831..1358a73 100644
--- a/chrome/browser/ui/performance_controls/memory_saver_chip_tab_helper.h
+++ b/chrome/browser/ui/performance_controls/memory_saver_chip_tab_helper.h
@@ -12,7 +12,7 @@
#include "content/public/browser/web_contents_observer.h"
#include "content/public/browser/web_contents_user_data.h"
-namespace high_efficiency {
+namespace memory_saver {
enum class ChipState {
// Chip is not shown for this tab.
HIDDEN,
@@ -25,13 +25,13 @@
// Previously expanded chip is collapsed due to tab switching.
COLLAPSED_FROM_EXPANDED,
};
-} // namespace high_efficiency
+} // namespace memory_saver
-// When a page in the background has been discarded due to high efficiency mode,
+// When a page in the background has been discarded due to memory saver mode,
// and the user returns to that tab, a page action chip should be shown to the
// user which conveys information about the discarded tab to the user.
// The MemorySaverChipTabHelper is a per-tab class which manages the state of
-// the high efficiency chip.
+// the memory saver chip.
class MemorySaverChipTabHelper
: public content::WebContentsObserver,
public content::WebContentsUserData<MemorySaverChipTabHelper> {
@@ -43,7 +43,7 @@
static constexpr int kChipAnimationCount = 3;
- high_efficiency::ChipState chip_state() const { return chip_state_; }
+ memory_saver::ChipState chip_state() const { return chip_state_; }
// content::WebContentsObserver
void DidStartNavigation(
@@ -70,7 +70,7 @@
// recent navigation.
void ComputeChipState(content::NavigationHandle* navigation_handle);
- high_efficiency::ChipState chip_state_ = high_efficiency::ChipState::HIDDEN;
+ memory_saver::ChipState chip_state_ = memory_saver::ChipState::HIDDEN;
// Represents whether the current chip state has been properly rendered. This
// gets reset when a tab gets hidden so the chip can be redrawn.
bool was_rendered_ = false;
diff --git a/chrome/browser/ui/performance_controls/memory_saver_opt_in_iph_controller.cc b/chrome/browser/ui/performance_controls/memory_saver_opt_in_iph_controller.cc
index b4537df1..11d2c14 100644
--- a/chrome/browser/ui/performance_controls/memory_saver_opt_in_iph_controller.cc
+++ b/chrome/browser/ui/performance_controls/memory_saver_opt_in_iph_controller.cc
@@ -17,7 +17,7 @@
: browser_(browser) {
auto* manager = performance_manager::user_tuning::
UserPerformanceTuningManager::GetInstance();
- high_efficiency_observer_.Observe(manager);
+ memory_saver_observer_.Observe(manager);
}
MemorySaverOptInIPHController::~MemorySaverOptInIPHController() = default;
diff --git a/chrome/browser/ui/performance_controls/memory_saver_opt_in_iph_controller.h b/chrome/browser/ui/performance_controls/memory_saver_opt_in_iph_controller.h
index 0b5c5fb..1fd360c 100644
--- a/chrome/browser/ui/performance_controls/memory_saver_opt_in_iph_controller.h
+++ b/chrome/browser/ui/performance_controls/memory_saver_opt_in_iph_controller.h
@@ -32,7 +32,7 @@
base::ScopedObservation<
performance_manager::user_tuning::UserPerformanceTuningManager,
performance_manager::user_tuning::UserPerformanceTuningManager::Observer>
- high_efficiency_observer_{this};
+ memory_saver_observer_{this};
const raw_ptr<Browser> browser_;
};
diff --git a/chrome/browser/ui/performance_controls/memory_saver_utils.cc b/chrome/browser/ui/performance_controls/memory_saver_utils.cc
index bd1d3d39..6e1e754 100644
--- a/chrome/browser/ui/performance_controls/memory_saver_utils.cc
+++ b/chrome/browser/ui/performance_controls/memory_saver_utils.cc
@@ -9,7 +9,7 @@
#include "components/performance_manager/public/user_tuning/prefs.h"
#include "content/public/common/url_constants.h"
-namespace high_efficiency {
+namespace memory_saver {
bool IsURLSupported(GURL url) {
return !url.SchemeIs(content::kChromeUIScheme);
@@ -58,4 +58,4 @@
1024;
}
-} // namespace high_efficiency
+} // namespace memory_saver
diff --git a/chrome/browser/ui/performance_controls/memory_saver_utils.h b/chrome/browser/ui/performance_controls/memory_saver_utils.h
index 3ad5d7f..144af76b 100644
--- a/chrome/browser/ui/performance_controls/memory_saver_utils.h
+++ b/chrome/browser/ui/performance_controls/memory_saver_utils.h
@@ -10,7 +10,7 @@
#include "content/public/browser/web_contents.h"
#include "url/gurl.h"
-namespace high_efficiency {
+namespace memory_saver {
// Returns whether |url| supports showing discard indicators
bool IsURLSupported(GURL url);
@@ -29,6 +29,6 @@
// Returns how much memory was saved through discarding `contents`
uint64_t GetDiscardedMemorySavingsInBytes(content::WebContents* contents);
-} // namespace high_efficiency
+} // namespace memory_saver
#endif // CHROME_BROWSER_UI_PERFORMANCE_CONTROLS_MEMORY_SAVER_UTILS_H_
diff --git a/chrome/browser/ui/performance_controls/performance_controls_hats_service.cc b/chrome/browser/ui/performance_controls/performance_controls_hats_service.cc
index fdde197..0c3ed96 100644
--- a/chrome/browser/ui/performance_controls/performance_controls_hats_service.cc
+++ b/chrome/browser/ui/performance_controls/performance_controls_hats_service.cc
@@ -58,17 +58,16 @@
const bool battery_saver_mode =
performance_manager::user_tuning::BatterySaverModeManager::GetInstance()
->IsBatterySaverModeEnabled();
- const bool high_efficiency_mode =
- performance_manager::user_tuning::UserPerformanceTuningManager::
- GetInstance()
- ->IsMemorySaverModeActive();
+ const bool memory_saver_mode = performance_manager::user_tuning::
+ UserPerformanceTuningManager::GetInstance()
+ ->IsMemorySaverModeActive();
// A general performance survey for all users.
if (base::FeatureList::IsEnabled(performance_manager::features::
kPerformanceControlsPerformanceSurvey)) {
hats_service->LaunchSurvey(kHatsSurveyTriggerPerformanceControlsPerformance,
base::DoNothing(), base::DoNothing(),
- {{"high_efficiency_mode", high_efficiency_mode},
+ {{"high_efficiency_mode", memory_saver_mode},
{"battery_saver_mode", battery_saver_mode}},
{});
}
@@ -87,7 +86,7 @@
hats_service->LaunchSurvey(
kHatsSurveyTriggerPerformanceControlsBatteryPerformance,
base::DoNothing(), base::DoNothing(),
- {{"high_efficiency_mode", high_efficiency_mode},
+ {{"high_efficiency_mode", memory_saver_mode},
{"battery_saver_mode", battery_saver_mode}},
{});
}
@@ -117,7 +116,7 @@
auto* manager = performance_manager::user_tuning::
UserPerformanceTuningManager::GetInstance();
- // A survey for users who have turned off high efficiency mode.
+ // A survey for users who have turned off memory saver mode.
if (!manager->IsMemorySaverModeActive() &&
!manager->IsMemorySaverModeManaged() &&
!manager->IsMemorySaverModeDefault()) {
diff --git a/chrome/browser/ui/performance_controls/performance_controls_hats_service.h b/chrome/browser/ui/performance_controls/performance_controls_hats_service.h
index 88ce7c0..e6e0ab9 100644
--- a/chrome/browser/ui/performance_controls/performance_controls_hats_service.h
+++ b/chrome/browser/ui/performance_controls/performance_controls_hats_service.h
@@ -31,7 +31,7 @@
void OnBatterySaverModeChanged(bool is_active) override;
// performance_manager::user_tuning::UserPerformanceTuningManager::Observer:
- // Called in response to a change in the high efficiency mode pref to check
+ // Called in response to a change in the memory saver mode pref to check
// whether a HaTS survey should be shown.
void OnMemorySaverModeChanged() override;
diff --git a/chrome/browser/ui/performance_controls/performance_controls_hats_service_unittest.cc b/chrome/browser/ui/performance_controls/performance_controls_hats_service_unittest.cc
index 116ac6b..1831a4cf 100644
--- a/chrome/browser/ui/performance_controls/performance_controls_hats_service_unittest.cc
+++ b/chrome/browser/ui/performance_controls/performance_controls_hats_service_unittest.cc
@@ -69,10 +69,10 @@
static_cast<int>(battery_saver_mode));
}
- void SetMemorySaverEnabled(const bool high_efficiency_enabled) {
+ void SetMemorySaverEnabled(const bool memory_saver_enabled) {
performance_manager::user_tuning::UserPerformanceTuningManager::
GetInstance()
- ->SetMemorySaverModeEnabled(high_efficiency_enabled);
+ ->SetMemorySaverModeEnabled(memory_saver_enabled);
}
PerformanceControlsHatsService* performance_controls_hats_service() {
diff --git a/chrome/browser/ui/tabs/tab_renderer_data.cc b/chrome/browser/ui/tabs/tab_renderer_data.cc
index ff78d3a..f62d6d2 100644
--- a/chrome/browser/ui/tabs/tab_renderer_data.cc
+++ b/chrome/browser/ui/tabs/tab_renderer_data.cc
@@ -100,20 +100,20 @@
entry && favicon::ShouldThemifyFaviconForEntry(entry);
std::optional<mojom::LifecycleUnitDiscardReason> discard_reason =
- high_efficiency::GetDiscardReason(contents);
+ memory_saver::GetDiscardReason(contents);
// Only show discard status for tabs that were proactively discarded to
// prevent confusion to users on why a tab was discarded. Also, the favicon
// discard animation may use resources so the animation should be limited
// to proactive discards to prevent performance issues.
data.should_show_discard_status =
- high_efficiency::IsURLSupported(contents->GetURL()) &&
+ memory_saver::IsURLSupported(contents->GetURL()) &&
contents->WasDiscarded() && discard_reason.has_value() &&
discard_reason.value() == mojom::LifecycleUnitDiscardReason::PROACTIVE;
if (contents->WasDiscarded()) {
data.discarded_memory_savings_in_bytes =
- high_efficiency::GetDiscardedMemorySavingsInBytes(contents);
+ memory_saver::GetDiscardedMemorySavingsInBytes(contents);
}
const auto* const resource_tab_helper =
diff --git a/chrome/browser/ui/views/frame/browser_view.cc b/chrome/browser/ui/views/frame/browser_view.cc
index 16e2a27..12d89c4c 100644
--- a/chrome/browser/ui/views/frame/browser_view.cc
+++ b/chrome/browser/ui/views/frame/browser_view.cc
@@ -1018,8 +1018,8 @@
}
#endif
- // High Efficiency mode is default off but is available to turn on
- high_efficiency_opt_in_iph_controller_ =
+ // Memory Saver mode is default off but is available to turn on
+ memory_saver_opt_in_iph_controller_ =
std::make_unique<MemorySaverOptInIPHController>(browser_.get());
registrar_.Init(GetProfile()->GetPrefs());
diff --git a/chrome/browser/ui/views/frame/browser_view.h b/chrome/browser/ui/views/frame/browser_view.h
index 8b18f286..b748525 100644
--- a/chrome/browser/ui/views/frame/browser_view.h
+++ b/chrome/browser/ui/views/frame/browser_view.h
@@ -1270,7 +1270,7 @@
OnLinkOpeningFromGestureCallbackList link_opened_from_gesture_callbacks_;
std::unique_ptr<MemorySaverOptInIPHController>
- high_efficiency_opt_in_iph_controller_;
+ memory_saver_opt_in_iph_controller_;
#if BUILDFLAG(IS_CHROMEOS_ASH)
// |loading_animation_tracker_| is used to measure animation smoothness for
diff --git a/chrome/browser/ui/views/performance_controls/memory_saver_bubble_view.cc b/chrome/browser/ui/views/performance_controls/memory_saver_bubble_view.cc
index ac2d0b4f..fe34796 100644
--- a/chrome/browser/ui/views/performance_controls/memory_saver_bubble_view.cc
+++ b/chrome/browser/ui/views/performance_controls/memory_saver_bubble_view.cc
@@ -114,7 +114,7 @@
content::WebContents* web_contents =
browser->tab_strip_model()->GetActiveWebContents();
const uint64_t memory_savings =
- high_efficiency::GetDiscardedMemorySavingsInBytes(web_contents);
+ memory_saver::GetDiscardedMemorySavingsInBytes(web_contents);
ui::DialogModelLabel::TextReplacement memory_savings_text =
ui::DialogModelLabel::CreatePlainText(ui::FormatBytes(memory_savings));
@@ -167,7 +167,7 @@
if (base::FeatureList::IsEnabled(
performance_manager::features::kDiscardExceptionsImprovements) &&
!is_guest && !profile->IsIncognitoProfile()) {
- const bool is_site_excluded = high_efficiency::IsSiteInExceptionsList(
+ const bool is_site_excluded = memory_saver::IsSiteInExceptionsList(
profile->GetPrefs(), web_contents->GetURL().host());
AddCancelButton(&dialog_model_builder, bubble_delegate, is_site_excluded);
}
diff --git a/chrome/browser/ui/views/performance_controls/memory_saver_chip_view.cc b/chrome/browser/ui/views/performance_controls/memory_saver_chip_view.cc
index bdb7c6e..90b5df2 100644
--- a/chrome/browser/ui/views/performance_controls/memory_saver_chip_view.cc
+++ b/chrome/browser/ui/views/performance_controls/memory_saver_chip_view.cc
@@ -93,23 +93,23 @@
MemorySaverChipTabHelper::FromWebContents(web_contents);
auto chip_state = tab_helper->chip_state();
- if (chip_state != high_efficiency::ChipState::HIDDEN &&
- is_high_efficiency_mode_enabled_) {
+ if (chip_state != memory_saver::ChipState::HIDDEN &&
+ is_memory_saver_mode_enabled_) {
if (!tab_helper->ShouldChipAnimate()) {
return;
}
switch (chip_state) {
- case high_efficiency::ChipState::EXPANDED_EDUCATION: {
+ case memory_saver::ChipState::EXPANDED_EDUCATION: {
SetVisible(true);
AnimateIn(IDS_MEMORY_SAVER_CHIP_LABEL);
RecordMemorySaverChipState(MemorySaverChipState::kExpandedEducation);
break;
}
- case high_efficiency::ChipState::EXPANDED_WITH_SAVINGS: {
+ case memory_saver::ChipState::EXPANDED_WITH_SAVINGS: {
SetVisible(true);
int const memory_savings =
- high_efficiency::GetDiscardedMemorySavingsInBytes(web_contents);
+ memory_saver::GetDiscardedMemorySavingsInBytes(web_contents);
std::u16string memory_savings_string = ui::FormatBytes(memory_savings);
SetLabel(l10n_util::GetStringFUTF16(IDS_MEMORY_SAVER_CHIP_SAVINGS_LABEL,
{memory_savings_string}),
@@ -120,14 +120,14 @@
RecordMemorySaverChipState(MemorySaverChipState::kExpandedWithSavings);
break;
}
- case high_efficiency::ChipState::COLLAPSED_FROM_EXPANDED: {
+ case memory_saver::ChipState::COLLAPSED_FROM_EXPANDED: {
SetVisible(true);
UnpauseAnimation();
AnimateOut();
ResetSlideAnimation(false);
break;
}
- case high_efficiency::ChipState::COLLAPSED: {
+ case memory_saver::ChipState::COLLAPSED: {
SetVisible(true);
SetAccessibleName(chip_accessible_label_);
RecordMemorySaverChipState(MemorySaverChipState::kCollapsed);
@@ -186,7 +186,7 @@
void MemorySaverChipView::OnMemorySaverModeChanged() {
auto* manager = performance_manager::user_tuning::
UserPerformanceTuningManager::GetInstance();
- is_high_efficiency_mode_enabled_ = manager->IsMemorySaverModeActive();
+ is_memory_saver_mode_enabled_ = manager->IsMemorySaverModeActive();
}
BEGIN_METADATA(MemorySaverChipView, PageActionIconView)
diff --git a/chrome/browser/ui/views/performance_controls/memory_saver_chip_view.h b/chrome/browser/ui/views/performance_controls/memory_saver_chip_view.h
index f9fedc9..5db2212 100644
--- a/chrome/browser/ui/views/performance_controls/memory_saver_chip_view.h
+++ b/chrome/browser/ui/views/performance_controls/memory_saver_chip_view.h
@@ -16,7 +16,7 @@
#include "ui/base/metadata/metadata_header_macros.h"
#include "ui/views/bubble/bubble_dialog_model_host.h"
-// Represents the high efficiency page action chip that appears on previously
+// Represents the memory saver page action chip that appears on previously
// discarded tabs.
class MemorySaverChipView : public PageActionIconView,
public MemorySaverBubbleObserver,
@@ -48,7 +48,7 @@
private:
// performance_manager::user_tuning::UserPerformanceTuningManager::Observer:
- // Checks whether high efficiency mode is currently enabled.
+ // Checks whether memory saver mode is currently enabled.
void OnMemorySaverModeChanged() override;
const raw_ptr<Browser> browser_;
@@ -59,7 +59,7 @@
performance_manager::user_tuning::UserPerformanceTuningManager,
performance_manager::user_tuning::UserPerformanceTuningManager::Observer>
user_performance_tuning_manager_observation_{this};
- bool is_high_efficiency_mode_enabled_ = false;
+ bool is_memory_saver_mode_enabled_ = false;
};
#endif // CHROME_BROWSER_UI_VIEWS_PERFORMANCE_CONTROLS_MEMORY_SAVER_CHIP_VIEW_H_
diff --git a/chrome/browser/ui/views/performance_controls/memory_saver_chip_view_unittest.cc b/chrome/browser/ui/views/performance_controls/memory_saver_chip_view_unittest.cc
index ea80e94..92458ff 100644
--- a/chrome/browser/ui/views/performance_controls/memory_saver_chip_view_unittest.cc
+++ b/chrome/browser/ui/views/performance_controls/memory_saver_chip_view_unittest.cc
@@ -112,12 +112,12 @@
void SetChipExpandedCount(int count) {
browser_view()->browser()->profile()->GetPrefs()->SetInteger(
- prefs::kHighEfficiencyChipExpandedCount, count);
+ prefs::kMemorySaverChipExpandedCount, count);
}
void SetChipExpandedTimeToNow() {
browser_view()->browser()->profile()->GetPrefs()->SetTime(
- prefs::kLastHighEfficiencyChipExpandedTimestamp, base::Time::Now());
+ prefs::kLastMemorySaverChipExpandedTimestamp, base::Time::Now());
}
PageActionIconView* GetPageActionIconView() {
@@ -155,7 +155,7 @@
EXPECT_FALSE(GetPageActionIconView()->GetVisible());
}
-// If a discard is triggered when the user doesn't have high efficiency mode
+// If a discard is triggered when the user doesn't have memory saver mode
// enabled, we don't show the chip.
TEST_F(MemorySaverChipViewTest, ShouldNotShowWhenPrefIsFalse) {
SetHighEfficiencyModeEnabled(false);
@@ -382,10 +382,10 @@
ASSERT_FALSE(browser_view()->unified_side_panel()->GetVisible());
- PageActionIconView* high_efficiency_chip = GetPageActionIconView();
+ PageActionIconView* memory_saver_chip = GetPageActionIconView();
ui::MouseEvent e(ui::ET_MOUSE_PRESSED, gfx::Point(), gfx::Point(),
ui::EventTimeForNow(), 0, 0);
- views::test::ButtonTestApi test_api(high_efficiency_chip);
+ views::test::ButtonTestApi test_api(memory_saver_chip);
test_api.NotifyClick(e);
ASSERT_TRUE(browser_view()->unified_side_panel()->GetVisible());
diff --git a/chrome/browser/ui/views/performance_controls/memory_saver_interactive_ui_test.cc b/chrome/browser/ui/views/performance_controls/memory_saver_interactive_ui_test.cc
index 4228d22..6442aeb5 100644
--- a/chrome/browser/ui/views/performance_controls/memory_saver_interactive_ui_test.cc
+++ b/chrome/browser/ui/views/performance_controls/memory_saver_interactive_ui_test.cc
@@ -318,7 +318,7 @@
TryDiscardTab(0), CheckTabIsNotDiscarded(0));
}
-// Tests the functionality of the High Efficiency page action chip
+// Tests the functionality of the Memory Saver page action chip
class MemorySaverChipInteractiveTest : public MemorySaverInteractiveTest {
public:
MemorySaverChipInteractiveTest() = default;
@@ -358,7 +358,7 @@
}
// Discard and reload the tab at discard_tab_index the number of times the
- // high efficiency page action chip can expand so subsequent discards
+ // memory saver page action chip can expand so subsequent discards
// will result in the chip staying in its collapsed state
auto DiscardTabUntilChipStopsExpanding(
size_t discard_tab_index,
@@ -450,7 +450,7 @@
EnsureNotPresent(kMemorySaverChipElementId));
}
-// High Efficiency Dialog bubble should close after clicking the "OK" button
+// Memory Saver Dialog bubble should close after clicking the "OK" button
IN_PROC_BROWSER_TEST_F(MemorySaverChipInteractiveTest,
CloseBubbleOnOkButtonClick) {
RunTestSequence(
@@ -464,7 +464,7 @@
WaitForHide(MemorySaverBubbleView::kMemorySaverDialogBodyElementId));
}
-// High Efficiency dialog bubble should close after clicking on the "X"
+// Memory Saver dialog bubble should close after clicking on the "X"
// close button
IN_PROC_BROWSER_TEST_F(MemorySaverChipInteractiveTest,
CloseBubbleOnCloseButtonClick) {
@@ -487,7 +487,7 @@
EnsureNotPresent(MemorySaverBubbleView::kMemorySaverDialogBodyElementId));
}
-// High Efficiency Dialog bubble should close after clicking on
+// Memory Saver Dialog bubble should close after clicking on
// the page action chip again
IN_PROC_BROWSER_TEST_F(MemorySaverChipInteractiveTest, CloseBubbleOnChipClick) {
RunTestSequence(
@@ -501,7 +501,7 @@
EnsureNotPresent(MemorySaverBubbleView::kMemorySaverDialogBodyElementId));
}
-// High Efficiency dialog bubble should close when clicking to navigate to
+// Memory Saver dialog bubble should close when clicking to navigate to
// another tab
IN_PROC_BROWSER_TEST_F(MemorySaverChipInteractiveTest, CloseBubbleOnTabSwitch) {
constexpr char kSecondTab[] = "second_tab";
@@ -554,7 +554,7 @@
browser())));
}
-// High Efficiency Dialog bubble should add the site it is currently on
+// Memory Saver Dialog bubble should add the site it is currently on
// to the exceptions list if the cancel button of the dialog bubble is clicked.
// Opening the dialog button again will cause the cancel button to give users
// the option to go to settings instead.
@@ -607,7 +607,7 @@
GURL(chrome::kChromeUIPerformanceSettingsURL)));
}
-// High Efficiency Dialog bubble's cancel button's state should be preserved
+// Memory Saver Dialog bubble's cancel button's state should be preserved
// for that tab even when navigating to another tab.
IN_PROC_BROWSER_TEST_F(MemorySaverChipInteractiveTest,
CancelButtonStatePreseveredWhenSwitchingTabs) {
@@ -720,7 +720,7 @@
MemorySaverFaviconTreatmentTest,
testing::ValuesIn(MemorySaverTestConfig()));
-// Tests the new memory savings reporting improvements on the high efficiency
+// Tests the new memory savings reporting improvements on the memory saver
// dialog.
class MemorySaverMemorySavingsReportingImprovementsTest
: public MemorySaverInteractiveTest {
@@ -739,7 +739,7 @@
base::test::ScopedFeatureList scoped_feature_list_;
};
-// The high efficiency chip dialog renders a gauge style visualization that
+// The memory saver chip dialog renders a gauge style visualization that
// must be rendered correctly.
IN_PROC_BROWSER_TEST_F(MemorySaverMemorySavingsReportingImprovementsTest,
RenderVisualizationInDialog) {
diff --git a/chrome/browser/ui/views/performance_controls/memory_saver_iph_browsertest.cc b/chrome/browser/ui/views/performance_controls/memory_saver_iph_browsertest.cc
index fc82c1ce..afa5e28 100644
--- a/chrome/browser/ui/views/performance_controls/memory_saver_iph_browsertest.cc
+++ b/chrome/browser/ui/views/performance_controls/memory_saver_iph_browsertest.cc
@@ -76,7 +76,7 @@
feature_engagement::test::ScopedIphFeatureList iph_features_;
};
-// Check that the high efficiency mode in-product help promo is shown when
+// Check that the memory saver mode in-product help promo is shown when
// a tab threshold is reached and dismisses correctly when the app menu
// button is pushed
IN_PROC_BROWSER_TEST_F(MemorySaverHelpPromoTest, ShowPromoOnTabThreshold) {
@@ -93,8 +93,8 @@
EXPECT_FALSE(promo_active);
}
-// Confirm that High Efficiency mode is enabled when the custom action
-// button for high efficiency mode is clicked
+// Confirm that Memory Saver mode is enabled when the custom action
+// button for memory saver mode is clicked
IN_PROC_BROWSER_TEST_F(MemorySaverHelpPromoTest, PromoCustomActionClicked) {
EXPECT_TRUE(performance_manager::user_tuning::UserPerformanceTuningManager::
GetInstance()
@@ -120,7 +120,7 @@
->IsMemorySaverModeActive());
}
-// Check that the performance menu item is alerted when the high efficiency
+// Check that the performance menu item is alerted when the memory saver
// promo is shown and the app menu button is clicked
IN_PROC_BROWSER_TEST_F(MemorySaverHelpPromoTest, AlertMenuItemWhenPromoShown) {
TriggerMemorySaverPromo();
diff --git a/chrome/browser/ui/views/tabs/tab_hover_card_controller_interactive_uitest.cc b/chrome/browser/ui/views/tabs/tab_hover_card_controller_interactive_uitest.cc
index eec882a8..c1f47f5 100644
--- a/chrome/browser/ui/views/tabs/tab_hover_card_controller_interactive_uitest.cc
+++ b/chrome/browser/ui/views/tabs/tab_hover_card_controller_interactive_uitest.cc
@@ -739,7 +739,7 @@
content::WebContents* const web_contents =
browser->tab_strip_model()->GetWebContentsAt(0);
const uint64_t memory_estimate =
- high_efficiency::GetDiscardedMemorySavingsInBytes(
+ memory_saver::GetDiscardedMemorySavingsInBytes(
web_contents);
return label->GetText() ==
l10n_util::GetStringFUTF16(
diff --git a/chrome/browser/ui/webui/settings/performance_settings_interactive_uitest.cc b/chrome/browser/ui/webui/settings/performance_settings_interactive_uitest.cc
index aea6e97..66b3b00 100644
--- a/chrome/browser/ui/webui/settings/performance_settings_interactive_uitest.cc
+++ b/chrome/browser/ui/webui/settings/performance_settings_interactive_uitest.cc
@@ -163,13 +163,13 @@
CheckJsResultAt(kPerformanceSettingsPage, kMemorySaverToggleQuery,
kCheckJsElementIsChecked),
- // Turn Off High Efficiency Mode
+ // Turn Off Memory Saver Mode
ClickElement(kPerformanceSettingsPage, kMemorySaverToggleQuery),
WaitForButtonStateChange(kPerformanceSettingsPage,
kMemorySaverToggleQuery, false),
CheckMemorySaverModePrefState(MemorySaverModeState::kDisabled),
- // Turn High Efficiency Mode back on
+ // Turn Memory Saver Mode back on
ClickElement(kPerformanceSettingsPage, kMemorySaverToggleQuery),
WaitForButtonStateChange(kPerformanceSettingsPage,
kMemorySaverToggleQuery, true),
@@ -179,22 +179,22 @@
IN_PROC_BROWSER_TEST_F(PerformanceSettingsInteractiveTest,
MemorySaverLearnMoreLinkNavigates) {
DEFINE_LOCAL_ELEMENT_IDENTIFIER_VALUE(kLearnMorePage);
- const DeepQuery high_efficiency_learn_more = {"settings-ui",
- "settings-main",
- "settings-basic-page",
- "settings-performance-page",
- "settings-toggle-button",
- "a#learn-more"};
+ const DeepQuery memory_saver_learn_more = {"settings-ui",
+ "settings-main",
+ "settings-basic-page",
+ "settings-performance-page",
+ "settings-toggle-button",
+ "a#learn-more"};
RunTestSequence(
InstrumentTab(kPerformanceSettingsPage),
NavigateWebContents(kPerformanceSettingsPage,
GURL(chrome::kChromeUIPerformanceSettingsURL)),
InstrumentNextTab(kLearnMorePage),
- ClickElement(kPerformanceSettingsPage, high_efficiency_learn_more),
+ ClickElement(kPerformanceSettingsPage, memory_saver_learn_more),
WaitForShow(kLearnMorePage), CheckTabCount(2),
WaitForWebContentsReady(kLearnMorePage,
- GURL(chrome::kHighEfficiencyModeLearnMoreUrl)));
+ GURL(chrome::kMemorySaverModeLearnMoreUrl)));
}
IN_PROC_BROWSER_TEST_F(PerformanceSettingsInteractiveTest,
@@ -209,14 +209,14 @@
CheckJsResultAt(kPerformanceSettingsPage, kMemorySaverToggleQuery,
kCheckJsElementIsChecked),
- // Turn Off High Efficiency Mode
+ // Turn Off Memory Saver Mode
ClickElement(kPerformanceSettingsPage, kMemorySaverToggleQuery),
WaitForButtonStateChange(kPerformanceSettingsPage,
kMemorySaverToggleQuery, false),
CheckMemorySaverModeLogged(MemorySaverModeState::kDisabled, 1,
histogram_tester),
- // Turn High Efficiency Mode back on
+ // Turn Memory Saver Mode back on
ClickElement(kPerformanceSettingsPage, kMemorySaverToggleQuery),
WaitForButtonStateChange(kPerformanceSettingsPage,
kMemorySaverToggleQuery, true),
@@ -228,7 +228,7 @@
// TODO(http://b/281528238): reenable the test.
IN_PROC_BROWSER_TEST_F(PerformanceSettingsInteractiveTest,
DISABLED_MemorySaverSendFeedbackDialogOpens) {
- const DeepQuery high_efficiency_feedback = {
+ const DeepQuery memory_saver_feedback = {
"settings-ui", "settings-main", "settings-basic-page",
"settings-section#performanceSettingsSection", "cr-icon-button#feedback"};
@@ -236,7 +236,7 @@
InstrumentTab(kPerformanceSettingsPage),
NavigateWebContents(kPerformanceSettingsPage,
GURL(chrome::kChromeUIPerformanceSettingsURL)),
- ClickElement(kPerformanceSettingsPage, high_efficiency_feedback),
+ ClickElement(kPerformanceSettingsPage, memory_saver_feedback),
InAnyContext(WaitForShow(FeedbackDialog::kFeedbackDialogForTesting)));
}
#endif // BUILDFLAG(GOOGLE_CHROME_BRANDING)
@@ -279,19 +279,19 @@
CheckJsResultAt(kPerformanceSettingsPage, kMemorySaverToggleQuery,
kCheckJsElementIsChecked),
- // Enable high efficiency mode to discard tabs based on a timer
+ // Enable memory saver mode to discard tabs based on a timer
ClickElement(kPerformanceSettingsPage, kDiscardOnTimerQuery),
WaitForButtonStateChange(kPerformanceSettingsPage, kDiscardOnTimerQuery,
true),
CheckMemorySaverModePrefState(MemorySaverModeState::kEnabledOnTimer),
- // Turn off high efficiency mode
+ // Turn off memory saver mode
ClickElement(kPerformanceSettingsPage, kMemorySaverToggleQuery),
WaitForButtonStateChange(kPerformanceSettingsPage,
kMemorySaverToggleQuery, false),
CheckMemorySaverModePrefState(MemorySaverModeState::kDisabled),
- // Turn high efficiency mode back on
+ // Turn memory saver mode back on
ClickElement(kPerformanceSettingsPage, kMemorySaverToggleQuery),
WaitForButtonStateChange(kPerformanceSettingsPage,
kMemorySaverToggleQuery, true),
@@ -314,14 +314,14 @@
CheckJsResultAt(kPerformanceSettingsPage, kMemorySaverToggleQuery,
kCheckJsElementIsChecked),
- // Turn Off High Efficiency Mode
+ // Turn Off Memory Saver Mode
ClickElement(kPerformanceSettingsPage, kMemorySaverToggleQuery),
WaitForButtonStateChange(kPerformanceSettingsPage,
kMemorySaverToggleQuery, false),
CheckMemorySaverModeLogged(MemorySaverModeState::kDisabled, 1,
histogram_tester),
- // Turn High Efficiency Mode back on
+ // Turn Memory Saver Mode back on
ClickElement(kPerformanceSettingsPage, kMemorySaverToggleQuery),
WaitForButtonStateChange(kPerformanceSettingsPage,
kMemorySaverToggleQuery, true),
@@ -333,14 +333,14 @@
WaitForIronListCollapseStateChange(kPerformanceSettingsPage,
iron_collapse),
- // Change high efficiency setting to discard tabs based on timer
+ // Change memory saver setting to discard tabs based on timer
ClickElement(kPerformanceSettingsPage, kDiscardOnTimerQuery),
WaitForButtonStateChange(kPerformanceSettingsPage, kDiscardOnTimerQuery,
true),
CheckMemorySaverModeLogged(MemorySaverModeState::kEnabledOnTimer, 1,
histogram_tester),
- // Change high efficiency setting to discard tabs based on usage
+ // Change memory saver setting to discard tabs based on usage
ClickElement(kPerformanceSettingsPage, kDiscardOnUsageQuery),
WaitForButtonStateChange(kPerformanceSettingsPage, kDiscardOnUsageQuery,
true),
@@ -392,11 +392,11 @@
base::ReplaceStringPlaceholders("(el) => { el.value = $1}",
{discard_timer_value}, nullptr)),
- // Turn off high efficiency mode
+ // Turn off memory saver mode
ClickElement(kPerformanceSettingsPage, kMemorySaverToggleQuery),
WaitForButtonStateChange(kPerformanceSettingsPage,
kMemorySaverToggleQuery, false),
- // Turn high efficiency mode back on
+ // Turn memory saver mode back on
ClickElement(kPerformanceSettingsPage, kMemorySaverToggleQuery),
WaitForIronListCollapseStateChange(kPerformanceSettingsPage,
iron_collapse),
diff --git a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
index 44e8dec..df24547 100644
--- a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
+++ b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
@@ -713,19 +713,19 @@
{"memoryPageTitle", IDS_SETTINGS_MEMORY_PAGE_TITLE},
{"speedPageTitle", IDS_SETTINGS_SPEED_PAGE_TITLE},
{"memorySaverModeLabel",
- IDS_SETTINGS_PERFORMANCE_HIGH_EFFICIENCY_MODE_SETTING},
+ IDS_SETTINGS_PERFORMANCE_MEMORY_SAVER_MODE_SETTING},
{"memorySaverModeDescription",
- IDS_SETTINGS_PERFORMANCE_HIGH_EFFICIENCY_MODE_SETTING_DESCRIPTION},
+ IDS_SETTINGS_PERFORMANCE_MEMORY_SAVER_MODE_SETTING_DESCRIPTION},
{"memorySaverModeHeuristicsLabel",
- IDS_SETTINGS_PERFORMANCE_HIGH_EFFICIENCY_MODE_HEURISTICS_LABEL},
+ IDS_SETTINGS_PERFORMANCE_MEMORY_SAVER_MODE_HEURISTICS_LABEL},
{"memorySaverModeRecommendedBadge",
- IDS_SETTINGS_PERFORMANCE_HIGH_EFFICIENCY_MODE_RECOMMENDED_BADGE},
+ IDS_SETTINGS_PERFORMANCE_MEMORY_SAVER_MODE_RECOMMENDED_BADGE},
{"memorySaverModeOnTimerLabel",
- IDS_SETTINGS_PERFORMANCE_HIGH_EFFICIENCY_MODE_ON_TIMER_LABEL},
+ IDS_SETTINGS_PERFORMANCE_MEMORY_SAVER_MODE_ON_TIMER_LABEL},
{"memorySaverModeRadioGroupAriaLabel",
- IDS_SETTINGS_PERFORMANCE_HIGH_EFFICIENCY_MODE_RADIO_GROUP_ARIA_LABEL},
+ IDS_SETTINGS_PERFORMANCE_MEMORY_SAVER_MODE_RADIO_GROUP_ARIA_LABEL},
{"memorySaverChooseDiscardTimeAriaLabel",
- IDS_SETTINGS_PERFORMANCE_HIGH_EFFICIENCY_MODE_CHOOSE_DISCARD_TIME_ARIA_LABEL},
+ IDS_SETTINGS_PERFORMANCE_MEMORY_SAVER_MODE_CHOOSE_DISCARD_TIME_ARIA_LABEL},
{"batteryPageTitle", IDS_SETTINGS_BATTERY_PAGE_TITLE},
{"batterySaverModeLabel",
IDS_SETTINGS_PERFORMANCE_BATTERY_SAVER_MODE_SETTING},
@@ -812,10 +812,10 @@
"tabDiscardingExceptionsAddDialogHelp",
l10n_util::GetStringFUTF16(
IDS_SETTINGS_PERFORMANCE_TAB_DISCARDING_EXCEPTIONS_ADD_DIALOG_HELP,
- chrome::kHighEfficiencyModeTabDiscardingHelpUrl));
+ chrome::kMemorySaverModeTabDiscardingHelpUrl));
html_source->AddString("memorySaverLearnMoreUrl",
- chrome::kHighEfficiencyModeLearnMoreUrl);
+ chrome::kMemorySaverModeLearnMoreUrl);
html_source->AddString("batterySaverLearnMoreUrl",
chrome::kBatterySaverModeLearnMoreUrl);
html_source->AddString("preloadingLearnMoreUrl",
diff --git a/chrome/common/pref_names.h b/chrome/common/pref_names.h
index 4bddbc9..c30d857 100644
--- a/chrome/common/pref_names.h
+++ b/chrome/common/pref_names.h
@@ -3869,14 +3869,16 @@
#endif
#if !BUILDFLAG(IS_ANDROID)
-// An integer count of how many times the user has seen the high efficiency mode
-// page action chip in the expanded size.
-inline constexpr char kHighEfficiencyChipExpandedCount[] =
+// An integer count of how many times the user has seen the memory saver mode
+// page action chip in the expanded size. While the feature was renamed to
+// "Memory Saver" the pref cannot be changed without migration.
+inline constexpr char kMemorySaverChipExpandedCount[] =
"high_efficiency.chip_expanded_count";
-// Stores the timestamp of the last time the high efficiency chip was shown
-// expanded to highlight memory savings.
-inline constexpr char kLastHighEfficiencyChipExpandedTimestamp[] =
+// Stores the timestamp of the last time the memory saver chip was shown
+// expanded to highlight memory savings. While the feature was renamed to
+// "Memory Saver" the pref cannot be changed without migration.
+inline constexpr char kLastMemorySaverChipExpandedTimestamp[] =
"high_efficiency.last_chip_expanded_timestamp";
// A boolean indicating whether the price track first user experience bubble
diff --git a/chrome/common/url_constants.h b/chrome/common/url_constants.h
index b8c59bb..9d0a7543 100644
--- a/chrome/common/url_constants.h
+++ b/chrome/common/url_constants.h
@@ -282,13 +282,13 @@
// URL of the Google Photos.
inline constexpr char kGooglePhotosURL[] = "https://photos.google.com";
-// The URL for the "Learn more" link for the High Efficiency Mode.
-inline constexpr char kHighEfficiencyModeLearnMoreUrl[] =
+// The URL for the "Learn more" link for the Memory Saver Mode.
+inline constexpr char kMemorySaverModeLearnMoreUrl[] =
"https://support.google.com/chrome?p=chrome_memory_saver";
-// The URL in the help text for the High Efficiency Mode tab discarding
+// The URL in the help text for the Memory Saver Mode tab discarding
// exceptions add dialog.
-inline constexpr char16_t kHighEfficiencyModeTabDiscardingHelpUrl[] =
+inline constexpr char16_t kMemorySaverModeTabDiscardingHelpUrl[] =
u"https://support.google.com/chrome?p=performance_site_exclusion";
// The URL to the help center article of Incognito mode.
diff --git a/chrome/test/data/webui/settings/performance_page_test.ts b/chrome/test/data/webui/settings/performance_page_test.ts
index 91ca7dd8..21fa346 100644
--- a/chrome/test/data/webui/settings/performance_page_test.ts
+++ b/chrome/test/data/webui/settings/performance_page_test.ts
@@ -16,7 +16,7 @@
import {TestPerformanceBrowserProxy} from './test_performance_browser_proxy.js';
import {TestPerformanceMetricsProxy} from './test_performance_metrics_proxy.js';
-const highEfficiencyModeDummyPrefs = {
+const memorySaverModeMockPrefs = {
high_efficiency_mode: {
state: {
type: chrome.settingsPrivate.PrefType.NUMBER,
@@ -30,10 +30,10 @@
};
/**
- * Constructs dummy prefs for tab discarding. Needs to be a function so that
+ * Constructs mock prefs for tab discarding. Needs to be a function so that
* list pref values are recreated and not shared between test suites.
*/
-function tabDiscardingDummyPrefs(): Record<
+function tabDiscardingMockPrefs(): Record<
string, Record<string, Omit<chrome.settingsPrivate.PrefObject, 'key'>>> {
return {
tab_discarding: {
@@ -63,8 +63,8 @@
performancePage = document.createElement('settings-performance-page');
performancePage.set('prefs', {
performance_tuning: {
- ...highEfficiencyModeDummyPrefs,
- ...tabDiscardingDummyPrefs(),
+ ...memorySaverModeMockPrefs,
+ ...tabDiscardingMockPrefs(),
},
});
document.body.appendChild(performancePage);
@@ -139,8 +139,8 @@
performancePage = document.createElement('settings-performance-page');
performancePage.set('prefs', {
performance_tuning: {
- ...highEfficiencyModeDummyPrefs,
- ...tabDiscardingDummyPrefs(),
+ ...memorySaverModeMockPrefs,
+ ...tabDiscardingMockPrefs(),
},
});
document.body.appendChild(performancePage);
@@ -257,7 +257,7 @@
document.body.innerHTML = window.trustedTypes!.emptyHTML;
performancePage = document.createElement('settings-performance-page');
performancePage.set('prefs', {
- performance_tuning: tabDiscardingDummyPrefs(),
+ performance_tuning: tabDiscardingMockPrefs(),
});
document.body.appendChild(performancePage);
flush();
diff --git a/components/performance_manager/public/user_tuning/prefs.h b/components/performance_manager/public/user_tuning/prefs.h
index 0cddc22b..00e2fb7 100644
--- a/components/performance_manager/public/user_tuning/prefs.h
+++ b/components/performance_manager/public/user_tuning/prefs.h
@@ -17,7 +17,7 @@
namespace performance_manager::user_tuning::prefs {
// DEPRECATED: being replaced by kMemorySaverModeState
-inline constexpr char kHighEfficiencyModeEnabled[] =
+inline constexpr char kMemorySaverModeEnabled[] =
"performance_tuning.high_efficiency_mode.enabled";
enum class MemorySaverModeState {
@@ -29,10 +29,10 @@
inline constexpr char kMemorySaverModeState[] =
"performance_tuning.high_efficiency_mode.state";
-inline constexpr char kHighEfficiencyModeTimeBeforeDiscardInMinutes[] =
+inline constexpr char kMemorySaverModeTimeBeforeDiscardInMinutes[] =
"performance_tuning.high_efficiency_mode.time_before_discard_in_minutes";
-constexpr int kDefaultHighEfficiencyModeTimeBeforeDiscardInMinutes = 120;
+constexpr int kDefaultMemorySaverModeTimeBeforeDiscardInMinutes = 120;
enum class BatterySaverModeState {
kDisabled = 0,
@@ -65,16 +65,16 @@
MemorySaverModeState GetCurrentMemorySaverModeState(PrefService* pref_service);
-base::TimeDelta GetCurrentHighEfficiencyModeTimeBeforeDiscard(
+base::TimeDelta GetCurrentMemorySaverModeTimeBeforeDiscard(
PrefService* pref_service);
BatterySaverModeState GetCurrentBatterySaverModeState(
PrefService* pref_service);
-// This function migrates the old, boolean High Efficiency (Memory Saver)
-// preference to the new, integer one that represents a value of the
-// `MemorySaverModeState` enum. This is done once at startup.
-void MigrateHighEfficiencyModePref(PrefService* pref_service);
+// This function migrates the old, boolean Memory Saver preference to the new,
+// integer one that represents a value of the `MemorySaverModeState` enum. This
+// is done once at startup.
+void MigrateMemorySaverModePref(PrefService* pref_service);
} // namespace performance_manager::user_tuning::prefs
diff --git a/components/performance_manager/user_tuning/prefs.cc b/components/performance_manager/user_tuning/prefs.cc
index f052856..b4cce77 100644
--- a/components/performance_manager/user_tuning/prefs.cc
+++ b/components/performance_manager/user_tuning/prefs.cc
@@ -12,10 +12,10 @@
namespace performance_manager::user_tuning::prefs {
void RegisterLocalStatePrefs(PrefRegistrySimple* registry) {
- registry->RegisterBooleanPref(kHighEfficiencyModeEnabled, false);
+ registry->RegisterBooleanPref(kMemorySaverModeEnabled, false);
registry->RegisterIntegerPref(
- kHighEfficiencyModeTimeBeforeDiscardInMinutes,
- kDefaultHighEfficiencyModeTimeBeforeDiscardInMinutes);
+ kMemorySaverModeTimeBeforeDiscardInMinutes,
+ kDefaultMemorySaverModeTimeBeforeDiscardInMinutes);
registry->RegisterIntegerPref(
kMemorySaverModeState, static_cast<int>(MemorySaverModeState::kDisabled));
registry->RegisterIntegerPref(
@@ -42,14 +42,14 @@
return static_cast<MemorySaverModeState>(state);
}
-base::TimeDelta GetCurrentHighEfficiencyModeTimeBeforeDiscard(
+base::TimeDelta GetCurrentMemorySaverModeTimeBeforeDiscard(
PrefService* pref_service) {
int time_before_discard_in_minutes =
- pref_service->GetInteger(kHighEfficiencyModeTimeBeforeDiscardInMinutes);
+ pref_service->GetInteger(kMemorySaverModeTimeBeforeDiscardInMinutes);
if (time_before_discard_in_minutes < 0) {
- pref_service->ClearPref(kHighEfficiencyModeTimeBeforeDiscardInMinutes);
+ pref_service->ClearPref(kMemorySaverModeTimeBeforeDiscardInMinutes);
time_before_discard_in_minutes =
- pref_service->GetInteger(kHighEfficiencyModeTimeBeforeDiscardInMinutes);
+ pref_service->GetInteger(kMemorySaverModeTimeBeforeDiscardInMinutes);
}
return base::Minutes(time_before_discard_in_minutes);
@@ -68,18 +68,18 @@
return static_cast<BatterySaverModeState>(state);
}
-void MigrateHighEfficiencyModePref(PrefService* pref_service) {
+void MigrateMemorySaverModePref(PrefService* pref_service) {
const PrefService::Preference* state_pref =
pref_service->FindPreference(kMemorySaverModeState);
if (!state_pref->IsDefaultValue()) {
// The user has changed the new pref, no migration needed. Clear the old
// pref because it won't be used anymore.
- pref_service->ClearPref(kHighEfficiencyModeEnabled);
+ pref_service->ClearPref(kMemorySaverModeEnabled);
return;
}
const PrefService::Preference* bool_pref =
- pref_service->FindPreference(kHighEfficiencyModeEnabled);
+ pref_service->FindPreference(kMemorySaverModeEnabled);
bool enabled = bool_pref->GetValue()->GetBool();
int equivalent_int_pref =
@@ -91,7 +91,7 @@
// the new pref.
pref_service->SetInteger(kMemorySaverModeState, equivalent_int_pref);
// Clear the old pref because it won't be used anymore.
- pref_service->ClearPref(kHighEfficiencyModeEnabled);
+ pref_service->ClearPref(kMemorySaverModeEnabled);
}
}
diff --git a/components/performance_manager/user_tuning/prefs_unittest.cc b/components/performance_manager/user_tuning/prefs_unittest.cc
index c14e473..3842fb14 100644
--- a/components/performance_manager/user_tuning/prefs_unittest.cc
+++ b/components/performance_manager/user_tuning/prefs_unittest.cc
@@ -20,18 +20,18 @@
TEST_F(HighEfficiencyModePrefMigrationTest, NoChangeToUserSetNewPref) {
// The old pref is set by the user, but so is the new pref so no migration
// should happen.
- pref_service_.SetBoolean(kHighEfficiencyModeEnabled, true);
+ pref_service_.SetBoolean(kMemorySaverModeEnabled, true);
pref_service_.SetInteger(kMemorySaverModeState,
static_cast<int>(MemorySaverModeState::kDisabled));
- MigrateHighEfficiencyModePref(&pref_service_);
+ MigrateMemorySaverModePref(&pref_service_);
EXPECT_EQ(pref_service_.GetInteger(kMemorySaverModeState),
static_cast<int>(MemorySaverModeState::kDisabled));
// The old pref should be reset.
- EXPECT_TRUE(pref_service_.FindPreference(kHighEfficiencyModeEnabled)
- ->IsDefaultValue());
- EXPECT_FALSE(pref_service_.GetBoolean(kHighEfficiencyModeEnabled));
+ EXPECT_TRUE(
+ pref_service_.FindPreference(kMemorySaverModeEnabled)->IsDefaultValue());
+ EXPECT_FALSE(pref_service_.GetBoolean(kMemorySaverModeEnabled));
}
TEST_F(HighEfficiencyModePrefMigrationTest, BothPrefsDefaultNoMigration) {
@@ -43,7 +43,7 @@
EXPECT_TRUE(
pref_service_.FindPreference(kMemorySaverModeState)->IsDefaultValue());
- MigrateHighEfficiencyModePref(&pref_service_);
+ MigrateMemorySaverModePref(&pref_service_);
// Both prefs were in the default state, no migration happens
EXPECT_TRUE(
@@ -55,14 +55,14 @@
TEST_F(HighEfficiencyModePrefMigrationTest,
MigrateDefaultNewPrefUserSetOldPrefEnabled) {
// Set the old pref as-if set by the user.
- pref_service_.SetBoolean(kHighEfficiencyModeEnabled, true);
+ pref_service_.SetBoolean(kMemorySaverModeEnabled, true);
EXPECT_EQ(pref_service_.GetInteger(kMemorySaverModeState),
static_cast<int>(MemorySaverModeState::kDisabled));
EXPECT_TRUE(
pref_service_.FindPreference(kMemorySaverModeState)->IsDefaultValue());
- MigrateHighEfficiencyModePref(&pref_service_);
+ MigrateMemorySaverModePref(&pref_service_);
EXPECT_FALSE(
pref_service_.FindPreference(kMemorySaverModeState)->IsDefaultValue());
@@ -71,22 +71,22 @@
static_cast<int>(MemorySaverModeState::kEnabledOnTimer));
// The old pref should be reset.
- EXPECT_TRUE(pref_service_.FindPreference(kHighEfficiencyModeEnabled)
- ->IsDefaultValue());
- EXPECT_FALSE(pref_service_.GetBoolean(kHighEfficiencyModeEnabled));
+ EXPECT_TRUE(
+ pref_service_.FindPreference(kMemorySaverModeEnabled)->IsDefaultValue());
+ EXPECT_FALSE(pref_service_.GetBoolean(kMemorySaverModeEnabled));
}
TEST_F(HighEfficiencyModePrefMigrationTest,
MigrateDefaultNewPrefUserSetOldPrefDisabled) {
// Set the old pref as-if set by the user.
- pref_service_.SetBoolean(kHighEfficiencyModeEnabled, false);
+ pref_service_.SetBoolean(kMemorySaverModeEnabled, false);
EXPECT_EQ(pref_service_.GetInteger(kMemorySaverModeState),
static_cast<int>(MemorySaverModeState::kDisabled));
EXPECT_TRUE(
pref_service_.FindPreference(kMemorySaverModeState)->IsDefaultValue());
- MigrateHighEfficiencyModePref(&pref_service_);
+ MigrateMemorySaverModePref(&pref_service_);
EXPECT_FALSE(
pref_service_.FindPreference(kMemorySaverModeState)->IsDefaultValue());
@@ -95,9 +95,9 @@
static_cast<int>(MemorySaverModeState::kDisabled));
// The old pref should be reset.
- EXPECT_TRUE(pref_service_.FindPreference(kHighEfficiencyModeEnabled)
- ->IsDefaultValue());
- EXPECT_FALSE(pref_service_.GetBoolean(kHighEfficiencyModeEnabled));
+ EXPECT_TRUE(
+ pref_service_.FindPreference(kMemorySaverModeEnabled)->IsDefaultValue());
+ EXPECT_FALSE(pref_service_.GetBoolean(kMemorySaverModeEnabled));
}
} // namespace performance_manager::user_tuning::prefs