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

Unified Diff: chrome/browser/browser.cc

Issue 276010: Remove the implicit wrench menu items for browser actions. (Closed)
Patch Set: Rebase 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/app/generated_resources.grd ('k') | chrome/browser/extensions/browser_action_apitest.cc » ('j') | 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 60a78ceb669df34e97aee46cab8019ef3ebe04f4..3dcd0fb7b8229e6d45affe4fb2040a5e6510be21 100644
--- a/chrome/browser/browser.cc
+++ b/chrome/browser/browser.cc
@@ -137,8 +137,6 @@ Browser::Browser(Type type, Profile* profile)
NotificationService::AllSources());
registrar_.Add(this, NotificationType::EXTENSION_UPDATE_DISABLED,
NotificationService::AllSources());
- registrar_.Add(this, NotificationType::EXTENSION_LOADED,
- NotificationService::AllSources());
registrar_.Add(this, NotificationType::EXTENSION_UNLOADED,
NotificationService::AllSources());
registrar_.Add(this, NotificationType::EXTENSION_PROCESS_CRASHED,
@@ -1469,27 +1467,6 @@ void Browser::ExecuteCommandWithDisposition(
// Browser, CommandUpdater::CommandUpdaterDelegate implementation:
void Browser::ExecuteCommand(int id) {
- if (id >= IDC_BROWSER_ACTION_FIRST && id <= IDC_BROWSER_ACTION_LAST) {
- ExtensionsService* service = profile_->GetExtensionsService();
- DCHECK(service); // No browser action command should have been created
- // in this window.
-
- // Go find the browser action in question.
- std::vector<ExtensionAction*> browser_actions =
- service->GetBrowserActions(false); // false means no popup actions.
- for (size_t i = 0; i < browser_actions.size(); ++i) {
- if (browser_actions[i]->command_id() == id) {
- ExtensionBrowserEventRouter::GetInstance()->BrowserActionExecuted(
- profile_, browser_actions[i]->extension_id(), this);
- return;
- }
- }
-
- // Could not find the command in question. Perhaps it went away while the
- // menu was open? More likely, it is a bug.
- LOG(WARNING) << "Unknown browser action executed: " << id;
- }
-
ExecuteCommandWithDisposition(id, CURRENT_TAB);
}
@@ -2190,16 +2167,6 @@ void Browser::Observe(NotificationType type,
break;
}
- case NotificationType::EXTENSION_LOADED: {
- // Enable the browser action for the extension, if it has one.
- Extension* extension = Details<Extension>(details).ptr();
- if (extension->browser_action()) {
- command_updater_.UpdateCommandEnabled(
- extension->browser_action()->command_id(), true);
- }
- break;
- }
-
case NotificationType::EXTENSION_UNLOADED: {
window()->GetLocationBar()->InvalidatePageActions();
@@ -2214,12 +2181,6 @@ void Browser::Observe(NotificationType type,
}
}
- // Disable the browser action for the extension, if it has one.
- if (extension->browser_action()) {
- command_updater_.UpdateCommandEnabled(
- extension->browser_action()->command_id(), false);
- }
-
break;
}
@@ -2377,17 +2338,6 @@ 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(false); // false means no popup actions.
- 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 | « chrome/app/generated_resources.grd ('k') | chrome/browser/extensions/browser_action_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698