Chromium Code Reviews| Index: ash/accelerators/accelerator_controller.cc |
| diff --git a/ash/accelerators/accelerator_controller.cc b/ash/accelerators/accelerator_controller.cc |
| index 2762f944573416de07351998dba4e09d1683d458..b09c3d646392d1ecd7cc6bf265a9a19ea7a654b1 100644 |
| --- a/ash/accelerators/accelerator_controller.cc |
| +++ b/ash/accelerators/accelerator_controller.cc |
| @@ -13,6 +13,7 @@ |
| #include "ash/launcher/launcher.h" |
| #include "ash/launcher/launcher_delegate.h" |
| #include "ash/launcher/launcher_model.h" |
| +#include "ash/magnifier/magnification_controller.h" |
| #include "ash/monitor/multi_monitor_manager.h" |
| #include "ash/screenshot_delegate.h" |
| #include "ash/shell.h" |
| @@ -171,6 +172,18 @@ bool HandlePrintWindowHierarchy() { |
| return true; |
| } |
| +// Mafnify the screen |
| +bool HandleMagnifyScreen(int delta_index) { |
| + float scale = (delta_index > 0) ? 1.2f : 1.0f/1.2f; |
|
sky
2012/06/07 18:05:50
Use constants (and spaces).
yoshiki
2012/06/08 22:27:45
Done.
|
| + |
| + float curren_scale = ash::Shell::GetInstance()-> |
|
sky
2012/06/07 18:05:50
current_scale
yoshiki
2012/06/08 22:27:45
Done.
|
| + magnification_controller()->GetScale(); |
| + ash::Shell::GetInstance()-> |
| + magnification_controller()->SetScale(curren_scale * scale, true); |
|
sky
2012/06/07 18:05:50
Won't this lead to rounding errors? Wouldn't it be
yoshiki
2012/06/08 22:27:45
Done.
|
| + |
| + return true; |
| +} |
| + |
| #endif |
| } // namespace |
| @@ -470,6 +483,10 @@ bool AcceleratorController::AcceleratorPressed( |
| case MONITOR_TOGGLE_SCALE: |
| internal::MultiMonitorManager::ToggleMonitorScale(); |
| return true; |
| + case MAGNIFY_SCREEN_ZOOM_IN: |
| + return HandleMagnifyScreen(1); |
| + case MAGNIFY_SCREEN_ZOOM_OUT: |
| + return HandleMagnifyScreen(-1); |
| #endif |
| default: |
| NOTREACHED() << "Unhandled action " << it->second; |