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

Unified Diff: ash/common/wm/window_cycle_list.cc

Issue 2337213002: CrOS Window cycle ui - set widget bounds with initparams to avoid extra (Closed)
Patch Set: Created 4 years, 3 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/widget.cc » ('j') | ui/views/widget/widget.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/wm/window_cycle_list.cc
diff --git a/ash/common/wm/window_cycle_list.cc b/ash/common/wm/window_cycle_list.cc
index f2318499bed5d3e98e18842a516d009f5a835297..ee92f738d19bf5e3e89830fee180826edb09f793 100644
--- a/ash/common/wm/window_cycle_list.cc
+++ b/ash/common/wm/window_cycle_list.cc
@@ -613,14 +613,14 @@ void WindowCycleList::InitWindowCycleView() {
WmWindow* root_window = WmShell::Get()->GetRootWindowForNewWindows();
root_window->GetRootWindowController()->ConfigureWidgetInitParamsForContainer(
widget, kShellWindowId_OverlayContainer, &params);
- widget->Init(params);
-
- screen_observer_.Add(display::Screen::GetScreen());
gfx::Rect widget_rect = root_window->GetDisplayNearestWindow().bounds();
int widget_height = cycle_view_->GetPreferredSize().height();
widget_rect.set_y((widget_rect.height() - widget_height) / 2);
widget_rect.set_height(widget_height);
- widget->SetBounds(widget_rect);
+ params.bounds = widget_rect;
+ widget->Init(params);
+
+ screen_observer_.Add(display::Screen::GetScreen());
sky 2016/09/13 19:44:02 optional: if you're moving this around, how about
widget->Show();
widget->SetCapture(cycle_view_);
widget->set_auto_release_capture(false);
« no previous file with comments | « no previous file | ui/views/widget/widget.cc » ('j') | ui/views/widget/widget.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698