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 #include <iterator> | 8 #include <iterator> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 // of the containing Window's client area so that regular events can be | 182 // of the containing Window's client area so that regular events can be |
183 // processed for them. | 183 // processed for them. |
184 return false; | 184 return false; |
185 } | 185 } |
186 | 186 |
187 void TabStrip::SetBackgroundOffset(const gfx::Point& offset) { | 187 void TabStrip::SetBackgroundOffset(const gfx::Point& offset) { |
188 for (int i = 0; i < tab_count(); ++i) | 188 for (int i = 0; i < tab_count(); ++i) |
189 GetTabAtTabDataIndex(i)->set_background_offset(offset); | 189 GetTabAtTabDataIndex(i)->set_background_offset(offset); |
190 } | 190 } |
191 | 191 |
| 192 views::View* TabStrip::GetNewTabButton() { |
| 193 return newtab_button_; |
| 194 } |
| 195 |
192 //////////////////////////////////////////////////////////////////////////////// | 196 //////////////////////////////////////////////////////////////////////////////// |
193 // TabStrip, BaseTabStrip implementation: | 197 // TabStrip, BaseTabStrip implementation: |
194 | 198 |
195 void TabStrip::PrepareForCloseAt(int model_index) { | 199 void TabStrip::PrepareForCloseAt(int model_index) { |
196 if (!in_tab_close_ && IsAnimating()) { | 200 if (!in_tab_close_ && IsAnimating()) { |
197 // Cancel any current animations. We do this as remove uses the current | 201 // Cancel any current animations. We do this as remove uses the current |
198 // ideal bounds and we need to know ideal bounds is in a good state. | 202 // ideal bounds and we need to know ideal bounds is in a good state. |
199 StopAnimating(true); | 203 StopAnimating(true); |
200 } | 204 } |
201 | 205 |
(...skipping 826 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1028 } | 1032 } |
1029 return mini_count; | 1033 return mini_count; |
1030 } | 1034 } |
1031 | 1035 |
1032 bool TabStrip::IsPointInTab(Tab* tab, | 1036 bool TabStrip::IsPointInTab(Tab* tab, |
1033 const gfx::Point& point_in_tabstrip_coords) { | 1037 const gfx::Point& point_in_tabstrip_coords) { |
1034 gfx::Point point_in_tab_coords(point_in_tabstrip_coords); | 1038 gfx::Point point_in_tab_coords(point_in_tabstrip_coords); |
1035 View::ConvertPointToView(this, tab, &point_in_tab_coords); | 1039 View::ConvertPointToView(this, tab, &point_in_tab_coords); |
1036 return tab->HitTest(point_in_tab_coords); | 1040 return tab->HitTest(point_in_tab_coords); |
1037 } | 1041 } |
OLD | NEW |