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

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

Issue 482993003: Move logic to clear ExtensionAction values to ExtensionActionAPI (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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/tab_helper.cc
diff --git a/chrome/browser/extensions/tab_helper.cc b/chrome/browser/extensions/tab_helper.cc
index 206e8b663a2383dd0a455ca4622826c23e451ba5..dd756b32f6ff92ae44c39847da0fe566ead81a1c 100644
--- a/chrome/browser/extensions/tab_helper.cc
+++ b/chrome/browser/extensions/tab_helper.cc
@@ -17,9 +17,6 @@
#include "chrome/browser/extensions/api/webstore/webstore_api.h"
#include "chrome/browser/extensions/bookmark_app_helper.h"
#include "chrome/browser/extensions/error_console/error_console.h"
-#include "chrome/browser/extensions/extension_action.h"
-#include "chrome/browser/extensions/extension_action_manager.h"
-#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/extensions/extension_tab_util.h"
#include "chrome/browser/extensions/location_bar_controller.h"
#include "chrome/browser/extensions/webstore_inline_installer.h"
@@ -48,7 +45,6 @@
#include "content/public/browser/notification_types.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/render_view_host.h"
-#include "content/public/browser/render_widget_host_view.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/frame_navigate_params.h"
#include "extensions/browser/extension_error.h"
@@ -248,24 +244,8 @@ void TabHelper::DidNavigateMainFrame(
enabled_extensions.GetExtensionOrAppByURL(params.url));
}
- if (details.is_in_page)
- return;
-
- ExtensionActionManager* extension_action_manager =
- ExtensionActionManager::Get(Profile::FromBrowserContext(context));
- ExtensionActionAPI* extension_action_api = ExtensionActionAPI::Get(context);
- for (ExtensionSet::const_iterator it = enabled_extensions.begin();
- it != enabled_extensions.end();
- ++it) {
- ExtensionAction* browser_action =
- extension_action_manager->GetBrowserAction(*it->get());
- if (browser_action) {
- browser_action->ClearAllValuesForTab(
- SessionTabHelper::IdForTab(web_contents()));
- extension_action_api->NotifyChange(
- browser_action, web_contents(), profile_);
- }
- }
+ if (!details.is_in_page)
+ ExtensionActionAPI::Get(context)->ClearAllValuesForTab(web_contents());
}
bool TabHelper::OnMessageReceived(const IPC::Message& message) {

Powered by Google App Engine
This is Rietveld 408576698