| Index: ash/accelerators/accelerator_controller.cc
|
| diff --git a/ash/accelerators/accelerator_controller.cc b/ash/accelerators/accelerator_controller.cc
|
| index 1311b19cd461780bcf8f2dff504056b60dde2036..ba9d6446136e4d72e4fdcbc7fd735d933a792341 100644
|
| --- a/ash/accelerators/accelerator_controller.cc
|
| +++ b/ash/accelerators/accelerator_controller.cc
|
| @@ -20,6 +20,7 @@
|
| #include "ash/launcher/launcher_delegate.h"
|
| #include "ash/launcher/launcher_model.h"
|
| #include "ash/magnifier/magnification_controller.h"
|
| +#include "ash/magnifier/partial_magnification_controller.h"
|
| #include "ash/root_window_controller.h"
|
| #include "ash/rotator/screen_rotation.h"
|
| #include "ash/screenshot_delegate.h"
|
| @@ -225,18 +226,25 @@ bool HandleToggleRootWindowFullScreen() {
|
|
|
| // Magnify the screen
|
| bool HandleMagnifyScreen(int delta_index) {
|
| - // TODO(yoshiki): Create the class like MagnifierStepScaleController, and
|
| - // move the following scale control to it.
|
| - float scale =
|
| - ash::Shell::GetInstance()->magnification_controller()->GetScale();
|
| - // Calculate rounded logarithm (base kMagnificationFactor) of scale.
|
| - int scale_index =
|
| - std::floor(std::log(scale) / std::log(kMagnificationFactor) + 0.5);
|
| -
|
| - int new_scale_index = std::max(0, std::min(8, scale_index + delta_index));
|
| -
|
| - ash::Shell::GetInstance()->magnification_controller()->
|
| - SetScale(std::pow(kMagnificationFactor, new_scale_index), true);
|
| + if (ash::Shell::GetInstance()->magnification_controller()->IsEnabled()) {
|
| + // TODO(yoshiki): Create the class like MagnifierStepScaleController, and
|
| + // move the following scale control to it.
|
| + float scale =
|
| + ash::Shell::GetInstance()->magnification_controller()->GetScale();
|
| + // Calculate rounded logarithm (base kMagnificationFactor) of scale.
|
| + int scale_index =
|
| + std::floor(std::log(scale) / std::log(kMagnificationFactor) + 0.5);
|
| +
|
| + int new_scale_index = std::max(0, std::min(8, scale_index + delta_index));
|
| +
|
| + ash::Shell::GetInstance()->magnification_controller()->
|
| + SetScale(std::pow(kMagnificationFactor, new_scale_index), true);
|
| + } else if (ash::Shell::GetInstance()
|
| + ->partial_magnification_controller()->IsEnabled()) {
|
| + float scale = delta_index > 0 ? internal::kDefaultPartialMagnifiedScale : 1;
|
| + ash::Shell::GetInstance()->partial_magnification_controller()->
|
| + SetScale(scale);
|
| + }
|
|
|
| return true;
|
| }
|
|
|