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

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

Issue 788883004: Not counting nested loops as time spent in a task (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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 | « ui/gfx/win/hwnd_util.cc ('k') | ui/views/win/hwnd_message_handler.cc » ('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 "ui/views/widget/desktop_aura/desktop_drag_drop_client_win.h" 5 #include "ui/views/widget/desktop_aura/desktop_drag_drop_client_win.h"
6 6
7 #include "base/tracked_objects.h"
7 #include "ui/base/dragdrop/drag_drop_types.h" 8 #include "ui/base/dragdrop/drag_drop_types.h"
8 #include "ui/base/dragdrop/drag_source_win.h" 9 #include "ui/base/dragdrop/drag_source_win.h"
9 #include "ui/base/dragdrop/drop_target_event.h" 10 #include "ui/base/dragdrop/drop_target_event.h"
10 #include "ui/base/dragdrop/os_exchange_data_provider_win.h" 11 #include "ui/base/dragdrop/os_exchange_data_provider_win.h"
11 #include "ui/views/widget/desktop_aura/desktop_drop_target_win.h" 12 #include "ui/views/widget/desktop_aura/desktop_drop_target_win.h"
12 #include "ui/views/widget/desktop_aura/desktop_window_tree_host_win.h" 13 #include "ui/views/widget/desktop_aura/desktop_window_tree_host_win.h"
13 14
14 namespace views { 15 namespace views {
15 16
16 DesktopDragDropClientWin::DesktopDragDropClientWin( 17 DesktopDragDropClientWin::DesktopDragDropClientWin(
(...skipping 12 matching lines...) Expand all
29 aura::Window* root_window, 30 aura::Window* root_window,
30 aura::Window* source_window, 31 aura::Window* source_window,
31 const gfx::Point& root_location, 32 const gfx::Point& root_location,
32 int operation, 33 int operation,
33 ui::DragDropTypes::DragEventSource source) { 34 ui::DragDropTypes::DragEventSource source) {
34 drag_drop_in_progress_ = true; 35 drag_drop_in_progress_ = true;
35 drag_operation_ = operation; 36 drag_operation_ = operation;
36 37
37 drag_source_ = new ui::DragSourceWin; 38 drag_source_ = new ui::DragSourceWin;
38 DWORD effect; 39 DWORD effect;
40
41 // Use task stopwatch to exclude the drag-drop time current task, if any.
42 tracked_objects::TaskStopwatch stopwatch;
43 stopwatch.Start();
39 HRESULT result = DoDragDrop( 44 HRESULT result = DoDragDrop(
40 ui::OSExchangeDataProviderWin::GetIDataObject(data), drag_source_.get(), 45 ui::OSExchangeDataProviderWin::GetIDataObject(data), drag_source_.get(),
41 ui::DragDropTypes::DragOperationToDropEffect(operation), &effect); 46 ui::DragDropTypes::DragOperationToDropEffect(operation), &effect);
47 stopwatch.Stop();
42 48
43 drag_drop_in_progress_ = false; 49 drag_drop_in_progress_ = false;
44 50
45 if (result != DRAGDROP_S_DROP) 51 if (result != DRAGDROP_S_DROP)
46 effect = DROPEFFECT_NONE; 52 effect = DROPEFFECT_NONE;
47 53
48 return ui::DragDropTypes::DropEffectToDragOperation(effect); 54 return ui::DragDropTypes::DropEffectToDragOperation(effect);
49 } 55 }
50 56
51 void DesktopDragDropClientWin::DragUpdate(aura::Window* target, 57 void DesktopDragDropClientWin::DragUpdate(aura::Window* target,
(...skipping 14 matching lines...) Expand all
66 } 72 }
67 73
68 void DesktopDragDropClientWin::OnNativeWidgetDestroying(HWND window) { 74 void DesktopDragDropClientWin::OnNativeWidgetDestroying(HWND window) {
69 if (drop_target_.get()) { 75 if (drop_target_.get()) {
70 RevokeDragDrop(window); 76 RevokeDragDrop(window);
71 drop_target_ = NULL; 77 drop_target_ = NULL;
72 } 78 }
73 } 79 }
74 80
75 } // namespace views 81 } // namespace views
OLDNEW
« no previous file with comments | « ui/gfx/win/hwnd_util.cc ('k') | ui/views/win/hwnd_message_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698