summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions
diff options
context:
space:
mode:
authortwiz@google.com <twiz@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-12 21:24:59 +0000
committertwiz@google.com <twiz@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-12 21:24:59 +0000
commitb283a75393c7c54e33ca7d25f9eec55ac6a2960b (patch)
treef18455820a1e47b5da8602f7ebc0a99296866e11 /chrome/browser/extensions
parent8e07d29abff1de820b4ca5105534f3bcc6a0510d (diff)
downloadchromium_src-b283a75393c7c54e33ca7d25f9eec55ac6a2960b.zip
chromium_src-b283a75393c7c54e33ca7d25f9eec55ac6a2960b.tar.gz
chromium_src-b283a75393c7c54e33ca7d25f9eec55ac6a2960b.tar.bz2
Clone of issue 2941001. See initial review below.
http://codereview.chromium.org/2941001 Initial submit broke the chromeos build. This patch includes the original change, and fixes to compile ChromeOs properly. BUG=None TEST=None Review URL: http://codereview.chromium.org/2819086 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@55951 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions')
-rw-r--r--chrome/browser/extensions/extension_dom_ui.cc9
-rw-r--r--chrome/browser/extensions/extension_install_ui.cc3
-rw-r--r--chrome/browser/extensions/extension_tabs_module.cc11
3 files changed, 12 insertions, 11 deletions
diff --git a/chrome/browser/extensions/extension_dom_ui.cc b/chrome/browser/extensions/extension_dom_ui.cc
index b23d12c..29768b9 100644
--- a/chrome/browser/extensions/extension_dom_ui.cc
+++ b/chrome/browser/extensions/extension_dom_ui.cc
@@ -177,12 +177,9 @@ void ExtensionDOMUI::ProcessDOMUIMessage(const std::string& message,
}
Browser* ExtensionDOMUI::GetBrowser() const {
- Browser* browser = NULL;
- TabContentsDelegate* tab_contents_delegate = tab_contents()->delegate();
- if (tab_contents_delegate)
- browser = tab_contents_delegate->GetBrowser();
-
- return browser;
+ // TODO(beng): This is an improper direct dependency on Browser. Route this
+ // through some sort of delegate.
+ return BrowserList::FindBrowserWithProfile(DOMUI::GetProfile());
}
Profile* ExtensionDOMUI::GetProfile() {
diff --git a/chrome/browser/extensions/extension_install_ui.cc b/chrome/browser/extensions/extension_install_ui.cc
index 3468336..bd59dd4 100644
--- a/chrome/browser/extensions/extension_install_ui.cc
+++ b/chrome/browser/extensions/extension_install_ui.cc
@@ -200,7 +200,8 @@ void ExtensionInstallUI::OnInstallSuccess(Extension* extension) {
url += "/#";
url += hash_params;
browser->AddTabWithURL(GURL(url), GURL(), PageTransition::TYPED, -1,
- TabStripModel::ADD_SELECTED, NULL, std::string());
+ TabStripModel::ADD_SELECTED, NULL, std::string(),
+ NULL);
}
return;
diff --git a/chrome/browser/extensions/extension_tabs_module.cc b/chrome/browser/extensions/extension_tabs_module.cc
index cf15d02..79b3cdf 100644
--- a/chrome/browser/extensions/extension_tabs_module.cc
+++ b/chrome/browser/extensions/extension_tabs_module.cc
@@ -373,7 +373,8 @@ bool CreateWindowFunction::RunImpl() {
Browser* new_window = new Browser(window_type, window_profile);
new_window->CreateBrowserWindow();
new_window->AddTabWithURL(url, GURL(), PageTransition::LINK, -1,
- TabStripModel::ADD_SELECTED, NULL, std::string());
+ TabStripModel::ADD_SELECTED, NULL, std::string(),
+ &new_window);
new_window->window()->SetBounds(bounds);
new_window->window()->Show();
@@ -581,15 +582,17 @@ bool CreateTabFunction::RunImpl() {
TabStripModel::ADD_NONE;
add_types |= TabStripModel::ADD_FORCE_INDEX;
TabContents* contents = browser->AddTabWithURL(url, GURL(),
- PageTransition::LINK, index, add_types, NULL, std::string());
- index = tab_strip->GetIndexOfTabContents(contents);
+ PageTransition::LINK, index, add_types, NULL, std::string(), &browser);
+ index = browser->tabstrip_model()->GetIndexOfTabContents(contents);
if (selected)
contents->Focus();
// Return data about the newly created tab.
if (has_callback())
- result_.reset(ExtensionTabUtil::CreateTabValue(contents, tab_strip, index));
+ result_.reset(ExtensionTabUtil::CreateTabValue(contents,
+ browser->tabstrip_model(),
+ index));
return true;
}