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

Unified Diff: chrome/browser/tab_contents/tab_contents.cc

Issue 306044: Refactor implementation of BrowserActions, and add support for (Closed)
Patch Set: Make it work on linux too 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/browser/gtk/location_bar_view_gtk.cc ('k') | chrome/browser/views/browser_actions_container.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/tab_contents/tab_contents.cc
diff --git a/chrome/browser/tab_contents/tab_contents.cc b/chrome/browser/tab_contents/tab_contents.cc
index 089545f7464dda2d08a50028ad3529981d6b69bb..9bdfdd7913a6f0c444509138246c0cb8b787de57 100644
--- a/chrome/browser/tab_contents/tab_contents.cc
+++ b/chrome/browser/tab_contents/tab_contents.cc
@@ -24,6 +24,7 @@
#include "chrome/browser/download/download_manager.h"
#include "chrome/browser/download/download_request_manager.h"
#include "chrome/browser/external_protocol_handler.h"
+#include "chrome/browser/extensions/extensions_service.h"
#include "chrome/browser/favicon_service.h"
#include "chrome/browser/form_field_history_manager.h"
#include "chrome/browser/gears_integration.h"
@@ -1410,12 +1411,27 @@ void TabContents::DidNavigateMainFramePostCommit(
fav_icon_helper_.FetchFavIcon(details.entry->url());
// Disable all page actions, unless this is an in-page navigation.
- if (!page_actions_.empty()) {
- url_canon::Replacements<char> replacements;
- replacements.ClearRef();
- if (params.url.ReplaceComponents(replacements) !=
- params.referrer.ReplaceComponents(replacements)) {
+ url_canon::Replacements<char> replacements;
+ replacements.ClearRef();
+ if (params.url.ReplaceComponents(replacements) !=
+ params.referrer.ReplaceComponents(replacements)) {
+ if (!page_actions_.empty())
page_actions_.clear();
+
+ ExtensionsService* service = profile()->GetExtensionsService();
+ if (service) {
+ for (size_t i = 0; i < service->extensions()->size(); ++i) {
+ ExtensionAction2* action =
+ service->extensions()->at(i)->browser_action();
+ if (!action)
+ continue;
+
+ action->ClearAllValuesForTab(controller().session_id().id());
+ NotificationService::current()->Notify(
+ NotificationType::EXTENSION_BROWSER_ACTION_UPDATED,
+ Source<ExtensionAction2>(action),
+ NotificationService::NoDetails());
+ }
}
}
« no previous file with comments | « chrome/browser/gtk/location_bar_view_gtk.cc ('k') | chrome/browser/views/browser_actions_container.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698