diff options
author | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-08 20:52:52 +0000 |
---|---|---|
committer | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-08 20:52:52 +0000 |
commit | 875d83611df7fe24b61233eb6acad0a52c7feec2 (patch) | |
tree | f6bd1773165979f1d04ed4f543de425354b03c7c /ui/views | |
parent | 17bc45d8acff61aa045ccff6521a310b827f0abf (diff) | |
download | chromium_src-875d83611df7fe24b61233eb6acad0a52c7feec2.zip chromium_src-875d83611df7fe24b61233eb6acad0a52c7feec2.tar.gz chromium_src-875d83611df7fe24b61233eb6acad0a52c7feec2.tar.bz2 |
ui/views: Fix the signature of View::OnViewAdded/Removed overridden methods.
The signature changed from (commit bf2f7326):
virtual void OnViewAdded(View* parent, View* child);
To:
virtual void OnViewAdded(const View& parent, const View& child);
BUG=72040
TEST=None
R=ben@chromium.org,sky@chromium.org,pkasting@chromium.org
Review URL: http://codereview.chromium.org/7104042
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@88392 0039d316-1c4b-4281-b951-d872f2087c98
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; |