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

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

Issue 2354343002: CrOS Window cycle ui - set widget bounds with initparams to avoid extra resizing. (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') | no next file with comments »
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 b6e82e332e82ea0d7f366bf2909514f7c251c6e3..e31826e12be7bd4ce5143d5bd3487399e29facdd 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());
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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698