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/tab_strip.h" | 5 #include "chrome/browser/ui/views/tabs/tab_strip.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/stl_util-inl.h" | 10 #include "base/stl_util-inl.h" |
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
526 | 526 |
527 void TabStrip::ButtonPressed(views::Button* sender, const views::Event& event) { | 527 void TabStrip::ButtonPressed(views::Button* sender, const views::Event& event) { |
528 if (sender == newtab_button_) | 528 if (sender == newtab_button_) |
529 controller()->CreateNewTab(); | 529 controller()->CreateNewTab(); |
530 } | 530 } |
531 | 531 |
532 /////////////////////////////////////////////////////////////////////////////// | 532 /////////////////////////////////////////////////////////////////////////////// |
533 // TabStrip, private: | 533 // TabStrip, private: |
534 | 534 |
535 void TabStrip::Init() { | 535 void TabStrip::Init() { |
536 SetID(VIEW_ID_TAB_STRIP); | 536 set_id(VIEW_ID_TAB_STRIP); |
537 newtab_button_bounds_.SetRect(0, 0, kNewTabButtonWidth, kNewTabButtonHeight); | 537 newtab_button_bounds_.SetRect(0, 0, kNewTabButtonWidth, kNewTabButtonHeight); |
538 if (browser_defaults::kSizeTabButtonToTopOfTabStrip) { | 538 if (browser_defaults::kSizeTabButtonToTopOfTabStrip) { |
539 newtab_button_bounds_.set_height( | 539 newtab_button_bounds_.set_height( |
540 kNewTabButtonHeight + kNewTabButtonVOffset); | 540 kNewTabButtonHeight + kNewTabButtonVOffset); |
541 } | 541 } |
542 if (drop_indicator_width == 0) { | 542 if (drop_indicator_width == 0) { |
543 // Direction doesn't matter, both images are the same size. | 543 // Direction doesn't matter, both images are the same size. |
544 SkBitmap* drop_image = GetDropArrowImage(true); | 544 SkBitmap* drop_image = GetDropArrowImage(true); |
545 drop_indicator_width = drop_image->width(); | 545 drop_indicator_width = drop_image->width(); |
546 drop_indicator_height = drop_image->height(); | 546 drop_indicator_height = drop_image->height(); |
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
999 int TabStrip::GetAvailableWidthForTabs(Tab* last_tab) const { | 999 int TabStrip::GetAvailableWidthForTabs(Tab* last_tab) const { |
1000 return last_tab->x() + last_tab->width(); | 1000 return last_tab->x() + last_tab->width(); |
1001 } | 1001 } |
1002 | 1002 |
1003 bool TabStrip::IsPointInTab(Tab* tab, | 1003 bool TabStrip::IsPointInTab(Tab* tab, |
1004 const gfx::Point& point_in_tabstrip_coords) { | 1004 const gfx::Point& point_in_tabstrip_coords) { |
1005 gfx::Point point_in_tab_coords(point_in_tabstrip_coords); | 1005 gfx::Point point_in_tab_coords(point_in_tabstrip_coords); |
1006 View::ConvertPointToView(this, tab, &point_in_tab_coords); | 1006 View::ConvertPointToView(this, tab, &point_in_tab_coords); |
1007 return tab->HitTest(point_in_tab_coords); | 1007 return tab->HitTest(point_in_tab_coords); |
1008 } | 1008 } |
OLD | NEW |