| 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 | 9 |
| 9 #include "ash/accelerators/focus_manager_factory.h" | 10 #include "ash/accelerators/focus_manager_factory.h" |
| 10 #include "ash/app_list/app_list.h" | |
| 11 #include "ash/ash_switches.h" | 11 #include "ash/ash_switches.h" |
| 12 #include "ash/desktop_background/desktop_background_controller.h" | 12 #include "ash/desktop_background/desktop_background_controller.h" |
| 13 #include "ash/desktop_background/desktop_background_resources.h" | 13 #include "ash/desktop_background/desktop_background_resources.h" |
| 14 #include "ash/desktop_background/desktop_background_view.h" | 14 #include "ash/desktop_background/desktop_background_view.h" |
| 15 #include "ash/drag_drop/drag_drop_controller.h" | 15 #include "ash/drag_drop/drag_drop_controller.h" |
| 16 #include "ash/focus_cycler.h" | 16 #include "ash/focus_cycler.h" |
| 17 #include "ash/ime/input_method_event_filter.h" | 17 #include "ash/ime/input_method_event_filter.h" |
| 18 #include "ash/launcher/launcher.h" | 18 #include "ash/launcher/launcher.h" |
| 19 #include "ash/magnifier/magnification_controller.h" | 19 #include "ash/magnifier/magnification_controller.h" |
| 20 #include "ash/monitor/monitor_controller.h" | 20 #include "ash/monitor/monitor_controller.h" |
| 21 #include "ash/monitor/multi_monitor_manager.h" | 21 #include "ash/monitor/multi_monitor_manager.h" |
| 22 #include "ash/screen_ash.h" | 22 #include "ash/screen_ash.h" |
| 23 #include "ash/shell_context_menu.h" | 23 #include "ash/shell_context_menu.h" |
| 24 #include "ash/shell_delegate.h" | 24 #include "ash/shell_delegate.h" |
| 25 #include "ash/shell_factory.h" | 25 #include "ash/shell_factory.h" |
| 26 #include "ash/shell_window_ids.h" | 26 #include "ash/shell_window_ids.h" |
| 27 #include "ash/system/bluetooth/bluetooth_observer.h" | 27 #include "ash/system/bluetooth/bluetooth_observer.h" |
| 28 #include "ash/system/network/network_observer.h" | 28 #include "ash/system/network/network_observer.h" |
| 29 #include "ash/system/tray/system_tray.h" | 29 #include "ash/system/tray/system_tray.h" |
| 30 #include "ash/system/tray/system_tray_delegate.h" | 30 #include "ash/system/tray/system_tray_delegate.h" |
| 31 #include "ash/tooltips/tooltip_controller.h" | 31 #include "ash/tooltips/tooltip_controller.h" |
| 32 #include "ash/wm/activation_controller.h" | 32 #include "ash/wm/activation_controller.h" |
| 33 #include "ash/wm/app_list_controller.h" |
| 33 #include "ash/wm/base_layout_manager.h" | 34 #include "ash/wm/base_layout_manager.h" |
| 34 #include "ash/wm/custom_frame_view_ash.h" | 35 #include "ash/wm/custom_frame_view_ash.h" |
| 35 #include "ash/wm/dialog_frame_view.h" | 36 #include "ash/wm/dialog_frame_view.h" |
| 36 #include "ash/wm/event_client_impl.h" | 37 #include "ash/wm/event_client_impl.h" |
| 37 #include "ash/wm/key_rewriter_event_filter.h" | 38 #include "ash/wm/key_rewriter_event_filter.h" |
| 38 #include "ash/wm/panel_layout_manager.h" | 39 #include "ash/wm/panel_layout_manager.h" |
| 39 #include "ash/wm/panel_window_event_filter.h" | 40 #include "ash/wm/panel_window_event_filter.h" |
| 40 #include "ash/wm/partial_screenshot_event_filter.h" | 41 #include "ash/wm/partial_screenshot_event_filter.h" |
| 41 #include "ash/wm/power_button_controller.h" | 42 #include "ash/wm/power_button_controller.h" |
| 42 #include "ash/wm/resize_shadow_controller.h" | 43 #include "ash/wm/resize_shadow_controller.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 60 #include "ash/wm/workspace/workspace_manager.h" | 61 #include "ash/wm/workspace/workspace_manager.h" |
| 61 #include "ash/wm/workspace_controller.h" | 62 #include "ash/wm/workspace_controller.h" |
| 62 #include "base/bind.h" | 63 #include "base/bind.h" |
| 63 #include "base/command_line.h" | 64 #include "base/command_line.h" |
| 64 #include "grit/ui_resources.h" | 65 #include "grit/ui_resources.h" |
| 65 #include "third_party/skia/include/core/SkBitmap.h" | 66 #include "third_party/skia/include/core/SkBitmap.h" |
| 66 #include "ui/aura/client/aura_constants.h" | 67 #include "ui/aura/client/aura_constants.h" |
| 67 #include "ui/aura/env.h" | 68 #include "ui/aura/env.h" |
| 68 #include "ui/aura/layout_manager.h" | 69 #include "ui/aura/layout_manager.h" |
| 69 #include "ui/aura/monitor_manager.h" | 70 #include "ui/aura/monitor_manager.h" |
| 70 #include "ui/aura/monitor_manager.h" | |
| 71 #include "ui/aura/root_window.h" | 71 #include "ui/aura/root_window.h" |
| 72 #include "ui/aura/ui_controls_aura.h" | 72 #include "ui/aura/ui_controls_aura.h" |
| 73 #include "ui/aura/window.h" | 73 #include "ui/aura/window.h" |
| 74 #include "ui/compositor/layer.h" | 74 #include "ui/compositor/layer.h" |
| 75 #include "ui/compositor/layer_animator.h" | 75 #include "ui/compositor/layer_animator.h" |
| 76 #include "ui/gfx/monitor.h" | 76 #include "ui/gfx/monitor.h" |
| 77 #include "ui/gfx/screen.h" | 77 #include "ui/gfx/screen.h" |
| 78 #include "ui/gfx/size.h" | 78 #include "ui/gfx/size.h" |
| 79 #include "ui/ui_controls/ui_controls.h" | 79 #include "ui/ui_controls/ui_controls.h" |
| 80 #include "ui/views/focus/focus_manager_factory.h" | 80 #include "ui/views/focus/focus_manager_factory.h" |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 } | 236 } |
| 237 | 237 |
| 238 virtual void OpenSetWallpaperPage() OVERRIDE { | 238 virtual void OpenSetWallpaperPage() OVERRIDE { |
| 239 } | 239 } |
| 240 | 240 |
| 241 virtual bool CanOpenSetWallpaperPage() OVERRIDE { | 241 virtual bool CanOpenSetWallpaperPage() OVERRIDE { |
| 242 return false; | 242 return false; |
| 243 } | 243 } |
| 244 | 244 |
| 245 private: | 245 private: |
| 246 DISALLOW_COPY_AND_ASSIGN(DummyUserWallpaperDelegate); | 246 DISALLOW_COPY_AND_ASSIGN(DummyUserWallpaperDelegate); |
| 247 }; | 247 }; |
| 248 | 248 |
| 249 class DummySystemTrayDelegate : public SystemTrayDelegate { | 249 class DummySystemTrayDelegate : public SystemTrayDelegate { |
| 250 public: | 250 public: |
| 251 DummySystemTrayDelegate() | 251 DummySystemTrayDelegate() |
| 252 : muted_(false), | 252 : muted_(false), |
| 253 wifi_enabled_(true), | 253 wifi_enabled_(true), |
| 254 cellular_enabled_(true), | 254 cellular_enabled_(true), |
| 255 bluetooth_enabled_(true), | 255 bluetooth_enabled_(true), |
| 256 volume_(0.5), | 256 volume_(0.5), |
| 257 caps_lock_enabled_(false) { | 257 caps_lock_enabled_(false) { |
| 258 } | 258 } |
| 259 | 259 |
| 260 virtual ~DummySystemTrayDelegate() {} | 260 virtual ~DummySystemTrayDelegate() {} |
| 261 | 261 |
| 262 private: | 262 private: |
| 263 | |
| 264 virtual bool GetTrayVisibilityOnStartup() OVERRIDE { return true; } | 263 virtual bool GetTrayVisibilityOnStartup() OVERRIDE { return true; } |
| 265 | 264 |
| 266 // Overridden from SystemTrayDelegate: | 265 // Overridden from SystemTrayDelegate: |
| 267 virtual const std::string GetUserDisplayName() const OVERRIDE { | 266 virtual const std::string GetUserDisplayName() const OVERRIDE { |
| 268 return "Über tray Über tray Über tray Über tray"; | 267 return "Über tray Über tray Über tray Über tray"; |
| 269 } | 268 } |
| 270 | 269 |
| 271 virtual const std::string GetUserEmail() const OVERRIDE { | 270 virtual const std::string GetUserEmail() const OVERRIDE { |
| 272 return "über@tray"; | 271 return "über@tray"; |
| 273 } | 272 } |
| (...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 773 GetRootWindow()->event_filter())->GetFilterCount(); | 772 GetRootWindow()->event_filter())->GetFilterCount(); |
| 774 } | 773 } |
| 775 | 774 |
| 776 void Shell::ShowBackgroundMenu(views::Widget* widget, | 775 void Shell::ShowBackgroundMenu(views::Widget* widget, |
| 777 const gfx::Point& location) { | 776 const gfx::Point& location) { |
| 778 if (shell_context_menu_.get()) | 777 if (shell_context_menu_.get()) |
| 779 shell_context_menu_->ShowMenu(widget, location); | 778 shell_context_menu_->ShowMenu(widget, location); |
| 780 } | 779 } |
| 781 | 780 |
| 782 void Shell::ToggleAppList() { | 781 void Shell::ToggleAppList() { |
| 783 if (!app_list_.get()) | 782 if (!app_list_controller_.get()) |
| 784 app_list_.reset(new internal::AppList); | 783 app_list_controller_.reset(new internal::AppListController); |
| 785 app_list_->SetVisible(!app_list_->IsVisible()); | 784 app_list_controller_->SetVisible(!app_list_controller_->IsVisible()); |
| 786 } | 785 } |
| 787 | 786 |
| 788 bool Shell::GetAppListTargetVisibility() const { | 787 bool Shell::GetAppListTargetVisibility() const { |
| 789 return app_list_.get() && app_list_->GetTargetVisibility(); | 788 return app_list_controller_.get() && |
| 789 app_list_controller_->GetTargetVisibility(); |
| 790 } | 790 } |
| 791 | 791 |
| 792 aura::Window* Shell::GetAppListWindow() { | 792 aura::Window* Shell::GetAppListWindow() { |
| 793 return app_list_.get() ? app_list_->GetWindow() : NULL; | 793 return app_list_controller_.get() ? app_list_controller_->GetWindow() : NULL; |
| 794 } | 794 } |
| 795 | 795 |
| 796 bool Shell::IsScreenLocked() const { | 796 bool Shell::IsScreenLocked() const { |
| 797 return !delegate_.get() || delegate_->IsScreenLocked(); | 797 return !delegate_.get() || delegate_->IsScreenLocked(); |
| 798 } | 798 } |
| 799 | 799 |
| 800 bool Shell::IsModalWindowOpen() const { | 800 bool Shell::IsModalWindowOpen() const { |
| 801 const aura::Window* modal_container = GetContainer( | 801 const aura::Window* modal_container = GetContainer( |
| 802 internal::kShellWindowId_SystemModalContainer); | 802 internal::kShellWindowId_SystemModalContainer); |
| 803 return !modal_container->children().empty(); | 803 return !modal_container->children().empty(); |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 934 panel_container->SetLayoutManager(panel_layout_manager_); | 934 panel_container->SetLayoutManager(panel_layout_manager_); |
| 935 } | 935 } |
| 936 } | 936 } |
| 937 | 937 |
| 938 void Shell::DisableWorkspaceGridLayout() { | 938 void Shell::DisableWorkspaceGridLayout() { |
| 939 if (workspace_controller_.get()) | 939 if (workspace_controller_.get()) |
| 940 workspace_controller_->workspace_manager()->set_grid_size(0); | 940 workspace_controller_->workspace_manager()->set_grid_size(0); |
| 941 } | 941 } |
| 942 | 942 |
| 943 } // namespace ash | 943 } // namespace ash |
| OLD | NEW |