[Extensions UI] Extract out bits from ToolbarActionsBar
ToolbarActionsBar was used in the legacy extensions toolbar. Remove
the extra dependencies on ToolbarActionsBar from other classes. In
practice, this involved extracting out a constant size and marking
a few profile preferences as obsolete for removal.
After this, the ToolbarActionsBar should be able to be removed.
Bug: 1165609
Change-Id: Id7eac77156a7939d7c7327475f05efbdeebd755b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2808217
Commit-Queue: Devlin <[email protected]>
Reviewed-by: Gabriel Charette <[email protected]>
Reviewed-by: Jan Krcal <[email protected]>
Reviewed-by: Peter Boström <[email protected]>
Cr-Commit-Position: refs/heads/master@{#870750}
diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc
index fa13f8b..7f814486 100644
--- a/chrome/browser/prefs/browser_prefs.cc
+++ b/chrome/browser/prefs/browser_prefs.cc
@@ -169,7 +169,6 @@
#include "chrome/browser/extensions/default_apps.h"
#include "chrome/browser/extensions/extension_web_ui.h"
#include "chrome/browser/ui/extensions/settings_api_bubble_helpers.h"
-#include "chrome/browser/ui/toolbar/toolbar_actions_bar.h"
#include "chrome/browser/ui/webui/extensions/extensions_ui.h"
#include "extensions/browser/api/audio/audio_api.h"
#include "extensions/browser/api/runtime/runtime_api.h"
@@ -543,6 +542,14 @@
"webauthn.last_transport_used";
#endif
+#if BUILDFLAG(ENABLE_EXTENSIONS)
+// Deprecated 04/2021
+const char kToolbarIconSurfacingBubbleAcknowledged[] =
+ "toolbar_icon_surfacing_bubble_acknowledged";
+const char kToolbarIconSurfacingBubbleLastShowTime[] =
+ "toolbar_icon_surfacing_bubble_show_time";
+#endif
+
// Register local state used only for migration (clearing or moving to a new
// key).
void RegisterLocalStatePrefsForMigration(PrefRegistrySimple* registry) {
@@ -659,6 +666,11 @@
registry->RegisterDoublePref(kSessionStatisticFCPStdDev, -1.0f);
registry->RegisterDoublePref(kSessionStatisticFCPMean, -1.0f);
+
+#if BUILDFLAG(ENABLE_EXTENSIONS)
+ registry->RegisterBooleanPref(kToolbarIconSurfacingBubbleAcknowledged, false);
+ registry->RegisterInt64Pref(kToolbarIconSurfacingBubbleLastShowTime, 0);
+#endif
}
} // namespace
@@ -965,7 +977,6 @@
#if BUILDFLAG(ENABLE_EXTENSIONS)
ExtensionWebUI::RegisterProfilePrefs(registry);
RegisterAnimationPolicyPrefs(registry);
- ToolbarActionsBar::RegisterProfilePrefs(registry);
extensions::api::CryptotokenRegisterProfilePrefs(registry);
extensions::ActivityLog::RegisterProfilePrefs(registry);
extensions::AudioAPI::RegisterUserPrefs(registry);
@@ -1347,6 +1358,12 @@
profile_prefs->ClearPref(kSessionStatisticFCPMean);
profile_prefs->ClearPref(kSessionStatisticFCPStdDev);
+#if BUILDFLAG(ENABLE_EXTENSIONS)
+ // Added 04/2021
+ profile_prefs->ClearPref(kToolbarIconSurfacingBubbleAcknowledged);
+ profile_prefs->ClearPref(kToolbarIconSurfacingBubbleLastShowTime);
+#endif
+
// Please don't delete the following line. It is used by PRESUBMIT.py.
// END_MIGRATE_OBSOLETE_PROFILE_PREFS
}