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

Unified Diff: chrome/browser/command_updater.cc

Issue 10677009: Move command handling and updating off Browser and onto a helper object. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 6 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/command_updater.h ('k') | chrome/browser/command_updater_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/command_updater.cc
===================================================================
--- chrome/browser/command_updater.cc (revision 144460)
+++ chrome/browser/command_updater.cc (working copy)
@@ -9,6 +9,7 @@
#include "base/logging.h"
#include "base/observer_list.h"
#include "base/stl_util.h"
+#include "chrome/browser/command_observer.h"
CommandUpdater::CommandUpdaterDelegate::~CommandUpdaterDelegate() {
}
@@ -40,18 +41,21 @@
return commands_.find(id) != commands_.end();
}
-void CommandUpdater::ExecuteCommand(int id) {
- ExecuteCommandWithDisposition(id, CURRENT_TAB);
+bool CommandUpdater::ExecuteCommand(int id) {
+ return ExecuteCommandWithDisposition(id, CURRENT_TAB);
}
-void CommandUpdater::ExecuteCommandWithDisposition(
+bool CommandUpdater::ExecuteCommandWithDisposition(
int id,
WindowOpenDisposition disposition) {
- if (IsCommandEnabled(id))
+ if (SupportsCommand(id) && IsCommandEnabled(id)) {
delegate_->ExecuteCommandWithDisposition(id, disposition);
+ return true;
+ }
+ return false;
}
-CommandUpdater::CommandObserver::~CommandObserver() {
+CommandObserver::~CommandObserver() {
}
void CommandUpdater::UpdateCommandEnabled(int id, bool enabled) {
« no previous file with comments | « chrome/browser/command_updater.h ('k') | chrome/browser/command_updater_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698