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

Unified Diff: chrome/browser/ui/views/browser_actions_container.cc

Issue 12256040: Second batch of fixing prefs registrations. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review comments and merge LKGR. Created 7 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/browser_actions_container.cc
diff --git a/chrome/browser/ui/views/browser_actions_container.cc b/chrome/browser/ui/views/browser_actions_container.cc
index 0d84413ede2df072ea62f0696cd1e203ad2a348d..87cd2a34dd9d159977bd90331e152c421bc77b3a 100644
--- a/chrome/browser/ui/views/browser_actions_container.cc
+++ b/chrome/browser/ui/views/browser_actions_container.cc
@@ -47,12 +47,6 @@ const int kItemSpacing = ToolbarView::kStandardSpacing;
// Horizontal spacing before the chevron (if visible).
const int kChevronSpacing = kItemSpacing - 2;
-void RegisterUserPrefs(PrefRegistrySyncable* registry) {
- registry->RegisterIntegerPref(prefs::kBrowserActionContainerWidth,
- 0,
- PrefRegistrySyncable::UNSYNCABLE_PREF);
-}
-
} // namespace
// static
@@ -61,6 +55,14 @@ bool BrowserActionsContainer::disable_animations_during_testing_ = false;
////////////////////////////////////////////////////////////////////////////////
// BrowserActionsContainer
+// static
+void BrowserActionsContainer::RegisterUserPrefs(
+ PrefRegistrySyncable* registry) {
+ registry->RegisterIntegerPref(prefs::kBrowserActionContainerWidth,
+ 0,
+ PrefRegistrySyncable::UNSYNCABLE_PREF);
+}
+
BrowserActionsContainer::BrowserActionsContainer(Browser* browser,
View* owner_view)
: profile_(browser->profile()),
@@ -119,14 +121,6 @@ BrowserActionsContainer::~BrowserActionsContainer() {
void BrowserActionsContainer::Init() {
LoadImages();
- // TODO(joi): Switch to official way of registering user prefs for
- // this class, i.e. in a function called from
- // browser_prefs::RegisterUserPrefs.
- if (!profile_->GetPrefs()->FindPreference(
- prefs::kBrowserActionContainerWidth))
- RegisterUserPrefs(static_cast<PrefRegistrySyncable*>(
- profile_->GetPrefs()->DeprecatedGetPrefRegistry()));
-
// We wait to set the container width until now so that the chevron images
// will be loaded. The width calculation needs to know the chevron size.
if (model_ &&

Powered by Google App Engine
This is Rietveld 408576698