| 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 "ash/drag_drop/drag_image_view.h" | 5 #include "ash/drag_drop/drag_image_view.h" |
| 6 | 6 |
| 7 #include "grit/ui_resources.h" | 7 #include "grit/ui_resources.h" |
| 8 #include "skia/ext/image_operations.h" | 8 #include "skia/ext/image_operations.h" |
| 9 #include "ui/aura/window.h" | 9 #include "ui/aura/window.h" |
| 10 #include "ui/base/resource/resource_bundle.h" | 10 #include "ui/base/resource/resource_bundle.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 params.type = Widget::InitParams::TYPE_TOOLTIP; | 26 params.type = Widget::InitParams::TYPE_TOOLTIP; |
| 27 params.keep_on_top = true; | 27 params.keep_on_top = true; |
| 28 params.context = context; | 28 params.context = context; |
| 29 params.accept_events = false; | 29 params.accept_events = false; |
| 30 params.ownership = Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; | 30 params.ownership = Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; |
| 31 params.opacity = Widget::InitParams::TRANSLUCENT_WINDOW; | 31 params.opacity = Widget::InitParams::TRANSLUCENT_WINDOW; |
| 32 drag_widget->Init(params); | 32 drag_widget->Init(params); |
| 33 drag_widget->SetOpacity(0xFF); | 33 drag_widget->SetOpacity(0xFF); |
| 34 drag_widget->GetNativeWindow()->set_owned_by_parent(false); | 34 drag_widget->GetNativeWindow()->set_owned_by_parent(false); |
| 35 drag_widget->GetNativeWindow()->SetName("DragWidget"); | 35 drag_widget->GetNativeWindow()->SetName("DragWidget"); |
| 36 SetShadowType(drag_widget->GetNativeView(), views::corewm::SHADOW_TYPE_NONE); | 36 SetShadowType(drag_widget->GetNativeView(), wm::SHADOW_TYPE_NONE); |
| 37 return drag_widget; | 37 return drag_widget; |
| 38 } | 38 } |
| 39 } | 39 } |
| 40 | 40 |
| 41 DragImageView::DragImageView(gfx::NativeView context, | 41 DragImageView::DragImageView(gfx::NativeView context, |
| 42 ui::DragDropTypes::DragEventSource event_source) | 42 ui::DragDropTypes::DragEventSource event_source) |
| 43 : views::ImageView(), | 43 : views::ImageView(), |
| 44 drag_event_source_(event_source), | 44 drag_event_source_(event_source), |
| 45 touch_drag_operation_(ui::DragDropTypes::DRAG_NONE) { | 45 touch_drag_operation_(ui::DragDropTypes::DRAG_NONE) { |
| 46 widget_.reset(CreateDragWidget(context)); | 46 widget_.reset(CreateDragWidget(context)); |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 drag_hint_bounds.AdjustToFit(gfx::Rect(widget_size_)); | 166 drag_hint_bounds.AdjustToFit(gfx::Rect(widget_size_)); |
| 167 | 167 |
| 168 // Draw image. | 168 // Draw image. |
| 169 canvas->DrawImageInt(*(drag_hint->ToImageSkia()), | 169 canvas->DrawImageInt(*(drag_hint->ToImageSkia()), |
| 170 drag_hint_bounds.x(), drag_hint_bounds.y()); | 170 drag_hint_bounds.x(), drag_hint_bounds.y()); |
| 171 } | 171 } |
| 172 } | 172 } |
| 173 | 173 |
| 174 } // namespace internal | 174 } // namespace internal |
| 175 } // namespace ash | 175 } // namespace ash |
| OLD | NEW |