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

Unified Diff: ash/magnifier/magnification_controller.cc

Issue 2095193002: clang-format all of //ash (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 | « ash/keyboard_uma_event_filter.cc ('k') | ash/magnifier/magnification_controller_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/magnifier/magnification_controller.cc
diff --git a/ash/magnifier/magnification_controller.cc b/ash/magnifier/magnification_controller.cc
index da21d7ec719085d5eafcc9be52d83fd0f7d4599f..c61f998afc27011449734e2e5b680c010507db4e 100644
--- a/ash/magnifier/magnification_controller.cc
+++ b/ash/magnifier/magnification_controller.cc
@@ -291,22 +291,20 @@ MagnificationControllerImpl::~MagnificationControllerImpl() {
Shell::GetInstance()->RemovePreTargetHandler(this);
}
-void MagnificationControllerImpl::RedrawKeepingMousePosition(
- float scale, bool animate) {
+void MagnificationControllerImpl::RedrawKeepingMousePosition(float scale,
+ bool animate) {
gfx::Point mouse_in_root = point_of_interest_;
// mouse_in_root is invalid value when the cursor is hidden.
if (!root_window_->bounds().Contains(mouse_in_root))
mouse_in_root = root_window_->bounds().CenterPoint();
- const gfx::PointF origin =
- gfx::PointF(mouse_in_root.x() -
- (scale_ / scale) * (mouse_in_root.x() - origin_.x()),
- mouse_in_root.y() -
- (scale_ / scale) * (mouse_in_root.y() - origin_.y()));
- bool changed = RedrawDIP(origin, scale,
- animate ? kDefaultAnimationDurationInMs : 0,
- kDefaultAnimationTweenType);
+ const gfx::PointF origin = gfx::PointF(
+ mouse_in_root.x() - (scale_ / scale) * (mouse_in_root.x() - origin_.x()),
+ mouse_in_root.y() - (scale_ / scale) * (mouse_in_root.y() - origin_.y()));
+ bool changed =
+ RedrawDIP(origin, scale, animate ? kDefaultAnimationDurationInMs : 0,
+ kDefaultAnimationTweenType);
if (changed)
AfterAnimationMoveCursorTo(mouse_in_root);
}
@@ -347,9 +345,7 @@ bool MagnificationControllerImpl::RedrawDIP(const gfx::PointF& position_in_dip,
y = max_y;
// Does nothing if both the origin and the scale are not changed.
- if (origin_.x() == x &&
- origin_.y() == y &&
- scale == scale_) {
+ if (origin_.x() == x && origin_.y() == y && scale == scale_) {
return false;
}
@@ -568,8 +564,8 @@ void MagnificationControllerImpl::SetScale(float scale, bool animate) {
return;
ValidateScale(&scale);
- Shell::GetInstance()->accessibility_delegate()->
- SaveScreenMagnifierScale(scale);
+ Shell::GetInstance()->accessibility_delegate()->SaveScreenMagnifierScale(
+ scale);
RedrawKeepingMousePosition(scale, animate);
}
@@ -601,9 +597,9 @@ void MagnificationControllerImpl::SetEnabled(bool enabled) {
if (!is_enabled_ && input_method)
input_method->AddObserver(this);
- float scale =
- Shell::GetInstance()->accessibility_delegate()->
- GetSavedScreenMagnifierScale();
+ float scale = Shell::GetInstance()
+ ->accessibility_delegate()
+ ->GetSavedScreenMagnifierScale();
if (scale <= 0.0f)
scale = kInitialMagnifiedScale;
ValidateScale(&scale);
@@ -825,9 +821,7 @@ void MagnificationControllerImpl::OnCaretBoundsChanged(
// Visible window_rect in |root_window_| coordinates.
const gfx::Rect visible_window_rect = GetViewportRect();
const int panning_margin = kCaretPanningMargin / scale_;
- MoveMagnifierWindowFollowPoint(caret_point_,
- panning_margin,
- panning_margin,
+ MoveMagnifierWindowFollowPoint(caret_point_, panning_margin, panning_margin,
visible_window_rect.width() / 2,
visible_window_rect.height() / 2);
return;
« no previous file with comments | « ash/keyboard_uma_event_filter.cc ('k') | ash/magnifier/magnification_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698