| 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/status_bubble_views.h" | 5 #include "chrome/browser/ui/views/status_bubble_views.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/i18n/rtl.h" | 10 #include "base/i18n/rtl.h" |
| (...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 433 std::min(gfx::GetStringWidth(text_, font_list), | 433 std::min(gfx::GetStringWidth(text_, font_list), |
| 434 width - shadow_size - kTextPositionX - kTextHorizPadding); | 434 width - shadow_size - kTextPositionX - kTextHorizPadding); |
| 435 int text_height = height - shadow_size; | 435 int text_height = height - shadow_size; |
| 436 gfx::Rect text_bounds(kShadowThickness + kTextPositionX, | 436 gfx::Rect text_bounds(kShadowThickness + kTextPositionX, |
| 437 kShadowThickness, | 437 kShadowThickness, |
| 438 std::max(0, text_width), | 438 std::max(0, text_width), |
| 439 std::max(0, text_height)); | 439 std::max(0, text_height)); |
| 440 // Make sure the text is aligned to the right on RTL UIs. | 440 // Make sure the text is aligned to the right on RTL UIs. |
| 441 text_bounds.set_x(GetMirroredXForRect(text_bounds)); | 441 text_bounds.set_x(GetMirroredXForRect(text_bounds)); |
| 442 | 442 |
| 443 // Text color is the foreground tab text color at 50% alpha. | 443 // Text color is the foreground tab text color at 60% alpha. |
| 444 SkColor text_color = | 444 SkColor text_color = color_utils::AlphaBlend( |
| 445 theme_provider_->GetColor(ThemeProperties::COLOR_TAB_TEXT); | 445 theme_provider_->GetColor(ThemeProperties::COLOR_TAB_TEXT), toolbar_color, |
| 446 canvas->DrawStringRect(text_, font_list, | 446 0x99); |
| 447 SkColorSetA(text_color, SkColorGetA(text_color) / 2), | 447 canvas->DrawStringRect( |
| 448 text_bounds); | 448 text_, font_list, |
| 449 color_utils::GetReadableColor(text_color, toolbar_color), text_bounds); |
| 449 } | 450 } |
| 450 | 451 |
| 451 | 452 |
| 452 // StatusBubbleViews::StatusViewAnimation -------------------------------------- | 453 // StatusBubbleViews::StatusViewAnimation -------------------------------------- |
| 453 | 454 |
| 454 StatusBubbleViews::StatusViewAnimation::StatusViewAnimation( | 455 StatusBubbleViews::StatusViewAnimation::StatusViewAnimation( |
| 455 StatusView* status_view, | 456 StatusView* status_view, |
| 456 float opacity_start, | 457 float opacity_start, |
| 457 float opacity_end) | 458 float opacity_end) |
| 458 : gfx::LinearAnimation(kFramerate, this), | 459 : gfx::LinearAnimation(kFramerate, this), |
| (...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 900 void StatusBubbleViews::SetBubbleWidth(int width) { | 901 void StatusBubbleViews::SetBubbleWidth(int width) { |
| 901 size_.set_width(width); | 902 size_.set_width(width); |
| 902 SetBounds(original_position_.x(), original_position_.y(), | 903 SetBounds(original_position_.x(), original_position_.y(), |
| 903 size_.width(), size_.height()); | 904 size_.width(), size_.height()); |
| 904 } | 905 } |
| 905 | 906 |
| 906 void StatusBubbleViews::CancelExpandTimer() { | 907 void StatusBubbleViews::CancelExpandTimer() { |
| 907 if (expand_timer_factory_.HasWeakPtrs()) | 908 if (expand_timer_factory_.HasWeakPtrs()) |
| 908 expand_timer_factory_.InvalidateWeakPtrs(); | 909 expand_timer_factory_.InvalidateWeakPtrs(); |
| 909 } | 910 } |
| OLD | NEW |