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

Side by Side Diff: content/browser/web_contents/web_contents_view_aura.cc

Issue 2179813003: Allow OSExchangeData::Provider to be overridden at run time. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Mac + win Created 4 years, 4 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
« no previous file with comments | « components/bookmarks/browser/bookmark_node_data_unittest.cc ('k') | ui/base/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "content/browser/web_contents/web_contents_view_aura.h" 5 #include "content/browser/web_contents/web_contents_view_aura.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 #include "ui/aura/window.h" 53 #include "ui/aura/window.h"
54 #include "ui/aura/window_observer.h" 54 #include "ui/aura/window_observer.h"
55 #include "ui/aura/window_tree_host.h" 55 #include "ui/aura/window_tree_host.h"
56 #include "ui/aura/window_tree_host_observer.h" 56 #include "ui/aura/window_tree_host_observer.h"
57 #include "ui/base/clipboard/clipboard.h" 57 #include "ui/base/clipboard/clipboard.h"
58 #include "ui/base/clipboard/custom_data_helper.h" 58 #include "ui/base/clipboard/custom_data_helper.h"
59 #include "ui/base/dragdrop/drag_drop_types.h" 59 #include "ui/base/dragdrop/drag_drop_types.h"
60 #include "ui/base/dragdrop/drag_utils.h" 60 #include "ui/base/dragdrop/drag_utils.h"
61 #include "ui/base/dragdrop/drop_target_event.h" 61 #include "ui/base/dragdrop/drop_target_event.h"
62 #include "ui/base/dragdrop/os_exchange_data.h" 62 #include "ui/base/dragdrop/os_exchange_data.h"
63 #include "ui/base/dragdrop/os_exchange_data_provider_factory.h"
63 #include "ui/base/hit_test.h" 64 #include "ui/base/hit_test.h"
64 #include "ui/compositor/layer.h" 65 #include "ui/compositor/layer.h"
65 #include "ui/display/screen.h" 66 #include "ui/display/screen.h"
66 #include "ui/events/event.h" 67 #include "ui/events/event.h"
67 #include "ui/events/event_utils.h" 68 #include "ui/events/event_utils.h"
68 #include "ui/gfx/canvas.h" 69 #include "ui/gfx/canvas.h"
69 #include "ui/gfx/image/image.h" 70 #include "ui/gfx/image/image.h"
70 #include "ui/gfx/image/image_png_rep.h" 71 #include "ui/gfx/image/image_png_rep.h"
71 #include "ui/gfx/image/image_skia.h" 72 #include "ui/gfx/image/image_skia.h"
72 #include "ui/touch_selection/touch_selection_controller.h" 73 #include "ui/touch_selection/touch_selection_controller.h"
(...skipping 753 matching lines...) Expand 10 before | Expand all | Expand 10 after
826 const DragEventSourceInfo& event_info) { 827 const DragEventSourceInfo& event_info) {
827 aura::Window* root_window = GetNativeView()->GetRootWindow(); 828 aura::Window* root_window = GetNativeView()->GetRootWindow();
828 if (!aura::client::GetDragDropClient(root_window)) { 829 if (!aura::client::GetDragDropClient(root_window)) {
829 web_contents_->SystemDragEnded(); 830 web_contents_->SystemDragEnded();
830 return; 831 return;
831 } 832 }
832 833
833 ui::TouchSelectionController* selection_controller = GetSelectionController(); 834 ui::TouchSelectionController* selection_controller = GetSelectionController();
834 if (selection_controller) 835 if (selection_controller)
835 selection_controller->HideAndDisallowShowingAutomatically(); 836 selection_controller->HideAndDisallowShowingAutomatically();
836 ui::OSExchangeData::Provider* provider = ui::OSExchangeData::CreateProvider(); 837 std::unique_ptr<ui::OSExchangeData::Provider> provider =
837 PrepareDragData(drop_data, provider, web_contents_); 838 ui::OSExchangeDataProviderFactory::CreateProvider();
839 PrepareDragData(drop_data, provider.get(), web_contents_);
838 840
839 ui::OSExchangeData data(provider); // takes ownership of |provider|. 841 ui::OSExchangeData data(
842 std::move(provider)); // takes ownership of |provider|.
840 843
841 if (!image.isNull()) 844 if (!image.isNull())
842 drag_utils::SetDragImageOnDataObject(image, image_offset, &data); 845 drag_utils::SetDragImageOnDataObject(image, image_offset, &data);
843 846
844 std::unique_ptr<WebDragSourceAura> drag_source( 847 std::unique_ptr<WebDragSourceAura> drag_source(
845 new WebDragSourceAura(GetNativeView(), web_contents_)); 848 new WebDragSourceAura(GetNativeView(), web_contents_));
846 849
847 // We need to enable recursive tasks on the message loop so we can get 850 // We need to enable recursive tasks on the message loop so we can get
848 // updates while in the system DoDragDrop loop. 851 // updates while in the system DoDragDrop loop.
849 int result_op = 0; 852 int result_op = 0;
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
1155 bool allow_multiple_selection) { 1158 bool allow_multiple_selection) {
1156 NOTIMPLEMENTED() << " show " << items.size() << " menu items"; 1159 NOTIMPLEMENTED() << " show " << items.size() << " menu items";
1157 } 1160 }
1158 1161
1159 void WebContentsViewAura::HidePopupMenu() { 1162 void WebContentsViewAura::HidePopupMenu() {
1160 NOTIMPLEMENTED(); 1163 NOTIMPLEMENTED();
1161 } 1164 }
1162 #endif 1165 #endif
1163 1166
1164 } // namespace content 1167 } // namespace content
OLDNEW
« no previous file with comments | « components/bookmarks/browser/bookmark_node_data_unittest.cc ('k') | ui/base/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698