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

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

Issue 309573004: aura: Reland r266681 to debug WindowObserver crashes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 626 matching lines...) Expand 10 before | Expand all | Expand 10 after
637 gfx::Point point_in_root(point_in_window); 637 gfx::Point point_in_root(point_in_window);
638 ConvertPointToTarget(this, root_window, &point_in_root); 638 ConvertPointToTarget(this, root_window, &point_in_root);
639 root_window->GetHost()->MoveCursorTo(point_in_root); 639 root_window->GetHost()->MoveCursorTo(point_in_root);
640 } 640 }
641 641
642 gfx::NativeCursor Window::GetCursor(const gfx::Point& point) const { 642 gfx::NativeCursor Window::GetCursor(const gfx::Point& point) const {
643 return delegate_ ? delegate_->GetCursor(point) : gfx::kNullCursor; 643 return delegate_ ? delegate_->GetCursor(point) : gfx::kNullCursor;
644 } 644 }
645 645
646 void Window::AddObserver(WindowObserver* observer) { 646 void Window::AddObserver(WindowObserver* observer) {
647 observer->OnObservingWindow(this);
647 observers_.AddObserver(observer); 648 observers_.AddObserver(observer);
648 } 649 }
649 650
650 void Window::RemoveObserver(WindowObserver* observer) { 651 void Window::RemoveObserver(WindowObserver* observer) {
652 observer->OnUnobservingWindow(this);
651 observers_.RemoveObserver(observer); 653 observers_.RemoveObserver(observer);
652 } 654 }
653 655
654 bool Window::HasObserver(WindowObserver* observer) { 656 bool Window::HasObserver(WindowObserver* observer) {
655 return observers_.HasObserver(observer); 657 return observers_.HasObserver(observer);
656 } 658 }
657 659
658 bool Window::ContainsPointInRoot(const gfx::Point& point_in_root) const { 660 bool Window::ContainsPointInRoot(const gfx::Point& point_in_root) const {
659 const Window* root_window = GetRootWindow(); 661 const Window* root_window = GetRootWindow();
660 if (!root_window) 662 if (!root_window)
(...skipping 765 matching lines...) Expand 10 before | Expand all | Expand 10 after
1426 return window; 1428 return window;
1427 if (offset) 1429 if (offset)
1428 *offset += window->bounds().OffsetFromOrigin(); 1430 *offset += window->bounds().OffsetFromOrigin();
1429 } 1431 }
1430 if (offset) 1432 if (offset)
1431 *offset = gfx::Vector2d(); 1433 *offset = gfx::Vector2d();
1432 return NULL; 1434 return NULL;
1433 } 1435 }
1434 1436
1435 } // namespace aura 1437 } // namespace aura
OLDNEW
« no previous file with comments | « ui/aura/aura.gyp ('k') | ui/aura/window_observer.h » ('j') | ui/aura/window_observer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698