| Index: chrome/browser/cocoa/toolbar_controller.mm
|
| diff --git a/chrome/browser/cocoa/toolbar_controller.mm b/chrome/browser/cocoa/toolbar_controller.mm
|
| index ed726f85c102ecbf3abd247ead96289d695c0bdb..9ce42b3ab3f1975130d153fb63b2e325e3e7b9a8 100644
|
| --- a/chrome/browser/cocoa/toolbar_controller.mm
|
| +++ b/chrome/browser/cocoa/toolbar_controller.mm
|
| @@ -101,13 +101,16 @@ class PrefObserverBridge : public NotificationObserver {
|
| resizeDelegate_ = resizeDelegate;
|
| hasToolbar_ = YES;
|
|
|
| - // Register for notificaotions about state changes for the toolbar buttons
|
| + // Register for notifications about state changes for the toolbar buttons.
|
| commandObserver_.reset(new CommandObserverBridge(self, commands));
|
| commandObserver_->ObserveCommand(IDC_BACK);
|
| commandObserver_->ObserveCommand(IDC_FORWARD);
|
| commandObserver_->ObserveCommand(IDC_RELOAD);
|
| commandObserver_->ObserveCommand(IDC_HOME);
|
| commandObserver_->ObserveCommand(IDC_STAR);
|
| + commandObserver_->ObserveCommand(IDC_OPEN_CURRENT_URL);
|
| + commandObserver_->ObserveCommand(IDC_PAGE_MENU_BUTTON);
|
| + commandObserver_->ObserveCommand(IDC_WRENCH_MENU_BUTTON);
|
| }
|
| return self;
|
| }
|
| @@ -236,17 +239,31 @@ class PrefObserverBridge : public NotificationObserver {
|
| case IDC_FORWARD:
|
| button = forwardButton_;
|
| break;
|
| + case IDC_RELOAD:
|
| + button = reloadButton_;
|
| + break;
|
| case IDC_HOME:
|
| button = homeButton_;
|
| break;
|
| case IDC_STAR:
|
| button = starButton_;
|
| break;
|
| + case IDC_OPEN_CURRENT_URL:
|
| + // We have two things to enable/disable.
|
| + [locationBar_ setEnabled:enabled];
|
| + button = goButton_;
|
| + break;
|
| + case IDC_PAGE_MENU_BUTTON:
|
| + button = pageButton_;
|
| + break;
|
| + case IDC_WRENCH_MENU_BUTTON:
|
| + button = wrenchButton_;
|
| + break;
|
| }
|
| [button setEnabled:enabled];
|
| }
|
|
|
| -// Init the enabled state of the buttons on the toolbar to match the state in
|
| +// Init the enabled state of the controls on the toolbar to match the state in
|
| // the controller.
|
| - (void)initCommandStatus:(CommandUpdater*)commands {
|
| [backButton_ setEnabled:commands->IsCommandEnabled(IDC_BACK) ? YES : NO];
|
| @@ -255,6 +272,14 @@ class PrefObserverBridge : public NotificationObserver {
|
| [reloadButton_ setEnabled:commands->IsCommandEnabled(IDC_RELOAD) ? YES : NO];
|
| [homeButton_ setEnabled:commands->IsCommandEnabled(IDC_HOME) ? YES : NO];
|
| [starButton_ setEnabled:commands->IsCommandEnabled(IDC_STAR) ? YES : NO];
|
| + [locationBar_ setEnabled:commands->IsCommandEnabled(IDC_OPEN_CURRENT_URL) ?
|
| + YES : NO];
|
| + [goButton_ setEnabled:commands->IsCommandEnabled(IDC_OPEN_CURRENT_URL) ?
|
| + YES : NO];
|
| + [pageButton_ setEnabled:commands->IsCommandEnabled(IDC_PAGE_MENU_BUTTON) ?
|
| + YES : NO];
|
| + [wrenchButton_ setEnabled:commands->IsCommandEnabled(IDC_WRENCH_MENU_BUTTON) ?
|
| + YES : NO];
|
| }
|
|
|
| - (void)updateToolbarWithContents:(TabContents*)tab
|
|
|