Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(780)

Side by Side Diff: ash/shell.cc

Issue 9960042: Refactor screen/monitor so that gfx::Screen returns monitor object. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cleanup Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 gfx::Monitor* monitor = aura::Env::GetInstance()->monitor_manager()->
792 GetMonitorNearestWindow(contains); 793 GetMonitorNearestWindow(contains);
793 if (monitor->work_area_insets() == insets) 794 gfx::Rect old_work_area = monitor->work_area();
795 monitor->UpdateWorkAreaWithInsets(insets);
796 if (old_work_area == monitor->work_area())
794 return; 797 return;
795 monitor->set_work_area_insets(insets);
796 FOR_EACH_OBSERVER(ShellObserver, observers_, 798 FOR_EACH_OBSERVER(ShellObserver, observers_,
797 OnMonitorWorkAreaInsetsChanged()); 799 OnMonitorWorkAreaInsetsChanged());
798 } 800 }
799 801
800 void Shell::OnLoginStateChanged(user::LoginStatus status) { 802 void Shell::OnLoginStateChanged(user::LoginStatus status) {
801 FOR_EACH_OBSERVER(ShellObserver, observers_, OnLoginStateChanged(status)); 803 FOR_EACH_OBSERVER(ShellObserver, observers_, OnLoginStateChanged(status));
802 } 804 }
803 805
804 void Shell::OnAppTerminating() { 806 void Shell::OnAppTerminating() {
805 FOR_EACH_OBSERVER(ShellObserver, observers_, OnAppTerminating()); 807 FOR_EACH_OBSERVER(ShellObserver, observers_, OnAppTerminating());
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
902 panel_container->SetLayoutManager(panel_layout_manager_); 904 panel_container->SetLayoutManager(panel_layout_manager_);
903 } 905 }
904 } 906 }
905 907
906 void Shell::DisableWorkspaceGridLayout() { 908 void Shell::DisableWorkspaceGridLayout() {
907 if (workspace_controller_.get()) 909 if (workspace_controller_.get())
908 workspace_controller_->workspace_manager()->set_grid_size(0); 910 workspace_controller_->workspace_manager()->set_grid_size(0);
909 } 911 }
910 912
911 } // namespace ash 913 } // namespace ash
OLDNEW
« no previous file with comments | « ash/screen_ash.cc ('k') | ash/system/tray/system_tray.cc » ('j') | ui/aura/monitor_manager.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698