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.h" | 5 #include "chrome/browser/ui/views/tabs/tab.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "chrome/browser/defaults.h" | 10 #include "chrome/browser/defaults.h" |
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 } else { | 352 } else { |
353 if (mini_title_animation_.get() && mini_title_animation_->is_animating()) | 353 if (mini_title_animation_.get() && mini_title_animation_->is_animating()) |
354 PaintInactiveTabBackgroundWithTitleChange(canvas); | 354 PaintInactiveTabBackgroundWithTitleChange(canvas); |
355 else | 355 else |
356 PaintInactiveTabBackground(canvas); | 356 PaintInactiveTabBackground(canvas); |
357 | 357 |
358 double throb_value = GetThrobValue(); | 358 double throb_value = GetThrobValue(); |
359 if (throb_value > 0) { | 359 if (throb_value > 0) { |
360 canvas->SaveLayerAlpha(static_cast<int>(throb_value * 0xff), | 360 canvas->SaveLayerAlpha(static_cast<int>(throb_value * 0xff), |
361 gfx::Rect(width(), height())); | 361 gfx::Rect(width(), height())); |
362 canvas->AsCanvasSkia()->drawARGB(0, 255, 255, 255, | 362 canvas->GetSkCanvas()->drawARGB(0, 255, 255, 255, |
363 SkXfermode::kClear_Mode); | 363 SkXfermode::kClear_Mode); |
364 PaintActiveTabBackground(canvas); | 364 PaintActiveTabBackground(canvas); |
365 canvas->Restore(); | 365 canvas->Restore(); |
366 } | 366 } |
367 } | 367 } |
368 } | 368 } |
369 | 369 |
370 void Tab::PaintInactiveTabBackgroundWithTitleChange(gfx::Canvas* canvas) { | 370 void Tab::PaintInactiveTabBackgroundWithTitleChange(gfx::Canvas* canvas) { |
371 // Render the inactive tab background. We'll use this for clipping. | 371 // Render the inactive tab background. We'll use this for clipping. |
372 gfx::CanvasSkia background_canvas(width(), height(), false); | 372 gfx::CanvasSkia background_canvas(width(), height(), false); |
373 PaintInactiveTabBackground(&background_canvas); | 373 PaintInactiveTabBackground(&background_canvas); |
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
655 tab_active_.image_r = rb.GetBitmapNamed(IDR_TAB_ACTIVE_RIGHT); | 655 tab_active_.image_r = rb.GetBitmapNamed(IDR_TAB_ACTIVE_RIGHT); |
656 tab_active_.l_width = tab_active_.image_l->width(); | 656 tab_active_.l_width = tab_active_.image_l->width(); |
657 tab_active_.r_width = tab_active_.image_r->width(); | 657 tab_active_.r_width = tab_active_.image_r->width(); |
658 | 658 |
659 tab_inactive_.image_l = rb.GetBitmapNamed(IDR_TAB_INACTIVE_LEFT); | 659 tab_inactive_.image_l = rb.GetBitmapNamed(IDR_TAB_INACTIVE_LEFT); |
660 tab_inactive_.image_c = rb.GetBitmapNamed(IDR_TAB_INACTIVE_CENTER); | 660 tab_inactive_.image_c = rb.GetBitmapNamed(IDR_TAB_INACTIVE_CENTER); |
661 tab_inactive_.image_r = rb.GetBitmapNamed(IDR_TAB_INACTIVE_RIGHT); | 661 tab_inactive_.image_r = rb.GetBitmapNamed(IDR_TAB_INACTIVE_RIGHT); |
662 tab_inactive_.l_width = tab_inactive_.image_l->width(); | 662 tab_inactive_.l_width = tab_inactive_.image_l->width(); |
663 tab_inactive_.r_width = tab_inactive_.image_r->width(); | 663 tab_inactive_.r_width = tab_inactive_.image_r->width(); |
664 } | 664 } |
OLD | NEW |