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

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

Issue 697953002: ObserverList::HasObserver now takes a const pointer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compile errors (ChromeOS unit tests). Created 6 years, 1 month 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
« no previous file with comments | « ui/aura/window.h ('k') | ui/compositor/compositor.h » ('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 645 matching lines...) Expand 10 before | Expand all | Expand 10 after
656 void Window::AddObserver(WindowObserver* observer) { 656 void Window::AddObserver(WindowObserver* observer) {
657 observer->OnObservingWindow(this); 657 observer->OnObservingWindow(this);
658 observers_.AddObserver(observer); 658 observers_.AddObserver(observer);
659 } 659 }
660 660
661 void Window::RemoveObserver(WindowObserver* observer) { 661 void Window::RemoveObserver(WindowObserver* observer) {
662 observer->OnUnobservingWindow(this); 662 observer->OnUnobservingWindow(this);
663 observers_.RemoveObserver(observer); 663 observers_.RemoveObserver(observer);
664 } 664 }
665 665
666 bool Window::HasObserver(WindowObserver* observer) { 666 bool Window::HasObserver(const WindowObserver* observer) const {
667 return observers_.HasObserver(observer); 667 return observers_.HasObserver(observer);
668 } 668 }
669 669
670 bool Window::ContainsPointInRoot(const gfx::Point& point_in_root) const { 670 bool Window::ContainsPointInRoot(const gfx::Point& point_in_root) const {
671 const Window* root_window = GetRootWindow(); 671 const Window* root_window = GetRootWindow();
672 if (!root_window) 672 if (!root_window)
673 return false; 673 return false;
674 gfx::Point local_point(point_in_root); 674 gfx::Point local_point(point_in_root);
675 ConvertPointToTarget(root_window, this, &local_point); 675 ConvertPointToTarget(root_window, this, &local_point);
676 return gfx::Rect(GetTargetBounds().size()).Contains(local_point); 676 return gfx::Rect(GetTargetBounds().size()).Contains(local_point);
(...skipping 774 matching lines...) Expand 10 before | Expand all | Expand 10 after
1451 return window; 1451 return window;
1452 if (offset) 1452 if (offset)
1453 *offset += window->bounds().OffsetFromOrigin(); 1453 *offset += window->bounds().OffsetFromOrigin();
1454 } 1454 }
1455 if (offset) 1455 if (offset)
1456 *offset = gfx::Vector2d(); 1456 *offset = gfx::Vector2d();
1457 return NULL; 1457 return NULL;
1458 } 1458 }
1459 1459
1460 } // namespace aura 1460 } // namespace aura
OLDNEW
« no previous file with comments | « ui/aura/window.h ('k') | ui/compositor/compositor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698