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

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

Issue 496403003: Remove NOTIFICATION_EXTENSION_PAGE_ACTIONS_UPDATED (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 4 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
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 3956072adabfc988485398f383d1746fd39c74ce..22ea9f41bb7784e3f82582c243d10576f283ade2 100644
--- a/chrome/browser/extensions/page_action_controller.cc
+++ b/chrome/browser/extensions/page_action_controller.cc
@@ -4,32 +4,18 @@
#include "chrome/browser/extensions/page_action_controller.h"
-#include <set>
-
-#include "base/lazy_instance.h"
-#include "base/metrics/histogram.h"
#include "chrome/browser/extensions/api/extension_action/extension_action_api.h"
#include "chrome/browser/extensions/extension_action.h"
#include "chrome/browser/extensions/extension_action_manager.h"
#include "chrome/browser/extensions/tab_helper.h"
-#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/sessions/session_tab_helper.h"
-#include "content/public/browser/navigation_details.h"
#include "content/public/browser/web_contents.h"
-#include "extensions/browser/extension_registry.h"
-#include "extensions/common/extension_set.h"
namespace extensions {
-// Keeps track of the profiles for which we've sent UMA statistics.
-base::LazyInstance<std::set<Profile*> > g_reported_for_profiles =
- LAZY_INSTANCE_INITIALIZER;
-
PageActionController::PageActionController(content::WebContents* web_contents)
: web_contents_(web_contents),
- extension_action_observer_(this) {
- extension_action_observer_.Add(
- ExtensionActionAPI::Get(web_contents_->GetBrowserContext()));
+ browser_context_(web_contents_->GetBrowserContext()) {
}
PageActionController::~PageActionController() {
@@ -37,13 +23,14 @@ PageActionController::~PageActionController() {
ExtensionAction* PageActionController::GetActionForExtension(
const Extension* extension) {
- return ExtensionActionManager::Get(GetProfile())->GetPageAction(*extension);
+ return ExtensionActionManager::Get(browser_context_)->GetPageAction(
+ *extension);
}
ExtensionAction::ShowAction PageActionController::OnClicked(
const Extension* extension) {
ExtensionAction* page_action =
- ExtensionActionManager::Get(GetProfile())->GetPageAction(*extension);
+ ExtensionActionManager::Get(browser_context_)->GetPageAction(*extension);
CHECK(page_action);
int tab_id = SessionTabHelper::IdForTab(web_contents_);
@@ -54,7 +41,7 @@ ExtensionAction::ShowAction PageActionController::OnClicked(
return ExtensionAction::ACTION_SHOW_POPUP;
ExtensionActionAPI::PageActionExecuted(
- web_contents_->GetBrowserContext(),
+ browser_context_,
*page_action,
tab_id,
web_contents_->GetLastCommittedURL().spec(),
@@ -68,17 +55,4 @@ void PageActionController::OnNavigated() {
// do here.
}
-void PageActionController::OnExtensionActionUpdated(
- ExtensionAction* extension_action,
- content::WebContents* web_contents,
- content::BrowserContext* browser_context) {
- if (web_contents == web_contents_ &&
- extension_action->action_type() == ActionInfo::TYPE_PAGE)
- LocationBarController::NotifyChange(web_contents_);
-}
-
-Profile* PageActionController::GetProfile() {
- return Profile::FromBrowserContext(web_contents_->GetBrowserContext());
-}
-
} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698