OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ash/shell.h" | 5 #include "ash/shell.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "ash/accelerators/accelerator_controller.h" | 9 #include "ash/accelerators/accelerator_controller.h" |
10 #include "ash/accelerators/accelerator_filter.h" | 10 #include "ash/accelerators/accelerator_filter.h" |
11 #include "ash/app_list/app_list.h" | 11 #include "ash/app_list/app_list.h" |
12 #include "ash/ash_switches.h" | 12 #include "ash/ash_switches.h" |
13 #include "ash/drag_drop/drag_drop_controller.h" | 13 #include "ash/drag_drop/drag_drop_controller.h" |
14 #include "ash/focus_cycler.h" | |
14 #include "ash/ime/input_method_event_filter.h" | 15 #include "ash/ime/input_method_event_filter.h" |
15 #include "ash/launcher/launcher.h" | 16 #include "ash/launcher/launcher.h" |
16 #include "ash/shell_delegate.h" | 17 #include "ash/shell_delegate.h" |
17 #include "ash/shell_factory.h" | 18 #include "ash/shell_factory.h" |
18 #include "ash/shell_window_ids.h" | 19 #include "ash/shell_window_ids.h" |
19 #include "ash/tooltips/tooltip_controller.h" | 20 #include "ash/tooltips/tooltip_controller.h" |
20 #include "ash/wm/activation_controller.h" | 21 #include "ash/wm/activation_controller.h" |
21 #include "ash/wm/compact_layout_manager.h" | 22 #include "ash/wm/compact_layout_manager.h" |
22 #include "ash/wm/compact_status_area_layout_manager.h" | 23 #include "ash/wm/compact_status_area_layout_manager.h" |
23 #include "ash/wm/dialog_frame_view.h" | 24 #include "ash/wm/dialog_frame_view.h" |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
290 launcher_.reset(new Launcher(default_container)); | 291 launcher_.reset(new Launcher(default_container)); |
291 | 292 |
292 if (IsWindowModeCompact()) | 293 if (IsWindowModeCompact()) |
293 SetupCompactWindowMode(); | 294 SetupCompactWindowMode(); |
294 else | 295 else |
295 SetupNormalWindowMode(); | 296 SetupNormalWindowMode(); |
296 | 297 |
297 if (!command_line->HasSwitch(switches::kAuraNoShadows)) | 298 if (!command_line->HasSwitch(switches::kAuraNoShadows)) |
298 shadow_controller_.reset(new internal::ShadowController()); | 299 shadow_controller_.reset(new internal::ShadowController()); |
299 | 300 |
301 focus_cycler_.reset(new internal::FocusCycler()); | |
302 focus_cycler_->AddWidget(status_widget_); | |
303 if (!IsWindowModeCompact()) | |
sky
2012/02/03 15:53:22
The window mode can be changed at runtime. See Cha
Zachary Kuznia
2012/02/06 05:48:09
Fixed to always add the launcher, and skip over it
| |
304 focus_cycler_->AddWidget(launcher_->widget()); | |
305 | |
300 // Force a layout. | 306 // Force a layout. |
301 root_window->layout_manager()->OnWindowResized(); | 307 root_window->layout_manager()->OnWindowResized(); |
302 | 308 |
303 window_modality_controller_.reset(new internal::WindowModalityController); | 309 window_modality_controller_.reset(new internal::WindowModalityController); |
304 AddRootWindowEventFilter(window_modality_controller_.get()); | 310 AddRootWindowEventFilter(window_modality_controller_.get()); |
305 | 311 |
306 visibility_controller_.reset(new internal::VisibilityController); | 312 visibility_controller_.reset(new internal::VisibilityController); |
307 aura::client::SetVisibilityClient(visibility_controller_.get()); | 313 aura::client::SetVisibilityClient(visibility_controller_.get()); |
308 | 314 |
309 accelerator_filter_.reset(new internal::AcceleratorFilter); | 315 accelerator_filter_.reset(new internal::AcceleratorFilter); |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
411 | 417 |
412 views::NonClientFrameView* Shell::CreateDefaultNonClientFrameView( | 418 views::NonClientFrameView* Shell::CreateDefaultNonClientFrameView( |
413 views::Widget* widget) { | 419 views::Widget* widget) { |
414 if (CommandLine::ForCurrentProcess()->HasSwitch( | 420 if (CommandLine::ForCurrentProcess()->HasSwitch( |
415 switches::kAuraGoogleDialogFrames)) { | 421 switches::kAuraGoogleDialogFrames)) { |
416 return new internal::DialogFrameView; | 422 return new internal::DialogFrameView; |
417 } | 423 } |
418 return NULL; | 424 return NULL; |
419 } | 425 } |
420 | 426 |
427 void Shell::RotateFocus(Direction direction) { | |
428 focus_cycler_->RotateFocus( | |
429 direction == FORWARD ? internal::FocusCycler::FORWARD : | |
430 internal::FocusCycler::BACKWARD); | |
431 } | |
432 | |
421 //////////////////////////////////////////////////////////////////////////////// | 433 //////////////////////////////////////////////////////////////////////////////// |
422 // Shell, private: | 434 // Shell, private: |
423 | 435 |
424 // Compact mode has a simplified layout manager and doesn't use the shelf, | 436 // Compact mode has a simplified layout manager and doesn't use the shelf, |
425 // desktop background, etc. The launcher still exists so we can use its | 437 // desktop background, etc. The launcher still exists so we can use its |
426 // data model and list of open windows, but we hide the UI to save space. | 438 // data model and list of open windows, but we hide the UI to save space. |
427 void Shell::SetupCompactWindowMode() { | 439 void Shell::SetupCompactWindowMode() { |
428 DCHECK(root_window_layout_); | 440 DCHECK(root_window_layout_); |
429 DCHECK(status_widget_); | 441 DCHECK(status_widget_); |
430 | 442 |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
511 | 523 |
512 // Create the desktop background image. | 524 // Create the desktop background image. |
513 root_window_layout_->SetBackgroundWidget(internal::CreateDesktopBackground()); | 525 root_window_layout_->SetBackgroundWidget(internal::CreateDesktopBackground()); |
514 } | 526 } |
515 | 527 |
516 void Shell::ResetLayoutManager(int container_id) { | 528 void Shell::ResetLayoutManager(int container_id) { |
517 GetContainer(container_id)->SetLayoutManager(NULL); | 529 GetContainer(container_id)->SetLayoutManager(NULL); |
518 } | 530 } |
519 | 531 |
520 } // namespace ash | 532 } // namespace ash |
OLD | NEW |