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

Unified Diff: chrome/browser/extensions/script_badge_controller.h

Issue 10446034: Rename ActionBoxController -> LocationBarController. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: grammar 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
Index: chrome/browser/extensions/script_badge_controller.h
diff --git a/chrome/browser/extensions/script_badge_controller.h b/chrome/browser/extensions/script_badge_controller.h
index 436a404d874f28c5d20edf2ba477550d71afd8ee..06fcdadffee1604a19cf2c1d7c735f20166f3c90 100644
--- a/chrome/browser/extensions/script_badge_controller.h
+++ b/chrome/browser/extensions/script_badge_controller.h
@@ -11,7 +11,7 @@
#include <string>
#include "base/memory/linked_ptr.h"
-#include "chrome/browser/extensions/action_box_controller.h"
+#include "chrome/browser/extensions/location_bar_controller.h"
#include "chrome/browser/extensions/script_executor.h"
#include "chrome/browser/extensions/script_executor_impl.h"
#include "content/public/browser/web_contents_observer.h"
@@ -24,16 +24,30 @@ namespace extensions {
class Extension;
-// An ActionBoxController which corresponds to script badges, and implements
-// ScriptExecutor in order to show those scripts in the action box too.
-class ScriptBadgeController : public ActionBoxController,
+// An LocationBarController which displays icons whenever a script is executing
+// in a tab. It accomplishes this two different ways:
+//
+// - For content_script declarations, the current URL in the tab is compared to
+// registered content scripts when GetCurrentActions() is called.
+// - An interface is exposed for programmatically executing scripts. Executed
+// scripts are recorded and used later to populate GetCurrentActions().
+//
+// TODO(aa): There are some edge cases that need to be thought-through here:
+//
+// - Redirects. In this case, I think we may flicker the icons in the url bar
+// as we bounce from URL to URL, without any script actually being executed.
not at google - send to devlin 2012/05/25 22:29:50 Yeah, maybe we should be showing these on load, ho
+// - Frames. This won't show icons for content_scripts running in frames. Should
+// it?
not at google - send to devlin 2012/05/25 22:29:50 Won't it? I thought it would? My understanding i
Aaron Boodman 2012/05/26 07:42:18 Nope.
+// - Possibly other weirdness where the state here doesn't match the state in
+// the renderer for whatever reason.
not at google - send to devlin 2012/05/25 22:29:50 Yes, I've been trying to keep all the state in one
+class ScriptBadgeController : public LocationBarController,
public ScriptExecutor,
public content::WebContentsObserver {
public:
explicit ScriptBadgeController(TabContentsWrapper* tab_contents);
virtual ~ScriptBadgeController();
- // ActionBoxController implementation.
+ // LocationBarController implementation.
virtual scoped_ptr<std::vector<ExtensionAction*> > GetCurrentActions()
OVERRIDE;
virtual Action OnClicked(const std::string& extension_id,

Powered by Google App Engine
This is Rietveld 408576698