| 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/ash_switches.h" | 8 #include "ash/ash_switches.h" |
| 9 #include "ash/caps_lock_delegate.h" | 9 #include "ash/caps_lock_delegate.h" |
| 10 #include "ash/desktop_background/desktop_background_controller.h" | 10 #include "ash/desktop_background/desktop_background_controller.h" |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 case 6: delta = -90; break; | 115 case 6: delta = -90; break; |
| 116 case 7: delta = -90; break; | 116 case 7: delta = -90; break; |
| 117 case 8: delta = -90; break; | 117 case 8: delta = -90; break; |
| 118 case 9: delta = 180; break; | 118 case 9: delta = 180; break; |
| 119 case 10: delta = 180; break; | 119 case 10: delta = 180; break; |
| 120 case 11: delta = 90; break; | 120 case 11: delta = 90; break; |
| 121 case 12: delta = 180; break; | 121 case 12: delta = 180; break; |
| 122 case 13: delta = 180; break; | 122 case 13: delta = 180; break; |
| 123 } | 123 } |
| 124 i = (i + 1) % 14; | 124 i = (i + 1) % 14; |
| 125 ash::Shell::GetRootWindow()->layer()->GetAnimator()-> | 125 ash::Shell::GetPrimaryRootWindow()->layer()->GetAnimator()-> |
| 126 set_preemption_strategy(ui::LayerAnimator::REPLACE_QUEUED_ANIMATIONS); | 126 set_preemption_strategy(ui::LayerAnimator::REPLACE_QUEUED_ANIMATIONS); |
| 127 scoped_ptr<ui::LayerAnimationSequence> screen_rotation( | 127 scoped_ptr<ui::LayerAnimationSequence> screen_rotation( |
| 128 new ui::LayerAnimationSequence(new ui::ScreenRotation(delta))); | 128 new ui::LayerAnimationSequence(new ui::ScreenRotation(delta))); |
| 129 screen_rotation->AddObserver(ash::Shell::GetRootWindow()); | 129 screen_rotation->AddObserver(ash::Shell::GetPrimaryRootWindow()); |
| 130 ash::Shell::GetRootWindow()->layer()->GetAnimator()->StartAnimation( | 130 ash::Shell::GetPrimaryRootWindow()->layer()->GetAnimator()->StartAnimation( |
| 131 screen_rotation.release()); | 131 screen_rotation.release()); |
| 132 return true; | 132 return true; |
| 133 } | 133 } |
| 134 | 134 |
| 135 bool HandleToggleDesktopBackgroundMode() { | 135 bool HandleToggleDesktopBackgroundMode() { |
| 136 ash::DesktopBackgroundController* desktop_background_controller = | 136 ash::DesktopBackgroundController* desktop_background_controller = |
| 137 ash::Shell::GetInstance()->desktop_background_controller(); | 137 ash::Shell::GetInstance()->desktop_background_controller(); |
| 138 if (desktop_background_controller->desktop_background_mode() == | 138 if (desktop_background_controller->desktop_background_mode() == |
| 139 ash::DesktopBackgroundController::BACKGROUND_IMAGE) | 139 ash::DesktopBackgroundController::BACKGROUND_IMAGE) |
| 140 desktop_background_controller->SetDesktopBackgroundSolidColorMode(); | 140 desktop_background_controller->SetDesktopBackgroundSolidColorMode(); |
| 141 else | 141 else |
| 142 desktop_background_controller->SetLoggedInUserWallpaper(); | 142 desktop_background_controller->SetLoggedInUserWallpaper(); |
| 143 return true; | 143 return true; |
| 144 } | 144 } |
| 145 | 145 |
| 146 bool HandleToggleRootWindowFullScreen() { | 146 bool HandleToggleRootWindowFullScreen() { |
| 147 ash::Shell::GetRootWindow()->ToggleFullScreen(); | 147 ash::Shell::GetPrimaryRootWindow()->ToggleFullScreen(); |
| 148 return true; | 148 return true; |
| 149 } | 149 } |
| 150 | 150 |
| 151 bool HandlePrintLayerHierarchy() { | 151 bool HandlePrintLayerHierarchy() { |
| 152 aura::RootWindow* root_window = ash::Shell::GetRootWindow(); | 152 aura::RootWindow* root_window = ash::Shell::GetPrimaryRootWindow(); |
| 153 ui::PrintLayerHierarchy(root_window->layer(), | 153 ui::PrintLayerHierarchy(root_window->layer(), |
| 154 root_window->last_mouse_location()); | 154 root_window->last_mouse_location()); |
| 155 return true; | 155 return true; |
| 156 } | 156 } |
| 157 | 157 |
| 158 void PrintWindowHierarchy(aura::Window* window, int indent) { | 158 void PrintWindowHierarchy(aura::Window* window, int indent) { |
| 159 std::string indent_str(indent, ' '); | 159 std::string indent_str(indent, ' '); |
| 160 VLOG(1) << indent_str << window->name() << " type " << window->type() | 160 VLOG(1) << indent_str << window->name() << " type " << window->type() |
| 161 << (ash::wm::IsActiveWindow(window) ? "active" : ""); | 161 << (ash::wm::IsActiveWindow(window) ? "active" : ""); |
| 162 for (size_t i = 0; i < window->children().size(); ++i) | 162 for (size_t i = 0; i < window->children().size(); ++i) |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 312 return HandleToggleSpokenFeedback(); | 312 return HandleToggleSpokenFeedback(); |
| 313 #endif | 313 #endif |
| 314 case EXIT: | 314 case EXIT: |
| 315 return HandleExit(); | 315 return HandleExit(); |
| 316 case NEW_INCOGNITO_WINDOW: | 316 case NEW_INCOGNITO_WINDOW: |
| 317 return HandleNewWindow(true /* is_incognito */); | 317 return HandleNewWindow(true /* is_incognito */); |
| 318 case NEW_WINDOW: | 318 case NEW_WINDOW: |
| 319 return HandleNewWindow(false /* is_incognito */); | 319 return HandleNewWindow(false /* is_incognito */); |
| 320 case TAKE_SCREENSHOT: | 320 case TAKE_SCREENSHOT: |
| 321 if (screenshot_delegate_.get()) { | 321 if (screenshot_delegate_.get()) { |
| 322 aura::RootWindow* root_window = Shell::GetRootWindow(); | 322 aura::RootWindow* root_window = Shell::GetPrimaryRootWindow(); |
| 323 screenshot_delegate_->HandleTakeScreenshot(root_window); | 323 screenshot_delegate_->HandleTakeScreenshot(root_window); |
| 324 } | 324 } |
| 325 // Return true to prevent propagation of the key event. | 325 // Return true to prevent propagation of the key event. |
| 326 return true; | 326 return true; |
| 327 case TAKE_PARTIAL_SCREENSHOT: | 327 case TAKE_PARTIAL_SCREENSHOT: |
| 328 if (screenshot_delegate_.get()) | 328 if (screenshot_delegate_.get()) |
| 329 ash::Shell::GetInstance()->delegate()-> | 329 ash::Shell::GetInstance()->delegate()-> |
| 330 StartPartialScreenshot(screenshot_delegate_.get()); | 330 StartPartialScreenshot(screenshot_delegate_.get()); |
| 331 // Return true to prevent propagation of the key event because | 331 // Return true to prevent propagation of the key event because |
| 332 // this key combination is reserved for partial screenshot. | 332 // this key combination is reserved for partial screenshot. |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 513 // Then set this one as active. | 513 // Then set this one as active. |
| 514 Shell::GetInstance()->launcher()->ActivateLauncherItem(found_index); | 514 Shell::GetInstance()->launcher()->ActivateLauncherItem(found_index); |
| 515 } | 515 } |
| 516 } | 516 } |
| 517 | 517 |
| 518 bool AcceleratorController::CanHandleAccelerators() const { | 518 bool AcceleratorController::CanHandleAccelerators() const { |
| 519 return true; | 519 return true; |
| 520 } | 520 } |
| 521 | 521 |
| 522 } // namespace ash | 522 } // namespace ash |
| OLD | NEW |