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

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: Created 6 years, 9 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
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/host/ash_window_tree_host.h"
10 #include "ash/display/root_window_transformers.h" 11 #include "ash/display/root_window_transformers.h"
12 #include "ash/host/root_window_transformer.h"
11 #include "ash/shell.h" 13 #include "ash/shell.h"
12 #include "ash/system/tray/system_tray_delegate.h" 14 #include "ash/system/tray/system_tray_delegate.h"
13 #include "base/command_line.h" 15 #include "base/command_line.h"
14 #include "base/synchronization/waitable_event.h" 16 #include "base/synchronization/waitable_event.h"
15 #include "ui/aura/client/cursor_client.h" 17 #include "ui/aura/client/cursor_client.h"
16 #include "ui/aura/root_window_transformer.h"
17 #include "ui/aura/window.h" 18 #include "ui/aura/window.h"
18 #include "ui/aura/window_property.h" 19 #include "ui/aura/window_property.h"
19 #include "ui/aura/window_tree_host.h" 20 #include "ui/aura/window_tree_host.h"
20 #include "ui/compositor/dip_util.h" 21 #include "ui/compositor/dip_util.h"
21 #include "ui/compositor/layer.h" 22 #include "ui/compositor/layer.h"
22 #include "ui/compositor/layer_animation_observer.h" 23 #include "ui/compositor/layer_animation_observer.h"
23 #include "ui/compositor/scoped_layer_animation_settings.h" 24 #include "ui/compositor/scoped_layer_animation_settings.h"
24 #include "ui/events/event.h" 25 #include "ui/events/event.h"
25 #include "ui/events/event_handler.h" 26 #include "ui/events/event_handler.h"
26 #include "ui/gfx/point3_f.h" 27 #include "ui/gfx/point3_f.h"
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 root_window_->layer()->GetAnimator()); 264 root_window_->layer()->GetAnimator());
264 settings.AddObserver(this); 265 settings.AddObserver(this);
265 settings.SetPreemptionStrategy( 266 settings.SetPreemptionStrategy(
266 ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET); 267 ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET);
267 settings.SetTweenType(gfx::Tween::EASE_OUT); 268 settings.SetTweenType(gfx::Tween::EASE_OUT);
268 settings.SetTransitionDuration( 269 settings.SetTransitionDuration(
269 base::TimeDelta::FromMilliseconds(animate ? 100 : 0)); 270 base::TimeDelta::FromMilliseconds(animate ? 100 : 0));
270 271
271 gfx::Display display = 272 gfx::Display display =
272 Shell::GetScreen()->GetDisplayNearestWindow(root_window_); 273 Shell::GetScreen()->GetDisplayNearestWindow(root_window_);
273 scoped_ptr<aura::RootWindowTransformer> transformer( 274 scoped_ptr<RootWindowTransformer> transformer(
274 internal::CreateRootWindowTransformerForDisplay(root_window_, display)); 275 internal::CreateRootWindowTransformerForDisplay(root_window_, display));
275 root_window_->GetHost()->SetRootWindowTransformer(transformer.Pass()); 276 AshWindowTreeHost::Get(root_window_)->SetRootWindowTransformer(transformer.Pas s());
276 277
277 if (animate) 278 if (animate)
278 is_on_animation_ = true; 279 is_on_animation_ = true;
279 280
280 return true; 281 return true;
281 } 282 }
282 283
283 void MagnificationControllerImpl::StartOrStopScrollIfNecessary() { 284 void MagnificationControllerImpl::StartOrStopScrollIfNecessary() {
284 // This value controls the scrolling speed. 285 // This value controls the scrolling speed.
285 const int kMoveOffset = 40; 286 const int kMoveOffset = 40;
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
596 597
597 //////////////////////////////////////////////////////////////////////////////// 598 ////////////////////////////////////////////////////////////////////////////////
598 // MagnificationController: 599 // MagnificationController:
599 600
600 // static 601 // static
601 MagnificationController* MagnificationController::CreateInstance() { 602 MagnificationController* MagnificationController::CreateInstance() {
602 return new MagnificationControllerImpl(); 603 return new MagnificationControllerImpl();
603 } 604 }
604 605
605 } // namespace ash 606 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698