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

Side by Side Diff: app/win/drag_source.cc

Issue 6250014: Move more dnd related files to ui/base (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « app/win/drag_source.h ('k') | app/win/drop_target.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "app/win/drag_source.h"
6
7 namespace app {
8 namespace win {
9
10 DragSource::DragSource() : cancel_drag_(false) {
11 }
12
13 HRESULT DragSource::QueryContinueDrag(BOOL escape_pressed, DWORD key_state) {
14 if (cancel_drag_)
15 return DRAGDROP_S_CANCEL;
16
17 if (escape_pressed) {
18 OnDragSourceCancel();
19 return DRAGDROP_S_CANCEL;
20 }
21
22 if (!(key_state & MK_LBUTTON)) {
23 OnDragSourceDrop();
24 return DRAGDROP_S_DROP;
25 }
26
27 OnDragSourceMove();
28 return S_OK;
29 }
30
31 HRESULT DragSource::GiveFeedback(DWORD effect) {
32 return DRAGDROP_S_USEDEFAULTCURSORS;
33 }
34
35 HRESULT DragSource::QueryInterface(const IID& iid, void** object) {
36 *object = NULL;
37 if (IsEqualIID(iid, IID_IUnknown) || IsEqualIID(iid, IID_IDropSource)) {
38 *object = this;
39 } else {
40 return E_NOINTERFACE;
41 }
42 AddRef();
43 return S_OK;
44 }
45
46 ULONG DragSource::AddRef() {
47 base::RefCountedThreadSafe<DragSource>::AddRef();
48 return 0;
49 }
50
51 ULONG DragSource::Release() {
52 base::RefCountedThreadSafe<DragSource>::Release();
53 return 0;
54 }
55
56 } // namespace win
57 } // namespace app
OLDNEW
« no previous file with comments | « app/win/drag_source.h ('k') | app/win/drop_target.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698