Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(70)

Side by Side Diff: chrome/browser/ui/views/status_bubble_views.cc

Issue 2036443002: Modify status bubble text color. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2743
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 double opacity_start, 457 double opacity_start,
457 double opacity_end) 458 double opacity_end)
458 : gfx::LinearAnimation(kFramerate, this), 459 : gfx::LinearAnimation(kFramerate, this),
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698