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

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

Issue 8743014: [cros, Aura] Refresh status area widget bounds on StatusAreaView layout. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nit fixes, merge, prevent double deletion of ShelfLayoutManager Created 9 years 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/status_area_layout_manager.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/layout_manager.h"
13 #include "ui/aura/window.h" 14 #include "ui/aura/window.h"
14 #include "ui/aura/window_types.h" 15 #include "ui/aura/window_types.h"
15 #include "ui/aura_shell/app_list.h" 16 #include "ui/aura_shell/app_list.h"
16 #include "ui/aura_shell/default_container_event_filter.h" 17 #include "ui/aura_shell/default_container_event_filter.h"
17 #include "ui/aura_shell/default_container_layout_manager.h" 18 #include "ui/aura_shell/default_container_layout_manager.h"
18 #include "ui/aura_shell/desktop_event_filter.h" 19 #include "ui/aura_shell/desktop_event_filter.h"
19 #include "ui/aura_shell/desktop_layout_manager.h" 20 #include "ui/aura_shell/desktop_layout_manager.h"
20 #include "ui/aura_shell/drag_drop_controller.h" 21 #include "ui/aura_shell/drag_drop_controller.h"
21 #include "ui/aura_shell/launcher/launcher.h" 22 #include "ui/aura_shell/launcher/launcher.h"
22 #include "ui/aura_shell/modal_container_layout_manager.h" 23 #include "ui/aura_shell/modal_container_layout_manager.h"
23 #include "ui/aura_shell/shadow_controller.h" 24 #include "ui/aura_shell/shadow_controller.h"
24 #include "ui/aura_shell/shelf_layout_controller.h" 25 #include "ui/aura_shell/shelf_layout_manager.h"
25 #include "ui/aura_shell/shell_accelerator_controller.h" 26 #include "ui/aura_shell/shell_accelerator_controller.h"
26 #include "ui/aura_shell/shell_accelerator_filter.h" 27 #include "ui/aura_shell/shell_accelerator_filter.h"
27 #include "ui/aura_shell/shell_delegate.h" 28 #include "ui/aura_shell/shell_delegate.h"
28 #include "ui/aura_shell/shell_factory.h" 29 #include "ui/aura_shell/shell_factory.h"
29 #include "ui/aura_shell/shell_tooltip_manager.h" 30 #include "ui/aura_shell/shell_tooltip_manager.h"
30 #include "ui/aura_shell/shell_window_ids.h" 31 #include "ui/aura_shell/shell_window_ids.h"
31 #include "ui/aura_shell/stacking_controller.h" 32 #include "ui/aura_shell/stacking_controller.h"
33 #include "ui/aura_shell/status_area_layout_manager.h"
32 #include "ui/aura_shell/toplevel_layout_manager.h" 34 #include "ui/aura_shell/toplevel_layout_manager.h"
33 #include "ui/aura_shell/toplevel_window_event_filter.h" 35 #include "ui/aura_shell/toplevel_window_event_filter.h"
34 #include "ui/aura_shell/workspace_controller.h" 36 #include "ui/aura_shell/workspace_controller.h"
35 #include "ui/gfx/compositor/layer.h" 37 #include "ui/gfx/compositor/layer.h"
36 #include "ui/gfx/compositor/layer_animator.h" 38 #include "ui/gfx/compositor/layer_animator.h"
37 #include "ui/views/widget/native_widget_aura.h" 39 #include "ui/views/widget/native_widget_aura.h"
38 #include "ui/views/widget/widget.h" 40 #include "ui/views/widget/widget.h"
39 41
40 namespace aura_shell { 42 namespace aura_shell {
41 43
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 aura::Window* default_container = 199 aura::Window* default_container =
198 GetContainer(internal::kShellWindowId_DefaultContainer); 200 GetContainer(internal::kShellWindowId_DefaultContainer);
199 launcher_.reset(new Launcher(default_container)); 201 launcher_.reset(new Launcher(default_container));
200 202
201 views::Widget* status_widget = NULL; 203 views::Widget* status_widget = NULL;
202 if (delegate_.get()) 204 if (delegate_.get())
203 status_widget = delegate_->CreateStatusArea(); 205 status_widget = delegate_->CreateStatusArea();
204 if (!status_widget) 206 if (!status_widget)
205 status_widget = internal::CreateStatusArea(); 207 status_widget = internal::CreateStatusArea();
206 208
207 shelf_layout_controller_.reset(new internal::ShelfLayoutController( 209 internal::ShelfLayoutManager* shelf_layout_manager =
208 launcher_->widget(), status_widget)); 210 new internal::ShelfLayoutManager(launcher_->widget(), status_widget);
209 desktop_layout->set_shelf(shelf_layout_controller_.get()); 211 GetContainer(aura_shell::internal::kShellWindowId_LauncherContainer)->
212 SetLayoutManager(shelf_layout_manager);
213
214 internal::StatusAreaLayoutManager* status_area_layout_manager =
215 new internal::StatusAreaLayoutManager(shelf_layout_manager);
216 GetContainer(aura_shell::internal::kShellWindowId_StatusContainer)->
217 SetLayoutManager(status_area_layout_manager);
210 218
211 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kAuraNoShadows)) 219 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kAuraNoShadows))
212 shadow_controller_.reset(new internal::ShadowController()); 220 shadow_controller_.reset(new internal::ShadowController());
213 221
214 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAuraWindows)) { 222 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAuraWindows)) {
215 EnableWorkspaceManager(); 223 EnableWorkspaceManager();
216 } else { 224 } else {
217 internal::ToplevelLayoutManager* toplevel_layout_manager = 225 internal::ToplevelLayoutManager* toplevel_layout_manager =
218 new internal::ToplevelLayoutManager(); 226 new internal::ToplevelLayoutManager();
219 default_container->SetLayoutManager(toplevel_layout_manager); 227 default_container->SetLayoutManager(toplevel_layout_manager);
220 toplevel_layout_manager->set_shelf(shelf_layout_controller_.get()); 228 toplevel_layout_manager->set_shelf(shelf_layout_manager);
221 } 229 }
222 230
223 // Force a layout. 231 // Force a layout.
224 desktop_layout->OnWindowResized(); 232 desktop_layout->OnWindowResized();
225 233
226 // Initialize ShellAcceleratorFilter 234 // Initialize ShellAcceleratorFilter
227 accelerator_filter_.reset(new internal::ShellAcceleratorFilter); 235 accelerator_filter_.reset(new internal::ShellAcceleratorFilter);
228 AddDesktopEventFilter(accelerator_filter_.get()); 236 AddDesktopEventFilter(accelerator_filter_.get());
229 237
230 // Initialize ShellTooltipManager 238 // Initialize ShellTooltipManager
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 new internal::WorkspaceController(default_container)); 288 new internal::WorkspaceController(default_container));
281 workspace_controller_->SetLauncherModel(launcher_->model()); 289 workspace_controller_->SetLauncherModel(launcher_->model());
282 default_container->SetEventFilter( 290 default_container->SetEventFilter(
283 new internal::DefaultContainerEventFilter(default_container)); 291 new internal::DefaultContainerEventFilter(default_container));
284 default_container->SetLayoutManager( 292 default_container->SetLayoutManager(
285 new internal::DefaultContainerLayoutManager( 293 new internal::DefaultContainerLayoutManager(
286 workspace_controller_->workspace_manager())); 294 workspace_controller_->workspace_manager()));
287 } 295 }
288 296
289 } // namespace aura_shell 297 } // namespace aura_shell
OLDNEW
« no previous file with comments | « ui/aura_shell/shell.h ('k') | ui/aura_shell/status_area_layout_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698