| 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 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 } else if (!tab->IsActive()) { | 295 } else if (!tab->IsActive()) { |
| 296 if (!tab->IsSelected()) | 296 if (!tab->IsSelected()) |
| 297 tab->Paint(canvas); | 297 tab->Paint(canvas); |
| 298 else | 298 else |
| 299 selected_tabs.push_back(tab); | 299 selected_tabs.push_back(tab); |
| 300 } else { | 300 } else { |
| 301 active_tab = tab; | 301 active_tab = tab; |
| 302 } | 302 } |
| 303 } | 303 } |
| 304 | 304 |
| 305 if (GetWindow()->ShouldUseNativeFrame()) { | 305 if (GetWindow()->non_client_view()->UseNativeFrame()) { |
| 306 bool multiple_tabs_selected = (!selected_tabs.empty() || | 306 bool multiple_tabs_selected = (!selected_tabs.empty() || |
| 307 tabs_dragging.size() > 1); | 307 tabs_dragging.size() > 1); |
| 308 // Make sure non-active tabs are somewhat transparent. | 308 // Make sure non-active tabs are somewhat transparent. |
| 309 SkPaint paint; | 309 SkPaint paint; |
| 310 // If there are multiple tabs selected, fade non-selected tabs more to make | 310 // If there are multiple tabs selected, fade non-selected tabs more to make |
| 311 // the selected tabs more noticable. | 311 // the selected tabs more noticable. |
| 312 paint.setColor(SkColorSetARGB( | 312 paint.setColor(SkColorSetARGB( |
| 313 multiple_tabs_selected ? 150 : 200, 255, 255, 255)); | 313 multiple_tabs_selected ? 150 : 200, 255, 255, 255)); |
| 314 paint.setXfermodeMode(SkXfermode::kDstIn_Mode); | 314 paint.setXfermodeMode(SkXfermode::kDstIn_Mode); |
| 315 paint.setStyle(SkPaint::kFill_Style); | 315 paint.setStyle(SkPaint::kFill_Style); |
| (...skipping 704 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1020 int TabStrip::GetAvailableWidthForTabs(Tab* last_tab) const { | 1020 int TabStrip::GetAvailableWidthForTabs(Tab* last_tab) const { |
| 1021 return last_tab->x() + last_tab->width(); | 1021 return last_tab->x() + last_tab->width(); |
| 1022 } | 1022 } |
| 1023 | 1023 |
| 1024 bool TabStrip::IsPointInTab(Tab* tab, | 1024 bool TabStrip::IsPointInTab(Tab* tab, |
| 1025 const gfx::Point& point_in_tabstrip_coords) { | 1025 const gfx::Point& point_in_tabstrip_coords) { |
| 1026 gfx::Point point_in_tab_coords(point_in_tabstrip_coords); | 1026 gfx::Point point_in_tab_coords(point_in_tabstrip_coords); |
| 1027 View::ConvertPointToView(this, tab, &point_in_tab_coords); | 1027 View::ConvertPointToView(this, tab, &point_in_tab_coords); |
| 1028 return tab->HitTest(point_in_tab_coords); | 1028 return tab->HitTest(point_in_tab_coords); |
| 1029 } | 1029 } |
| OLD | NEW |