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

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

Issue 2044223006: Make toolbar color opaque in browser theme (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make status bubble background color opaque 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 353 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 const char* StatusBubbleViews::StatusView::GetClassName() const { 364 const char* StatusBubbleViews::StatusView::GetClassName() const {
365 return "StatusBubbleViews::StatusView"; 365 return "StatusBubbleViews::StatusView";
366 } 366 }
367 367
368 void StatusBubbleViews::StatusView::OnPaint(gfx::Canvas* canvas) { 368 void StatusBubbleViews::StatusView::OnPaint(gfx::Canvas* canvas) {
369 SkPaint paint; 369 SkPaint paint;
370 paint.setStyle(SkPaint::kFill_Style); 370 paint.setStyle(SkPaint::kFill_Style);
371 paint.setAntiAlias(true); 371 paint.setAntiAlias(true);
372 SkColor toolbar_color = theme_provider_->GetColor( 372 SkColor toolbar_color = theme_provider_->GetColor(
373 ThemeProperties::COLOR_TOOLBAR); 373 ThemeProperties::COLOR_TOOLBAR);
374 paint.setColor(toolbar_color); 374 // The status bubble is intentionally set to ignore the alpha value of
375 // toolbar_color, see crbug.com/618278. A partly transparent color with
376 // subpixel rendering of the text may result in weird font in the status
377 // bubble.
Peter Kasting 2016/06/22 05:02:30 Changing things here only fixes the status bubble.
378 paint.setColor(SkColorSetARGB(SK_AlphaOPAQUE, SkColorGetR(toolbar_color),
379 SkColorGetG(toolbar_color),
380 SkColorGetB(toolbar_color)));
375 381
376 gfx::Rect popup_bounds = popup_->GetWindowBoundsInScreen(); 382 gfx::Rect popup_bounds = popup_->GetWindowBoundsInScreen();
377 383
378 SkScalar rad[8] = {}; 384 SkScalar rad[8] = {};
379 385
380 // Top Edges - if the bubble is in its bottom position (sticking downwards), 386 // Top Edges - if the bubble is in its bottom position (sticking downwards),
381 // then we square the top edges. Otherwise, we square the edges based on the 387 // then we square the top edges. Otherwise, we square the edges based on the
382 // position of the bubble within the window (the bubble is positioned in the 388 // position of the bubble within the window (the bubble is positioned in the
383 // southeast corner in RTL and in the southwest corner in LTR). 389 // southeast corner in RTL and in the southwest corner in LTR).
384 if (style_ != STYLE_BOTTOM) { 390 if (style_ != STYLE_BOTTOM) {
(...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after
901 void StatusBubbleViews::SetBubbleWidth(int width) { 907 void StatusBubbleViews::SetBubbleWidth(int width) {
902 size_.set_width(width); 908 size_.set_width(width);
903 SetBounds(original_position_.x(), original_position_.y(), 909 SetBounds(original_position_.x(), original_position_.y(),
904 size_.width(), size_.height()); 910 size_.width(), size_.height());
905 } 911 }
906 912
907 void StatusBubbleViews::CancelExpandTimer() { 913 void StatusBubbleViews::CancelExpandTimer() {
908 if (expand_timer_factory_.HasWeakPtrs()) 914 if (expand_timer_factory_.HasWeakPtrs())
909 expand_timer_factory_.InvalidateWeakPtrs(); 915 expand_timer_factory_.InvalidateWeakPtrs();
910 } 916 }
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