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

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

Issue 248773002: aura: A couple of API cleanups. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . 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 | « ui/aura/window.h ('k') | ui/aura/window_event_dispatcher_unittest.cc » ('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 "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 618 matching lines...) Expand 10 before | Expand all | Expand 10 after
629 DCHECK(root_window); 629 DCHECK(root_window);
630 gfx::Point point_in_root(point_in_window); 630 gfx::Point point_in_root(point_in_window);
631 ConvertPointToTarget(this, root_window, &point_in_root); 631 ConvertPointToTarget(this, root_window, &point_in_root);
632 root_window->GetHost()->MoveCursorTo(point_in_root); 632 root_window->GetHost()->MoveCursorTo(point_in_root);
633 } 633 }
634 634
635 gfx::NativeCursor Window::GetCursor(const gfx::Point& point) const { 635 gfx::NativeCursor Window::GetCursor(const gfx::Point& point) const {
636 return delegate_ ? delegate_->GetCursor(point) : gfx::kNullCursor; 636 return delegate_ ? delegate_->GetCursor(point) : gfx::kNullCursor;
637 } 637 }
638 638
639 void Window::SetEventFilter(ui::EventHandler* event_filter) {
640 if (event_filter_)
641 RemovePreTargetHandler(event_filter_.get());
642 event_filter_.reset(event_filter);
643 if (event_filter)
644 AddPreTargetHandler(event_filter);
645 }
646
647 void Window::AddObserver(WindowObserver* observer) { 639 void Window::AddObserver(WindowObserver* observer) {
648 observers_.AddObserver(observer); 640 observers_.AddObserver(observer);
649 } 641 }
650 642
651 void Window::RemoveObserver(WindowObserver* observer) { 643 void Window::RemoveObserver(WindowObserver* observer) {
652 observers_.RemoveObserver(observer); 644 observers_.RemoveObserver(observer);
653 } 645 }
654 646
655 bool Window::HasObserver(WindowObserver* observer) { 647 bool Window::HasObserver(WindowObserver* observer) {
656 return observers_.HasObserver(observer); 648 return observers_.HasObserver(observer);
(...skipping 780 matching lines...) Expand 10 before | Expand all | Expand 10 after
1437 return window; 1429 return window;
1438 if (offset) 1430 if (offset)
1439 *offset += window->bounds().OffsetFromOrigin(); 1431 *offset += window->bounds().OffsetFromOrigin();
1440 } 1432 }
1441 if (offset) 1433 if (offset)
1442 *offset = gfx::Vector2d(); 1434 *offset = gfx::Vector2d();
1443 return NULL; 1435 return NULL;
1444 } 1436 }
1445 1437
1446 } // namespace aura 1438 } // namespace aura
OLDNEW
« no previous file with comments | « ui/aura/window.h ('k') | ui/aura/window_event_dispatcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698