summaryrefslogtreecommitdiffstats
path: root/ash/magnifier
diff options
context:
space:
mode:
authorben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-25 19:22:45 +0000
committerben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-25 19:22:45 +0000
commitbf9cdb36cc79becab099c9f37eb80284fb203f45 (patch)
tree4c9011f0aa08ac613027abd372cec3a3b613032b /ash/magnifier
parentfef72c1c9890633a237e06ccb0d0f4ce2ca6c9c1 (diff)
downloadchromium_src-bf9cdb36cc79becab099c9f37eb80284fb203f45.zip
chromium_src-bf9cdb36cc79becab099c9f37eb80284fb203f45.tar.gz
chromium_src-bf9cdb36cc79becab099c9f37eb80284fb203f45.tar.bz2
Make GetRootWindow() return a Window instead of a RootWindow.
Also adds a typedef from RootWindow to WindowEventDispatcher, the eventual name of this type. Adds a GetDispatcher() method that crawls up to the root Window and returns the WindowEventDispatcher. R=sky@chromium.org http://crbug.com/308843 Review URL: https://codereview.chromium.org/37733003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@231077 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/magnifier')
-rw-r--r--ash/magnifier/magnification_controller.cc18
-rw-r--r--ash/magnifier/magnification_controller_unittest.cc6
-rw-r--r--ash/magnifier/partial_magnification_controller.cc6
-rw-r--r--ash/magnifier/partial_magnification_controller.h2
4 files changed, 16 insertions, 16 deletions
diff --git a/ash/magnifier/magnification_controller.cc b/ash/magnifier/magnification_controller.cc
index c6a6a52..0df6e12 100644
--- a/ash/magnifier/magnification_controller.cc
+++ b/ash/magnifier/magnification_controller.cc
@@ -127,7 +127,7 @@ class MagnificationControllerImpl : virtual public MagnificationController,
// - Unzoom the current root_window.
// - Zoom the given new root_window |new_root_window|.
// - Switch the target window from current window to |new_root_window|.
- void SwitchTargetRootWindow(aura::RootWindow* new_root_window,
+ void SwitchTargetRootWindow(aura::Window* new_root_window,
bool redraw_original_root_window);
// Returns if the magnification scale is 1.0 or not (larger then 1.0).
@@ -147,7 +147,7 @@ class MagnificationControllerImpl : virtual public MagnificationController,
virtual void OnTouchEvent(ui::TouchEvent* event) OVERRIDE;
// Target root window. This must not be NULL.
- aura::RootWindow* root_window_;
+ aura::Window* root_window_;
// True if the magnified window is currently animating a change. Otherwise,
// false.
@@ -273,7 +273,7 @@ bool MagnificationControllerImpl::RedrawDIP(const gfx::PointF& position_in_dip,
Shell::GetScreen()->GetDisplayNearestWindow(root_window_);
scoped_ptr<aura::RootWindowTransformer> transformer(
internal::CreateRootWindowTransformerForDisplay(root_window_, display));
- root_window_->SetRootWindowTransformer(transformer.Pass());
+ root_window_->GetDispatcher()->SetRootWindowTransformer(transformer.Pass());
if (animate)
is_on_animation_ = true;
@@ -380,7 +380,7 @@ void MagnificationControllerImpl::OnMouseMove(const gfx::Point& location) {
if (ret) {
// If the magnified region is moved, hides the mouse cursor and moves it.
if (x_diff != 0 || y_diff != 0)
- MoveCursorTo(root_window_, mouse);
+ MoveCursorTo(root_window_->GetDispatcher(), mouse);
}
}
}
@@ -437,7 +437,7 @@ void MagnificationControllerImpl::OnImplicitAnimationsCompleted() {
return;
if (move_cursor_after_animation_) {
- MoveCursorTo(root_window_, position_after_animation_);
+ MoveCursorTo(root_window_->GetDispatcher(), position_after_animation_);
move_cursor_after_animation_ = false;
aura::client::CursorClient* cursor_client =
@@ -456,7 +456,7 @@ void MagnificationControllerImpl::OnWindowDestroying(
// destroyed before the root windows get destroyed.
DCHECK(root_window);
- aura::RootWindow* target_root_window = Shell::GetTargetRootWindow();
+ aura::Window* target_root_window = Shell::GetTargetRootWindow();
CHECK(target_root_window);
// The destroyed root window must not be target.
@@ -475,7 +475,7 @@ void MagnificationControllerImpl::OnWindowBoundsChanged(
}
void MagnificationControllerImpl::SwitchTargetRootWindow(
- aura::RootWindow* new_root_window,
+ aura::Window* new_root_window,
bool redraw_original_root_window) {
DCHECK(new_root_window);
@@ -577,7 +577,7 @@ bool MagnificationControllerImpl::IsEnabled() const {
void MagnificationControllerImpl::OnMouseEvent(ui::MouseEvent* event) {
aura::Window* target = static_cast<aura::Window*>(event->target());
- aura::RootWindow* current_root = target->GetRootWindow();
+ aura::Window* current_root = target->GetRootWindow();
gfx::Rect root_bounds = current_root->bounds();
if (root_bounds.Contains(event->root_location())) {
@@ -615,7 +615,7 @@ void MagnificationControllerImpl::OnScrollEvent(ui::ScrollEvent* event) {
void MagnificationControllerImpl::OnTouchEvent(ui::TouchEvent* event) {
aura::Window* target = static_cast<aura::Window*>(event->target());
- aura::RootWindow* current_root = target->GetRootWindow();
+ aura::Window* current_root = target->GetRootWindow();
if (current_root == root_window_) {
gfx::Rect root_bounds = current_root->bounds();
if (root_bounds.Contains(event->root_location()))
diff --git a/ash/magnifier/magnification_controller_unittest.cc b/ash/magnifier/magnification_controller_unittest.cc
index 63608fc..2f87ee1 100644
--- a/ash/magnifier/magnification_controller_unittest.cc
+++ b/ash/magnifier/magnification_controller_unittest.cc
@@ -32,7 +32,7 @@ class MagnificationControllerTest: public test::AshTestBase {
AshTestBase::SetUp();
UpdateDisplay(base::StringPrintf("%dx%d", kRootWidth, kRootHeight));
- aura::RootWindow* root = GetRootWindow();
+ aura::Window* root = GetRootWindow();
gfx::Rect root_bounds(root->bounds());
#if defined(OS_WIN)
@@ -48,13 +48,13 @@ class MagnificationControllerTest: public test::AshTestBase {
}
protected:
- aura::RootWindow* GetRootWindow() const {
+ aura::Window* GetRootWindow() const {
return Shell::GetPrimaryRootWindow();
}
std::string GetHostMouseLocation() {
gfx::Point point;
- GetRootWindow()->QueryMouseLocationForTest(&point);
+ GetRootWindow()->GetDispatcher()->QueryMouseLocationForTest(&point);
return point.ToString();
}
diff --git a/ash/magnifier/partial_magnification_controller.cc b/ash/magnifier/partial_magnification_controller.cc
index d913856..3e762b7 100644
--- a/ash/magnifier/partial_magnification_controller.cc
+++ b/ash/magnifier/partial_magnification_controller.cc
@@ -79,7 +79,7 @@ void PartialMagnificationController::SetEnabled(bool enabled) {
void PartialMagnificationController::OnMouseEvent(ui::MouseEvent* event) {
if (IsPartialMagnified() && event->type() == ui::ET_MOUSE_MOVED) {
aura::Window* target = static_cast<aura::Window*>(event->target());
- aura::RootWindow* current_root = target->GetRootWindow();
+ aura::Window* current_root = target->GetRootWindow();
// TODO(zork): Handle the case where the event is captured on a different
// display, such as when a menu is opened.
gfx::Rect root_bounds = current_root->bounds();
@@ -178,14 +178,14 @@ void PartialMagnificationController::CloseMagnifierWindow() {
void PartialMagnificationController::RemoveZoomWidgetObservers() {
DCHECK(zoom_widget_);
zoom_widget_->RemoveObserver(this);
- aura::RootWindow* root_window =
+ aura::Window* root_window =
zoom_widget_->GetNativeView()->GetRootWindow();
DCHECK(root_window);
root_window->RemoveObserver(this);
}
void PartialMagnificationController::SwitchTargetRootWindow(
- aura::RootWindow* new_root_window) {
+ aura::Window* new_root_window) {
if (zoom_widget_ &&
new_root_window == zoom_widget_->GetNativeView()->GetRootWindow())
return;
diff --git a/ash/magnifier/partial_magnification_controller.h b/ash/magnifier/partial_magnification_controller.h
index 54c15f3..01c3a2b 100644
--- a/ash/magnifier/partial_magnification_controller.h
+++ b/ash/magnifier/partial_magnification_controller.h
@@ -49,7 +49,7 @@ class PartialMagnificationController
// - Remove the magnifier from the current root window.
// - Create a magnifier in the new root_window |new_root_window|.
// - Switch the target window from current window to |new_root_window|.
- void SwitchTargetRootWindow(aura::RootWindow* new_root_window);
+ void SwitchTargetRootWindow(aura::Window* new_root_window);
// Returns the root window that contains the mouse cursor.
aura::RootWindow* GetCurrentRootWindow();