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

Side by Side Diff: views/widget/native_widget_aura.h

Issue 8450018: First shot at implementing drag&drop for Aura (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: minor changes 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 #ifndef VIEWS_WIDGET_NATIVE_WIDGET_AURA_H_ 5 #ifndef VIEWS_WIDGET_NATIVE_WIDGET_AURA_H_
6 #define VIEWS_WIDGET_NATIVE_WIDGET_AURA_H_ 6 #define VIEWS_WIDGET_NATIVE_WIDGET_AURA_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/memory/scoped_vector.h" 9 #include "base/memory/scoped_vector.h"
10 #include "base/memory/weak_ptr.h" 10 #include "base/memory/weak_ptr.h"
11 #include "ui/aura/window_delegate.h" 11 #include "ui/aura/window_delegate.h"
12 #include "ui/aura/window_drag_drop_delegate.h"
12 #include "ui/base/events.h" 13 #include "ui/base/events.h"
13 #include "views/views_export.h" 14 #include "views/views_export.h"
14 #include "views/widget/native_widget_private.h" 15 #include "views/widget/native_widget_private.h"
15 16
16 namespace aura { 17 namespace aura {
17 class Window; 18 class Window;
18 } 19 }
19 namespace gfx { 20 namespace gfx {
20 class Font; 21 class Font;
21 } 22 }
22 23
23 namespace views { 24 namespace views {
24 25
26 class DropHelper;
25 class TooltipManagerViews; 27 class TooltipManagerViews;
26 28
27 class VIEWS_EXPORT NativeWidgetAura : public internal::NativeWidgetPrivate, 29 class VIEWS_EXPORT NativeWidgetAura : public internal::NativeWidgetPrivate,
28 public aura::WindowDelegate { 30 public aura::WindowDelegate,
31 public aura::WindowDragDropDelegate {
29 public: 32 public:
30 explicit NativeWidgetAura(internal::NativeWidgetDelegate* delegate); 33 explicit NativeWidgetAura(internal::NativeWidgetDelegate* delegate);
31 virtual ~NativeWidgetAura(); 34 virtual ~NativeWidgetAura();
32 35
33 // TODO(beng): Find a better place for this, and the similar method on 36 // TODO(beng): Find a better place for this, and the similar method on
34 // NativeWidgetWin. 37 // NativeWidgetWin.
35 static gfx::Font GetWindowTitleFont(); 38 static gfx::Font GetWindowTitleFont();
36 39
37 // Overridden from internal::NativeWidgetPrivate: 40 // Overridden from internal::NativeWidgetPrivate:
38 virtual void InitNativeWidget(const Widget::InitParams& params) OVERRIDE; 41 virtual void InitNativeWidget(const Widget::InitParams& params) OVERRIDE;
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 virtual ui::TouchStatus OnTouchEvent(aura::TouchEvent* event) OVERRIDE; 135 virtual ui::TouchStatus OnTouchEvent(aura::TouchEvent* event) OVERRIDE;
133 virtual bool ShouldActivate(aura::Event* event) OVERRIDE; 136 virtual bool ShouldActivate(aura::Event* event) OVERRIDE;
134 virtual void OnActivated() OVERRIDE; 137 virtual void OnActivated() OVERRIDE;
135 virtual void OnLostActive() OVERRIDE; 138 virtual void OnLostActive() OVERRIDE;
136 virtual void OnCaptureLost() OVERRIDE; 139 virtual void OnCaptureLost() OVERRIDE;
137 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; 140 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
138 virtual void OnWindowDestroying() OVERRIDE; 141 virtual void OnWindowDestroying() OVERRIDE;
139 virtual void OnWindowDestroyed() OVERRIDE; 142 virtual void OnWindowDestroyed() OVERRIDE;
140 virtual void OnWindowVisibilityChanged(bool visible) OVERRIDE; 143 virtual void OnWindowVisibilityChanged(bool visible) OVERRIDE;
141 144
145 // Overridden from aura::WindowDragDropDelegate:
146 virtual bool CanDrop(const aura::DropTargetEvent& event) OVERRIDE;
147 virtual void OnDragEntered(const aura::DropTargetEvent& event) OVERRIDE;
148 virtual int OnDragUpdated(const aura::DropTargetEvent& event) OVERRIDE;
149 virtual void OnDragExited() OVERRIDE;
150 virtual int OnPerformDrop(const aura::DropTargetEvent& event) OVERRIDE;
151
142 private: 152 private:
143 class DesktopObserverImpl; 153 class DesktopObserverImpl;
144 154
145 internal::NativeWidgetDelegate* delegate_; 155 internal::NativeWidgetDelegate* delegate_;
146 156
147 aura::Window* window_; 157 aura::Window* window_;
148 158
149 // See class documentation for Widget in widget.h for a note about ownership. 159 // See class documentation for Widget in widget.h for a note about ownership.
150 Widget::InitParams::Ownership ownership_; 160 Widget::InitParams::Ownership ownership_;
151 161
152 // The following factory is used for calls to close the NativeWidgetAura 162 // The following factory is used for calls to close the NativeWidgetAura
153 // instance. 163 // instance.
154 base::WeakPtrFactory<NativeWidgetAura> close_widget_factory_; 164 base::WeakPtrFactory<NativeWidgetAura> close_widget_factory_;
155 165
156 // Can we be made active? 166 // Can we be made active?
157 bool can_activate_; 167 bool can_activate_;
158 168
159 gfx::NativeCursor cursor_; 169 gfx::NativeCursor cursor_;
160 170
161 scoped_ptr<TooltipManagerViews> tooltip_manager_; 171 scoped_ptr<TooltipManagerViews> tooltip_manager_;
162 172
163 scoped_ptr<DesktopObserverImpl> desktop_observer_; 173 scoped_ptr<DesktopObserverImpl> desktop_observer_;
164 174
175 scoped_ptr<DropHelper> drop_helper_;
176
165 DISALLOW_COPY_AND_ASSIGN(NativeWidgetAura); 177 DISALLOW_COPY_AND_ASSIGN(NativeWidgetAura);
166 }; 178 };
167 179
168 } // namespace views 180 } // namespace views
169 181
170 #endif // VIEWS_WIDGET_NATIVE_WIDGET_AURA_H_ 182 #endif // VIEWS_WIDGET_NATIVE_WIDGET_AURA_H_
OLDNEW
« views/views.gyp ('K') | « views/views.gyp ('k') | views/widget/native_widget_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698