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

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

Issue 10381105: Refactor UI "badge" (page action) logic into a BadgeController interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: dont include badgecontroller.h 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/page_action_controller.h
diff --git a/chrome/browser/extensions/page_action_controller.h b/chrome/browser/extensions/page_action_controller.h
new file mode 100644
index 0000000000000000000000000000000000000000..904d23577eb9f8e37ed392ef3c58bd946e971608
--- /dev/null
+++ b/chrome/browser/extensions/page_action_controller.h
@@ -0,0 +1,36 @@
+// Copyright (c) 2012 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_PAGE_ACTION_CONTROLLER_H_
+#define CHROME_BROWSER_EXTENSIONS_PAGE_ACTION_CONTROLLER_H_
+#pragma once
+
+#include "chrome/browser/extensions/badge_controller.h"
+
+class ExtensionService;
+class TabContentsWrapper;
+
+namespace extensions {
+
+// A BadgeController which corresponds to the page actions of an extension.
+class PageActionController : public BadgeController {
+ public:
+ explicit PageActionController(TabContentsWrapper* tab_contents);
+ virtual ~PageActionController();
+
+ virtual scoped_ptr<DataList> GetAllBadgeData() OVERRIDE;
+
+ virtual Reaction OnClicked(const std::string& extension_id,
+ int button_type) OVERRIDE;
+
+ private:
+ // Gets the ExtensionService for |tab_contents_|.
+ ExtensionService* GetExtensionService();
+
+ TabContentsWrapper* tab_contents_;
+};
Evan Stade 2012/05/11 21:52:08 DISALLOW_COPY_AND_ASSIGN
not at google - send to devlin 2012/05/14 03:59:01 Done.
+
+} // namespace extensions
+
+#endif // CHROME_BROWSER_EXTENSIONS_PAGE_ACTION_CONTROLLER_H_

Powered by Google App Engine
This is Rietveld 408576698