Chromium Code Reviews| 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 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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 // 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/29 23:25:36
This comment is no longer necessary.
sunxd
2016/07/01 20:58:06
Done.
| |
| 374 paint.setColor(toolbar_color); | 378 paint.setColor(toolbar_color); |
| 375 | 379 |
| 376 gfx::Rect popup_bounds = popup_->GetWindowBoundsInScreen(); | 380 gfx::Rect popup_bounds = popup_->GetWindowBoundsInScreen(); |
| 377 | 381 |
| 378 SkScalar rad[8] = {}; | 382 SkScalar rad[8] = {}; |
| 379 | 383 |
| 380 // Top Edges - if the bubble is in its bottom position (sticking downwards), | 384 // 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 | 385 // 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 | 386 // 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). | 387 // southeast corner in RTL and in the southwest corner in LTR). |
| (...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 901 void StatusBubbleViews::SetBubbleWidth(int width) { | 905 void StatusBubbleViews::SetBubbleWidth(int width) { |
| 902 size_.set_width(width); | 906 size_.set_width(width); |
| 903 SetBounds(original_position_.x(), original_position_.y(), | 907 SetBounds(original_position_.x(), original_position_.y(), |
| 904 size_.width(), size_.height()); | 908 size_.width(), size_.height()); |
| 905 } | 909 } |
| 906 | 910 |
| 907 void StatusBubbleViews::CancelExpandTimer() { | 911 void StatusBubbleViews::CancelExpandTimer() { |
| 908 if (expand_timer_factory_.HasWeakPtrs()) | 912 if (expand_timer_factory_.HasWeakPtrs()) |
| 909 expand_timer_factory_.InvalidateWeakPtrs(); | 913 expand_timer_factory_.InvalidateWeakPtrs(); |
| 910 } | 914 } |
| OLD | NEW |