summaryrefslogtreecommitdiffstats
path: root/chrome/browser/tabs
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-04 15:49:08 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-04 15:49:08 +0000
commit36fb2c7c17069ad7b6d767e4c40b8ee29b762cf8 (patch)
tree2e87bed9b96d30210008b64fde9e90fe7d6a399d /chrome/browser/tabs
parent2bd51de1a5ffc4514a11c3f18c7e2e5f1b92d728 (diff)
downloadchromium_src-36fb2c7c17069ad7b6d767e4c40b8ee29b762cf8.zip
chromium_src-36fb2c7c17069ad7b6d767e4c40b8ee29b762cf8.tar.gz
chromium_src-36fb2c7c17069ad7b6d767e4c40b8ee29b762cf8.tar.bz2
Get rid of extensions dependency from content\browser.
BUG=76789 Review URL: http://codereview.chromium.org/6693054 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@80315 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/tabs')
-rw-r--r--chrome/browser/tabs/pinned_tab_codec.cc4
-rw-r--r--chrome/browser/tabs/tab_strip_model.cc8
-rw-r--r--chrome/browser/tabs/tab_strip_model.h4
-rw-r--r--chrome/browser/tabs/tab_strip_model_unittest.cc5
4 files changed, 13 insertions, 8 deletions
diff --git a/chrome/browser/tabs/pinned_tab_codec.cc b/chrome/browser/tabs/pinned_tab_codec.cc
index 7b89949..6680d82 100644
--- a/chrome/browser/tabs/pinned_tab_codec.cc
+++ b/chrome/browser/tabs/pinned_tab_codec.cc
@@ -6,6 +6,7 @@
#include "base/values.h"
#include "chrome/browser/browser_list.h"
+#include "chrome/browser/extensions/extension_tab_helper.h"
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/tabs/tab_strip_model.h"
@@ -43,7 +44,8 @@ static void EncodePinnedTab(TabStripModel* model,
TabContentsWrapper* tab_contents = model->GetTabContentsAt(index);
if (model->IsAppTab(index)) {
- const Extension* extension = tab_contents->extension_app();
+ const Extension* extension =
+ tab_contents->extension_tab_helper()->extension_app();
DCHECK(extension);
value->SetString(kAppID, extension->id());
// For apps we use the launch url. We do this for the following reason:
diff --git a/chrome/browser/tabs/tab_strip_model.cc b/chrome/browser/tabs/tab_strip_model.cc
index 407bb00..7e31c30 100644
--- a/chrome/browser/tabs/tab_strip_model.cc
+++ b/chrome/browser/tabs/tab_strip_model.cc
@@ -16,6 +16,7 @@
#include "chrome/browser/browser_shutdown.h"
#include "chrome/browser/defaults.h"
#include "chrome/browser/extensions/extension_service.h"
+#include "chrome/browser/extensions/extension_tab_helper.h"
#include "chrome/browser/metrics/user_metrics.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/sessions/tab_restore_service.h"
@@ -117,7 +118,8 @@ void TabStripModel::InsertTabContentsAt(int index,
int add_types) {
bool foreground = add_types & ADD_SELECTED;
// Force app tabs to be pinned.
- bool pin = contents->is_app() || add_types & ADD_PINNED;
+ bool pin =
+ contents->extension_tab_helper()->is_app() || add_types & ADD_PINNED;
index = ConstrainInsertionIndex(index, pin);
// In tab dragging situations, if the last tab in the window was detached
@@ -545,7 +547,7 @@ bool TabStripModel::IsMiniTab(int index) const {
bool TabStripModel::IsAppTab(int index) const {
TabContentsWrapper* contents = GetTabContentsAt(index);
- return contents && contents->is_app();
+ return contents && contents->extension_tab_helper()->is_app();
}
bool TabStripModel::IsTabBlocked(int index) const {
@@ -997,7 +999,7 @@ void TabStripModel::Observe(NotificationType type,
// Iterate backwards as we may remove items while iterating.
for (int i = count() - 1; i >= 0; i--) {
TabContentsWrapper* contents = GetTabContentsAt(i);
- if (contents->extension_app() == extension) {
+ if (contents->extension_tab_helper()->extension_app() == extension) {
// The extension an app tab was created from has been nuked. Delete
// the TabContents. Deleting a TabContents results in a notification
// of type TAB_CONTENTS_DESTROYED; we do the necessary cleanup in
diff --git a/chrome/browser/tabs/tab_strip_model.h b/chrome/browser/tabs/tab_strip_model.h
index df0c545..42489b4 100644
--- a/chrome/browser/tabs/tab_strip_model.h
+++ b/chrome/browser/tabs/tab_strip_model.h
@@ -41,8 +41,8 @@ class TabStripModelOrderController;
// You'll notice there is no explcit api for making a tab a mini-tab, rather
// there are two tab types that are implicitly mini-tabs:
// . App. Corresponds to an extension that wants an app tab. App tabs are
-// identified by TabContents::is_app(). App tabs are always pinneded (you
-// can't unpin them).
+// identified by TabContentsWrapper::extension_tab_helper()::is_app().
+// App tabs are always pinneded (you can't unpin them).
// . Pinned. Any tab can be pinned. Non-app tabs whose pinned state is changed
// are moved to be with other mini-tabs or non-mini tabs.
//
diff --git a/chrome/browser/tabs/tab_strip_model_unittest.cc b/chrome/browser/tabs/tab_strip_model_unittest.cc
index aac26a9..993f409 100644
--- a/chrome/browser/tabs/tab_strip_model_unittest.cc
+++ b/chrome/browser/tabs/tab_strip_model_unittest.cc
@@ -15,6 +15,7 @@
#include "base/string_util.h"
#include "base/utf_string_conversions.h"
#include "chrome/browser/defaults.h"
+#include "chrome/browser/extensions/extension_tab_helper.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/tabs/tab_strip_model.h"
@@ -1759,9 +1760,9 @@ TEST_F(TabStripModelTest, Apps) {
Extension::INVALID));
extension_app->launch_web_url_ = "http://www.google.com";
TabContentsWrapper* contents1 = CreateTabContents();
- contents1->tab_contents()->SetExtensionApp(extension_app);
+ contents1->extension_tab_helper()->SetExtensionApp(extension_app);
TabContentsWrapper* contents2 = CreateTabContents();
- contents2->tab_contents()->SetExtensionApp(extension_app);
+ contents2->extension_tab_helper()->SetExtensionApp(extension_app);
TabContentsWrapper* contents3 = CreateTabContents();
SetID(contents1->tab_contents(), 1);