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

Issue 7185005: Add View::ReorderChildView and Widget::MoveToTop. (Closed)

Created:
9 years, 6 months ago by sadrul
Modified:
9 years, 6 months ago
CC:
chromium-reviews, dhollowa, oshima, rjkroege
Visibility:
Public.

Description

Add View::ReorderChildView and Widget::MoveToTop. The z-ordering of child views is currently maintained (implicitly?) by the order they are added to the parent view. It may often be necessary to change the z-order of views, and View::ReorderChildView can be used to do that. I changed views_desktop to have the two pure-views windows to have overlapping regions, and View::ReorderChildView is used to change the z-ordering of the two windows. So it is possible to click a window to activate it and bring it on top of the other. It could have been done without adding Widget::MoveToTop, but given Widget::MoveAbove and MoveAboveWidget, it sounded like a good idea to have Widget::MoveToTop (MoveToFront?). I do now know what the implementation for windows should be, though. So left it as NOTIMPLEMENTED. BUG=none TEST=none Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=89363

Patch Set 1 #

Total comments: 2

Patch Set 2 : . #

Total comments: 2

Patch Set 3 : add test #

Total comments: 3

Patch Set 4 : . #

Total comments: 6

Patch Set 5 : . #

Unified diffs Side-by-side diffs Delta from patch set Stats (+109 lines, -1 line) Patch
M views/desktop/desktop_window.cc View 2 chunks +2 lines, -1 line 0 comments Download
M views/view.h View 1 chunk +4 lines, -0 lines 0 comments Download
M views/view.cc View 1 1 chunk +26 lines, -0 lines 0 comments Download
M views/view_unittest.cc View 1 2 3 4 1 chunk +54 lines, -0 lines 0 comments Download
M views/widget/native_widget.h View 1 chunk +1 line, -0 lines 0 comments Download
M views/widget/native_widget_gtk.h View 1 chunk +1 line, -0 lines 0 comments Download
M views/widget/native_widget_gtk.cc View 1 chunk +5 lines, -0 lines 0 comments Download
M views/widget/native_widget_views.h View 1 chunk +1 line, -0 lines 0 comments Download
M views/widget/native_widget_views.cc View 1 2 chunks +5 lines, -0 lines 0 comments Download
M views/widget/native_widget_win.h View 1 chunk +1 line, -0 lines 0 comments Download
M views/widget/native_widget_win.cc View 1 chunk +4 lines, -0 lines 0 comments Download
M views/widget/widget.h View 1 chunk +1 line, -0 lines 0 comments Download
M views/widget/widget.cc View 1 chunk +4 lines, -0 lines 0 comments Download

Messages

Total messages: 12 (0 generated)
sadrul
9 years, 6 months ago (2011-06-16 04:12:32 UTC) #1
Ben Goodger (Google)
LGTM. Cool, sky & I were just talking about how we needed this yesterday.
9 years, 6 months ago (2011-06-16 14:35:22 UTC) #2
tfarina
http://codereview.chromium.org/7185005/diff/1/views/view.cc File views/view.cc (right): http://codereview.chromium.org/7185005/diff/1/views/view.cc#newcode180 views/view.cc:180: DCHECK(view->parent() == this); view->parent_ please! DCHECK_EQ(view->parent_, this);
9 years, 6 months ago (2011-06-16 14:58:05 UTC) #3
sadrul
I also explicitly turned on paint_to_texture_ for the NativeWidgetView so that it always uses accelerated ...
9 years, 6 months ago (2011-06-16 15:37:13 UTC) #4
tfarina
http://codereview.chromium.org/7185005/diff/3002/views/view.cc File views/view.cc (right): http://codereview.chromium.org/7185005/diff/3002/views/view.cc#newcode179 views/view.cc:179: void View::ReorderChildView(View* view, int index) { Could you add ...
9 years, 6 months ago (2011-06-16 15:40:10 UTC) #5
sadrul
http://codereview.chromium.org/7185005/diff/3002/views/view.cc File views/view.cc (right): http://codereview.chromium.org/7185005/diff/3002/views/view.cc#newcode179 views/view.cc:179: void View::ReorderChildView(View* view, int index) { On 2011/06/16 15:40:10, ...
9 years, 6 months ago (2011-06-16 15:55:18 UTC) #6
tfarina
http://codereview.chromium.org/7185005/diff/1013/views/view_unittest.cc File views/view_unittest.cc (right): http://codereview.chromium.org/7185005/diff/1013/views/view_unittest.cc#newcode2147 views/view_unittest.cc:2147: // Move |foo1| at the end. Could you test ...
9 years, 6 months ago (2011-06-16 15:59:42 UTC) #7
sadrul
http://codereview.chromium.org/7185005/diff/1013/views/view_unittest.cc File views/view_unittest.cc (right): http://codereview.chromium.org/7185005/diff/1013/views/view_unittest.cc#newcode2147 views/view_unittest.cc:2147: // Move |foo1| at the end. On 2011/06/16 15:59:42, ...
9 years, 6 months ago (2011-06-16 16:12:54 UTC) #8
tfarina
Code I care, LGTM. http://codereview.chromium.org/7185005/diff/2003/views/view_unittest.cc File views/view_unittest.cc (right): http://codereview.chromium.org/7185005/diff/2003/views/view_unittest.cc#newcode2115 views/view_unittest.cc:2115: TEST_F(ViewTest, ReorderChildren) { I'd add ...
9 years, 6 months ago (2011-06-16 16:18:24 UTC) #9
sadrul
http://codereview.chromium.org/7185005/diff/2003/views/view_unittest.cc File views/view_unittest.cc (right): http://codereview.chromium.org/7185005/diff/2003/views/view_unittest.cc#newcode2115 views/view_unittest.cc:2115: TEST_F(ViewTest, ReorderChildren) { On 2011/06/16 16:18:24, tfarina wrote: > ...
9 years, 6 months ago (2011-06-16 16:25:01 UTC) #10
Ben Goodger (Google)
http://codereview.chromium.org/7185005/diff/2003/views/view_unittest.cc File views/view_unittest.cc (right): http://codereview.chromium.org/7185005/diff/2003/views/view_unittest.cc#newcode2115 views/view_unittest.cc:2115: TEST_F(ViewTest, ReorderChildren) { I think you mean: On 2011/06/16 ...
9 years, 6 months ago (2011-06-16 16:25:06 UTC) #11
tfarina
9 years, 6 months ago (2011-06-16 16:28:12 UTC) #12
http://codereview.chromium.org/7185005/diff/2003/views/view_unittest.cc
File views/view_unittest.cc (right):

http://codereview.chromium.org/7185005/diff/2003/views/view_unittest.cc#newco...
views/view_unittest.cc:2115: TEST_F(ViewTest, ReorderChildren) {
On 2011/06/16 16:25:01, sadrul wrote:
> On 2011/06/16 16:18:24, tfarina wrote:
> > I'd add a comment like this (but it's OK to not too):
> > 
> > // The tree looks like this:
> > // root
> > // |-- child
> > // |   |-- foo1
> > // |   |-- foo2
> > // +---|-- foo3
> 
> I think the view hierarchy is pretty self-evident, and since the hierarchy is
> changed a lot of time, it probably doesn't make sense to draw the hierarchy :)

Sure, that why I said I'm OK to not have one. It's just a hint for me and for
any further reader to know instantly (without having to guess/read from the
code) how the tree we're testing looks like.

Powered by Google App Engine
This is Rietveld 408576698