Chromium Code Reviews
[email protected] (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(196)

Issue 11421006: Desktop aura: Break aura::Window::SetParent in two. (Closed)

Created:
8 years, 1 month ago by Elliot Glaysher
Modified:
8 years ago
CC:
chromium-reviews, sadrul, nkostylev+watch_chromium.org, ben+watch_chromium.org, tfarina, penghuang+watch_chromium.org, dcheng, joi+watch-content_chromium.org, Aaron Boodman, darin-cc_chromium.org, oshima+watch_chromium.org, chromium-apps-reviews_chromium.org, James Su, stevenjb+watch_chromium.org, davemoore+watch_chromium.org, yusukes+watch_chromium.org, ananta, cpu_(ooo_6.6-7.5), oshima
Visibility:
Public.

Description

Desktop aura: Break aura::Window::SetParent in two. Previously, SetParent will query a global StackingClient object if NULL is passed to it. Since we want different behavior on the desktop and on ash, we need to break that. It has been replaced with two methods: - SetParentTo(), which takes an aura window and does the parenting. - SetDefaultParentByTargetRoot(), which takes a RootWindow as context and asks the StackingClient on said RootWindow where it should parent the window. The problem is that people have relied for a long time on what amounts to a global variable. This is the first of several patches that pass around a context RootWindow. This patch focuses on ash/ unittests mostly. Later patches will focus on threading context through Widget creation. The last patch in this series will pull out the global stacking client interface and add DCHECKs so NULL can't be passed to either of these methods on Window. BUG=161882 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=170049

Patch Set 1 #

Patch Set 2 : Add DCHECK because this stack is impossible otherwise? #

Patch Set 3 : Re-add parent finding thing to web_contents_view_aura.cc. I guess it was necessary after all? #

Total comments: 4

Patch Set 4 : Theoretically fix everything ben asked for. #

Patch Set 5 : Rebase to ToT and fix in-air collision with recently committed unit tests #

Patch Set 6 : I think the content_unittests timeout on linux_aura is flake, but try to fix it anyway. #

Total comments: 17

Patch Set 7 : fixes and stuff for sky #

Total comments: 4

Patch Set 8 : Fix bad merge for oshima #

Patch Set 9 : Rename for oshima/comment fix for sky #

Total comments: 4

Patch Set 10 : Undo all changes to the second half of InitAsPopup #

Patch Set 11 : And use parent for the view #

Patch Set 12 : And the rest of oshima's comments #

Total comments: 1

Patch Set 13 : Further renames for oshima #

Total comments: 3

Patch Set 14 : Now for commit #

Patch Set 15 : Fix license header to shut bot up. #

Patch Set 16 : merge + fix modified test #

Patch Set 17 : Fix ash_unittests #

Patch Set 18 : Fix ash_unittests #

Unified diffs Side-by-side diffs Delta from patch set Stats (+648 lines, -521 lines) Patch
M ash/accelerators/accelerator_controller_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 3 chunks +3 lines, -3 lines 0 comments Download
M ash/accelerators/accelerator_filter_unittest.cc View 1 chunk +2 lines, -3 lines 0 comments Download
M ash/accelerators/nested_dispatcher_controller_unittest.cc View 2 chunks +3 lines, -5 lines 0 comments Download
M ash/display/screen_position_controller_unittest.cc View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M ash/drag_drop/drag_drop_controller.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +1 line, -1 line 0 comments Download
M ash/drag_drop/drag_drop_tracker.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +2 lines, -1 line 0 comments Download
M ash/drag_drop/drag_drop_tracker.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +4 lines, -4 lines 0 comments Download
M ash/drag_drop/drag_drop_tracker_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 4 chunks +9 lines, -11 lines 0 comments Download
M ash/focus_cycler_unittest.cc View 7 chunks +6 lines, -7 lines 0 comments Download
M ash/root_window_controller_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +2 lines, -2 lines 0 comments Download
M ash/shell_unittest.cc View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M ash/test/ash_test_base.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +27 lines, -0 lines 0 comments Download
M ash/test/ash_test_base.cc View 1 2 3 4 5 6 7 8 2 chunks +51 lines, -0 lines 0 comments Download
M ash/tooltips/tooltip_controller_unittest.cc View 9 chunks +15 lines, -13 lines 0 comments Download
M ash/wm/activation_controller_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 14 chunks +66 lines, -57 lines 0 comments Download
M ash/wm/base_layout_manager_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M ash/wm/gestures/long_press_affordance_handler.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +3 lines, -3 lines 0 comments Download
M ash/wm/panel_layout_manager_unittest.cc View 1 chunk +3 lines, -4 lines 0 comments Download
M ash/wm/shelf_layout_manager_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +1 line, -1 line 0 comments Download
M ash/wm/toplevel_window_event_handler_unittest.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M ash/wm/user_activity_detector_unittest.cc View 3 chunks +3 lines, -6 lines 0 comments Download
M ash/wm/video_detector_unittest.cc View 5 chunks +6 lines, -6 lines 0 comments Download
M ash/wm/visibility_controller_unittest.cc View 1 chunk +1 line, -2 lines 0 comments Download
M ash/wm/window_animations_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +3 lines, -6 lines 0 comments Download
M ash/wm/window_cycle_controller_unittest.cc View 10 chunks +18 lines, -18 lines 0 comments Download
M ash/wm/window_manager_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 8 chunks +19 lines, -20 lines 0 comments Download
M ash/wm/window_modality_controller_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 8 chunks +25 lines, -25 lines 0 comments Download
M ash/wm/workspace/multi_window_resize_controller_unittest.cc View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M ash/wm/workspace/workspace.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M ash/wm/workspace/workspace_event_handler_unittest.cc View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M ash/wm/workspace/workspace_layout_manager_unittest.cc View 1 2 3 4 5 6 7 chunks +14 lines, -19 lines 0 comments Download
M ash/wm/workspace/workspace_manager.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M ash/wm/workspace/workspace_manager_unittest.cc View 1 2 3 4 5 6 17 chunks +27 lines, -45 lines 0 comments Download
M ash/wm/workspace/workspace_window_resizer_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +4 lines, -4 lines 0 comments Download
M chrome/browser/chromeos/extensions/wallpaper_private_api_unittest.cc View 1 chunk +4 lines, -4 lines 0 comments Download
M chrome/browser/ui/ash/window_positioner_unittest.cc View 1 chunk +3 lines, -3 lines 0 comments Download
M chrome/browser/ui/window_sizer/window_sizer_ash_unittest.cc View 6 chunks +8 lines, -16 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_view_aura.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 3 chunks +15 lines, -12 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_view_aura_unittest.cc View 1 2 3 4 5 6 7 8 5 chunks +19 lines, -2 lines 0 comments Download
M content/browser/web_contents/web_contents_view_aura.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +2 lines, -1 line 0 comments Download
M ui/aura/client/stacking_client.h View 1 2 3 4 5 6 3 chunks +11 lines, -8 lines 0 comments Download
M ui/aura/demo/demo_main.cc View 1 2 3 4 5 6 7 8 3 chunks +3 lines, -3 lines 0 comments Download
M ui/aura/gestures/gesture_recognizer_unittest.cc View 43 chunks +43 lines, -43 lines 0 comments Download
M ui/aura/root_window_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 5 chunks +6 lines, -6 lines 0 comments Download
M ui/aura/test/aura_test_base.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +7 lines, -0 lines 0 comments Download
M ui/aura/test/aura_test_base.cc View 1 2 3 4 5 6 7 8 2 chunks +15 lines, -0 lines 0 comments Download
M ui/aura/test/test_windows.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +3 lines, -3 lines 0 comments Download
M ui/aura/test/test_windows.cc View 1 2 3 1 chunk +1 line, -11 lines 0 comments Download
M ui/aura/window.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +6 lines, -3 lines 0 comments Download
M ui/aura/window.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +12 lines, -15 lines 0 comments Download
M ui/aura/window_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 69 chunks +118 lines, -91 lines 0 comments Download
M ui/views/corewm/compound_event_filter_unittest.cc View 1 2 chunks +3 lines, -2 lines 0 comments Download
M ui/views/corewm/focus_controller_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 3 chunks +3 lines, -3 lines 0 comments Download
M ui/views/corewm/shadow_controller_unittest.cc View 1 2 3 4 5 6 8 chunks +8 lines, -8 lines 0 comments Download
M ui/views/widget/native_widget_aura.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 3 chunks +31 lines, -12 lines 0 comments Download
M ui/views/widget/widget.h View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 29 (0 generated)
Elliot Glaysher
+ ananta & cpu as CC; this isn't going out for real review yet; still ...
8 years, 1 month ago (2012-11-20 20:59:06 UTC) #1
Elliot Glaysher
+ ben Getting some green trybots now.
8 years, 1 month ago (2012-11-20 23:37:38 UTC) #2
Ben Goodger (Google)
https://codereview.chromium.org/11421006/diff/3003/ui/aura/window.cc File ui/aura/window.cc (right): https://codereview.chromium.org/11421006/diff/3003/ui/aura/window.cc#newcode323 ui/aura/window.cc:323: void Window::SetParentTo(Window* parent) { Since you're renaming this method, ...
8 years, 1 month ago (2012-11-20 23:46:37 UTC) #3
Ben Goodger (Google)
> .. I'm OK with the SetDefault etc. function taking window bounds if that helps. ...
8 years, 1 month ago (2012-11-20 23:47:31 UTC) #4
Elliot Glaysher
sky+jam: this is ready for real review right now. Yesterday, Ben did a preliminary review ...
8 years, 1 month ago (2012-11-21 21:20:54 UTC) #5
sky
https://codereview.chromium.org/11421006/diff/5057/ash/drag_drop/drag_drop_tracker.h File ash/drag_drop/drag_drop_tracker.h (right): https://codereview.chromium.org/11421006/diff/5057/ash/drag_drop/drag_drop_tracker.h#newcode28 ash/drag_drop/drag_drop_tracker.h:28: DragDropTracker(aura::RootWindow* context_root); explicit https://codereview.chromium.org/11421006/diff/5057/ash/test/ash_test_base.h File ash/test/ash_test_base.h (right): https://codereview.chromium.org/11421006/diff/5057/ash/test/ash_test_base.h#newcode77 ash/test/ash_test_base.h:77: ...
8 years, 1 month ago (2012-11-21 23:35:58 UTC) #6
sky
I'm adding Oshima to the cc list. Oshima, you might want to look at the ...
8 years, 1 month ago (2012-11-21 23:37:11 UTC) #7
Elliot Glaysher
https://codereview.chromium.org/11421006/diff/5057/ui/views/widget/native_widget_aura.cc File ui/views/widget/native_widget_aura.cc (right): https://codereview.chromium.org/11421006/diff/5057/ui/views/widget/native_widget_aura.cc#newcode1037 ui/views/widget/native_widget_aura.cc:1037: native_view->SetDefaultParentByTargetRoot(native_view->GetRootWindow(), On 2012/11/21 23:35:59, sky wrote: > I think ...
8 years, 1 month ago (2012-11-22 00:26:55 UTC) #8
sky
https://codereview.chromium.org/11421006/diff/5057/ui/views/widget/native_widget_aura.cc File ui/views/widget/native_widget_aura.cc (right): https://codereview.chromium.org/11421006/diff/5057/ui/views/widget/native_widget_aura.cc#newcode1037 ui/views/widget/native_widget_aura.cc:1037: native_view->SetDefaultParentByTargetRoot(native_view->GetRootWindow(), On 2012/11/22 00:26:56, Elliot Glaysher wrote: > On ...
8 years, 1 month ago (2012-11-22 00:59:50 UTC) #9
Elliot Glaysher
https://codereview.chromium.org/11421006/diff/5057/ui/views/widget/native_widget_aura.cc File ui/views/widget/native_widget_aura.cc (right): https://codereview.chromium.org/11421006/diff/5057/ui/views/widget/native_widget_aura.cc#newcode1037 ui/views/widget/native_widget_aura.cc:1037: native_view->SetDefaultParentByTargetRoot(native_view->GetRootWindow(), On 2012/11/22 00:59:50, sky wrote: > On 2012/11/22 ...
8 years ago (2012-11-26 21:04:54 UTC) #10
oshima
https://codereview.chromium.org/11421006/diff/8005/content/browser/renderer_host/render_widget_host_view_aura.cc File content/browser/renderer_host/render_widget_host_view_aura.cc (right): https://codereview.chromium.org/11421006/diff/8005/content/browser/renderer_host/render_widget_host_view_aura.cc#newcode330 content/browser/renderer_host/render_widget_host_view_aura.cc:330: gfx::Point origin_in_screen(bounds_in_display.origin()); bounds_in_display is in screen coordinates, so you ...
8 years ago (2012-11-26 21:24:45 UTC) #11
sky
https://codereview.chromium.org/11421006/diff/5057/ui/views/widget/native_widget_aura.cc File ui/views/widget/native_widget_aura.cc (right): https://codereview.chromium.org/11421006/diff/5057/ui/views/widget/native_widget_aura.cc#newcode1037 ui/views/widget/native_widget_aura.cc:1037: native_view->SetDefaultParentByTargetRoot(native_view->GetRootWindow(), On 2012/11/26 21:04:54, Elliot Glaysher wrote: > On ...
8 years ago (2012-11-26 22:29:08 UTC) #12
Elliot Glaysher
https://codereview.chromium.org/11421006/diff/8005/content/browser/renderer_host/render_widget_host_view_aura.cc File content/browser/renderer_host/render_widget_host_view_aura.cc (right): https://codereview.chromium.org/11421006/diff/8005/content/browser/renderer_host/render_widget_host_view_aura.cc#newcode336 content/browser/renderer_host/render_widget_host_view_aura.cc:336: window_->SetDefaultParentByRoot( On 2012/11/26 21:24:46, oshima wrote: > Does this ...
8 years ago (2012-11-26 23:02:30 UTC) #13
oshima
https://codereview.chromium.org/11421006/diff/8005/content/browser/renderer_host/render_widget_host_view_aura.cc File content/browser/renderer_host/render_widget_host_view_aura.cc (right): https://codereview.chromium.org/11421006/diff/8005/content/browser/renderer_host/render_widget_host_view_aura.cc#newcode336 content/browser/renderer_host/render_widget_host_view_aura.cc:336: window_->SetDefaultParentByRoot( On 2012/11/26 23:02:30, Elliot Glaysher wrote: > On ...
8 years ago (2012-11-27 00:14:29 UTC) #14
Elliot Glaysher
https://codereview.chromium.org/11421006/diff/5115/content/browser/renderer_host/render_widget_host_view_aura.cc File content/browser/renderer_host/render_widget_host_view_aura.cc (right): https://codereview.chromium.org/11421006/diff/5115/content/browser/renderer_host/render_widget_host_view_aura.cc#newcode336 content/browser/renderer_host/render_widget_host_view_aura.cc:336: SetBounds(gfx::Rect(origin_in_screen, bounds_in_screen.size())); On 2012/11/27 00:14:30, oshima wrote: > This ...
8 years ago (2012-11-27 00:33:50 UTC) #15
jam
do you need me to review this? sky is an owner in chrome and content/browser
8 years ago (2012-11-27 00:37:11 UTC) #16
oshima
RWHVA lgtm. https://codereview.chromium.org/11421006/diff/2019/ui/aura/window.cc File ui/aura/window.cc (right): https://codereview.chromium.org/11421006/diff/2019/ui/aura/window.cc#newcode324 ui/aura/window.cc:324: const gfx::Rect& bounds) { would you mind ...
8 years ago (2012-11-27 00:45:55 UTC) #17
Elliot Glaysher
I didn't know sky was an owner in content/ -jam
8 years ago (2012-11-27 00:46:00 UTC) #18
sky
LGTM https://codereview.chromium.org/11421006/diff/2021/ash/test/ash_test_base.h File ash/test/ash_test_base.h (right): https://codereview.chromium.org/11421006/diff/2021/ash/test/ash_test_base.h#newcode76 ash/test/ash_test_base.h:76: // Attach this to the current shell's root ...
8 years ago (2012-11-27 01:45:51 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/[email protected]/11421006/5172
8 years ago (2012-11-27 17:51:28 UTC) #20
commit-bot: I haz the power
Presubmit check for 11421006-5172 failed and returned exit status 1. Running presubmit commit checks ...
8 years ago (2012-11-27 17:52:00 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/[email protected]/11421006/5173
8 years ago (2012-11-27 17:53:47 UTC) #22
commit-bot: I haz the power
Retried try job too often for step(s) base_unittests, compile, crypto_unittests, googleurl_unittests, sql_unittests
8 years ago (2012-11-28 01:25:30 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/[email protected]/11421006/5173
8 years ago (2012-11-28 17:26:47 UTC) #24
commit-bot: I haz the power
Failed to apply patch for ash/drag_drop/drag_drop_controller.cc: While running patch -p1 --forward --force --no-backup-if-mismatch; patching file ...
8 years ago (2012-11-28 17:27:10 UTC) #25
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/[email protected]/11421006/4072
8 years ago (2012-11-28 17:55:27 UTC) #26
commit-bot: I haz the power
Sorry for I got bad news for ya. Compile failed with a clobber build on ...
8 years ago (2012-11-28 18:40:27 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/[email protected]/11421006/18022
8 years ago (2012-11-28 18:42:41 UTC) #28
commit-bot: I haz the power
8 years ago (2012-11-28 21:00:09 UTC) #29
Message was sent while issue was closed.
Change committed as 170049

Powered by Google App Engine
This is Rietveld 408576698