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 "ui/views/bubble/tray_bubble_view.h" | 5 #include "ui/views/bubble/tray_bubble_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "third_party/skia/include/core/SkCanvas.h" | 9 #include "third_party/skia/include/core/SkCanvas.h" |
10 #include "third_party/skia/include/core/SkColor.h" | 10 #include "third_party/skia/include/core/SkColor.h" |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 } | 288 } |
289 | 289 |
290 void TrayBubbleView::InitializeAndShowBubble() { | 290 void TrayBubbleView::InitializeAndShowBubble() { |
291 // Must occur after call to BubbleDelegateView::CreateBubble(). | 291 // Must occur after call to BubbleDelegateView::CreateBubble(). |
292 SetAlignment(params_.arrow_alignment); | 292 SetAlignment(params_.arrow_alignment); |
293 bubble_border_->UpdateArrowOffset(); | 293 bubble_border_->UpdateArrowOffset(); |
294 | 294 |
295 if (get_use_acceleration_when_possible()) | 295 if (get_use_acceleration_when_possible()) |
296 layer()->parent()->SetMaskLayer(bubble_content_mask_->layer()); | 296 layer()->parent()->SetMaskLayer(bubble_content_mask_->layer()); |
297 | 297 |
298 Show(); | 298 GetWidget()->Show(); |
299 UpdateBubble(); | 299 UpdateBubble(); |
300 } | 300 } |
301 | 301 |
302 void TrayBubbleView::UpdateBubble() { | 302 void TrayBubbleView::UpdateBubble() { |
303 SizeToContents(); | 303 SizeToContents(); |
304 if (get_use_acceleration_when_possible()) | 304 if (get_use_acceleration_when_possible()) |
305 bubble_content_mask_->layer()->SetBounds(layer()->bounds()); | 305 bubble_content_mask_->layer()->SetBounds(layer()->bounds()); |
306 GetWidget()->GetRootView()->SchedulePaint(); | 306 GetWidget()->GetRootView()->SchedulePaint(); |
307 } | 307 } |
308 | 308 |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
402 View* parent, | 402 View* parent, |
403 View* child) { | 403 View* child) { |
404 if (get_use_acceleration_when_possible() && is_add && child == this) { | 404 if (get_use_acceleration_when_possible() && is_add && child == this) { |
405 parent->SetPaintToLayer(true); | 405 parent->SetPaintToLayer(true); |
406 parent->SetFillsBoundsOpaquely(true); | 406 parent->SetFillsBoundsOpaquely(true); |
407 parent->layer()->SetMasksToBounds(true); | 407 parent->layer()->SetMasksToBounds(true); |
408 } | 408 } |
409 } | 409 } |
410 | 410 |
411 } // namespace views | 411 } // namespace views |
OLD | NEW |