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

Unified Diff: ui/views/bubble/tray_bubble_view.cc

Issue 11836003: Allow message center and related bubbles to render on Windows. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Move comment and early return instead of big blocks. Created 7 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/message_center/quiet_mode_bubble.cc ('k') | ui/views/controls/slide_out_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/bubble/tray_bubble_view.cc
diff --git a/ui/views/bubble/tray_bubble_view.cc b/ui/views/bubble/tray_bubble_view.cc
index 256c8afcba66046f26ac9369bd609c255054ab00..f1dfbc1fbbbe622552a493ee13f4da12a2c7eb7c 100644
--- a/ui/views/bubble/tray_bubble_view.cc
+++ b/ui/views/bubble/tray_bubble_view.cc
@@ -275,13 +275,14 @@ TrayBubbleView::TrayBubbleView(gfx::NativeView parent_window,
set_notify_enter_exit_on_child(true);
set_close_on_deactivate(init_params.close_on_deactivate);
set_margins(gfx::Insets());
- SetPaintToLayer(true);
- SetFillsBoundsOpaquely(true);
-
bubble_border_ = new TrayBubbleBorder(this, anchor_view(), params_);
+ if (get_use_acceleration_when_possible()) {
+ SetPaintToLayer(true);
+ SetFillsBoundsOpaquely(true);
- bubble_content_mask_.reset(
- new TrayBubbleContentMask(bubble_border_->GetBorderCornerRadius() - 1));
+ bubble_content_mask_.reset(
+ new TrayBubbleContentMask(bubble_border_->GetBorderCornerRadius() - 1));
+ }
}
TrayBubbleView::~TrayBubbleView() {
@@ -295,7 +296,8 @@ void TrayBubbleView::InitializeAndShowBubble() {
SetAlignment(views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE);
bubble_border_->UpdateArrowOffset();
- layer()->parent()->SetMaskLayer(bubble_content_mask_->layer());
+ if (get_use_acceleration_when_possible())
+ layer()->parent()->SetMaskLayer(bubble_content_mask_->layer());
Show();
UpdateBubble();
@@ -303,7 +305,8 @@ void TrayBubbleView::InitializeAndShowBubble() {
void TrayBubbleView::UpdateBubble() {
SizeToContents();
- bubble_content_mask_->layer()->SetBounds(layer()->bounds());
+ if (get_use_acceleration_when_possible())
+ bubble_content_mask_->layer()->SetBounds(layer()->bounds());
GetWidget()->GetRootView()->SchedulePaint();
}
@@ -403,7 +406,7 @@ void TrayBubbleView::ChildPreferredSizeChanged(View* child) {
void TrayBubbleView::ViewHierarchyChanged(bool is_add,
views::View* parent,
views::View* child) {
- if (is_add && child == this) {
+ if (get_use_acceleration_when_possible() && is_add && child == this) {
parent->SetPaintToLayer(true);
parent->SetFillsBoundsOpaquely(true);
parent->layer()->SetMasksToBounds(true);
« no previous file with comments | « ui/message_center/quiet_mode_bubble.cc ('k') | ui/views/controls/slide_out_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698