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

Side by Side Diff: base/base_drag_source.cc

Issue 155548: Merge 20436 - Fix a crash that happens if a tab is closed while... (Closed) Base URL: svn://chrome-svn/chrome/branches/193/src/
Patch Set: Created 11 years, 5 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 | « base/base_drag_source.h ('k') | chrome/browser/tab_contents/tab_contents.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:mergeinfo
Merged /branches/chrome_webkit_merge_branch/base/base_drag_source.cc:r69-2775
Merged /trunk/src/base/base_drag_source.cc:r20436
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 "base/base_drag_source.h" 5 #include "base/base_drag_source.h"
6 6
7 /////////////////////////////////////////////////////////////////////////////// 7 ///////////////////////////////////////////////////////////////////////////////
8 // BaseDragSource, public: 8 // BaseDragSource, public:
9 9
10 BaseDragSource::BaseDragSource() : ref_count_(0) { 10 BaseDragSource::BaseDragSource() : ref_count_(0), cancel_drag_(false) {
11 } 11 }
12 12
13 /////////////////////////////////////////////////////////////////////////////// 13 ///////////////////////////////////////////////////////////////////////////////
14 // BaseDragSource, IDropSource implementation: 14 // BaseDragSource, IDropSource implementation:
15 15
16 HRESULT BaseDragSource::QueryContinueDrag(BOOL escape_pressed, 16 HRESULT BaseDragSource::QueryContinueDrag(BOOL escape_pressed,
17 DWORD key_state) { 17 DWORD key_state) {
18 if (cancel_drag_)
19 return DRAGDROP_S_CANCEL;
20
18 if (escape_pressed) { 21 if (escape_pressed) {
19 OnDragSourceCancel(); 22 OnDragSourceCancel();
20 return DRAGDROP_S_CANCEL; 23 return DRAGDROP_S_CANCEL;
21 } 24 }
22 25
23 if (!(key_state & MK_LBUTTON)) { 26 if (!(key_state & MK_LBUTTON)) {
24 OnDragSourceDrop(); 27 OnDragSourceDrop();
25 return DRAGDROP_S_DROP; 28 return DRAGDROP_S_DROP;
26 } 29 }
27 30
(...skipping 23 matching lines...) Expand all
51 return ++ref_count_; 54 return ++ref_count_;
52 } 55 }
53 56
54 ULONG BaseDragSource::Release() { 57 ULONG BaseDragSource::Release() {
55 if (--ref_count_ == 0) { 58 if (--ref_count_ == 0) {
56 delete this; 59 delete this;
57 return 0U; 60 return 0U;
58 } 61 }
59 return ref_count_; 62 return ref_count_;
60 } 63 }
OLDNEW
« no previous file with comments | « base/base_drag_source.h ('k') | chrome/browser/tab_contents/tab_contents.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698