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/touch/tabs/touch_tab_strip.h" | 5 #include "chrome/browser/ui/touch/tabs/touch_tab_strip.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 | 9 |
10 #include "chrome/browser/ui/touch/tabs/touch_tab.h" | 10 #include "chrome/browser/ui/touch/tabs/touch_tab.h" |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 // removed after its TabContents has been destroyed. | 297 // removed after its TabContents has been destroyed. |
298 if (tab->dragging()) { | 298 if (tab->dragging()) { |
299 dragging_tab = tab; | 299 dragging_tab = tab; |
300 } else if (!tab->IsSelected()) { | 300 } else if (!tab->IsSelected()) { |
301 tab->Paint(canvas); | 301 tab->Paint(canvas); |
302 } else { | 302 } else { |
303 selected_tab = tab; | 303 selected_tab = tab; |
304 } | 304 } |
305 } | 305 } |
306 | 306 |
307 if (GetWindow()->ShouldUseNativeFrame()) { | 307 if (GetWidget()->ShouldUseNativeFrame()) { |
308 // Make sure unselected tabs are somewhat transparent. | 308 // Make sure unselected tabs are somewhat transparent. |
309 SkPaint paint; | 309 SkPaint paint; |
310 paint.setColor(SkColorSetARGB(200, 255, 255, 255)); | 310 paint.setColor(SkColorSetARGB(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); |
313 canvas->DrawRectInt(0, 0, width(), | 313 canvas->DrawRectInt(0, 0, width(), |
314 height() - 2, // Visible region that overlaps the toolbar. | 314 height() - 2, // Visible region that overlaps the toolbar. |
315 paint); | 315 paint); |
316 } | 316 } |
317 | 317 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
353 last_tapped_view_ = view; | 353 last_tapped_view_ = view; |
354 return TOUCH_STATUS_UNKNOWN; | 354 return TOUCH_STATUS_UNKNOWN; |
355 } | 355 } |
356 | 356 |
357 void TouchTabStrip::ViewHierarchyChanged(bool is_add, | 357 void TouchTabStrip::ViewHierarchyChanged(bool is_add, |
358 View* parent, | 358 View* parent, |
359 View* child) { | 359 View* child) { |
360 if (!is_add && last_tapped_view_ == child) | 360 if (!is_add && last_tapped_view_ == child) |
361 last_tapped_view_ = NULL; | 361 last_tapped_view_ = NULL; |
362 } | 362 } |
OLD | NEW |