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

Unified Diff: chrome/browser/cocoa/toolbar_controller.mm

Issue 164547: Mac: make save/open dialogs operate as tab-modal sheets.... Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Painfully (but hopefully correctly) merged ToT. Created 11 years, 2 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
« no previous file with comments | « chrome/browser/cocoa/tab_strip_controller.mm ('k') | chrome/browser/debugger/devtools_window.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « chrome/browser/cocoa/tab_strip_controller.mm ('k') | chrome/browser/debugger/devtools_window.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698