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

Unified Diff: chrome/browser/extensions/page_action_controller.cc

Issue 10446005: Revert half of the changes from 137638 that are probably causing breakages in (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 7 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/extensions/page_action_controller.h ('k') | chrome/browser/ui/gtk/location_bar_view_gtk.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/page_action_controller.cc
diff --git a/chrome/browser/extensions/page_action_controller.cc b/chrome/browser/extensions/page_action_controller.cc
index a8381e4a8af6c2d8c3f463c49e46921e8d44bb09..fc131ddf624cf8627e17bc08fb38bcda824ed5c4 100644
--- a/chrome/browser/extensions/page_action_controller.cc
+++ b/chrome/browser/extensions/page_action_controller.cc
@@ -8,7 +8,6 @@
#include "chrome/browser/extensions/extension_browser_event_router.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/extensions/extension_system.h"
-#include "chrome/browser/extensions/extension_tab_helper.h"
#include "chrome/browser/extensions/extension_tab_util.h"
#include "chrome/common/extensions/extension_set.h"
#include "chrome/common/chrome_notification_types.h"
@@ -17,27 +16,20 @@
namespace extensions {
-PageActionController::PageActionController(TabContentsWrapper* tab_contents,
- ExtensionTabHelper* tab_helper)
- : tab_contents_(tab_contents),
- tab_helper_(tab_helper) {
- tab_helper->AddObserver(this);
-}
+PageActionController::PageActionController(TabContentsWrapper* tab_contents)
+ : tab_contents_(tab_contents) {}
-PageActionController::~PageActionController() {
- tab_helper_->RemoveObserver(this);
-}
+PageActionController::~PageActionController() {}
scoped_ptr<std::vector<ExtensionAction*> >
PageActionController::GetCurrentActions() {
- int tab_id = ExtensionTabUtil::GetTabId(tab_contents_->web_contents());
const ExtensionSet* extensions = GetExtensionService()->extensions();
scoped_ptr<std::vector<ExtensionAction*> > current_actions(
new std::vector<ExtensionAction*>());
for (ExtensionSet::const_iterator i = extensions->begin();
i != extensions->end(); ++i) {
ExtensionAction* action = (*i)->page_action();
- if (action && action->GetIsVisible(tab_id))
+ if (action)
current_actions->push_back(action);
}
return current_actions.Pass();
@@ -75,25 +67,6 @@ ActionBoxController::Action PageActionController::OnClicked(
return ACTION_NONE;
}
-void PageActionController::OnPageActionStateChanged() {
- content::NotificationService::current()->Notify(
- chrome::NOTIFICATION_EXTENSION_ACTION_BOX_UPDATED,
- content::Source<Profile>(tab_contents_->profile()),
- content::Details<TabContentsWrapper>(tab_contents_));
-
- // TODO(kalman): remove this, and all occurrences of
- // NOTIFICATION_EXTENSION_PAGE_ACTION_VISIBILITY_CHANGED, when views and
- // cocoa have been updated to not use it.
- //
- // Only tests care about them, and they only ever use AllSources, so it can
- // safely be a bogus value.
- ExtensionAction bogus_action("");
- content::NotificationService::current()->Notify(
- chrome::NOTIFICATION_EXTENSION_PAGE_ACTION_VISIBILITY_CHANGED,
- content::Source<ExtensionAction>(&bogus_action),
- content::Details<content::WebContents>(tab_contents_->web_contents()));
-}
-
ExtensionService* PageActionController::GetExtensionService() {
return ExtensionSystem::Get(tab_contents_->profile())->extension_service();
}
« no previous file with comments | « chrome/browser/extensions/page_action_controller.h ('k') | chrome/browser/ui/gtk/location_bar_view_gtk.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698