| Index: chrome/browser/extensions/extension_sidebar_api.cc
|
| ===================================================================
|
| --- chrome/browser/extensions/extension_sidebar_api.cc (revision 74134)
|
| +++ chrome/browser/extensions/extension_sidebar_api.cc (working copy)
|
| @@ -15,7 +15,6 @@
|
| #include "chrome/browser/profiles/profile.h"
|
| #include "chrome/browser/sidebar/sidebar_container.h"
|
| #include "chrome/browser/sidebar/sidebar_manager.h"
|
| -#include "chrome/browser/tab_contents/tab_contents.h"
|
| #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
|
| #include "chrome/common/extensions/extension.h"
|
| #include "chrome/common/extensions/extension_constants.h"
|
| @@ -54,9 +53,11 @@
|
|
|
| // static
|
| void ExtensionSidebarEventRouter::OnStateChanged(
|
| - Profile* profile, TabContents* tab, const std::string& content_id,
|
| + Profile* profile,
|
| + TabContentsWrapper* tab,
|
| + const std::string& content_id,
|
| const std::string& state) {
|
| - int tab_id = ExtensionTabUtil::GetTabId(tab);
|
| + int tab_id = ExtensionTabUtil::GetTabId(tab->tab_contents());
|
| DictionaryValue* details = new DictionaryValue;
|
| details->Set(kTabIdKey, Value::CreateIntegerValue(tab_id));
|
| details->Set(kStateKey, Value::CreateStringValue(state));
|
| @@ -129,18 +130,18 @@
|
| return false;
|
|
|
| std::string content_id(GetExtension()->id());
|
| - return RunImpl(tab_contents->tab_contents(), content_id, *details);
|
| + return RunImpl(tab_contents, content_id, *details);
|
| }
|
|
|
|
|
| -bool CollapseSidebarFunction::RunImpl(TabContents* tab,
|
| +bool CollapseSidebarFunction::RunImpl(TabContentsWrapper* tab,
|
| const std::string& content_id,
|
| const DictionaryValue& details) {
|
| SidebarManager::GetInstance()->CollapseSidebar(tab, content_id);
|
| return true;
|
| }
|
|
|
| -bool ExpandSidebarFunction::RunImpl(TabContents* tab,
|
| +bool ExpandSidebarFunction::RunImpl(TabContentsWrapper* tab,
|
| const std::string& content_id,
|
| const DictionaryValue& details) {
|
| // TODO(alekseys): enable this check back when WebKit's user gesture flag
|
| @@ -153,7 +154,7 @@
|
| return true;
|
| }
|
|
|
| -bool GetStateSidebarFunction::RunImpl(TabContents* tab,
|
| +bool GetStateSidebarFunction::RunImpl(TabContentsWrapper* tab,
|
| const std::string& content_id,
|
| const DictionaryValue& details) {
|
| SidebarManager* manager = SidebarManager::GetInstance();
|
| @@ -194,14 +195,14 @@
|
| return true;
|
| }
|
|
|
| -bool HideSidebarFunction::RunImpl(TabContents* tab,
|
| +bool HideSidebarFunction::RunImpl(TabContentsWrapper* tab,
|
| const std::string& content_id,
|
| const DictionaryValue& details) {
|
| SidebarManager::GetInstance()->HideSidebar(tab, content_id);
|
| return true;
|
| }
|
|
|
| -bool NavigateSidebarFunction::RunImpl(TabContents* tab,
|
| +bool NavigateSidebarFunction::RunImpl(TabContentsWrapper* tab,
|
| const std::string& content_id,
|
| const DictionaryValue& details) {
|
| std::string path_string;
|
| @@ -216,7 +217,7 @@
|
| return true;
|
| }
|
|
|
| -bool SetBadgeTextSidebarFunction::RunImpl(TabContents* tab,
|
| +bool SetBadgeTextSidebarFunction::RunImpl(TabContentsWrapper* tab,
|
| const std::string& content_id,
|
| const DictionaryValue& details) {
|
| string16 badge_text;
|
| @@ -226,7 +227,7 @@
|
| return true;
|
| }
|
|
|
| -bool SetIconSidebarFunction::RunImpl(TabContents* tab,
|
| +bool SetIconSidebarFunction::RunImpl(TabContentsWrapper* tab,
|
| const std::string& content_id,
|
| const DictionaryValue& details) {
|
| BinaryValue* binary;
|
| @@ -240,7 +241,7 @@
|
| return true;
|
| }
|
|
|
| -bool SetTitleSidebarFunction::RunImpl(TabContents* tab,
|
| +bool SetTitleSidebarFunction::RunImpl(TabContentsWrapper* tab,
|
| const std::string& content_id,
|
| const DictionaryValue& details) {
|
| string16 title;
|
| @@ -249,7 +250,7 @@
|
| return true;
|
| }
|
|
|
| -bool ShowSidebarFunction::RunImpl(TabContents* tab,
|
| +bool ShowSidebarFunction::RunImpl(TabContentsWrapper* tab,
|
| const std::string& content_id,
|
| const DictionaryValue& details) {
|
| SidebarManager::GetInstance()->ShowSidebar(tab, content_id);
|
|
|