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/widget/desktop_aura/desktop_drag_drop_client_aurax11.h" | 5 #include "ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <X11/Xatom.h> | 9 #include <X11/Xatom.h> |
10 | 10 |
(...skipping 1168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1179 } | 1179 } |
1180 | 1180 |
1181 void DesktopDragDropClientAuraX11::CreateDragWidget( | 1181 void DesktopDragDropClientAuraX11::CreateDragWidget( |
1182 const gfx::ImageSkia& image) { | 1182 const gfx::ImageSkia& image) { |
1183 Widget* widget = new Widget; | 1183 Widget* widget = new Widget; |
1184 Widget::InitParams params(Widget::InitParams::TYPE_DRAG); | 1184 Widget::InitParams params(Widget::InitParams::TYPE_DRAG); |
1185 params.opacity = Widget::InitParams::OPAQUE_WINDOW; | 1185 params.opacity = Widget::InitParams::OPAQUE_WINDOW; |
1186 params.ownership = Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; | 1186 params.ownership = Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; |
1187 params.accept_events = false; | 1187 params.accept_events = false; |
1188 | 1188 |
1189 gfx::Point location = gfx::Screen::GetNativeScreen()->GetCursorScreenPoint() - | 1189 gfx::Point location = |
1190 drag_widget_offset_; | 1190 gfx::Screen::GetScreen()->GetCursorScreenPoint() - drag_widget_offset_; |
1191 params.bounds = gfx::Rect(location, image.size()); | 1191 params.bounds = gfx::Rect(location, image.size()); |
1192 widget->set_focus_on_creation(false); | 1192 widget->set_focus_on_creation(false); |
1193 widget->set_frame_type(Widget::FRAME_TYPE_FORCE_NATIVE); | 1193 widget->set_frame_type(Widget::FRAME_TYPE_FORCE_NATIVE); |
1194 widget->Init(params); | 1194 widget->Init(params); |
1195 widget->SetOpacity(kDragWidgetOpacity); | 1195 widget->SetOpacity(kDragWidgetOpacity); |
1196 widget->GetNativeWindow()->SetName("DragWindow"); | 1196 widget->GetNativeWindow()->SetName("DragWindow"); |
1197 | 1197 |
1198 ImageView* image_view = new ImageView(); | 1198 ImageView* image_view = new ImageView(); |
1199 image_view->SetImage(image); | 1199 image_view->SetImage(image); |
1200 image_view->SetBounds(0, 0, image.width(), image.height()); | 1200 image_view->SetBounds(0, 0, image.width(), image.height()); |
(...skipping 20 matching lines...) Expand all Loading... |
1221 for (int x = 0; x < in_bitmap->width(); ++x) { | 1221 for (int x = 0; x < in_bitmap->width(); ++x) { |
1222 if (SkColorGetA(in_row[x]) > kMinAlpha) | 1222 if (SkColorGetA(in_row[x]) > kMinAlpha) |
1223 return true; | 1223 return true; |
1224 } | 1224 } |
1225 } | 1225 } |
1226 | 1226 |
1227 return false; | 1227 return false; |
1228 } | 1228 } |
1229 | 1229 |
1230 } // namespace views | 1230 } // namespace views |
OLD | NEW |