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

Unified Diff: ash/accelerators/accelerator_controller.cc

Issue 10388141: Full-screen Magnifier: Support warping the cursor on the edge (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Change behaivior of the magnified region. Created 8 years, 6 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/accelerators/accelerator_table.h » ('j') | ash/magnifier/magnification_controller.cc » ('J')
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 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;
« no previous file with comments | « no previous file | ash/accelerators/accelerator_table.h » ('j') | ash/magnifier/magnification_controller.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698