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

Unified Diff: ash/wm/overview/window_grid.cc

Issue 2978273002: Revert of Cros Tablet Window management - Split Screen part II (Closed)
Patch Set: Created 3 years, 5 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 | « ash/wm/overview/window_grid.h ('k') | ash/wm/overview/window_selector.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/overview/window_grid.cc
diff --git a/ash/wm/overview/window_grid.cc b/ash/wm/overview/window_grid.cc
index acb22d7899cc0c6ac511007558b9d7f53bb49b55..e8d26c28e25ab9dd2af355199c39cf92a19344c7 100644
--- a/ash/wm/overview/window_grid.cc
+++ b/ash/wm/overview/window_grid.cc
@@ -257,16 +257,14 @@
WindowGrid::WindowGrid(aura::Window* root_window,
const std::vector<aura::Window*>& windows,
- WindowSelector* window_selector,
- const gfx::Rect& bounds_in_screen)
+ WindowSelector* window_selector)
: root_window_(root_window),
window_selector_(window_selector),
window_observer_(this),
window_state_observer_(this),
selected_index_(0),
num_columns_(0),
- prepared_for_overview_(false),
- bounds_(bounds_in_screen) {
+ prepared_for_overview_(false) {
aura::Window::Windows windows_in_root;
for (auto* window : windows) {
if (window->GetRootWindow() == root_window)
@@ -277,7 +275,7 @@
window_observer_.Add(window);
window_state_observer_.Add(wm::GetWindowState(window));
window_list_.push_back(
- base::MakeUnique<WindowSelectorItem>(window, window_selector_, this));
+ base::MakeUnique<WindowSelectorItem>(window, window_selector_));
}
}
@@ -328,8 +326,9 @@
aura::Window* widget_window = shield_widget_->GetNativeWindow();
const gfx::Rect bounds = widget_window->parent()->bounds();
widget_window->SetBounds(bounds);
-
- gfx::Rect total_bounds = bounds_;
+ gfx::Rect total_bounds = ScreenUtil::GetDisplayWorkAreaBoundsInParent(
+ root_window_->GetChildById(kShellWindowId_DefaultContainer));
+ ::wm::ConvertRectToScreen(root_window_, &total_bounds);
// Windows occupy vertically centered area with additional vertical insets.
int horizontal_inset =
gfx::ToFlooredInt(std::min(kOverviewInsetRatio * total_bounds.width(),
@@ -519,20 +518,6 @@
return false;
}
-void WindowGrid::RemoveItem(WindowSelectorItem* selector_item) {
- auto iter =
- std::find_if(window_list_.begin(), window_list_.end(),
- [selector_item](std::unique_ptr<WindowSelectorItem>& item) {
- return (item.get() == selector_item);
- });
- if (iter != window_list_.end()) {
- window_observer_.Remove(selector_item->GetWindow());
- window_state_observer_.Remove(
- wm::GetWindowState(selector_item->GetWindow()));
- window_list_.erase(iter);
- }
-}
-
void WindowGrid::FilterItems(const base::string16& pattern) {
base::i18n::FixedPatternStringSearchIgnoringCaseAndAccents finder(pattern);
for (const auto& window : window_list_) {
@@ -557,11 +542,6 @@
OverviewAnimationType::OVERVIEW_ANIMATION_CLOSING_SELECTOR_ITEM,
selection_widget_window);
selection_widget_->SetOpacity(0.f);
-}
-
-void WindowGrid::SetBoundsAndUpdatePositions(const gfx::Rect& bounds) {
- bounds_ = bounds;
- PositionWindows(true /* animate */);
}
void WindowGrid::OnWindowDestroying(aura::Window* window) {
« no previous file with comments | « ash/wm/overview/window_grid.h ('k') | ash/wm/overview/window_selector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698