| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ui/views/tabs/side_tab_strip.h" | 5 #include "chrome/browser/ui/views/tabs/side_tab_strip.h" |
| 6 | 6 |
| 7 #include "chrome/browser/ui/view_ids.h" | 7 #include "chrome/browser/ui/view_ids.h" |
| 8 #include "chrome/browser/ui/views/tabs/side_tab.h" | 8 #include "chrome/browser/ui/views/tabs/side_tab.h" |
| 9 #include "chrome/browser/ui/views/tabs/tab_strip_controller.h" | 9 #include "chrome/browser/ui/views/tabs/tab_strip_controller.h" |
| 10 #include "grit/generated_resources.h" | 10 #include "grit/generated_resources.h" |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 | 148 |
| 149 if (dragging_tab) | 149 if (dragging_tab) |
| 150 dragging_tab->ProcessPaint(canvas); | 150 dragging_tab->ProcessPaint(canvas); |
| 151 } | 151 } |
| 152 | 152 |
| 153 BaseTab* SideTabStrip::CreateTab() { | 153 BaseTab* SideTabStrip::CreateTab() { |
| 154 return new SideTab(this); | 154 return new SideTab(this); |
| 155 } | 155 } |
| 156 | 156 |
| 157 void SideTabStrip::GenerateIdealBounds() { | 157 void SideTabStrip::GenerateIdealBounds() { |
| 158 gfx::Rect layout_rect = GetLocalBounds(); | 158 gfx::Rect layout_rect = GetContentsBounds(); |
| 159 layout_rect.Inset(kTabStripInset, kTabStripInset); | 159 layout_rect.Inset(kTabStripInset, kTabStripInset); |
| 160 | 160 |
| 161 int y = layout_rect.y(); | 161 int y = layout_rect.y(); |
| 162 bool last_was_mini = true; | 162 bool last_was_mini = true; |
| 163 bool has_non_closing_tab = false; | 163 bool has_non_closing_tab = false; |
| 164 separator_bounds_.SetRect(0, -kSeparatorHeight, width(), kSeparatorHeight); | 164 separator_bounds_.SetRect(0, -kSeparatorHeight, width(), kSeparatorHeight); |
| 165 for (int i = 0; i < tab_count(); ++i) { | 165 for (int i = 0; i < tab_count(); ++i) { |
| 166 BaseTab* tab = base_tab_at_tab_index(i); | 166 BaseTab* tab = base_tab_at_tab_index(i); |
| 167 if (!tab->closing()) { | 167 if (!tab->closing()) { |
| 168 if (last_was_mini != tab->data().mini) { | 168 if (last_was_mini != tab->data().mini) { |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 bounds_animator().AnimateViewTo(separator_, separator_bounds_); | 226 bounds_animator().AnimateViewTo(separator_, separator_bounds_); |
| 227 } | 227 } |
| 228 | 228 |
| 229 void SideTabStrip::DoLayout() { | 229 void SideTabStrip::DoLayout() { |
| 230 BaseTabStrip::DoLayout(); | 230 BaseTabStrip::DoLayout(); |
| 231 | 231 |
| 232 newtab_button_->SetBoundsRect(newtab_button_bounds_); | 232 newtab_button_->SetBoundsRect(newtab_button_bounds_); |
| 233 | 233 |
| 234 separator_->SetBoundsRect(separator_bounds_); | 234 separator_->SetBoundsRect(separator_bounds_); |
| 235 } | 235 } |
| OLD | NEW |