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

Unified Diff: ui/views/view_unittest.cc

Issue 7104042: ui/views: Fix the signature of View::OnViewAdded/Removed overridden methods. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/views/widget/root_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/view_unittest.cc
diff --git a/ui/views/view_unittest.cc b/ui/views/view_unittest.cc
index 202b2238ff1fc57a9d76d1c4948eb698b57c0aac..bec5a144236d7a19ecf246bf9cb556132e334149 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"
@@ -56,10 +57,9 @@ TEST_F(ViewTest, TreeOperations) {
class ObserverView : public View {
public:
- ObserverView()
- : view_added_(false),
- view_removed_(false),
- subject_view_(NULL) {}
+ ObserverView() : view_added_(false),
sky 2011/06/08 15:57:35 The old code is the correct indentation style. See
tfarina 2011/06/08 19:13:56 Done.
+ view_removed_(false),
+ subject_view_(NULL) {}
virtual ~ObserverView() {}
void ResetTestState() {
@@ -69,15 +69,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_; }
« no previous file with comments | « no previous file | ui/views/widget/root_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698