Remove the refcount from ScriptBadgeController, which
required me to switch it from wrapping a ScriptExecutor to observing one.
Also write a simple test to demonstrate how to test ScriptBadgeController. This was the original point of the change. The associated refactoring turned out to be more useful, but was ultimately unnecessary for the test.
BUG=133139,136301
Review URL: https://chromiumcodereview.appspot.com/10754004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@145994 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/extensions/extension_tab_helper.h b/chrome/browser/extensions/extension_tab_helper.h
index 222c24f..00e07e4a7 100644
--- a/chrome/browser/extensions/extension_tab_helper.h
+++ b/chrome/browser/extensions/extension_tab_helper.h
@@ -111,9 +111,13 @@
return content::WebContentsObserver::web_contents();
}
- extensions::ScriptExecutor* script_executor();
+ extensions::ScriptExecutor* script_executor() {
+ return script_executor_.get();
+ }
- extensions::LocationBarController* location_bar_controller();
+ extensions::LocationBarController* location_bar_controller() {
+ return location_bar_controller_.get();
+ }
extensions::ActiveTabPermissionManager* active_tab_permission_manager() {
return &active_tab_permission_manager_;
@@ -221,12 +225,9 @@
TabContents* tab_contents_;
- // Either script_executor/location_bar_controller will have values, or
- // script_badge_controller will have a value, depending on whether the action
- // box is turned on.
scoped_ptr<extensions::ScriptExecutor> script_executor_;
+
scoped_ptr<extensions::LocationBarController> location_bar_controller_;
- scoped_refptr<extensions::ScriptBadgeController> script_badge_controller_;
extensions::ActiveTabPermissionManager active_tab_permission_manager_;