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

Side by Side Diff: ui/aura/window.cc

Issue 8450018: First shot at implementing drag&drop for Aura (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: added missing test file Created 9 years, 1 month 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/aura/window.h" 5 #include "ui/aura/window.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 12 matching lines...) Expand all
23 23
24 namespace aura { 24 namespace aura {
25 25
26 Window::Window(WindowDelegate* delegate) 26 Window::Window(WindowDelegate* delegate)
27 : type_(WINDOW_TYPE_UNKNOWN), 27 : type_(WINDOW_TYPE_UNKNOWN),
28 delegate_(delegate), 28 delegate_(delegate),
29 parent_(NULL), 29 parent_(NULL),
30 transient_parent_(NULL), 30 transient_parent_(NULL),
31 id_(-1), 31 id_(-1),
32 user_data_(NULL), 32 user_data_(NULL),
33 stops_event_propagation_(false) { 33 stops_event_propagation_(false),
34 drag_drop_delegate_(NULL) {
34 } 35 }
35 36
36 Window::~Window() { 37 Window::~Window() {
38 // We need to NULL the drag drop delegate to prevent race condition where a
39 // drag/drop event may be sent to a window while its being destroyed.
40 drag_drop_delegate_ = NULL;
41
37 // Let the delegate know we're in the processing of destroying. 42 // Let the delegate know we're in the processing of destroying.
38 if (delegate_) 43 if (delegate_)
39 delegate_->OnWindowDestroying(); 44 delegate_->OnWindowDestroying();
40 45
41 // Let the root know so that it can remove any references to us. 46 // Let the root know so that it can remove any references to us.
42 Desktop* desktop = GetDesktop(); 47 Desktop* desktop = GetDesktop();
43 if (desktop) 48 if (desktop)
44 desktop->WindowDestroying(this); 49 desktop->WindowDestroying(this);
45 50
46 // Then destroy the children. 51 // Then destroy the children.
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after
489 494
490 return delegate_ ? this : NULL; 495 return delegate_ ? this : NULL;
491 } 496 }
492 497
493 void Window::OnPaintLayer(gfx::Canvas* canvas) { 498 void Window::OnPaintLayer(gfx::Canvas* canvas) {
494 if (delegate_) 499 if (delegate_)
495 delegate_->OnPaint(canvas); 500 delegate_->OnPaint(canvas);
496 } 501 }
497 502
498 } // namespace aura 503 } // namespace aura
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698