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 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 bool multiple_tabs_selected = (!selected_tabs.empty() || | 327 bool multiple_tabs_selected = (!selected_tabs.empty() || |
328 tabs_dragging.size() > 1); | 328 tabs_dragging.size() > 1); |
329 // Make sure non-active tabs are somewhat transparent. | 329 // Make sure non-active tabs are somewhat transparent. |
330 SkPaint paint; | 330 SkPaint paint; |
331 // If there are multiple tabs selected, fade non-selected tabs more to make | 331 // If there are multiple tabs selected, fade non-selected tabs more to make |
332 // the selected tabs more noticable. | 332 // the selected tabs more noticable. |
333 paint.setColor(SkColorSetARGB( | 333 paint.setColor(SkColorSetARGB( |
334 multiple_tabs_selected ? 150 : 200, 255, 255, 255)); | 334 multiple_tabs_selected ? 150 : 200, 255, 255, 255)); |
335 paint.setXfermodeMode(SkXfermode::kDstIn_Mode); | 335 paint.setXfermodeMode(SkXfermode::kDstIn_Mode); |
336 paint.setStyle(SkPaint::kFill_Style); | 336 paint.setStyle(SkPaint::kFill_Style); |
337 canvas->DrawRectInt(0, 0, width(), | 337 // The tabstrip area overlaps the toolbar area by 2 px. |
338 height() - 2, // Visible region that overlaps the toolbar. | 338 canvas->DrawRect(gfx::Rect(0, 0, width(), height() - 2), paint); |
339 paint); | |
340 } | 339 } |
341 | 340 |
342 // 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 |
343 // frame, so they're painted after initial pass. | 342 // frame, so they're painted after initial pass. |
344 for (size_t i = 0; i < selected_tabs.size(); ++i) | 343 for (size_t i = 0; i < selected_tabs.size(); ++i) |
345 selected_tabs[i]->Paint(canvas); | 344 selected_tabs[i]->Paint(canvas); |
346 | 345 |
347 // Next comes the active tab. | 346 // Next comes the active tab. |
348 if (active_tab && !is_dragging) | 347 if (active_tab && !is_dragging) |
349 active_tab->Paint(canvas); | 348 active_tab->Paint(canvas); |
(...skipping 696 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1046 } | 1045 } |
1047 return mini_count; | 1046 return mini_count; |
1048 } | 1047 } |
1049 | 1048 |
1050 bool TabStrip::IsPointInTab(Tab* tab, | 1049 bool TabStrip::IsPointInTab(Tab* tab, |
1051 const gfx::Point& point_in_tabstrip_coords) { | 1050 const gfx::Point& point_in_tabstrip_coords) { |
1052 gfx::Point point_in_tab_coords(point_in_tabstrip_coords); | 1051 gfx::Point point_in_tab_coords(point_in_tabstrip_coords); |
1053 View::ConvertPointToView(this, tab, &point_in_tab_coords); | 1052 View::ConvertPointToView(this, tab, &point_in_tab_coords); |
1054 return tab->HitTest(point_in_tab_coords); | 1053 return tab->HitTest(point_in_tab_coords); |
1055 } | 1054 } |
OLD | NEW |