Chromium Code Reviews| 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 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 326 bool multiple_tabs_selected = (!selected_tabs.empty() || | 326 bool multiple_tabs_selected = (!selected_tabs.empty() || |
| 327 tabs_dragging.size() > 1); | 327 tabs_dragging.size() > 1); |
| 328 // Make sure non-active tabs are somewhat transparent. | 328 // Make sure non-active tabs are somewhat transparent. |
| 329 SkPaint paint; | 329 SkPaint paint; |
| 330 // If there are multiple tabs selected, fade non-selected tabs more to make | 330 // If there are multiple tabs selected, fade non-selected tabs more to make |
| 331 // the selected tabs more noticable. | 331 // the selected tabs more noticable. |
| 332 paint.setColor(SkColorSetARGB( | 332 paint.setColor(SkColorSetARGB( |
| 333 multiple_tabs_selected ? 150 : 200, 255, 255, 255)); | 333 multiple_tabs_selected ? 150 : 200, 255, 255, 255)); |
| 334 paint.setXfermodeMode(SkXfermode::kDstIn_Mode); | 334 paint.setXfermodeMode(SkXfermode::kDstIn_Mode); |
| 335 paint.setStyle(SkPaint::kFill_Style); | 335 paint.setStyle(SkPaint::kFill_Style); |
| 336 canvas->DrawRectInt(0, 0, width(), | 336 canvas->DrawRect(gfx::Rect(0, 0, width(), |
| 337 height() - 2, // Visible region that overlaps the toolbar. | 337 height() - 2), // Visible region that overlaps the toolbar. |
|
Peter Kasting
2011/11/05 01:10:10
Nit: I'd hoist this comment above the line as "//
tfarina
2011/11/05 02:23:24
Done.
| |
| 338 paint); | 338 paint); |
| 339 } | 339 } |
| 340 | 340 |
| 341 // Now selected but not active. We don't want these dimmed if using native | 341 // Now selected but not active. We don't want these dimmed if using native |
| 342 // frame, so they're painted after initial pass. | 342 // frame, so they're painted after initial pass. |
| 343 for (size_t i = 0; i < selected_tabs.size(); ++i) | 343 for (size_t i = 0; i < selected_tabs.size(); ++i) |
| 344 selected_tabs[i]->Paint(canvas); | 344 selected_tabs[i]->Paint(canvas); |
| 345 | 345 |
| 346 // Next comes the active tab. | 346 // Next comes the active tab. |
| 347 if (active_tab && !is_dragging) | 347 if (active_tab && !is_dragging) |
| 348 active_tab->Paint(canvas); | 348 active_tab->Paint(canvas); |
| (...skipping 696 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1045 } | 1045 } |
| 1046 return mini_count; | 1046 return mini_count; |
| 1047 } | 1047 } |
| 1048 | 1048 |
| 1049 bool TabStrip::IsPointInTab(Tab* tab, | 1049 bool TabStrip::IsPointInTab(Tab* tab, |
| 1050 const gfx::Point& point_in_tabstrip_coords) { | 1050 const gfx::Point& point_in_tabstrip_coords) { |
| 1051 gfx::Point point_in_tab_coords(point_in_tabstrip_coords); | 1051 gfx::Point point_in_tab_coords(point_in_tabstrip_coords); |
| 1052 View::ConvertPointToView(this, tab, &point_in_tab_coords); | 1052 View::ConvertPointToView(this, tab, &point_in_tab_coords); |
| 1053 return tab->HitTest(point_in_tab_coords); | 1053 return tab->HitTest(point_in_tab_coords); |
| 1054 } | 1054 } |
| OLD | NEW |