| 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 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 owned_bubble_border_(bubble_border_), | 202 owned_bubble_border_(bubble_border_), |
| 203 is_gesture_dragging_(false), | 203 is_gesture_dragging_(false), |
| 204 mouse_actively_entered_(false) { | 204 mouse_actively_entered_(false) { |
| 205 bubble_border_->set_alignment(BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE); | 205 bubble_border_->set_alignment(BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE); |
| 206 bubble_border_->set_paint_arrow(BubbleBorder::PAINT_NONE); | 206 bubble_border_->set_paint_arrow(BubbleBorder::PAINT_NONE); |
| 207 set_can_activate(params_.can_activate); | 207 set_can_activate(params_.can_activate); |
| 208 DCHECK(anchor_widget()); // Computed by BubbleDialogDelegateView(). | 208 DCHECK(anchor_widget()); // Computed by BubbleDialogDelegateView(). |
| 209 set_notify_enter_exit_on_child(true); | 209 set_notify_enter_exit_on_child(true); |
| 210 set_close_on_deactivate(init_params.close_on_deactivate); | 210 set_close_on_deactivate(init_params.close_on_deactivate); |
| 211 set_margins(gfx::Insets()); | 211 set_margins(gfx::Insets()); |
| 212 SetPaintToLayer(true); | 212 SetPaintToLayer(); |
| 213 | 213 |
| 214 bubble_content_mask_.reset( | 214 bubble_content_mask_.reset( |
| 215 new TrayBubbleContentMask(bubble_border_->GetBorderCornerRadius())); | 215 new TrayBubbleContentMask(bubble_border_->GetBorderCornerRadius())); |
| 216 | 216 |
| 217 layout_->SetDefaultFlex(1); | 217 layout_->SetDefaultFlex(1); |
| 218 SetLayoutManager(layout_); | 218 SetLayoutManager(layout_); |
| 219 } | 219 } |
| 220 | 220 |
| 221 TrayBubbleView::~TrayBubbleView() { | 221 TrayBubbleView::~TrayBubbleView() { |
| 222 mouse_watcher_.reset(); | 222 mouse_watcher_.reset(); |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 mouse_watcher_->Stop(); | 371 mouse_watcher_->Stop(); |
| 372 } | 372 } |
| 373 | 373 |
| 374 void TrayBubbleView::ChildPreferredSizeChanged(View* child) { | 374 void TrayBubbleView::ChildPreferredSizeChanged(View* child) { |
| 375 SizeToContents(); | 375 SizeToContents(); |
| 376 } | 376 } |
| 377 | 377 |
| 378 void TrayBubbleView::ViewHierarchyChanged( | 378 void TrayBubbleView::ViewHierarchyChanged( |
| 379 const ViewHierarchyChangedDetails& details) { | 379 const ViewHierarchyChangedDetails& details) { |
| 380 if (details.is_add && details.child == this) { | 380 if (details.is_add && details.child == this) { |
| 381 details.parent->SetPaintToLayer(true); | 381 details.parent->SetPaintToLayer(); |
| 382 details.parent->layer()->SetMasksToBounds(true); | 382 details.parent->layer()->SetMasksToBounds(true); |
| 383 } | 383 } |
| 384 } | 384 } |
| 385 | 385 |
| 386 } // namespace views | 386 } // namespace views |
| OLD | NEW |