| 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/app_list/app_list.h" | 9 #include "ash/app_list/app_list.h" |
| 10 #include "ash/ash_switches.h" | 10 #include "ash/ash_switches.h" |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 #include "ash/wm/workspace/workspace_layout_manager.h" | 56 #include "ash/wm/workspace/workspace_layout_manager.h" |
| 57 #include "ash/wm/workspace/workspace_manager.h" | 57 #include "ash/wm/workspace/workspace_manager.h" |
| 58 #include "ash/wm/workspace_controller.h" | 58 #include "ash/wm/workspace_controller.h" |
| 59 #include "base/bind.h" | 59 #include "base/bind.h" |
| 60 #include "base/command_line.h" | 60 #include "base/command_line.h" |
| 61 #include "grit/ui_resources.h" | 61 #include "grit/ui_resources.h" |
| 62 #include "third_party/skia/include/core/SkBitmap.h" | 62 #include "third_party/skia/include/core/SkBitmap.h" |
| 63 #include "ui/aura/client/aura_constants.h" | 63 #include "ui/aura/client/aura_constants.h" |
| 64 #include "ui/aura/env.h" | 64 #include "ui/aura/env.h" |
| 65 #include "ui/aura/layout_manager.h" | 65 #include "ui/aura/layout_manager.h" |
| 66 #include "ui/aura/monitor.h" | |
| 67 #include "ui/aura/monitor_manager.h" | 66 #include "ui/aura/monitor_manager.h" |
| 68 #include "ui/aura/monitor_manager.h" | 67 #include "ui/aura/monitor_manager.h" |
| 69 #include "ui/aura/root_window.h" | 68 #include "ui/aura/root_window.h" |
| 70 #include "ui/aura/ui_controls_aura.h" | 69 #include "ui/aura/ui_controls_aura.h" |
| 71 #include "ui/aura/window.h" | 70 #include "ui/aura/window.h" |
| 72 #include "ui/gfx/compositor/layer.h" | 71 #include "ui/gfx/compositor/layer.h" |
| 73 #include "ui/gfx/compositor/layer_animator.h" | 72 #include "ui/gfx/compositor/layer_animator.h" |
| 73 #include "ui/gfx/monitor.h" |
| 74 #include "ui/gfx/screen.h" |
| 74 #include "ui/gfx/size.h" | 75 #include "ui/gfx/size.h" |
| 75 #include "ui/ui_controls/ui_controls.h" | 76 #include "ui/ui_controls/ui_controls.h" |
| 76 #include "ui/views/widget/native_widget_aura.h" | 77 #include "ui/views/widget/native_widget_aura.h" |
| 77 #include "ui/views/widget/widget.h" | 78 #include "ui/views/widget/widget.h" |
| 78 | 79 |
| 79 #if !defined(OS_MACOSX) | 80 #if !defined(OS_MACOSX) |
| 80 #include "ash/accelerators/accelerator_controller.h" | 81 #include "ash/accelerators/accelerator_controller.h" |
| 81 #include "ash/accelerators/accelerator_filter.h" | 82 #include "ash/accelerators/accelerator_filter.h" |
| 82 #include "ash/accelerators/nested_dispatcher_controller.h" | 83 #include "ash/accelerators/nested_dispatcher_controller.h" |
| 83 #endif | 84 #endif |
| (...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 781 } | 782 } |
| 782 | 783 |
| 783 void Shell::RotateFocus(Direction direction) { | 784 void Shell::RotateFocus(Direction direction) { |
| 784 focus_cycler_->RotateFocus( | 785 focus_cycler_->RotateFocus( |
| 785 direction == FORWARD ? internal::FocusCycler::FORWARD : | 786 direction == FORWARD ? internal::FocusCycler::FORWARD : |
| 786 internal::FocusCycler::BACKWARD); | 787 internal::FocusCycler::BACKWARD); |
| 787 } | 788 } |
| 788 | 789 |
| 789 void Shell::SetMonitorWorkAreaInsets(Window* contains, | 790 void Shell::SetMonitorWorkAreaInsets(Window* contains, |
| 790 const gfx::Insets& insets) { | 791 const gfx::Insets& insets) { |
| 791 aura::Monitor* monitor = aura::Env::GetInstance()->monitor_manager()-> | 792 internal::MultiMonitorManager* monitor_manager = |
| 792 GetMonitorNearestWindow(contains); | 793 static_cast<internal::MultiMonitorManager*>( |
| 793 if (monitor->work_area_insets() == insets) | 794 aura::Env::GetInstance()->monitor_manager()); |
| 795 if (!monitor_manager->UpdateWorkAreaOfMonitorNearestWindow(contains, insets)) |
| 794 return; | 796 return; |
| 795 monitor->set_work_area_insets(insets); | |
| 796 FOR_EACH_OBSERVER(ShellObserver, observers_, | 797 FOR_EACH_OBSERVER(ShellObserver, observers_, |
| 797 OnMonitorWorkAreaInsetsChanged()); | 798 OnMonitorWorkAreaInsetsChanged()); |
| 798 } | 799 } |
| 799 | 800 |
| 800 void Shell::OnLoginStateChanged(user::LoginStatus status) { | 801 void Shell::OnLoginStateChanged(user::LoginStatus status) { |
| 801 FOR_EACH_OBSERVER(ShellObserver, observers_, OnLoginStateChanged(status)); | 802 FOR_EACH_OBSERVER(ShellObserver, observers_, OnLoginStateChanged(status)); |
| 802 } | 803 } |
| 803 | 804 |
| 804 void Shell::OnAppTerminating() { | 805 void Shell::OnAppTerminating() { |
| 805 FOR_EACH_OBSERVER(ShellObserver, observers_, OnAppTerminating()); | 806 FOR_EACH_OBSERVER(ShellObserver, observers_, OnAppTerminating()); |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 902 panel_container->SetLayoutManager(panel_layout_manager_); | 903 panel_container->SetLayoutManager(panel_layout_manager_); |
| 903 } | 904 } |
| 904 } | 905 } |
| 905 | 906 |
| 906 void Shell::DisableWorkspaceGridLayout() { | 907 void Shell::DisableWorkspaceGridLayout() { |
| 907 if (workspace_controller_.get()) | 908 if (workspace_controller_.get()) |
| 908 workspace_controller_->workspace_manager()->set_grid_size(0); | 909 workspace_controller_->workspace_manager()->set_grid_size(0); |
| 909 } | 910 } |
| 910 | 911 |
| 911 } // namespace ash | 912 } // namespace ash |
| OLD | NEW |