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

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

Issue 11411308: Enable script bubble by default on all but mac. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Everything passes Created 8 years 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/script_bubble_controller.cc
diff --git a/chrome/browser/extensions/script_bubble_controller.cc b/chrome/browser/extensions/script_bubble_controller.cc
index 67c6593e3ae904d3770b245e9372d843b71ad9ee..a4f76cee55ebef7df9e04559a30560f57fbb171b 100644
--- a/chrome/browser/extensions/script_bubble_controller.cc
+++ b/chrome/browser/extensions/script_bubble_controller.cc
@@ -13,6 +13,7 @@
#include "chrome/browser/extensions/location_bar_controller.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/extensions/extension.h"
+#include "content/public/browser/navigation_details.h"
namespace extensions {
@@ -40,7 +41,7 @@ void ScriptBubbleController::OnScriptsExecuted(
// those are effectively not installed from the user's point of view.
const Extension* extension =
extension_service->extensions()->GetByID(i->first);
- if (extension->ShouldDisplayInExtensionSettings())
+ if (extension && extension->ShouldDisplayInExtensionSettings())
changed |= extensions_running_scripts_.insert(i->first).second;
}
@@ -51,10 +52,18 @@ void ScriptBubbleController::OnScriptsExecuted(
void ScriptBubbleController::DidNavigateMainFrame(
const content::LoadCommittedDetails& details,
const content::FrameNavigateParams& params) {
+ if (!details.is_navigation_to_different_page())
+ return;
extensions_running_scripts_.clear();
UpdateScriptBubble();
}
+void ScriptBubbleController::OnExtensionUnloaded(
+ const std::string& extension_id) {
+ if (extensions_running_scripts_.erase(extension_id) == 1)
+ UpdateScriptBubble();
+}
+
Profile* ScriptBubbleController::profile() const {
return Profile::FromBrowserContext(web_contents()->GetBrowserContext());
}
« no previous file with comments | « chrome/browser/extensions/script_bubble_controller.h ('k') | chrome/browser/extensions/script_bubble_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698