diff options
author | joaodasilva@chromium.org <joaodasilva@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-11 00:35:00 +0000 |
---|---|---|
committer | joaodasilva@chromium.org <joaodasilva@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-11 00:35:00 +0000 |
commit | 3710d00089e1b6d64a92a50a060b9581abd33fcd (patch) | |
tree | c3a84e4c0fa559eecef5f5ba01b20ea8eb20a989 /chrome/browser/prefs | |
parent | 068970d4e8a15c8915c3e3b1df16c71428a20ba5 (diff) | |
download | chromium_src-3710d00089e1b6d64a92a50a060b9581abd33fcd.zip chromium_src-3710d00089e1b6d64a92a50a060b9581abd33fcd.tar.gz chromium_src-3710d00089e1b6d64a92a50a060b9581abd33fcd.tar.bz2 |
Fixed behavior of the bookmark bar visibility.
- Removed the kEnableBookmarkBar preference. This was only used from the policy
code, and duplicated what the kShowBookmarkBar preference already does.
Removed custom policy code that handle this.
- Fixed the pref UI for the kShowBookmarkBar preference, which wasn't working
when set to true by the associated policy. Removed custom UI code for this.
- Fire NOTIFICATION_BOOKMARK_BAR_VISIBILITY_CHANGED from a single place, and
every time that the preference changes.
- Made ChromeWebUI::force_bookmark_bar_visible a virtual method instead, so that
subclasses can recompute the state dynamically. The previous implementation
wouldn't react to pref changes on existing NTPs.
Current behavior of the bookmark bar:
- If kShowBookmarkBar is true, it is shown as part of the tab;
- If kShowBookmarkBar is false, it is shown inline IF the policy is not set, AND
- using the old NTP, OR
- using the new NTP without bookmark features.
The policy forces the bar to be always visible in all tabs, or to never appear
at all.
BUG=98918
TEST=The BookmarkBarEnabled policy does what it's supposed to do in the old NTP, new NTP, and new NTP with bookmarks. The show-bookmark-bar shortcut also does the right thing in all versions.
Review URL: http://codereview.chromium.org/8135001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@104827 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/prefs')
-rw-r--r-- | chrome/browser/prefs/pref_model_associator.cc | 16 | ||||
-rw-r--r-- | chrome/browser/prefs/pref_model_associator.h | 4 |
2 files changed, 0 insertions, 20 deletions
diff --git a/chrome/browser/prefs/pref_model_associator.cc b/chrome/browser/prefs/pref_model_associator.cc index 2028f8d..b61e511 100644 --- a/chrome/browser/prefs/pref_model_associator.cc +++ b/chrome/browser/prefs/pref_model_associator.cc @@ -82,8 +82,6 @@ void PrefModelAssociator::InitPrefAndAssociate( pref_service_->Set(pref_name.c_str(), *new_value); } - SendUpdateNotificationsIfNecessary(pref_name); - // If the merge resulted in an updated value, inform the syncer. if (!value->Equals(new_value.get())) { SyncData sync_data; @@ -273,18 +271,6 @@ Value* PrefModelAssociator::MergeDictionaryValues( return result; } -void PrefModelAssociator::SendUpdateNotificationsIfNecessary( - const std::string& pref_name) { - // The bookmark bar visibility preference requires a special - // notification to update the UI. - if (0 == pref_name.compare(prefs::kShowBookmarkBar)) { - NotificationService::current()->Notify( - chrome::NOTIFICATION_BOOKMARK_BAR_VISIBILITY_PREF_CHANGED, - Source<PrefModelAssociator>(this), - NotificationService::NoDetails()); - } -} - // Note: This will build a model of all preferences registered as syncable // with user controlled data. We do not track any information for preferences // not registered locally as syncable and do not inform the syncer of @@ -365,8 +351,6 @@ SyncError PrefModelAssociator::ProcessSyncChanges( if (iter->change_type() == SyncChange::ACTION_ADD) { synced_preferences_.insert(name); } - - SendUpdateNotificationsIfNecessary(name); } return SyncError(); } diff --git a/chrome/browser/prefs/pref_model_associator.h b/chrome/browser/prefs/pref_model_associator.h index a185a78..5e2189c 100644 --- a/chrome/browser/prefs/pref_model_associator.h +++ b/chrome/browser/prefs/pref_model_associator.h @@ -104,10 +104,6 @@ class PrefModelAssociator const std::string& pref_name, SyncChangeList* sync_changes); - // Perform any additional local operations that need to happen after a - // preference has been updated. - void SendUpdateNotificationsIfNecessary(const std::string& pref_name); - static base::Value* MergeListValues( const base::Value& from_value, const base::Value& to_value); static base::Value* MergeDictionaryValues(const base::Value& from_value, |