OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include <iterator> | 8 #include <iterator> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 1004 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1015 for (int i = 0; i < tab_count(); ++i) { | 1015 for (int i = 0; i < tab_count(); ++i) { |
1016 if (base_tab_at_tab_index(i)->data().mini) | 1016 if (base_tab_at_tab_index(i)->data().mini) |
1017 mini_count++; | 1017 mini_count++; |
1018 else | 1018 else |
1019 return mini_count; | 1019 return mini_count; |
1020 } | 1020 } |
1021 return mini_count; | 1021 return mini_count; |
1022 } | 1022 } |
1023 | 1023 |
1024 /////////////////////////////////////////////////////////////////////////////// | 1024 /////////////////////////////////////////////////////////////////////////////// |
1025 // TabStrip, views::BaseButton::ButtonListener implementation: | 1025 // TabStrip, views::ButtonListener implementation: |
1026 | 1026 |
1027 void TabStrip::ButtonPressed(views::Button* sender, const views::Event& event) { | 1027 void TabStrip::ButtonPressed(views::Button* sender, const views::Event& event) { |
1028 if (sender == newtab_button_) | 1028 if (sender == newtab_button_) |
1029 controller()->CreateNewTab(); | 1029 controller()->CreateNewTab(); |
1030 } | 1030 } |
1031 | 1031 |
1032 /////////////////////////////////////////////////////////////////////////////// | 1032 /////////////////////////////////////////////////////////////////////////////// |
1033 // TabStrip, protected: | 1033 // TabStrip, protected: |
1034 | 1034 |
1035 void TabStrip::ViewHierarchyChanged(bool is_add, | 1035 void TabStrip::ViewHierarchyChanged(bool is_add, |
(...skipping 874 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1910 ui::AnimationDelegate* TabStrip::CreateRemoveTabDelegate(BaseTab* tab) { | 1910 ui::AnimationDelegate* TabStrip::CreateRemoveTabDelegate(BaseTab* tab) { |
1911 return new RemoveTabDelegate(this, tab); | 1911 return new RemoveTabDelegate(this, tab); |
1912 } | 1912 } |
1913 | 1913 |
1914 bool TabStrip::IsPointInTab(Tab* tab, | 1914 bool TabStrip::IsPointInTab(Tab* tab, |
1915 const gfx::Point& point_in_tabstrip_coords) { | 1915 const gfx::Point& point_in_tabstrip_coords) { |
1916 gfx::Point point_in_tab_coords(point_in_tabstrip_coords); | 1916 gfx::Point point_in_tab_coords(point_in_tabstrip_coords); |
1917 View::ConvertPointToView(this, tab, &point_in_tab_coords); | 1917 View::ConvertPointToView(this, tab, &point_in_tab_coords); |
1918 return tab->HitTest(point_in_tab_coords); | 1918 return tab->HitTest(point_in_tab_coords); |
1919 } | 1919 } |
OLD | NEW |