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 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 delta = initial_y - ideal_bounds(first_vis_index + 1).y(); | 282 delta = initial_y - ideal_bounds(first_vis_index + 1).y(); |
283 } | 283 } |
284 } | 284 } |
285 SetFirstTabYOffset(first_tab_y_offset_ + delta); | 285 SetFirstTabYOffset(first_tab_y_offset_ + delta); |
286 } | 286 } |
287 | 287 |
288 BaseTab* SideTabStrip::CreateTab() { | 288 BaseTab* SideTabStrip::CreateTab() { |
289 return new SideTab(this); | 289 return new SideTab(this); |
290 } | 290 } |
291 | 291 |
292 bool SideTabStrip::IgnoreTitlePrefixEliding(BaseTab* tab) { | |
293 DCHECK(tab != NULL); | |
294 return tab->data().title.empty(); | |
295 } | |
296 | |
297 void SideTabStrip::GenerateIdealBounds() { | 292 void SideTabStrip::GenerateIdealBounds() { |
298 gfx::Rect layout_rect = GetContentsBounds(); | 293 gfx::Rect layout_rect = GetContentsBounds(); |
299 layout_rect.Inset(kTabStripInset, kTabStripInset); | 294 layout_rect.Inset(kTabStripInset, kTabStripInset); |
300 | 295 |
301 int y = layout_rect.y() + first_tab_y_offset_; | 296 int y = layout_rect.y() + first_tab_y_offset_; |
302 bool last_was_mini = true; | 297 bool last_was_mini = true; |
303 bool has_non_closing_tab = false; | 298 bool has_non_closing_tab = false; |
304 separator_bounds_.SetRect(0, -kSeparatorHeight, width(), kSeparatorHeight); | 299 separator_bounds_.SetRect(0, -kSeparatorHeight, width(), kSeparatorHeight); |
305 for (int i = 0; i < tab_count(); ++i) { | 300 for (int i = 0; i < tab_count(); ++i) { |
306 BaseTab* tab = base_tab_at_tab_index(i); | 301 BaseTab* tab = base_tab_at_tab_index(i); |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
463 return; | 458 return; |
464 | 459 |
465 if (ideal_bounds(tab_index).y() < kTabStripInset) { | 460 if (ideal_bounds(tab_index).y() < kTabStripInset) { |
466 SetFirstTabYOffset(first_tab_y_offset_ - ideal_bounds(tab_index).y() + | 461 SetFirstTabYOffset(first_tab_y_offset_ - ideal_bounds(tab_index).y() + |
467 kTabStripInset); | 462 kTabStripInset); |
468 } else if (ideal_bounds(tab_index).bottom() > GetMaxTabY()) { | 463 } else if (ideal_bounds(tab_index).bottom() > GetMaxTabY()) { |
469 SetFirstTabYOffset(GetMaxTabY() - (ideal_bounds(tab_index).bottom() - | 464 SetFirstTabYOffset(GetMaxTabY() - (ideal_bounds(tab_index).bottom() - |
470 first_tab_y_offset_)); | 465 first_tab_y_offset_)); |
471 } | 466 } |
472 } | 467 } |
OLD | NEW |