| Index: chrome/browser/ui/browser_command_controller.cc
|
| diff --git a/chrome/browser/ui/browser_command_controller.cc b/chrome/browser/ui/browser_command_controller.cc
|
| index aa6821cc30dc7cc035085b6141bcdb848162f471..9833db3f832a2680854c9bb05ea859a07ece81c1 100644
|
| --- a/chrome/browser/ui/browser_command_controller.cc
|
| +++ b/chrome/browser/ui/browser_command_controller.cc
|
| @@ -669,29 +669,6 @@ void BrowserCommandController::Observe(
|
| const content::NotificationSource& source,
|
| const content::NotificationDetails& details) {
|
| switch (type) {
|
| - case NOTIFICATION_PREF_CHANGED: {
|
| - const std::string& pref_name =
|
| - *content::Details<std::string>(details).ptr();
|
| - if (pref_name == prefs::kPrintingEnabled) {
|
| - UpdatePrintingState();
|
| - } else if (pref_name == prefs::kIncognitoModeAvailability) {
|
| - UpdateCommandsForIncognitoAvailability();
|
| - } else if (pref_name == prefs::kDevToolsDisabled) {
|
| - UpdateCommandsForDevTools();
|
| - } else if (pref_name == prefs::kEditBookmarksEnabled) {
|
| - UpdateCommandsForBookmarkEditing();
|
| - } else if (pref_name == prefs::kShowBookmarkBar) {
|
| - UpdateCommandsForBookmarkBar();
|
| - } else if (pref_name == prefs::kAllowFileSelectionDialogs) {
|
| - UpdateSaveAsState();
|
| - UpdateOpenFileState();
|
| - } else if (pref_name == prefs::kInManagedMode) {
|
| - UpdateCommandsForMultipleProfiles();
|
| - } else {
|
| - NOTREACHED();
|
| - }
|
| - break;
|
| - }
|
| case content::NOTIFICATION_INTERSTITIAL_ATTACHED:
|
| UpdateCommandsForTabState();
|
| break;
|
| @@ -706,6 +683,32 @@ void BrowserCommandController::Observe(
|
| }
|
|
|
| ////////////////////////////////////////////////////////////////////////////////
|
| +// PrefObserver implementation:
|
| +
|
| +void BrowserCommandController::OnPreferenceChanged(
|
| + PrefServiceBase* service,
|
| + const std::string& pref_name) {
|
| + if (pref_name == prefs::kPrintingEnabled) {
|
| + UpdatePrintingState();
|
| + } else if (pref_name == prefs::kIncognitoModeAvailability) {
|
| + UpdateCommandsForIncognitoAvailability();
|
| + } else if (pref_name == prefs::kDevToolsDisabled) {
|
| + UpdateCommandsForDevTools();
|
| + } else if (pref_name == prefs::kEditBookmarksEnabled) {
|
| + UpdateCommandsForBookmarkEditing();
|
| + } else if (pref_name == prefs::kShowBookmarkBar) {
|
| + UpdateCommandsForBookmarkBar();
|
| + } else if (pref_name == prefs::kAllowFileSelectionDialogs) {
|
| + UpdateSaveAsState();
|
| + UpdateOpenFileState();
|
| + } else if (pref_name == prefs::kInManagedMode) {
|
| + UpdateCommandsForMultipleProfiles();
|
| + } else {
|
| + NOTREACHED();
|
| + }
|
| +}
|
| +
|
| +////////////////////////////////////////////////////////////////////////////////
|
| // BrowserCommandController, TabStripModelObserver implementation:
|
|
|
| void BrowserCommandController::TabInsertedAt(TabContents* contents,
|
|
|