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 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 } else if (!tab->IsActive()) { | 292 } else if (!tab->IsActive()) { |
293 if (!tab->IsSelected()) | 293 if (!tab->IsSelected()) |
294 tab->Paint(canvas); | 294 tab->Paint(canvas); |
295 else | 295 else |
296 selected_tabs.push_back(tab); | 296 selected_tabs.push_back(tab); |
297 } else { | 297 } else { |
298 active_tab = tab; | 298 active_tab = tab; |
299 } | 299 } |
300 } | 300 } |
301 | 301 |
302 if (GetWindow()->ShouldUseNativeFrame()) { | 302 if (GetWidget()->ShouldUseNativeFrame()) { |
303 bool multiple_tabs_selected = (!selected_tabs.empty() || | 303 bool multiple_tabs_selected = (!selected_tabs.empty() || |
304 tabs_dragging.size() > 1); | 304 tabs_dragging.size() > 1); |
305 // Make sure non-active tabs are somewhat transparent. | 305 // Make sure non-active tabs are somewhat transparent. |
306 SkPaint paint; | 306 SkPaint paint; |
307 // If there are multiple tabs selected, fade non-selected tabs more to make | 307 // If there are multiple tabs selected, fade non-selected tabs more to make |
308 // the selected tabs more noticable. | 308 // the selected tabs more noticable. |
309 paint.setColor(SkColorSetARGB( | 309 paint.setColor(SkColorSetARGB( |
310 multiple_tabs_selected ? 150 : 200, 255, 255, 255)); | 310 multiple_tabs_selected ? 150 : 200, 255, 255, 255)); |
311 paint.setXfermodeMode(SkXfermode::kDstIn_Mode); | 311 paint.setXfermodeMode(SkXfermode::kDstIn_Mode); |
312 paint.setStyle(SkPaint::kFill_Style); | 312 paint.setStyle(SkPaint::kFill_Style); |
(...skipping 686 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 |