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/accelerators/accelerator_controller.h" | 5 #include "ash/accelerators/accelerator_controller.h" |
6 | 6 |
7 #include "ash/accelerators/accelerator_table.h" | 7 #include "ash/accelerators/accelerator_table.h" |
| 8 #include "ash/desktop_background/desktop_background_controller.h" |
8 #include "ash/ash_switches.h" | 9 #include "ash/ash_switches.h" |
9 #include "ash/caps_lock_delegate.h" | 10 #include "ash/caps_lock_delegate.h" |
10 #include "ash/ime_control_delegate.h" | 11 #include "ash/ime_control_delegate.h" |
11 #include "ash/launcher/launcher.h" | 12 #include "ash/launcher/launcher.h" |
12 #include "ash/launcher/launcher_model.h" | 13 #include "ash/launcher/launcher_model.h" |
13 #include "ash/screenshot_delegate.h" | 14 #include "ash/screenshot_delegate.h" |
14 #include "ash/shell.h" | 15 #include "ash/shell.h" |
15 #include "ash/shell_delegate.h" | 16 #include "ash/shell_delegate.h" |
16 #include "ash/shell_window_ids.h" | 17 #include "ash/shell_window_ids.h" |
17 #include "ash/system/brightness/brightness_control_delegate.h" | 18 #include "ash/system/brightness/brightness_control_delegate.h" |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 set_preemption_strategy(ui::LayerAnimator::REPLACE_QUEUED_ANIMATIONS); | 84 set_preemption_strategy(ui::LayerAnimator::REPLACE_QUEUED_ANIMATIONS); |
84 scoped_ptr<ui::LayerAnimationSequence> screen_rotation( | 85 scoped_ptr<ui::LayerAnimationSequence> screen_rotation( |
85 new ui::LayerAnimationSequence(new ui::ScreenRotation(delta))); | 86 new ui::LayerAnimationSequence(new ui::ScreenRotation(delta))); |
86 screen_rotation->AddObserver(ash::Shell::GetRootWindow()); | 87 screen_rotation->AddObserver(ash::Shell::GetRootWindow()); |
87 ash::Shell::GetRootWindow()->layer()->GetAnimator()->StartAnimation( | 88 ash::Shell::GetRootWindow()->layer()->GetAnimator()->StartAnimation( |
88 screen_rotation.release()); | 89 screen_rotation.release()); |
89 return true; | 90 return true; |
90 } | 91 } |
91 | 92 |
92 bool HandleToggleDesktopBackgroundMode() { | 93 bool HandleToggleDesktopBackgroundMode() { |
93 ash::Shell* shell = ash::Shell::GetInstance(); | 94 ash::DesktopBackgroundController* desktop_background_controller = |
94 if (shell->desktop_background_mode() == ash::Shell::BACKGROUND_IMAGE) | 95 ash::Shell::GetInstance()->desktop_background_controller(); |
95 shell->SetDesktopBackgroundMode(ash::Shell::BACKGROUND_SOLID_COLOR); | 96 if (desktop_background_controller->desktop_background_mode() == |
| 97 ash::DesktopBackgroundController::BACKGROUND_IMAGE) |
| 98 desktop_background_controller->SetDesktopBackgroundSolidColorMode(); |
96 else | 99 else |
97 shell->SetDesktopBackgroundMode(ash::Shell::BACKGROUND_IMAGE); | 100 desktop_background_controller->SetPreviousDesktopBackgroundImage(); |
98 return true; | 101 return true; |
99 } | 102 } |
100 | 103 |
101 bool HandleToggleRootWindowFullScreen() { | 104 bool HandleToggleRootWindowFullScreen() { |
102 ash::Shell::GetRootWindow()->ToggleFullScreen(); | 105 ash::Shell::GetRootWindow()->ToggleFullScreen(); |
103 return true; | 106 return true; |
104 } | 107 } |
105 | 108 |
106 bool HandlePrintLayerHierarchy() { | 109 bool HandlePrintLayerHierarchy() { |
107 aura::RootWindow* root_window = ash::Shell::GetRootWindow(); | 110 aura::RootWindow* root_window = ash::Shell::GetRootWindow(); |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 NOTREACHED() << "Unhandled action " << it->second; | 298 NOTREACHED() << "Unhandled action " << it->second; |
296 } | 299 } |
297 return false; | 300 return false; |
298 } | 301 } |
299 | 302 |
300 bool AcceleratorController::CanHandleAccelerators() const { | 303 bool AcceleratorController::CanHandleAccelerators() const { |
301 return true; | 304 return true; |
302 } | 305 } |
303 | 306 |
304 } // namespace ash | 307 } // namespace ash |
OLD | NEW |