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

Side by Side Diff: ui/v2/public/view.h

Issue 25757007: V2: Implement reparenting, bounds and visibility change notifications, and write more tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 2 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
« no previous file with comments | « no previous file | ui/v2/public/view_observer.h » ('j') | ui/v2/src/view_private.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 #ifndef UI_V2_PUBLIC_VIEW_H_ 5 #ifndef UI_V2_PUBLIC_VIEW_H_
6 #define UI_V2_PUBLIC_VIEW_H_ 6 #define UI_V2_PUBLIC_VIEW_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 18 matching lines...) Expand all
29 29
30 // Configuration. 30 // Configuration.
31 31
32 void set_owned_by_parent(bool owned_by_parent) { 32 void set_owned_by_parent(bool owned_by_parent) {
33 owned_by_parent_ = owned_by_parent; 33 owned_by_parent_ = owned_by_parent;
34 } 34 }
35 35
36 // View takes ownership. 36 // View takes ownership.
37 void SetPainter(Painter* painter); 37 void SetPainter(Painter* painter);
38 38
39 // See documentation in layout.h. A layout manager's rules apply to this
40 // View's children.
39 // View takes ownership. 41 // View takes ownership.
40 void SetLayout(Layout* layout); 42 void SetLayout(Layout* layout);
41 43
42 // Observation. 44 // Observation.
43 45
44 void AddObserver(ViewObserver* observer); 46 void AddObserver(ViewObserver* observer);
45 void RemoveObserver(ViewObserver* observer); 47 void RemoveObserver(ViewObserver* observer);
46 48
47 // Disposition. 49 // Disposition.
48 50
(...skipping 14 matching lines...) Expand all
63 65
64 bool Contains(View* child) const; 66 bool Contains(View* child) const;
65 67
66 void StackChildAtTop(View* child); 68 void StackChildAtTop(View* child);
67 void StackChildAtBottom(View* child); 69 void StackChildAtBottom(View* child);
68 void StackChildAbove(View* child, View* other); 70 void StackChildAbove(View* child, View* other);
69 void StackChildBelow(View* child, View* other); 71 void StackChildBelow(View* child, View* other);
70 72
71 private: 73 private:
72 friend class Layout; 74 friend class Layout;
73 friend class ViewObserversAccessor; 75 friend class ViewPrivate;
74
75 void SetBoundsInternal(const gfx::Rect& bounds);
76 76
77 // Disposition attributes. 77 // Disposition attributes.
78 gfx::Rect bounds_; 78 gfx::Rect bounds_;
79 bool visible_; 79 bool visible_;
80 80
81 scoped_ptr<Painter> painter_; 81 scoped_ptr<Painter> painter_;
82 scoped_ptr<Layout> layout_; 82 scoped_ptr<Layout> layout_;
83 83
84 // Tree. 84 // Tree.
85 bool owned_by_parent_; 85 bool owned_by_parent_;
86 View* parent_; 86 View* parent_;
87 Children children_; 87 Children children_;
88 88
89 ObserverList<ViewObserver> observers_; 89 ObserverList<ViewObserver> observers_;
90 90
91 DISALLOW_COPY_AND_ASSIGN(View); 91 DISALLOW_COPY_AND_ASSIGN(View);
92 }; 92 };
93 93
94 } // namespace v2 94 } // namespace v2
95 95
96 #endif // UI_V2_PUBLIC_VIEW_H_ 96 #endif // UI_V2_PUBLIC_VIEW_H_
OLDNEW
« no previous file with comments | « no previous file | ui/v2/public/view_observer.h » ('j') | ui/v2/src/view_private.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698