summaryrefslogtreecommitdiffstats
path: root/chrome/browser/browser.cc
diff options
context:
space:
mode:
authoraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-15 06:07:38 +0000
committeraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-15 06:07:38 +0000
commit15294d803ac17bb5355076c90ddbecca983985a8 (patch)
tree4d8a0f1a95daf85c51420bfa41984becad28e12c /chrome/browser/browser.cc
parent66ff7356a381d6c8c6c3272b095938408c4f3188 (diff)
downloadchromium_src-15294d803ac17bb5355076c90ddbecca983985a8.zip
chromium_src-15294d803ac17bb5355076c90ddbecca983985a8.tar.gz
chromium_src-15294d803ac17bb5355076c90ddbecca983985a8.tar.bz2
Remove the implicit wrench menu items for browser actions.
Also, allow browser actions with no initial icons, and add some better tests. BUG=24379,24671 Review URL: http://codereview.chromium.org/276010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29095 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser.cc')
-rw-r--r--chrome/browser/browser.cc50
1 files changed, 0 insertions, 50 deletions
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc
index 60a78ce..3dcd0fb 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;