summaryrefslogtreecommitdiffstats
path: root/chrome/browser/views/tabs/tab_strip.cc
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-29 03:20:27 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-29 03:20:27 +0000
commitad3d7273dff93e5107a947c05c6a47c35ea7eea7 (patch)
treedd34fa6e3aaa7080885f5d28e046c76751f7d25f /chrome/browser/views/tabs/tab_strip.cc
parent21bd81995a2dbeb92833ee6b55612ec30ce6122f (diff)
downloadchromium_src-ad3d7273dff93e5107a947c05c6a47c35ea7eea7.zip
chromium_src-ad3d7273dff93e5107a947c05c6a47c35ea7eea7.tar.gz
chromium_src-ad3d7273dff93e5107a947c05c6a47c35ea7eea7.tar.bz2
Relands your patch to have an option for enabling vertical tabs. I've
added the following additions: . made the layout work for opaque_browser_frame. . Only show the menu if the user supplied --enable-vertical-tabs. BUG=none TEST=none Review URL: http://codereview.chromium.org/1708014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45906 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/tabs/tab_strip.cc')
-rw-r--r--chrome/browser/views/tabs/tab_strip.cc20
1 files changed, 18 insertions, 2 deletions
diff --git a/chrome/browser/views/tabs/tab_strip.cc b/chrome/browser/views/tabs/tab_strip.cc
index 7f31722..a6e11d3 100644
--- a/chrome/browser/views/tabs/tab_strip.cc
+++ b/chrome/browser/views/tabs/tab_strip.cc
@@ -265,8 +265,7 @@ TabStrip::~TabStrip() {
// delete the tabs.
StopAnimating(false);
- // TODO(beng): (1031854) Restore this line once XPFrame/VistaFrame are dead.
- // model_->RemoveObserver(this);
+ model_->RemoveObserver(this);
// TODO(beng): remove this if it doesn't work to fix the TabSelectedAt bug.
drag_controller_.reset(NULL);
@@ -341,6 +340,15 @@ gfx::Rect TabStrip::GetNewTabButtonBounds() {
return newtab_button_->bounds();
}
+void TabStrip::InitFromModel() {
+ // Walk the model, calling our insertion observer method for each item within
+ // it.
+ for (int i = 0; i < model_->count(); ++i) {
+ TabInsertedAt(model_->GetTabContentsAt(i), i,
+ i == model_->selected_index());
+ }
+}
+
////////////////////////////////////////////////////////////////////////////////
// TabStrip, BaseTabStrip implementation:
@@ -866,6 +874,14 @@ bool TabStrip::IsCommandEnabledForTab(
return false;
}
+bool TabStrip::IsCommandCheckedForTab(
+ TabStripModel::ContextMenuCommand command_id, const Tab* tab) const {
+ int model_index = GetModelIndexOfTab(tab);
+ if (model_->ContainsIndex(model_index))
+ return model_->IsContextMenuCommandChecked(model_index, command_id);
+ return false;
+}
+
void TabStrip::ExecuteCommandForTab(
TabStripModel::ContextMenuCommand command_id, Tab* tab) {
int model_index = GetModelIndexOfTab(tab);