| 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 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 #include "ash/desktop_background/user_wallpaper_delegate.h" | 32 #include "ash/desktop_background/user_wallpaper_delegate.h" |
| 33 #include "ash/display/cursor_window_controller.h" | 33 #include "ash/display/cursor_window_controller.h" |
| 34 #include "ash/display/display_configuration_controller.h" | 34 #include "ash/display/display_configuration_controller.h" |
| 35 #include "ash/display/display_manager.h" | 35 #include "ash/display/display_manager.h" |
| 36 #include "ash/display/event_transformation_handler.h" | 36 #include "ash/display/event_transformation_handler.h" |
| 37 #include "ash/display/mouse_cursor_event_filter.h" | 37 #include "ash/display/mouse_cursor_event_filter.h" |
| 38 #include "ash/display/screen_position_controller.h" | 38 #include "ash/display/screen_position_controller.h" |
| 39 #include "ash/display/window_tree_host_manager.h" | 39 #include "ash/display/window_tree_host_manager.h" |
| 40 #include "ash/drag_drop/drag_drop_controller.h" | 40 #include "ash/drag_drop/drag_drop_controller.h" |
| 41 #include "ash/first_run/first_run_helper_impl.h" | 41 #include "ash/first_run/first_run_helper_impl.h" |
| 42 #include "ash/focus_cycler.h" | |
| 43 #include "ash/frame/custom_frame_view_ash.h" | 42 #include "ash/frame/custom_frame_view_ash.h" |
| 44 #include "ash/gpu_support.h" | 43 #include "ash/gpu_support.h" |
| 45 #include "ash/high_contrast/high_contrast_controller.h" | 44 #include "ash/high_contrast/high_contrast_controller.h" |
| 46 #include "ash/host/ash_window_tree_host_init_params.h" | 45 #include "ash/host/ash_window_tree_host_init_params.h" |
| 47 #include "ash/ime/input_method_event_handler.h" | 46 #include "ash/ime/input_method_event_handler.h" |
| 48 #include "ash/keyboard/keyboard_ui.h" | 47 #include "ash/keyboard/keyboard_ui.h" |
| 49 #include "ash/keyboard_uma_event_filter.h" | 48 #include "ash/keyboard_uma_event_filter.h" |
| 50 #include "ash/magnifier/magnification_controller.h" | 49 #include "ash/magnifier/magnification_controller.h" |
| 51 #include "ash/magnifier/partial_magnification_controller.h" | 50 #include "ash/magnifier/partial_magnification_controller.h" |
| 52 #include "ash/media_delegate.h" | 51 #include "ash/media_delegate.h" |
| (...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 360 } | 359 } |
| 361 return false; | 360 return false; |
| 362 } | 361 } |
| 363 | 362 |
| 364 views::NonClientFrameView* Shell::CreateDefaultNonClientFrameView( | 363 views::NonClientFrameView* Shell::CreateDefaultNonClientFrameView( |
| 365 views::Widget* widget) { | 364 views::Widget* widget) { |
| 366 // Use translucent-style window frames for dialogs. | 365 // Use translucent-style window frames for dialogs. |
| 367 return new CustomFrameViewAsh(widget); | 366 return new CustomFrameViewAsh(widget); |
| 368 } | 367 } |
| 369 | 368 |
| 370 void Shell::RotateFocus(Direction direction) { | |
| 371 focus_cycler_->RotateFocus(direction == FORWARD ? FocusCycler::FORWARD | |
| 372 : FocusCycler::BACKWARD); | |
| 373 } | |
| 374 | |
| 375 void Shell::SetDisplayWorkAreaInsets(Window* contains, | 369 void Shell::SetDisplayWorkAreaInsets(Window* contains, |
| 376 const gfx::Insets& insets) { | 370 const gfx::Insets& insets) { |
| 377 if (!window_tree_host_manager_->UpdateWorkAreaOfDisplayNearestWindow( | 371 if (!window_tree_host_manager_->UpdateWorkAreaOfDisplayNearestWindow( |
| 378 contains, insets)) { | 372 contains, insets)) { |
| 379 return; | 373 return; |
| 380 } | 374 } |
| 381 FOR_EACH_OBSERVER(ShellObserver, *wm_shell_common_->shell_observers(), | 375 FOR_EACH_OBSERVER(ShellObserver, *wm_shell_common_->shell_observers(), |
| 382 OnDisplayWorkAreaInsetsChanged()); | 376 OnDisplayWorkAreaInsetsChanged()); |
| 383 } | 377 } |
| 384 | 378 |
| (...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 948 env_filter_.reset(new ::wm::CompoundEventFilter); | 942 env_filter_.reset(new ::wm::CompoundEventFilter); |
| 949 AddPreTargetHandler(env_filter_.get()); | 943 AddPreTargetHandler(env_filter_.get()); |
| 950 | 944 |
| 951 wm::AshFocusRules* focus_rules = new wm::AshFocusRules(); | 945 wm::AshFocusRules* focus_rules = new wm::AshFocusRules(); |
| 952 | 946 |
| 953 ::wm::FocusController* focus_controller = | 947 ::wm::FocusController* focus_controller = |
| 954 new ::wm::FocusController(focus_rules); | 948 new ::wm::FocusController(focus_rules); |
| 955 focus_client_.reset(focus_controller); | 949 focus_client_.reset(focus_controller); |
| 956 activation_client_ = focus_controller; | 950 activation_client_ = focus_controller; |
| 957 activation_client_->AddObserver(this); | 951 activation_client_->AddObserver(this); |
| 958 focus_cycler_.reset(new FocusCycler()); | |
| 959 | 952 |
| 960 screen_position_controller_.reset(new ScreenPositionController); | 953 screen_position_controller_.reset(new ScreenPositionController); |
| 961 | 954 |
| 962 window_tree_host_manager_->Start(); | 955 window_tree_host_manager_->Start(); |
| 963 window_tree_host_manager_->CreatePrimaryHost( | 956 window_tree_host_manager_->CreatePrimaryHost( |
| 964 ShellInitParamsToAshWindowTreeHostInitParams(init_params)); | 957 ShellInitParamsToAshWindowTreeHostInitParams(init_params)); |
| 965 aura::Window* root_window = window_tree_host_manager_->GetPrimaryRootWindow(); | 958 aura::Window* root_window = window_tree_host_manager_->GetPrimaryRootWindow(); |
| 966 target_root_window_ = root_window; | 959 target_root_window_ = root_window; |
| 967 | 960 |
| 968 #if defined(OS_CHROMEOS) | 961 #if defined(OS_CHROMEOS) |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1243 | 1236 |
| 1244 void Shell::OnWindowActivated( | 1237 void Shell::OnWindowActivated( |
| 1245 aura::client::ActivationChangeObserver::ActivationReason reason, | 1238 aura::client::ActivationChangeObserver::ActivationReason reason, |
| 1246 aura::Window* gained_active, | 1239 aura::Window* gained_active, |
| 1247 aura::Window* lost_active) { | 1240 aura::Window* lost_active) { |
| 1248 if (gained_active) | 1241 if (gained_active) |
| 1249 target_root_window_ = gained_active->GetRootWindow(); | 1242 target_root_window_ = gained_active->GetRootWindow(); |
| 1250 } | 1243 } |
| 1251 | 1244 |
| 1252 } // namespace ash | 1245 } // namespace ash |
| OLD | NEW |