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

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

Issue 8555025: aura: Draw drop shadows under browsers and menus. (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
« no previous file with comments | « ui/aura_shell/shell.h ('k') | ui/aura_shell/show_state_controller.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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" 10 #include "ui/aura/client/aura_constants.h"
11 #include "ui/aura/client/drag_drop_client.h" 11 #include "ui/aura/client/drag_drop_client.h"
12 #include "ui/aura/desktop.h" 12 #include "ui/aura/desktop.h"
13 #include "ui/aura/window.h" 13 #include "ui/aura/window.h"
14 #include "ui/aura/window_types.h" 14 #include "ui/aura/window_types.h"
15 #include "ui/aura_shell/default_container_event_filter.h" 15 #include "ui/aura_shell/default_container_event_filter.h"
16 #include "ui/aura_shell/default_container_layout_manager.h" 16 #include "ui/aura_shell/default_container_layout_manager.h"
17 #include "ui/aura_shell/desktop_event_filter.h" 17 #include "ui/aura_shell/desktop_event_filter.h"
18 #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" 19 #include "ui/aura_shell/drag_drop_controller.h"
20 #include "ui/aura_shell/launcher/launcher.h" 20 #include "ui/aura_shell/launcher/launcher.h"
21 #include "ui/aura_shell/modal_container_layout_manager.h" 21 #include "ui/aura_shell/modal_container_layout_manager.h"
22 #include "ui/aura_shell/shadow_controller.h"
22 #include "ui/aura_shell/shelf_layout_controller.h" 23 #include "ui/aura_shell/shelf_layout_controller.h"
23 #include "ui/aura_shell/shell_delegate.h" 24 #include "ui/aura_shell/shell_delegate.h"
24 #include "ui/aura_shell/shell_factory.h" 25 #include "ui/aura_shell/shell_factory.h"
25 #include "ui/aura_shell/shell_window_ids.h" 26 #include "ui/aura_shell/shell_window_ids.h"
26 #include "ui/aura_shell/stacking_controller.h" 27 #include "ui/aura_shell/stacking_controller.h"
27 #include "ui/aura_shell/toplevel_layout_manager.h" 28 #include "ui/aura_shell/toplevel_layout_manager.h"
28 #include "ui/aura_shell/toplevel_window_event_filter.h" 29 #include "ui/aura_shell/toplevel_window_event_filter.h"
29 #include "ui/aura_shell/workspace_controller.h" 30 #include "ui/aura_shell/workspace_controller.h"
30 #include "ui/gfx/compositor/layer.h" 31 #include "ui/gfx/compositor/layer.h"
31 #include "ui/gfx/compositor/layer_animator.h" 32 #include "ui/gfx/compositor/layer_animator.h"
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 launcher_.reset(new Launcher(default_container)); 166 launcher_.reset(new Launcher(default_container));
166 167
167 views::Widget* status_widget = NULL; 168 views::Widget* status_widget = NULL;
168 if (delegate_.get()) 169 if (delegate_.get())
169 status_widget = delegate_->CreateStatusArea(); 170 status_widget = delegate_->CreateStatusArea();
170 if (!status_widget) 171 if (!status_widget)
171 status_widget = internal::CreateStatusArea(); 172 status_widget = internal::CreateStatusArea();
172 173
173 shelf_layout_controller_.reset(new internal::ShelfLayoutController( 174 shelf_layout_controller_.reset(new internal::ShelfLayoutController(
174 launcher_->widget(), status_widget)); 175 launcher_->widget(), status_widget));
176 desktop_layout->set_shelf(shelf_layout_controller_.get());
175 177
176 desktop_layout->set_shelf(shelf_layout_controller_.get()); 178 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kAuraNoShadows))
179 shadow_controller_.reset(new internal::ShadowController());
177 180
178 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAuraWindows)) { 181 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAuraWindows)) {
179 EnableWorkspaceManager(); 182 EnableWorkspaceManager();
180 } else { 183 } else {
181 internal::ToplevelLayoutManager* toplevel_layout_manager = 184 internal::ToplevelLayoutManager* toplevel_layout_manager =
182 new internal::ToplevelLayoutManager(); 185 new internal::ToplevelLayoutManager();
183 default_container->SetLayoutManager(toplevel_layout_manager); 186 default_container->SetLayoutManager(toplevel_layout_manager);
184 toplevel_layout_manager->set_shelf(shelf_layout_controller_.get()); 187 toplevel_layout_manager->set_shelf(shelf_layout_controller_.get());
185 } 188 }
186 189
187 // Force a layout. 190 // Force a layout.
188 desktop_layout->OnWindowResized(); 191 desktop_layout->OnWindowResized();
189 192
190 // Initialize drag drop controller.
191 drag_drop_controller_.reset(new internal::DragDropController); 193 drag_drop_controller_.reset(new internal::DragDropController);
192 aura::Desktop::GetInstance()->SetProperty(aura::kDesktopDragDropClientKey, 194 aura::Desktop::GetInstance()->SetProperty(aura::kDesktopDragDropClientKey,
193 static_cast<aura::DragDropClient*>(drag_drop_controller_.get())); 195 static_cast<aura::DragDropClient*>(drag_drop_controller_.get()));
194 } 196 }
195 197
196 aura::Window* Shell::GetContainer(int container_id) { 198 aura::Window* Shell::GetContainer(int container_id) {
197 return const_cast<aura::Window*>( 199 return const_cast<aura::Window*>(
198 const_cast<const aura_shell::Shell*>(this)->GetContainer(container_id)); 200 const_cast<const aura_shell::Shell*>(this)->GetContainer(container_id));
199 } 201 }
200 202
(...skipping 27 matching lines...) Expand all
228 new internal::WorkspaceController(default_container)); 230 new internal::WorkspaceController(default_container));
229 workspace_controller_->SetLauncherModel(launcher_->model()); 231 workspace_controller_->SetLauncherModel(launcher_->model());
230 default_container->SetEventFilter( 232 default_container->SetEventFilter(
231 new internal::DefaultContainerEventFilter(default_container)); 233 new internal::DefaultContainerEventFilter(default_container));
232 default_container->SetLayoutManager( 234 default_container->SetLayoutManager(
233 new internal::DefaultContainerLayoutManager( 235 new internal::DefaultContainerLayoutManager(
234 workspace_controller_->workspace_manager())); 236 workspace_controller_->workspace_manager()));
235 } 237 }
236 238
237 } // namespace aura_shell 239 } // namespace aura_shell
OLDNEW
« no previous file with comments | « ui/aura_shell/shell.h ('k') | ui/aura_shell/show_state_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698