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/root_window_controller.h" | 5 #include "ash/root_window_controller.h" |
6 | 6 |
7 #include <queue> | 7 #include <queue> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "ash/ash_constants.h" | 10 #include "ash/ash_constants.h" |
11 #include "ash/ash_switches.h" | 11 #include "ash/ash_switches.h" |
12 #include "ash/desktop_background/desktop_background_controller.h" | 12 #include "ash/desktop_background/desktop_background_controller.h" |
13 #include "ash/desktop_background/desktop_background_widget_controller.h" | 13 #include "ash/desktop_background/desktop_background_widget_controller.h" |
14 #include "ash/desktop_background/user_wallpaper_delegate.h" | 14 #include "ash/desktop_background/user_wallpaper_delegate.h" |
15 #include "ash/display/display_manager.h" | 15 #include "ash/display/display_manager.h" |
16 #include "ash/focus_cycler.h" | 16 #include "ash/focus_cycler.h" |
17 #include "ash/high_contrast/high_contrast_controller.h" | 17 #include "ash/high_contrast/high_contrast_controller.h" |
18 #include "ash/root_window_settings.h" | 18 #include "ash/root_window_settings.h" |
19 #include "ash/session_state_delegate.h" | 19 #include "ash/session_state_delegate.h" |
20 #include "ash/shelf/shelf_layout_manager.h" | 20 #include "ash/shelf/shelf_layout_manager.h" |
21 #include "ash/shelf/shelf_types.h" | 21 #include "ash/shelf/shelf_types.h" |
22 #include "ash/shelf/shelf_widget.h" | 22 #include "ash/shelf/shelf_widget.h" |
23 #include "ash/shell.h" | 23 #include "ash/shell.h" |
24 #include "ash/shell_delegate.h" | 24 #include "ash/shell_delegate.h" |
25 #include "ash/shell_factory.h" | 25 #include "ash/shell_factory.h" |
26 #include "ash/shell_window_ids.h" | 26 #include "ash/shell_window_ids.h" |
27 #include "ash/switchable_windows.h" | 27 #include "ash/switchable_windows.h" |
28 #include "ash/system/status_area_widget.h" | 28 #include "ash/system/status_area_widget.h" |
29 #include "ash/system/tray/system_tray_delegate.h" | 29 #include "ash/system/tray/system_tray_delegate.h" |
| 30 #include "ash/system/tray/system_tray_notifier.h" |
30 #include "ash/touch/touch_hud_debug.h" | 31 #include "ash/touch/touch_hud_debug.h" |
31 #include "ash/touch/touch_hud_projection.h" | 32 #include "ash/touch/touch_hud_projection.h" |
32 #include "ash/touch/touch_observer_hud.h" | 33 #include "ash/touch/touch_observer_hud.h" |
33 #include "ash/wm/always_on_top_controller.h" | 34 #include "ash/wm/always_on_top_controller.h" |
34 #include "ash/wm/dock/docked_window_layout_manager.h" | 35 #include "ash/wm/dock/docked_window_layout_manager.h" |
35 #include "ash/wm/panels/panel_layout_manager.h" | 36 #include "ash/wm/panels/panel_layout_manager.h" |
36 #include "ash/wm/panels/panel_window_event_handler.h" | 37 #include "ash/wm/panels/panel_window_event_handler.h" |
37 #include "ash/wm/root_window_layout_manager.h" | 38 #include "ash/wm/root_window_layout_manager.h" |
38 #include "ash/wm/screen_dimmer.h" | 39 #include "ash/wm/screen_dimmer.h" |
39 #include "ash/wm/stacking_controller.h" | 40 #include "ash/wm/stacking_controller.h" |
(...skipping 666 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
706 } else { | 707 } else { |
707 root_window_layout()->OnWindowResized(); | 708 root_window_layout()->OnWindowResized(); |
708 shell->desktop_background_controller()->OnRootWindowAdded(root_window()); | 709 shell->desktop_background_controller()->OnRootWindowAdded(root_window()); |
709 shell->high_contrast_controller()->OnRootWindowAdded(root_window()); | 710 shell->high_contrast_controller()->OnRootWindowAdded(root_window()); |
710 host_->Show(); | 711 host_->Show(); |
711 | 712 |
712 // Create a shelf if a user is already logged in. | 713 // Create a shelf if a user is already logged in. |
713 if (shell->session_state_delegate()->NumberOfLoggedInUsers()) | 714 if (shell->session_state_delegate()->NumberOfLoggedInUsers()) |
714 shelf()->CreateShelf(); | 715 shelf()->CreateShelf(); |
715 } | 716 } |
| 717 |
| 718 Shell::GetInstance()->system_tray_notifier()->AddAccessibilityObserver(this); |
| 719 UpdateTouchExplorationState(); |
716 } | 720 } |
717 | 721 |
718 void RootWindowController::InitLayoutManagers() { | 722 void RootWindowController::InitLayoutManagers() { |
719 root_window_layout_ = new RootWindowLayoutManager(root_window()); | 723 root_window_layout_ = new RootWindowLayoutManager(root_window()); |
720 root_window()->SetLayoutManager(root_window_layout_); | 724 root_window()->SetLayoutManager(root_window_layout_); |
721 | 725 |
722 aura::Window* default_container = | 726 aura::Window* default_container = |
723 GetContainer(kShellWindowId_DefaultContainer); | 727 GetContainer(kShellWindowId_DefaultContainer); |
724 // Workspace manager has its own layout managers. | 728 // Workspace manager has its own layout managers. |
725 workspace_controller_.reset( | 729 workspace_controller_.reset( |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1002 shelf_->shelf_layout_manager()->UpdateVisibilityState(); | 1006 shelf_->shelf_layout_manager()->UpdateVisibilityState(); |
1003 } | 1007 } |
1004 | 1008 |
1005 void RootWindowController::OnTouchHudProjectionToggled(bool enabled) { | 1009 void RootWindowController::OnTouchHudProjectionToggled(bool enabled) { |
1006 if (enabled) | 1010 if (enabled) |
1007 EnableTouchHudProjection(); | 1011 EnableTouchHudProjection(); |
1008 else | 1012 else |
1009 DisableTouchHudProjection(); | 1013 DisableTouchHudProjection(); |
1010 } | 1014 } |
1011 | 1015 |
| 1016 void RootWindowController::UpdateTouchExplorationState() { |
| 1017 AccessibilityDelegate* delegate = |
| 1018 Shell::GetInstance()->accessibility_delegate(); |
| 1019 bool enabled = delegate->IsSpokenFeedbackEnabled(); |
| 1020 |
| 1021 LOG(ERROR) << "RWC::UpdateTouchExplorationState: enabled=" << enabled; |
| 1022 |
| 1023 if (enabled && !touch_exploration_controller_.get()) { |
| 1024 touch_exploration_controller_.reset( |
| 1025 new TouchExplorationController(root_window())); |
| 1026 } else if (!enabled && touch_exploration_controller_.get()) { |
| 1027 touch_exploration_controller_.reset(); |
| 1028 } |
| 1029 } |
| 1030 |
| 1031 void RootWindowController::OnAccessibilityModeChanged( |
| 1032 AccessibilityNotificationVisibility notify) { |
| 1033 UpdateTouchExplorationState(); |
| 1034 } |
| 1035 |
1012 RootWindowController* GetRootWindowController( | 1036 RootWindowController* GetRootWindowController( |
1013 const aura::Window* root_window) { | 1037 const aura::Window* root_window) { |
1014 return root_window ? GetRootWindowSettings(root_window)->controller : NULL; | 1038 return root_window ? GetRootWindowSettings(root_window)->controller : NULL; |
1015 } | 1039 } |
1016 | 1040 |
1017 } // namespace internal | 1041 } // namespace internal |
1018 } // namespace ash | 1042 } // namespace ash |
OLD | NEW |