| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/views/status_bubble_views.h" | 5 #include "chrome/browser/views/status_bubble_views.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "app/animation.h" | 9 #include "app/animation.h" |
| 10 #include "app/l10n_util.h" | 10 #include "app/l10n_util.h" |
| (...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 424 width - (kShadowThickness * 2) - kTextPositionX - kTextHorizPadding); | 424 width - (kShadowThickness * 2) - kTextPositionX - kTextHorizPadding); |
| 425 int text_height = height - (kShadowThickness * 2); | 425 int text_height = height - (kShadowThickness * 2); |
| 426 gfx::Rect body_bounds(kShadowThickness + kTextPositionX, | 426 gfx::Rect body_bounds(kShadowThickness + kTextPositionX, |
| 427 kShadowThickness, | 427 kShadowThickness, |
| 428 std::max(0, text_width), | 428 std::max(0, text_width), |
| 429 std::max(0, text_height)); | 429 std::max(0, text_height)); |
| 430 body_bounds.set_x(MirroredLeftPointForRect(body_bounds)); | 430 body_bounds.set_x(MirroredLeftPointForRect(body_bounds)); |
| 431 SkColor text_color = | 431 SkColor text_color = |
| 432 theme_provider_->GetColor(BrowserThemeProvider::COLOR_TAB_TEXT); | 432 theme_provider_->GetColor(BrowserThemeProvider::COLOR_TAB_TEXT); |
| 433 | 433 |
| 434 // DrawStringInt doesn't handle alpha, so we'll do the blending ourselves. | 434 // Make text half transparent. |
| 435 text_color = SkColorSetARGB( | 435 #if defined(OS_WIN) |
| 436 SkColorGetA(text_color), | 436 // DrawStringInt doesn't handle alpha on windows, |
| 437 // so we'll do the blending ourselves. |
| 438 text_color = SkColorSetRGB( |
| 437 (SkColorGetR(text_color) + SkColorGetR(toolbar_color)) / 2, | 439 (SkColorGetR(text_color) + SkColorGetR(toolbar_color)) / 2, |
| 438 (SkColorGetG(text_color) + SkColorGetR(toolbar_color)) / 2, | 440 (SkColorGetG(text_color) + SkColorGetR(toolbar_color)) / 2, |
| 439 (SkColorGetB(text_color) + SkColorGetR(toolbar_color)) / 2); | 441 (SkColorGetB(text_color) + SkColorGetR(toolbar_color)) / 2); |
| 442 #else |
| 443 text_color = SkColorSetA(text_color, 127); |
| 444 #endif |
| 445 |
| 440 canvas->DrawStringInt(text_, | 446 canvas->DrawStringInt(text_, |
| 441 views::Label::font(), | 447 views::Label::font(), |
| 442 text_color, | 448 text_color, |
| 443 body_bounds.x(), | 449 body_bounds.x(), |
| 444 body_bounds.y(), | 450 body_bounds.y(), |
| 445 body_bounds.width(), | 451 body_bounds.width(), |
| 446 body_bounds.height()); | 452 body_bounds.height()); |
| 447 } | 453 } |
| 448 | 454 |
| 449 // StatusBubble --------------------------------------------------------------- | 455 // StatusBubble --------------------------------------------------------------- |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 679 } | 685 } |
| 680 } | 686 } |
| 681 | 687 |
| 682 bool StatusBubbleViews::IsFrameVisible() { | 688 bool StatusBubbleViews::IsFrameVisible() { |
| 683 if (!frame_->IsVisible()) | 689 if (!frame_->IsVisible()) |
| 684 return false; | 690 return false; |
| 685 | 691 |
| 686 views::Window* window = frame_->GetWindow(); | 692 views::Window* window = frame_->GetWindow(); |
| 687 return !window || !window->IsMinimized(); | 693 return !window || !window->IsMinimized(); |
| 688 } | 694 } |
| OLD | NEW |