Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2121)

Unified Diff: ash/accelerators/accelerator_controller.cc

Issue 13947045: Magnifier: Move the cursor directly to the root window host. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ash/magnifier/magnification_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/accelerators/accelerator_controller.cc
diff --git a/ash/accelerators/accelerator_controller.cc b/ash/accelerators/accelerator_controller.cc
index 07b92f27dc4f8feed57256b0226799fc9d022699..cdc67dca26b5d07c2ee492dcef5589d63f62372b 100644
--- a/ash/accelerators/accelerator_controller.cc
+++ b/ash/accelerators/accelerator_controller.cc
@@ -73,11 +73,6 @@ namespace {
using internal::DisplayInfo;
-// Factor of magnification scale. For example, when this value is 1.189, scale
-// value will be changed x1.000, x1.189, x1.414, x1.681, x2.000, ...
-// Note: this value is 2.0 ^ (1 / 4).
-const float kMagnificationFactor = 1.18920712f;
-
bool DebugShortcutsEnabled() {
#if defined(NDEBUG)
return CommandLine::ForCurrentProcess()->HasSwitch(
@@ -228,18 +223,17 @@ bool HandleToggleRootWindowFullScreen() {
// Magnify the screen
bool HandleMagnifyScreen(int delta_index) {
if (ash::Shell::GetInstance()->magnification_controller()->IsEnabled()) {
- // TODO(yoshiki): Create the class like MagnifierStepScaleController, and
- // move the following scale control to it.
+ // TODO(yoshiki): Move the following logic to MagnificationController.
float scale =
ash::Shell::GetInstance()->magnification_controller()->GetScale();
- // Calculate rounded logarithm (base kMagnificationFactor) of scale.
+ // Calculate rounded logarithm (base kMagnificationScaleFactor) of scale.
int scale_index =
- std::floor(std::log(scale) / std::log(kMagnificationFactor) + 0.5);
+ std::floor(std::log(scale) / std::log(kMagnificationScaleFactor) + 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);
+ SetScale(std::pow(kMagnificationScaleFactor, new_scale_index), true);
} else if (ash::Shell::GetInstance()->
partial_magnification_controller()->is_enabled()) {
float scale = delta_index > 0 ? kDefaultPartialMagnifiedScale : 1;
« no previous file with comments | « no previous file | ash/magnifier/magnification_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698