| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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" |
| 11 #include "chrome/browser/themes/theme_service.h" | 11 #include "chrome/browser/themes/theme_service.h" |
| 12 #include "chrome/browser/ui/tabs/tab_resources.h" | 12 #include "chrome/browser/ui/tabs/tab_resources.h" |
| 13 #include "chrome/browser/ui/views/tabs/tab_controller.h" | 13 #include "chrome/browser/ui/views/tabs/tab_controller.h" |
| 14 #include "grit/generated_resources.h" | 14 #include "grit/generated_resources.h" |
| 15 #include "grit/theme_resources.h" | 15 #include "grit/theme_resources.h" |
| 16 #include "grit/theme_resources_standard.h" | 16 #include "grit/theme_resources_standard.h" |
| 17 #include "grit/ui_resources.h" | 17 #include "grit/ui_resources.h" |
| 18 #include "third_party/skia/include/effects/SkGradientShader.h" | 18 #include "third_party/skia/include/effects/SkGradientShader.h" |
| 19 #include "ui/base/animation/multi_animation.h" | 19 #include "ui/base/animation/multi_animation.h" |
| 20 #include "ui/base/animation/throb_animation.h" | 20 #include "ui/base/animation/throb_animation.h" |
| 21 #include "ui/base/resource/resource_bundle.h" | 21 #include "ui/base/resource/resource_bundle.h" |
| 22 #include "ui/gfx/canvas_skia.h" | 22 #include "ui/gfx/canvas.h" |
| 23 #include "ui/gfx/favicon_size.h" | 23 #include "ui/gfx/favicon_size.h" |
| 24 #include "ui/gfx/font.h" | 24 #include "ui/gfx/font.h" |
| 25 #include "ui/gfx/path.h" | 25 #include "ui/gfx/path.h" |
| 26 #include "ui/gfx/skbitmap_operations.h" | 26 #include "ui/gfx/skbitmap_operations.h" |
| 27 #include "ui/views/controls/button/image_button.h" | 27 #include "ui/views/controls/button/image_button.h" |
| 28 #include "ui/views/touchui/touch_mode_support.h" | 28 #include "ui/views/touchui/touch_mode_support.h" |
| 29 #include "ui/views/widget/tooltip_manager.h" | 29 #include "ui/views/widget/tooltip_manager.h" |
| 30 #include "ui/views/widget/widget.h" | 30 #include "ui/views/widget/widget.h" |
| 31 #include "ui/views/window/non_client_view.h" | 31 #include "ui/views/window/non_client_view.h" |
| 32 | 32 |
| (...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 canvas->GetSkCanvas()->drawARGB(0, 255, 255, 255, | 373 canvas->GetSkCanvas()->drawARGB(0, 255, 255, 255, |
| 374 SkXfermode::kClear_Mode); | 374 SkXfermode::kClear_Mode); |
| 375 PaintActiveTabBackground(canvas); | 375 PaintActiveTabBackground(canvas); |
| 376 canvas->Restore(); | 376 canvas->Restore(); |
| 377 } | 377 } |
| 378 } | 378 } |
| 379 } | 379 } |
| 380 | 380 |
| 381 void Tab::PaintInactiveTabBackgroundWithTitleChange(gfx::Canvas* canvas) { | 381 void Tab::PaintInactiveTabBackgroundWithTitleChange(gfx::Canvas* canvas) { |
| 382 // Render the inactive tab background. We'll use this for clipping. | 382 // Render the inactive tab background. We'll use this for clipping. |
| 383 gfx::CanvasSkia background_canvas(size(), false); | 383 gfx::Canvas background_canvas(size(), false); |
| 384 PaintInactiveTabBackground(&background_canvas); | 384 PaintInactiveTabBackground(&background_canvas); |
| 385 | 385 |
| 386 SkBitmap background_image = background_canvas.ExtractBitmap(); | 386 SkBitmap background_image = background_canvas.ExtractBitmap(); |
| 387 | 387 |
| 388 // Draw a radial gradient to hover_canvas. | 388 // Draw a radial gradient to hover_canvas. |
| 389 gfx::CanvasSkia hover_canvas(size(), false); | 389 gfx::CanvasSkia hover_canvas(size(), false); |
| 390 int radius = kMiniTitleChangeGradientRadius; | 390 int radius = kMiniTitleChangeGradientRadius; |
| 391 int x0 = width() + radius - kMiniTitleChangeInitialXOffset; | 391 int x0 = width() + radius - kMiniTitleChangeInitialXOffset; |
| 392 int x1 = radius; | 392 int x1 = radius; |
| 393 int x2 = -radius; | 393 int x2 = -radius; |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 619 tab_active_.image_r = rb.GetBitmapNamed(IDR_TAB_ACTIVE_RIGHT); | 619 tab_active_.image_r = rb.GetBitmapNamed(IDR_TAB_ACTIVE_RIGHT); |
| 620 tab_active_.l_width = tab_active_.image_l->width(); | 620 tab_active_.l_width = tab_active_.image_l->width(); |
| 621 tab_active_.r_width = tab_active_.image_r->width(); | 621 tab_active_.r_width = tab_active_.image_r->width(); |
| 622 | 622 |
| 623 tab_inactive_.image_l = rb.GetBitmapNamed(IDR_TAB_INACTIVE_LEFT); | 623 tab_inactive_.image_l = rb.GetBitmapNamed(IDR_TAB_INACTIVE_LEFT); |
| 624 tab_inactive_.image_c = rb.GetBitmapNamed(IDR_TAB_INACTIVE_CENTER); | 624 tab_inactive_.image_c = rb.GetBitmapNamed(IDR_TAB_INACTIVE_CENTER); |
| 625 tab_inactive_.image_r = rb.GetBitmapNamed(IDR_TAB_INACTIVE_RIGHT); | 625 tab_inactive_.image_r = rb.GetBitmapNamed(IDR_TAB_INACTIVE_RIGHT); |
| 626 tab_inactive_.l_width = tab_inactive_.image_l->width(); | 626 tab_inactive_.l_width = tab_inactive_.image_l->width(); |
| 627 tab_inactive_.r_width = tab_inactive_.image_r->width(); | 627 tab_inactive_.r_width = tab_inactive_.image_r->width(); |
| 628 } | 628 } |
| OLD | NEW |