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

Side by Side Diff: ui/aura_shell/shell.cc

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 #include "ui/aura_shell/shell.h" 5 #include "ui/aura_shell/shell.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "ui/aura/aura_switches.h" 9 #include "ui/aura/aura_switches.h"
10 #include "ui/aura/client/aura_constants.h"
11 #include "ui/aura/client/drag_drop_client.h"
10 #include "ui/aura/desktop.h" 12 #include "ui/aura/desktop.h"
11 #include "ui/aura/window.h" 13 #include "ui/aura/window.h"
12 #include "ui/aura/window_types.h" 14 #include "ui/aura/window_types.h"
13 #include "ui/aura_shell/default_container_event_filter.h" 15 #include "ui/aura_shell/default_container_event_filter.h"
14 #include "ui/aura_shell/default_container_layout_manager.h" 16 #include "ui/aura_shell/default_container_layout_manager.h"
15 #include "ui/aura_shell/desktop_event_filter.h" 17 #include "ui/aura_shell/desktop_event_filter.h"
16 #include "ui/aura_shell/desktop_layout_manager.h" 18 #include "ui/aura_shell/desktop_layout_manager.h"
19 #include "ui/aura_shell/drag_drop_controller.h"
17 #include "ui/aura_shell/launcher/launcher.h" 20 #include "ui/aura_shell/launcher/launcher.h"
18 #include "ui/aura_shell/shelf_layout_controller.h" 21 #include "ui/aura_shell/shelf_layout_controller.h"
19 #include "ui/aura_shell/shell_delegate.h" 22 #include "ui/aura_shell/shell_delegate.h"
20 #include "ui/aura_shell/shell_factory.h" 23 #include "ui/aura_shell/shell_factory.h"
21 #include "ui/aura_shell/shell_window_ids.h" 24 #include "ui/aura_shell/shell_window_ids.h"
22 #include "ui/aura_shell/stacking_controller.h" 25 #include "ui/aura_shell/stacking_controller.h"
23 #include "ui/aura_shell/toplevel_layout_manager.h" 26 #include "ui/aura_shell/toplevel_layout_manager.h"
24 #include "ui/aura_shell/toplevel_window_event_filter.h" 27 #include "ui/aura_shell/toplevel_window_event_filter.h"
25 #include "ui/aura_shell/workspace_controller.h" 28 #include "ui/aura_shell/workspace_controller.h"
26 #include "ui/gfx/compositor/layer.h" 29 #include "ui/gfx/compositor/layer.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 //////////////////////////////////////////////////////////////////////////////// 85 ////////////////////////////////////////////////////////////////////////////////
83 // Shell, public: 86 // Shell, public:
84 87
85 Shell::Shell(ShellDelegate* delegate) 88 Shell::Shell(ShellDelegate* delegate)
86 : ALLOW_THIS_IN_INITIALIZER_LIST(method_factory_(this)), 89 : ALLOW_THIS_IN_INITIALIZER_LIST(method_factory_(this)),
87 delegate_(delegate) { 90 delegate_(delegate) {
88 aura::Desktop::GetInstance()->SetEventFilter( 91 aura::Desktop::GetInstance()->SetEventFilter(
89 new internal::DesktopEventFilter); 92 new internal::DesktopEventFilter);
90 aura::Desktop::GetInstance()->SetStackingClient( 93 aura::Desktop::GetInstance()->SetStackingClient(
91 new internal::StackingController); 94 new internal::StackingController);
95 aura::Desktop::GetInstance()->SetProperty(aura::kDesktopDragDropClientKey,
96 static_cast<aura::DragDropClient*>(new internal::DragDropController));
92 } 97 }
93 98
94 Shell::~Shell() { 99 Shell::~Shell() {
95 DCHECK(instance_ == this); 100 DCHECK(instance_ == this);
96 instance_ = NULL; 101 instance_ = NULL;
97 102
98 // Make sure we delete WorkspaceController before launcher is 103 // Make sure we delete WorkspaceController before launcher is
99 // deleted as it has a reference to launcher model. 104 // deleted as it has a reference to launcher model.
100 workspace_controller_.reset(); 105 workspace_controller_.reset();
101 } 106 }
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 new internal::WorkspaceController(default_container)); 201 new internal::WorkspaceController(default_container));
197 workspace_controller_->SetLauncherModel(launcher_->model()); 202 workspace_controller_->SetLauncherModel(launcher_->model());
198 default_container->SetEventFilter( 203 default_container->SetEventFilter(
199 new internal::DefaultContainerEventFilter(default_container)); 204 new internal::DefaultContainerEventFilter(default_container));
200 default_container->SetLayoutManager( 205 default_container->SetLayoutManager(
201 new internal::DefaultContainerLayoutManager( 206 new internal::DefaultContainerLayoutManager(
202 workspace_controller_->workspace_manager())); 207 workspace_controller_->workspace_manager()));
203 } 208 }
204 209
205 } // namespace aura_shell 210 } // namespace aura_shell
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698