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

Side by Side Diff: ui/aura/window.cc

Issue 10543174: Aura: Add Window::MoveCursorTo() taking relative location to the window. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added tests with transform. 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 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 "ui/aura/window.h" 5 #include "ui/aura/window.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after
400 400
401 // static 401 // static
402 void Window::ConvertPointToWindow(const Window* source, 402 void Window::ConvertPointToWindow(const Window* source,
403 const Window* target, 403 const Window* target,
404 gfx::Point* point) { 404 gfx::Point* point) {
405 if (!source) 405 if (!source)
406 return; 406 return;
407 ui::Layer::ConvertPointToLayer(source->layer(), target->layer(), point); 407 ui::Layer::ConvertPointToLayer(source->layer(), target->layer(), point);
408 } 408 }
409 409
410 void Window::MoveCursorTo(const gfx::Point& point_in_window) {
411 RootWindow* root_window = GetRootWindow();
412 DCHECK(root_window);
413 gfx::Point point_in_root(point_in_window);
414 ConvertPointToWindow(this, root_window, &point_in_root);
415 root_window->MoveCursorTo(point_in_root);
416 }
417
410 gfx::NativeCursor Window::GetCursor(const gfx::Point& point) const { 418 gfx::NativeCursor Window::GetCursor(const gfx::Point& point) const {
411 return delegate_ ? delegate_->GetCursor(point) : gfx::kNullCursor; 419 return delegate_ ? delegate_->GetCursor(point) : gfx::kNullCursor;
412 } 420 }
413 421
414 void Window::SetEventFilter(EventFilter* event_filter) { 422 void Window::SetEventFilter(EventFilter* event_filter) {
415 event_filter_.reset(event_filter); 423 event_filter_.reset(event_filter);
416 } 424 }
417 425
418 void Window::AddObserver(WindowObserver* observer) { 426 void Window::AddObserver(WindowObserver* observer) {
419 observers_.AddObserver(observer); 427 observers_.AddObserver(observer);
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
870 for (Windows::const_reverse_iterator it = children_.rbegin(), 878 for (Windows::const_reverse_iterator it = children_.rbegin(),
871 rend = children_.rend(); 879 rend = children_.rend();
872 it != rend; ++it) { 880 it != rend; ++it) {
873 Window* child = *it; 881 Window* child = *it;
874 child->PrintWindowHierarchy(depth + 1); 882 child->PrintWindowHierarchy(depth + 1);
875 } 883 }
876 } 884 }
877 #endif 885 #endif
878 886
879 } // namespace aura 887 } // namespace aura
OLDNEW
« no previous file with comments | « ui/aura/window.h ('k') | ui/aura/window_unittest.cc » ('j') | ui/aura/window_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698