Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(53)

Side by Side Diff: ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11.cc

Issue 1915363002: Rename gfx::Display/Screen to display::Display/Screen in views/wm (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more cleanups Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <X11/Xatom.h> 7 #include <X11/Xatom.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
11 #include "base/event_types.h" 11 #include "base/event_types.h"
12 #include "base/lazy_instance.h" 12 #include "base/lazy_instance.h"
13 #include "base/macros.h" 13 #include "base/macros.h"
14 #include "base/memory/ptr_util.h" 14 #include "base/memory/ptr_util.h"
15 #include "base/message_loop/message_loop.h" 15 #include "base/message_loop/message_loop.h"
16 #include "base/metrics/histogram_macros.h" 16 #include "base/metrics/histogram_macros.h"
17 #include "third_party/skia/include/core/SkBitmap.h" 17 #include "third_party/skia/include/core/SkBitmap.h"
18 #include "ui/aura/client/capture_client.h" 18 #include "ui/aura/client/capture_client.h"
19 #include "ui/aura/window.h" 19 #include "ui/aura/window.h"
20 #include "ui/aura/window_tree_host.h" 20 #include "ui/aura/window_tree_host.h"
21 #include "ui/base/clipboard/clipboard.h" 21 #include "ui/base/clipboard/clipboard.h"
22 #include "ui/base/dragdrop/drop_target_event.h" 22 #include "ui/base/dragdrop/drop_target_event.h"
23 #include "ui/base/dragdrop/os_exchange_data.h" 23 #include "ui/base/dragdrop/os_exchange_data.h"
24 #include "ui/base/dragdrop/os_exchange_data_provider_aurax11.h" 24 #include "ui/base/dragdrop/os_exchange_data_provider_aurax11.h"
25 #include "ui/base/x/selection_utils.h" 25 #include "ui/base/x/selection_utils.h"
26 #include "ui/base/x/x11_foreign_window_manager.h" 26 #include "ui/base/x/x11_foreign_window_manager.h"
27 #include "ui/base/x/x11_util.h" 27 #include "ui/base/x/x11_util.h"
28 #include "ui/display/screen.h"
28 #include "ui/events/event.h" 29 #include "ui/events/event.h"
29 #include "ui/events/event_utils.h" 30 #include "ui/events/event_utils.h"
30 #include "ui/events/platform/platform_event_source.h" 31 #include "ui/events/platform/platform_event_source.h"
31 #include "ui/gfx/image/image_skia.h" 32 #include "ui/gfx/image/image_skia.h"
32 #include "ui/gfx/screen.h"
33 #include "ui/views/controls/image_view.h" 33 #include "ui/views/controls/image_view.h"
34 #include "ui/views/widget/desktop_aura/desktop_native_cursor_manager.h" 34 #include "ui/views/widget/desktop_aura/desktop_native_cursor_manager.h"
35 #include "ui/views/widget/desktop_aura/x11_topmost_window_finder.h" 35 #include "ui/views/widget/desktop_aura/x11_topmost_window_finder.h"
36 #include "ui/views/widget/desktop_aura/x11_whole_screen_move_loop.h" 36 #include "ui/views/widget/desktop_aura/x11_whole_screen_move_loop.h"
37 #include "ui/views/widget/widget.h" 37 #include "ui/views/widget/widget.h"
38 #include "ui/wm/public/drag_drop_client.h" 38 #include "ui/wm/public/drag_drop_client.h"
39 #include "ui/wm/public/drag_drop_delegate.h" 39 #include "ui/wm/public/drag_drop_delegate.h"
40 40
41 using aura::client::DragDropDelegate; 41 using aura::client::DragDropDelegate;
42 using ui::OSExchangeData; 42 using ui::OSExchangeData;
(...skipping 1137 matching lines...) Expand 10 before | Expand all | Expand 10 after
1180 } 1180 }
1181 1181
1182 void DesktopDragDropClientAuraX11::CreateDragWidget( 1182 void DesktopDragDropClientAuraX11::CreateDragWidget(
1183 const gfx::ImageSkia& image) { 1183 const gfx::ImageSkia& image) {
1184 Widget* widget = new Widget; 1184 Widget* widget = new Widget;
1185 Widget::InitParams params(Widget::InitParams::TYPE_DRAG); 1185 Widget::InitParams params(Widget::InitParams::TYPE_DRAG);
1186 params.opacity = Widget::InitParams::OPAQUE_WINDOW; 1186 params.opacity = Widget::InitParams::OPAQUE_WINDOW;
1187 params.ownership = Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; 1187 params.ownership = Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET;
1188 params.accept_events = false; 1188 params.accept_events = false;
1189 1189
1190 gfx::Point location = 1190 gfx::Point location = display::Screen::GetScreen()->GetCursorScreenPoint() -
1191 gfx::Screen::GetScreen()->GetCursorScreenPoint() - drag_widget_offset_; 1191 drag_widget_offset_;
1192 params.bounds = gfx::Rect(location, image.size()); 1192 params.bounds = gfx::Rect(location, image.size());
1193 widget->set_focus_on_creation(false); 1193 widget->set_focus_on_creation(false);
1194 widget->set_frame_type(Widget::FRAME_TYPE_FORCE_NATIVE); 1194 widget->set_frame_type(Widget::FRAME_TYPE_FORCE_NATIVE);
1195 widget->Init(params); 1195 widget->Init(params);
1196 widget->SetOpacity(kDragWidgetOpacity); 1196 widget->SetOpacity(kDragWidgetOpacity);
1197 widget->GetNativeWindow()->SetName("DragWindow"); 1197 widget->GetNativeWindow()->SetName("DragWindow");
1198 1198
1199 ImageView* image_view = new ImageView(); 1199 ImageView* image_view = new ImageView();
1200 image_view->SetImage(image); 1200 image_view->SetImage(image);
1201 image_view->SetBounds(0, 0, image.width(), image.height()); 1201 image_view->SetBounds(0, 0, image.width(), image.height());
(...skipping 20 matching lines...) Expand all
1222 for (int x = 0; x < in_bitmap->width(); ++x) { 1222 for (int x = 0; x < in_bitmap->width(); ++x) {
1223 if (SkColorGetA(in_row[x]) > kMinAlpha) 1223 if (SkColorGetA(in_row[x]) > kMinAlpha)
1224 return true; 1224 return true;
1225 } 1225 }
1226 } 1226 }
1227 1227
1228 return false; 1228 return false;
1229 } 1229 }
1230 1230
1231 } // namespace views 1231 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698