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 "base/macros.h" | 9 #include "base/macros.h" |
10 #include "third_party/skia/include/core/SkCanvas.h" | 10 #include "third_party/skia/include/core/SkCanvas.h" |
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
347 | 347 |
348 void TrayBubbleView::InitializeAndShowBubble() { | 348 void TrayBubbleView::InitializeAndShowBubble() { |
349 // Must occur after call to BubbleDelegateView::CreateBubble(). | 349 // Must occur after call to BubbleDelegateView::CreateBubble(). |
350 SetAlignment(params_.arrow_alignment); | 350 SetAlignment(params_.arrow_alignment); |
351 bubble_border_->UpdateArrowOffset(); | 351 bubble_border_->UpdateArrowOffset(); |
352 | 352 |
353 layer()->parent()->SetMaskLayer(bubble_content_mask_->layer()); | 353 layer()->parent()->SetMaskLayer(bubble_content_mask_->layer()); |
354 | 354 |
355 GetWidget()->Show(); | 355 GetWidget()->Show(); |
356 GetWidget()->GetNativeWindow()->SetEventTargeter( | 356 GetWidget()->GetNativeWindow()->SetEventTargeter( |
357 scoped_ptr<ui::EventTargeter>(new BubbleWindowTargeter(this))); | 357 std::unique_ptr<ui::EventTargeter>(new BubbleWindowTargeter(this))); |
358 UpdateBubble(); | 358 UpdateBubble(); |
359 | 359 |
360 if (params_.close_via_capture) { | 360 if (params_.close_via_capture) { |
361 GetWidget()->set_auto_release_capture(false); | 361 GetWidget()->set_auto_release_capture(false); |
362 // Capture events to this view so it will be notified of capture loss. | 362 // Capture events to this view so it will be notified of capture loss. |
363 GetWidget()->SetCapture(this); | 363 GetWidget()->SetCapture(this); |
364 } | 364 } |
365 } | 365 } |
366 | 366 |
367 void TrayBubbleView::UpdateBubble() { | 367 void TrayBubbleView::UpdateBubble() { |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
528 | 528 |
529 void TrayBubbleView::ViewHierarchyChanged( | 529 void TrayBubbleView::ViewHierarchyChanged( |
530 const ViewHierarchyChangedDetails& details) { | 530 const ViewHierarchyChangedDetails& details) { |
531 if (details.is_add && details.child == this) { | 531 if (details.is_add && details.child == this) { |
532 details.parent->SetPaintToLayer(true); | 532 details.parent->SetPaintToLayer(true); |
533 details.parent->layer()->SetMasksToBounds(true); | 533 details.parent->layer()->SetMasksToBounds(true); |
534 } | 534 } |
535 } | 535 } |
536 | 536 |
537 } // namespace views | 537 } // namespace views |
OLD | NEW |