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

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

Issue 270153004: Introduce ActiveScriptController; track active extension scripts (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: UMA Created 6 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/location_bar_controller_provider.h
diff --git a/chrome/browser/extensions/location_bar_controller_provider.h b/chrome/browser/extensions/location_bar_controller_provider.h
new file mode 100644
index 0000000000000000000000000000000000000000..7366f18f135c8f6764ed0c68db9e878aed6db69a
--- /dev/null
+++ b/chrome/browser/extensions/location_bar_controller_provider.h
@@ -0,0 +1,66 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_EXTENSIONS_LOCATION_BAR_CONTROLLER_PROVIDER_H_
+#define CHROME_BROWSER_EXTENSIONS_LOCATION_BAR_CONTROLLER_PROVIDER_H_
+
+#include "chrome/browser/extensions/location_bar_controller.h"
+#include "content/public/browser/web_contents_observer.h"
+
+namespace content {
+class BrowserContext;
+class WebContents;
+}
+
+class ExtensionAction;
+
+namespace extensions {
+
+class Extension;
+class ExtensionRegistry;
+
+class LocationBarControllerProvider : public content::WebContentsObserver {
not at google - send to devlin 2014/05/07 22:49:02 This looks a lot like what LocationBarController w
Devlin 2014/05/08 18:15:46 Done.
+ public:
+ explicit LocationBarControllerProvider(content::WebContents* web_contents);
+ virtual ~LocationBarControllerProvider();
+
+ // Returns the ExtensionActions for all extensions.
+ virtual std::vector<ExtensionAction*> GetCurrentActions() = 0;
+
+ // Handles a click on an extension action.
+ virtual LocationBarController::Action OnClicked(
+ const Extension* extension,
+ LocationBarController::MouseButton button) = 0;
+
+ // A notification that the WebContents has navigated (and thus, actions and
+ // state likely need to be refreshed). This is basically forwarded from
+ // WebContentsObserver::DidNavigateMainFrame().
+ virtual void NavigatedMainFrame(
+ const content::LoadCommittedDetails& details,
+ const content::FrameNavigateParams& params) = 0;
+
+ protected:
+ // Notifies that there has been a change, and actions need to be refreshed.
+ void NotifyChange();
not at google - send to devlin 2014/05/07 22:49:02 it would be nice to make these protected: things a
Devlin 2014/05/08 18:15:46 Done.
+
+ // Returns the associated ExtensionRegistry.
+ ExtensionRegistry* GetExtensionRegistry();
+
+ content::WebContents* web_contents() { return web_contents_; }
+
+ private:
+ // content::WebContentsObserver implementation.
+ virtual void DidNavigateMainFrame(
+ const content::LoadCommittedDetails& details,
+ const content::FrameNavigateParams& params) OVERRIDE;
+
+ // The associated web contents.
+ content::WebContents* web_contents_;
+
+ DISALLOW_COPY_AND_ASSIGN(LocationBarControllerProvider);
+};
+
+} // namespace extensions
+
+#endif // CHROME_BROWSER_EXTENSIONS_LOCATION_BAR_CONTROLLER_PROVIDER_H_

Powered by Google App Engine
This is Rietveld 408576698