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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | ui/views/widget/widget.cc » ('j') | ui/views/widget/widget.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/common/wm/window_cycle_list.h" 5 #include "ash/common/wm/window_cycle_list.h"
6 6
7 #include <list> 7 #include <list>
8 #include <map> 8 #include <map>
9 9
10 #include "ash/common/shell_window_ids.h" 10 #include "ash/common/shell_window_ids.h"
(...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after
606 params.delegate = cycle_view_; 606 params.delegate = cycle_view_;
607 params.type = views::Widget::InitParams::TYPE_WINDOW_FRAMELESS; 607 params.type = views::Widget::InitParams::TYPE_WINDOW_FRAMELESS;
608 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; 608 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW;
609 params.accept_events = true; 609 params.accept_events = true;
610 params.name = "WindowCycleList (Alt+Tab)"; 610 params.name = "WindowCycleList (Alt+Tab)";
611 // TODO(estade): make sure nothing untoward happens when the lock screen 611 // TODO(estade): make sure nothing untoward happens when the lock screen
612 // or a system modal dialog is shown. 612 // or a system modal dialog is shown.
613 WmWindow* root_window = WmShell::Get()->GetRootWindowForNewWindows(); 613 WmWindow* root_window = WmShell::Get()->GetRootWindowForNewWindows();
614 root_window->GetRootWindowController()->ConfigureWidgetInitParamsForContainer( 614 root_window->GetRootWindowController()->ConfigureWidgetInitParamsForContainer(
615 widget, kShellWindowId_OverlayContainer, &params); 615 widget, kShellWindowId_OverlayContainer, &params);
616 widget->Init(params);
617
618 screen_observer_.Add(display::Screen::GetScreen());
619 gfx::Rect widget_rect = root_window->GetDisplayNearestWindow().bounds(); 616 gfx::Rect widget_rect = root_window->GetDisplayNearestWindow().bounds();
620 int widget_height = cycle_view_->GetPreferredSize().height(); 617 int widget_height = cycle_view_->GetPreferredSize().height();
621 widget_rect.set_y((widget_rect.height() - widget_height) / 2); 618 widget_rect.set_y((widget_rect.height() - widget_height) / 2);
622 widget_rect.set_height(widget_height); 619 widget_rect.set_height(widget_height);
623 widget->SetBounds(widget_rect); 620 params.bounds = widget_rect;
621 widget->Init(params);
622
623 screen_observer_.Add(display::Screen::GetScreen());
sky 2016/09/13 19:44:02 optional: if you're moving this around, how about
624 widget->Show(); 624 widget->Show();
625 widget->SetCapture(cycle_view_); 625 widget->SetCapture(cycle_view_);
626 widget->set_auto_release_capture(false); 626 widget->set_auto_release_capture(false);
627 cycle_ui_widget_ = widget; 627 cycle_ui_widget_ = widget;
628 } 628 }
629 629
630 } // namespace ash 630 } // namespace ash
OLDNEW
« 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