diff options
Diffstat (limited to 'ui/views')
-rw-r--r-- | ui/views/view_unittest.cc | 11 | ||||
-rw-r--r-- | ui/views/widget/root_view.cc | 6 | ||||
-rw-r--r-- | ui/views/widget/root_view.h | 2 |
3 files changed, 10 insertions, 9 deletions
diff --git a/ui/views/view_unittest.cc b/ui/views/view_unittest.cc index 202b223..ebdc717 100644 --- a/ui/views/view_unittest.cc +++ b/ui/views/view_unittest.cc @@ -4,6 +4,7 @@ #include <algorithm> +#include "base/compiler_specific.h" #include "testing/gtest/include/gtest/gtest.h" #include "ui/gfx/canvas.h" #include "ui/views/view.h" @@ -69,15 +70,15 @@ class ObserverView : public View { } // Overridden from View: - virtual void OnViewAdded(View* parent, View* child) { - subject_view_ = child; + virtual void OnViewAdded(const View& parent, const View& child) OVERRIDE { view_added_ = true; view_removed_ = false; + subject_view_ = &child; } - virtual void OnViewRemoved(View* parent, View* child) { - subject_view_ = child; - view_removed_ = true; + virtual void OnViewRemoved(const View& parent, const View& child) OVERRIDE { view_added_ = false; + view_removed_ = true; + subject_view_ = &child; } bool view_added() const { return view_added_; } diff --git a/ui/views/widget/root_view.cc b/ui/views/widget/root_view.cc index 8a4f053..dd2ebf5 100644 --- a/ui/views/widget/root_view.cc +++ b/ui/views/widget/root_view.cc @@ -31,11 +31,11 @@ RootView::~RootView() { //////////////////////////////////////////////////////////////////////////////// // RootView, View overrides: -void RootView::OnViewRemoved(View* parent, View* child) { - if (child == mouse_pressed_handler_) +void RootView::OnViewRemoved(const View& parent, const View& child) { + if (&child == mouse_pressed_handler_) mouse_pressed_handler_ = NULL; - GetFocusManager()->RemoveView(child); + GetFocusManager()->RemoveView(&child); } bool RootView::OnKeyPressed(const KeyEvent& event) { diff --git a/ui/views/widget/root_view.h b/ui/views/widget/root_view.h index 59ac133..6838a65 100644 --- a/ui/views/widget/root_view.h +++ b/ui/views/widget/root_view.h @@ -26,7 +26,7 @@ class RootView : public View, virtual ~RootView(); // Overridden from View: - virtual void OnViewRemoved(View* parent, View* child) OVERRIDE; + virtual void OnViewRemoved(const View& parent, const View& child) OVERRIDE; virtual bool OnKeyPressed(const KeyEvent& event) OVERRIDE; virtual bool OnKeyReleased(const KeyEvent& event) OVERRIDE; virtual bool OnMouseWheel(const MouseWheelEvent& event) OVERRIDE; |