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

Side by Side Diff: ash/magnifier/magnification_controller.cc

Issue 201573015: Introdcue AshWindowTreeHost and move ash/chrome specific code in WTH to ash. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ash/magnifier/DEPS ('k') | ash/root_window_controller.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/magnifier/magnification_controller.h" 5 #include "ash/magnifier/magnification_controller.h"
6 6
7 #include "ash/accelerators/accelerator_controller.h" 7 #include "ash/accelerators/accelerator_controller.h"
8 #include "ash/accessibility_delegate.h" 8 #include "ash/accessibility_delegate.h"
9 #include "ash/ash_switches.h" 9 #include "ash/ash_switches.h"
10 #include "ash/display/root_window_transformers.h" 10 #include "ash/display/root_window_transformers.h"
11 #include "ash/host/ash_window_tree_host.h"
12 #include "ash/host/root_window_transformer.h"
13 #include "ash/root_window_controller.h"
11 #include "ash/shell.h" 14 #include "ash/shell.h"
12 #include "ash/system/tray/system_tray_delegate.h" 15 #include "ash/system/tray/system_tray_delegate.h"
13 #include "base/command_line.h" 16 #include "base/command_line.h"
14 #include "base/synchronization/waitable_event.h" 17 #include "base/synchronization/waitable_event.h"
15 #include "ui/aura/client/cursor_client.h" 18 #include "ui/aura/client/cursor_client.h"
16 #include "ui/aura/root_window_transformer.h"
17 #include "ui/aura/window.h" 19 #include "ui/aura/window.h"
18 #include "ui/aura/window_property.h" 20 #include "ui/aura/window_property.h"
19 #include "ui/aura/window_tree_host.h" 21 #include "ui/aura/window_tree_host.h"
20 #include "ui/compositor/dip_util.h" 22 #include "ui/compositor/dip_util.h"
21 #include "ui/compositor/layer.h" 23 #include "ui/compositor/layer.h"
22 #include "ui/compositor/layer_animation_observer.h" 24 #include "ui/compositor/layer_animation_observer.h"
23 #include "ui/compositor/scoped_layer_animation_settings.h" 25 #include "ui/compositor/scoped_layer_animation_settings.h"
24 #include "ui/events/event.h" 26 #include "ui/events/event.h"
25 #include "ui/events/event_handler.h" 27 #include "ui/events/event_handler.h"
26 #include "ui/gfx/point3_f.h" 28 #include "ui/gfx/point3_f.h"
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 root_window_->layer()->GetAnimator()); 265 root_window_->layer()->GetAnimator());
264 settings.AddObserver(this); 266 settings.AddObserver(this);
265 settings.SetPreemptionStrategy( 267 settings.SetPreemptionStrategy(
266 ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET); 268 ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET);
267 settings.SetTweenType(gfx::Tween::EASE_OUT); 269 settings.SetTweenType(gfx::Tween::EASE_OUT);
268 settings.SetTransitionDuration( 270 settings.SetTransitionDuration(
269 base::TimeDelta::FromMilliseconds(animate ? 100 : 0)); 271 base::TimeDelta::FromMilliseconds(animate ? 100 : 0));
270 272
271 gfx::Display display = 273 gfx::Display display =
272 Shell::GetScreen()->GetDisplayNearestWindow(root_window_); 274 Shell::GetScreen()->GetDisplayNearestWindow(root_window_);
273 scoped_ptr<aura::RootWindowTransformer> transformer( 275 scoped_ptr<RootWindowTransformer> transformer(
274 CreateRootWindowTransformerForDisplay(root_window_, display)); 276 CreateRootWindowTransformerForDisplay(root_window_, display));
275 root_window_->GetHost()->SetRootWindowTransformer(transformer.Pass()); 277 GetRootWindowController(root_window_)->ash_host()->SetRootWindowTransformer(
278 transformer.Pass());
276 279
277 if (animate) 280 if (animate)
278 is_on_animation_ = true; 281 is_on_animation_ = true;
279 282
280 return true; 283 return true;
281 } 284 }
282 285
283 void MagnificationControllerImpl::StartOrStopScrollIfNecessary() { 286 void MagnificationControllerImpl::StartOrStopScrollIfNecessary() {
284 // This value controls the scrolling speed. 287 // This value controls the scrolling speed.
285 const int kMoveOffset = 40; 288 const int kMoveOffset = 40;
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
596 599
597 //////////////////////////////////////////////////////////////////////////////// 600 ////////////////////////////////////////////////////////////////////////////////
598 // MagnificationController: 601 // MagnificationController:
599 602
600 // static 603 // static
601 MagnificationController* MagnificationController::CreateInstance() { 604 MagnificationController* MagnificationController::CreateInstance() {
602 return new MagnificationControllerImpl(); 605 return new MagnificationControllerImpl();
603 } 606 }
604 607
605 } // namespace ash 608 } // namespace ash
OLDNEW
« no previous file with comments | « ash/magnifier/DEPS ('k') | ash/root_window_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698