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

Issue 2713643002: Add View::AddedToWidget and RemovedFromWidget. (Closed)

Created:
3 years, 10 months ago by msimonides
Modified:
3 years, 9 months ago
Reviewers:
sky
CC:
chromium-reviews, tfarina
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add View::AddedToWidget and RemovedFromWidget. Many views implement ViewHierarchyChanged to perform some setup once a Widget becomes available to them. This results with code duplication. With these new methods there will be no need to implement ViewHierarchyChanged for the common case. BUG=5191 Review-Url: https://codereview.chromium.org/2713643002 Cr-Commit-Position: refs/heads/master@{#454542} Committed: https://chromium.googlesource.com/chromium/src/+/88ece8a16a39921247c1a74dc1747ea00e8e9377

Patch Set 1 #

Total comments: 4

Patch Set 2 : Review fixes. #

Total comments: 2

Patch Set 3 : Reimplement without using the additional member View::attached_widget_. #

Total comments: 4

Patch Set 4 : Use existing propagation code instead of adding more tree walking. #

Total comments: 10

Patch Set 5 : Review fixes. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+187 lines, -12 lines) Patch
M ui/views/view.h View 1 2 3 4 3 chunks +20 lines, -2 lines 0 comments Download
M ui/views/view.cc View 1 2 3 4 6 chunks +27 lines, -10 lines 0 comments Download
M ui/views/view_unittest.cc View 1 2 3 4 1 chunk +140 lines, -0 lines 0 comments Download

Messages

Total messages: 18 (4 generated)
msimonides
3 years, 10 months ago (2017-02-22 10:47:49 UTC) #2
sky
https://codereview.chromium.org/2713643002/diff/1/ui/views/view.cc File ui/views/view.cc (right): https://codereview.chromium.org/2713643002/diff/1/ui/views/view.cc#newcode2030 ui/views/view.cc:2030: ViewHierarchyChanged(details); Please call the new functions from here. That ...
3 years, 10 months ago (2017-02-22 17:21:33 UTC) #3
msimonides
Added fixes for review comments.
3 years, 10 months ago (2017-02-24 06:52:21 UTC) #4
sky
https://codereview.chromium.org/2713643002/diff/20001/ui/views/view.h File ui/views/view.h (right): https://codereview.chromium.org/2713643002/diff/20001/ui/views/view.h#newcode1504 ui/views/view.h:1504: Widget* attached_widget_; We shouldn't need to cache the widget. ...
3 years, 10 months ago (2017-02-24 18:26:14 UTC) #5
msimonides
https://codereview.chromium.org/2713643002/diff/20001/ui/views/view.h File ui/views/view.h (right): https://codereview.chromium.org/2713643002/diff/20001/ui/views/view.h#newcode1504 ui/views/view.h:1504: Widget* attached_widget_; On 2017/02/24 18:26:14, sky wrote: > We ...
3 years, 9 months ago (2017-02-27 09:52:28 UTC) #6
sky
https://codereview.chromium.org/2713643002/diff/40001/ui/views/view.cc File ui/views/view.cc (right): https://codereview.chromium.org/2713643002/diff/40001/ui/views/view.cc#newcode254 ui/views/view.cc:254: view->PropagateAddedToWidget(); I would like to avoid more tree walking. ...
3 years, 9 months ago (2017-02-27 16:46:54 UTC) #7
msimonides
https://codereview.chromium.org/2713643002/diff/40001/ui/views/view.cc File ui/views/view.cc (right): https://codereview.chromium.org/2713643002/diff/40001/ui/views/view.cc#newcode254 ui/views/view.cc:254: view->PropagateAddedToWidget(); On 2017/02/27 16:46:54, sky wrote: > I would ...
3 years, 9 months ago (2017-02-28 10:07:28 UTC) #8
sky
https://codereview.chromium.org/2713643002/diff/40001/ui/views/view.cc File ui/views/view.cc (right): https://codereview.chromium.org/2713643002/diff/40001/ui/views/view.cc#newcode254 ui/views/view.cc:254: view->PropagateAddedToWidget(); On 2017/02/28 10:07:27, msimonides wrote: > On 2017/02/27 ...
3 years, 9 months ago (2017-02-28 17:35:33 UTC) #9
msimonides
https://codereview.chromium.org/2713643002/diff/40001/ui/views/view.cc File ui/views/view.cc (right): https://codereview.chromium.org/2713643002/diff/40001/ui/views/view.cc#newcode254 ui/views/view.cc:254: view->PropagateAddedToWidget(); On 2017/02/28 17:35:33, sky wrote: > On 2017/02/28 ...
3 years, 9 months ago (2017-03-01 10:31:52 UTC) #10
sky
Almost there, thanks. https://codereview.chromium.org/2713643002/diff/60001/ui/views/view.cc File ui/views/view.cc (right): https://codereview.chromium.org/2713643002/diff/60001/ui/views/view.cc#newcode199 ui/views/view.cc:199: Widget* old_widget = NULL; nullptr https://codereview.chromium.org/2713643002/diff/60001/ui/views/view.h ...
3 years, 9 months ago (2017-03-01 20:26:52 UTC) #11
msimonides
https://codereview.chromium.org/2713643002/diff/60001/ui/views/view.cc File ui/views/view.cc (right): https://codereview.chromium.org/2713643002/diff/60001/ui/views/view.cc#newcode199 ui/views/view.cc:199: Widget* old_widget = NULL; On 2017/03/01 20:26:51, sky wrote: ...
3 years, 9 months ago (2017-03-02 07:48:56 UTC) #12
sky
LGTM - thanks!
3 years, 9 months ago (2017-03-02 18:19:31 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2713643002/80001
3 years, 9 months ago (2017-03-03 07:03:46 UTC) #15
commit-bot: I haz the power
3 years, 9 months ago (2017-03-03 08:01:21 UTC) #18
Message was sent while issue was closed.
Committed patchset #5 (id:80001) as
https://chromium.googlesource.com/chromium/src/+/88ece8a16a39921247c1a74dc174...

Powered by Google App Engine
This is Rietveld 408576698