| 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 10 matching lines...) Expand all Loading... |
| 21 #include "ui/gfx/canvas.h" | 21 #include "ui/gfx/canvas.h" |
| 22 #include "ui/gfx/color_palette.h" | 22 #include "ui/gfx/color_palette.h" |
| 23 #include "ui/gfx/geometry/insets.h" | 23 #include "ui/gfx/geometry/insets.h" |
| 24 #include "ui/gfx/geometry/rect.h" | 24 #include "ui/gfx/geometry/rect.h" |
| 25 #include "ui/gfx/path.h" | 25 #include "ui/gfx/path.h" |
| 26 #include "ui/gfx/skia_util.h" | 26 #include "ui/gfx/skia_util.h" |
| 27 #include "ui/views/bubble/bubble_frame_view.h" | 27 #include "ui/views/bubble/bubble_frame_view.h" |
| 28 #include "ui/views/bubble/bubble_window_targeter.h" | 28 #include "ui/views/bubble/bubble_window_targeter.h" |
| 29 #include "ui/views/layout/box_layout.h" | 29 #include "ui/views/layout/box_layout.h" |
| 30 #include "ui/views/widget/widget.h" | 30 #include "ui/views/widget/widget.h" |
| 31 #include "ui/wm/core/shadow_types.h" |
| 31 | 32 |
| 32 namespace views { | 33 namespace views { |
| 33 | 34 |
| 34 namespace { | 35 namespace { |
| 35 | 36 |
| 36 // The sampling time for mouse position changes in ms - which is roughly a frame | 37 // The sampling time for mouse position changes in ms - which is roughly a frame |
| 37 // time. | 38 // time. |
| 38 const int kFrameTimeInMS = 30; | 39 const int kFrameTimeInMS = 30; |
| 39 | 40 |
| 40 BubbleBorder::Arrow GetArrowAlignment( | 41 BubbleBorder::Arrow GetArrowAlignment( |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 267 int TrayBubbleView::GetDialogButtons() const { | 268 int TrayBubbleView::GetDialogButtons() const { |
| 268 return ui::DIALOG_BUTTON_NONE; | 269 return ui::DIALOG_BUTTON_NONE; |
| 269 } | 270 } |
| 270 | 271 |
| 271 void TrayBubbleView::OnBeforeBubbleWidgetInit(Widget::InitParams* params, | 272 void TrayBubbleView::OnBeforeBubbleWidgetInit(Widget::InitParams* params, |
| 272 Widget* bubble_widget) const { | 273 Widget* bubble_widget) const { |
| 273 if (delegate_) | 274 if (delegate_) |
| 274 delegate_->OnBeforeBubbleWidgetInit(anchor_widget(), bubble_widget, params); | 275 delegate_->OnBeforeBubbleWidgetInit(anchor_widget(), bubble_widget, params); |
| 275 // Apply a WM-provided shadow (see ui/wm/core/). | 276 // Apply a WM-provided shadow (see ui/wm/core/). |
| 276 params->shadow_type = Widget::InitParams::SHADOW_TYPE_DROP; | 277 params->shadow_type = Widget::InitParams::SHADOW_TYPE_DROP; |
| 278 params->shadow_elevation = static_cast<int>(wm::ShadowElevation::BIG); |
| 277 } | 279 } |
| 278 | 280 |
| 279 NonClientFrameView* TrayBubbleView::CreateNonClientFrameView(Widget* widget) { | 281 NonClientFrameView* TrayBubbleView::CreateNonClientFrameView(Widget* widget) { |
| 280 BubbleFrameView* frame = static_cast<BubbleFrameView*>( | 282 BubbleFrameView* frame = static_cast<BubbleFrameView*>( |
| 281 BubbleDialogDelegateView::CreateNonClientFrameView(widget)); | 283 BubbleDialogDelegateView::CreateNonClientFrameView(widget)); |
| 282 frame->SetBubbleBorder(std::move(owned_bubble_border_)); | 284 frame->SetBubbleBorder(std::move(owned_bubble_border_)); |
| 283 return frame; | 285 return frame; |
| 284 } | 286 } |
| 285 | 287 |
| 286 bool TrayBubbleView::WidgetHasHitTestMask() const { | 288 bool TrayBubbleView::WidgetHasHitTestMask() const { |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 | 377 |
| 376 void TrayBubbleView::ViewHierarchyChanged( | 378 void TrayBubbleView::ViewHierarchyChanged( |
| 377 const ViewHierarchyChangedDetails& details) { | 379 const ViewHierarchyChangedDetails& details) { |
| 378 if (details.is_add && details.child == this) { | 380 if (details.is_add && details.child == this) { |
| 379 details.parent->SetPaintToLayer(true); | 381 details.parent->SetPaintToLayer(true); |
| 380 details.parent->layer()->SetMasksToBounds(true); | 382 details.parent->layer()->SetMasksToBounds(true); |
| 381 } | 383 } |
| 382 } | 384 } |
| 383 | 385 |
| 384 } // namespace views | 386 } // namespace views |
| OLD | NEW |