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

Unified Diff: athena/wm/split_view_controller.cc

Issue 573803003: [Athena] Hide the windows which used to be in split view in ActivateSplitMode() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 | « athena/wm/split_view_controller.h ('k') | athena/wm/split_view_controller_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: athena/wm/split_view_controller.cc
diff --git a/athena/wm/split_view_controller.cc b/athena/wm/split_view_controller.cc
index 1d61ba7d957e77f938fea6d216563401875f2e1b..5974cf1357c83791f4cf3723ebd1ec6abe777201 100644
--- a/athena/wm/split_view_controller.cc
+++ b/athena/wm/split_view_controller.cc
@@ -65,14 +65,9 @@ void SplitViewController::ActivateSplitMode(aura::Window* left,
aura::Window::Windows windows = window_list_provider_->GetWindowList();
aura::Window::Windows::reverse_iterator iter = windows.rbegin();
if (state_ == ACTIVE) {
- if (left_window_ == right)
- left_window_ = left;
- if (right_window_ == left)
- right_window_ = right;
-
- if (!left)
+ if (!left && left_window_ != right)
left = left_window_;
- if (!right)
+ if (!right && right_window_ != left)
right = right_window_;
}
@@ -94,6 +89,12 @@ void SplitViewController::ActivateSplitMode(aura::Window* left,
}
}
+ to_hide_.clear();
+ if (left_window_ && left_window_ != left && left_window_ != right)
+ to_hide_.push_back(left_window_);
+ if (right_window_ && right_window_ != left && right_window_ != right)
+ to_hide_.push_back(right_window_);
+
SetState(ACTIVE);
right_window_ = right;
left_window_ = left;
@@ -155,16 +156,20 @@ void SplitViewController::UpdateLayout(bool animate) {
CHECK(left_window_);
CHECK(right_window_);
- // Splitview can be activated from SplitViewController::ActivateSplitMode or
- // SplitViewController::ScrollEnd. Additionally we don't want to rotate the
- // screen while engaging splitview (i.e. state_ == SCROLLING).
- if (state_ == INACTIVE && !animate) {
- if (!wm::IsActiveWindow(left_window_))
- left_window_->Hide();
- if (!wm::IsActiveWindow(right_window_))
- right_window_->Hide();
- SetWindowTransforms(gfx::Transform(), gfx::Transform(), false);
- return;
+ if (!animate) {
+ for (size_t i = 0; i < to_hide_.size(); ++i)
+ to_hide_[i]->Hide();
+ to_hide_.clear();
+
+ if (state_ == INACTIVE) {
+ if (!wm::IsActiveWindow(left_window_))
+ left_window_->Hide();
+ if (!wm::IsActiveWindow(right_window_))
+ right_window_->Hide();
+
+ SetWindowTransforms(gfx::Transform(), gfx::Transform(), false);
+ return;
+ }
sadrul 2014/09/15 21:01:21 It's difficult to reason why this is here. OnAnima
mfomitchev 2014/09/15 22:18:34 I agree. On a related note, I think it would be ni
}
left_window_->Show();
« no previous file with comments | « athena/wm/split_view_controller.h ('k') | athena/wm/split_view_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698