| 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 #include "ash/wm/window_modality_controller.h" | 50 #include "ash/wm/window_modality_controller.h" |
| 51 #include "ash/wm/window_util.h" | 51 #include "ash/wm/window_util.h" |
| 52 #include "ash/wm/workspace_controller.h" | 52 #include "ash/wm/workspace_controller.h" |
| 53 #include "ash/wm/workspace/workspace_event_filter.h" | 53 #include "ash/wm/workspace/workspace_event_filter.h" |
| 54 #include "ash/wm/workspace/workspace_layout_manager.h" | 54 #include "ash/wm/workspace/workspace_layout_manager.h" |
| 55 #include "ash/wm/workspace/workspace_manager.h" | 55 #include "ash/wm/workspace/workspace_manager.h" |
| 56 #include "base/bind.h" | 56 #include "base/bind.h" |
| 57 #include "base/command_line.h" | 57 #include "base/command_line.h" |
| 58 #include "third_party/skia/include/core/SkBitmap.h" | 58 #include "third_party/skia/include/core/SkBitmap.h" |
| 59 #include "ui/aura/client/aura_constants.h" | 59 #include "ui/aura/client/aura_constants.h" |
| 60 #include "ui/aura/env.h" |
| 60 #include "ui/aura/layout_manager.h" | 61 #include "ui/aura/layout_manager.h" |
| 62 #include "ui/aura/monitor.h" |
| 63 #include "ui/aura/monitor_manager.h" |
| 61 #include "ui/aura/root_window.h" | 64 #include "ui/aura/root_window.h" |
| 62 #include "ui/aura/window.h" | 65 #include "ui/aura/window.h" |
| 63 #include "ui/gfx/compositor/layer.h" | 66 #include "ui/gfx/compositor/layer.h" |
| 64 #include "ui/gfx/compositor/layer_animator.h" | 67 #include "ui/gfx/compositor/layer_animator.h" |
| 65 #include "ui/gfx/screen.h" | |
| 66 #include "ui/gfx/size.h" | 68 #include "ui/gfx/size.h" |
| 67 #include "ui/views/widget/native_widget_aura.h" | 69 #include "ui/views/widget/native_widget_aura.h" |
| 68 #include "ui/views/widget/widget.h" | 70 #include "ui/views/widget/widget.h" |
| 69 | 71 |
| 70 #if !defined(OS_MACOSX) | 72 #if !defined(OS_MACOSX) |
| 71 #include "ash/accelerators/accelerator_controller.h" | 73 #include "ash/accelerators/accelerator_controller.h" |
| 72 #include "ash/accelerators/accelerator_filter.h" | 74 #include "ash/accelerators/accelerator_filter.h" |
| 73 #include "ash/accelerators/nested_dispatcher_controller.h" | 75 #include "ash/accelerators/nested_dispatcher_controller.h" |
| 74 #endif | 76 #endif |
| 75 | 77 |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 root_filter_(NULL), | 313 root_filter_(NULL), |
| 312 delegate_(delegate), | 314 delegate_(delegate), |
| 313 audio_controller_(NULL), | 315 audio_controller_(NULL), |
| 314 brightness_controller_(NULL), | 316 brightness_controller_(NULL), |
| 315 network_controller_(NULL), | 317 network_controller_(NULL), |
| 316 power_status_controller_(NULL), | 318 power_status_controller_(NULL), |
| 317 shelf_(NULL), | 319 shelf_(NULL), |
| 318 desktop_background_mode_(BACKGROUND_IMAGE), | 320 desktop_background_mode_(BACKGROUND_IMAGE), |
| 319 root_window_layout_(NULL), | 321 root_window_layout_(NULL), |
| 320 status_widget_(NULL) { | 322 status_widget_(NULL) { |
| 323 aura::Env::GetInstance()->SetMonitorManager( |
| 324 aura::CreateSingleMonitorManager(root_window_.get())); |
| 321 gfx::Screen::SetInstance(screen_); | 325 gfx::Screen::SetInstance(screen_); |
| 322 } | 326 } |
| 323 | 327 |
| 324 Shell::~Shell() { | 328 Shell::~Shell() { |
| 325 RemoveRootWindowEventFilter(partial_screenshot_filter_.get()); | 329 RemoveRootWindowEventFilter(partial_screenshot_filter_.get()); |
| 326 RemoveRootWindowEventFilter(input_method_filter_.get()); | 330 RemoveRootWindowEventFilter(input_method_filter_.get()); |
| 327 RemoveRootWindowEventFilter(window_modality_controller_.get()); | 331 RemoveRootWindowEventFilter(window_modality_controller_.get()); |
| 328 #if !defined(OS_MACOSX) | 332 #if !defined(OS_MACOSX) |
| 329 RemoveRootWindowEventFilter(accelerator_filter_.get()); | 333 RemoveRootWindowEventFilter(accelerator_filter_.get()); |
| 330 #endif | 334 #endif |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 593 frame_view->Init(widget); | 597 frame_view->Init(widget); |
| 594 return frame_view; | 598 return frame_view; |
| 595 } | 599 } |
| 596 | 600 |
| 597 void Shell::RotateFocus(Direction direction) { | 601 void Shell::RotateFocus(Direction direction) { |
| 598 focus_cycler_->RotateFocus( | 602 focus_cycler_->RotateFocus( |
| 599 direction == FORWARD ? internal::FocusCycler::FORWARD : | 603 direction == FORWARD ? internal::FocusCycler::FORWARD : |
| 600 internal::FocusCycler::BACKWARD); | 604 internal::FocusCycler::BACKWARD); |
| 601 } | 605 } |
| 602 | 606 |
| 603 void Shell::SetScreenWorkAreaInsets(const gfx::Insets& insets) { | 607 void Shell::SetMonitorWorkAreaInsets(Window* contains, |
| 604 if (screen_->work_area_insets() == insets) | 608 const gfx::Insets& insets) { |
| 609 aura::Monitor* monitor = aura::Env::GetInstance()->monitor_manager()-> |
| 610 GetMonitorNearestWindow(contains); |
| 611 if (monitor->work_area_insets() == insets) |
| 605 return; | 612 return; |
| 606 screen_->set_work_area_insets(insets); | 613 monitor->set_work_area_insets(insets); |
| 607 FOR_EACH_OBSERVER(ShellObserver, observers_, | 614 FOR_EACH_OBSERVER(ShellObserver, observers_, |
| 608 OnScreenWorkAreaInsetsChanged()); | 615 OnMonitorWorkAreaInsetsChanged()); |
| 609 } | 616 } |
| 610 | 617 |
| 611 void Shell::AddShellObserver(ShellObserver* observer) { | 618 void Shell::AddShellObserver(ShellObserver* observer) { |
| 612 observers_.AddObserver(observer); | 619 observers_.AddObserver(observer); |
| 613 } | 620 } |
| 614 | 621 |
| 615 void Shell::RemoveShellObserver(ShellObserver* observer) { | 622 void Shell::RemoveShellObserver(ShellObserver* observer) { |
| 616 observers_.RemoveObserver(observer); | 623 observers_.RemoveObserver(observer); |
| 617 } | 624 } |
| 618 | 625 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 647 // Create the desktop background image. | 654 // Create the desktop background image. |
| 648 SetDesktopBackgroundMode(BACKGROUND_IMAGE); | 655 SetDesktopBackgroundMode(BACKGROUND_IMAGE); |
| 649 } | 656 } |
| 650 | 657 |
| 651 void Shell::DisableWorkspaceGridLayout() { | 658 void Shell::DisableWorkspaceGridLayout() { |
| 652 if (workspace_controller_.get()) | 659 if (workspace_controller_.get()) |
| 653 workspace_controller_->workspace_manager()->set_grid_size(0); | 660 workspace_controller_->workspace_manager()->set_grid_size(0); |
| 654 } | 661 } |
| 655 | 662 |
| 656 } // namespace ash | 663 } // namespace ash |
| OLD | NEW |