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

Unified Diff: chrome/browser/browser.cc

Issue 242083: Set the initial enabledness state of any browser actions when (Closed)
Patch Set: sub-i Created 11 years, 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/browser.cc
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc
index a4052bda82c9c0d18795ce075b7f7b60496ef302..003a3fc9b2985050c6e0aa840b8fe87fad4c42fb 100644
--- a/chrome/browser/browser.cc
+++ b/chrome/browser/browser.cc
@@ -28,6 +28,7 @@
#include "chrome/browser/extensions/extension_browser_event_router.h"
#include "chrome/browser/extensions/extension_disabled_infobar_delegate.h"
#include "chrome/browser/extensions/extension_tabs_module.h"
+#include "chrome/browser/extensions/extensions_service.h"
#include "chrome/browser/find_bar.h"
#include "chrome/browser/find_bar_controller.h"
#include "chrome/browser/google_url_tracker.h"
@@ -2328,6 +2329,17 @@ void Browser::InitCommandState() {
command_updater_.UpdateCommandEnabled(IDC_CONTROL_PANEL, true);
#endif
+ // Set up any browser action commands that are installed.
+ ExtensionsService* service = profile()->GetExtensionsService();
+ if (service) {
+ std::vector<ExtensionAction*> browser_actions =
+ service->GetBrowserActions();
+ for (size_t i = 0; i < browser_actions.size(); ++i) {
+ command_updater_.UpdateCommandEnabled(browser_actions[i]->command_id(),
+ true);
+ }
+ }
+
// Initialize other commands based on the window type.
{
bool normal_window = type() == TYPE_NORMAL;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698