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" |
(...skipping 10 matching lines...) Expand all Loading... | |
21 #include "ash/shelf/shelf_layout_manager.h" | 21 #include "ash/shelf/shelf_layout_manager.h" |
22 #include "ash/shelf/shelf_types.h" | 22 #include "ash/shelf/shelf_types.h" |
23 #include "ash/shelf/shelf_widget.h" | 23 #include "ash/shelf/shelf_widget.h" |
24 #include "ash/shell.h" | 24 #include "ash/shell.h" |
25 #include "ash/shell_delegate.h" | 25 #include "ash/shell_delegate.h" |
26 #include "ash/shell_factory.h" | 26 #include "ash/shell_factory.h" |
27 #include "ash/shell_window_ids.h" | 27 #include "ash/shell_window_ids.h" |
28 #include "ash/switchable_windows.h" | 28 #include "ash/switchable_windows.h" |
29 #include "ash/system/status_area_widget.h" | 29 #include "ash/system/status_area_widget.h" |
30 #include "ash/system/tray/system_tray_delegate.h" | 30 #include "ash/system/tray/system_tray_delegate.h" |
31 #include "ash/system/tray/system_tray_notifier.h" | |
31 #include "ash/touch/touch_hud_debug.h" | 32 #include "ash/touch/touch_hud_debug.h" |
32 #include "ash/touch/touch_hud_projection.h" | 33 #include "ash/touch/touch_hud_projection.h" |
33 #include "ash/touch/touch_observer_hud.h" | 34 #include "ash/touch/touch_observer_hud.h" |
34 #include "ash/wm/always_on_top_controller.h" | 35 #include "ash/wm/always_on_top_controller.h" |
35 #include "ash/wm/dock/docked_window_layout_manager.h" | 36 #include "ash/wm/dock/docked_window_layout_manager.h" |
36 #include "ash/wm/panels/panel_layout_manager.h" | 37 #include "ash/wm/panels/panel_layout_manager.h" |
37 #include "ash/wm/panels/panel_window_event_handler.h" | 38 #include "ash/wm/panels/panel_window_event_handler.h" |
38 #include "ash/wm/root_window_layout_manager.h" | 39 #include "ash/wm/root_window_layout_manager.h" |
39 #include "ash/wm/screen_dimmer.h" | 40 #include "ash/wm/screen_dimmer.h" |
40 #include "ash/wm/stacking_controller.h" | 41 #include "ash/wm/stacking_controller.h" |
(...skipping 682 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
723 root_window_layout()->OnWindowResized(); | 724 root_window_layout()->OnWindowResized(); |
724 ash_host_->AsWindowTreeHost()->Show(); | 725 ash_host_->AsWindowTreeHost()->Show(); |
725 | 726 |
726 // Create a shelf if a user is already logged in. | 727 // Create a shelf if a user is already logged in. |
727 if (shell->session_state_delegate()->NumberOfLoggedInUsers()) | 728 if (shell->session_state_delegate()->NumberOfLoggedInUsers()) |
728 shelf()->CreateShelf(); | 729 shelf()->CreateShelf(); |
729 | 730 |
730 // Notify shell observers about new root window. | 731 // Notify shell observers about new root window. |
731 shell->OnRootWindowAdded(root_window); | 732 shell->OnRootWindowAdded(root_window); |
732 } | 733 } |
734 | |
735 Shell::GetInstance()->system_tray_notifier()->AddAccessibilityObserver(this); | |
Daniel Erat
2014/04/18 00:44:08
remove the observer in the d'tor (probably need to
| |
736 UpdateTouchExplorationState(); | |
733 } | 737 } |
734 | 738 |
735 void RootWindowController::InitLayoutManagers() { | 739 void RootWindowController::InitLayoutManagers() { |
736 aura::Window* root_window = GetRootWindow(); | 740 aura::Window* root_window = GetRootWindow(); |
737 root_window_layout_ = new RootWindowLayoutManager(root_window); | 741 root_window_layout_ = new RootWindowLayoutManager(root_window); |
738 root_window->SetLayoutManager(root_window_layout_); | 742 root_window->SetLayoutManager(root_window_layout_); |
739 | 743 |
740 aura::Window* default_container = | 744 aura::Window* default_container = |
741 GetContainer(kShellWindowId_DefaultContainer); | 745 GetContainer(kShellWindowId_DefaultContainer); |
742 // Workspace manager has its own layout managers. | 746 // Workspace manager has its own layout managers. |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1012 shelf_->shelf_layout_manager()->UpdateVisibilityState(); | 1016 shelf_->shelf_layout_manager()->UpdateVisibilityState(); |
1013 } | 1017 } |
1014 | 1018 |
1015 void RootWindowController::OnTouchHudProjectionToggled(bool enabled) { | 1019 void RootWindowController::OnTouchHudProjectionToggled(bool enabled) { |
1016 if (enabled) | 1020 if (enabled) |
1017 EnableTouchHudProjection(); | 1021 EnableTouchHudProjection(); |
1018 else | 1022 else |
1019 DisableTouchHudProjection(); | 1023 DisableTouchHudProjection(); |
1020 } | 1024 } |
1021 | 1025 |
1026 void RootWindowController::UpdateTouchExplorationState() { | |
1027 AccessibilityDelegate* delegate = | |
1028 Shell::GetInstance()->accessibility_delegate(); | |
Daniel Erat
2014/04/18 00:44:08
fix indenting: should be four spaces beyond previo
| |
1029 bool enabled = delegate->IsSpokenFeedbackEnabled(); | |
1030 | |
1031 LOG(ERROR) << "RWC::UpdateTouchExplorationState: enabled=" << enabled; | |
Daniel Erat
2014/04/18 00:44:08
remove debugging logging
| |
1032 | |
1033 if (enabled && !touch_exploration_controller_.get()) { | |
1034 touch_exploration_controller_.reset( | |
1035 new TouchExplorationController(GetRootWindow())); | |
1036 } else if (!enabled && touch_exploration_controller_.get()) { | |
1037 touch_exploration_controller_.reset(); | |
1038 } | |
1039 } | |
1040 | |
1041 void RootWindowController::OnAccessibilityModeChanged( | |
1042 AccessibilityNotificationVisibility notify) { | |
1043 UpdateTouchExplorationState(); | |
1044 } | |
1045 | |
1022 RootWindowController* GetRootWindowController( | 1046 RootWindowController* GetRootWindowController( |
1023 const aura::Window* root_window) { | 1047 const aura::Window* root_window) { |
1024 return root_window ? GetRootWindowSettings(root_window)->controller : NULL; | 1048 return root_window ? GetRootWindowSettings(root_window)->controller : NULL; |
1025 } | 1049 } |
1026 | 1050 |
1027 } // namespace ash | 1051 } // namespace ash |
OLD | NEW |