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

Unified Diff: athena/wm/split_view_controller.cc

Issue 480293003: Adding functions to the window_list_provider for accessing the activities window list (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Updated the other functions as well 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
Index: athena/wm/split_view_controller.cc
diff --git a/athena/wm/split_view_controller.cc b/athena/wm/split_view_controller.cc
index 85db209536916f46ec72f8d59b586abf056f9e4e..1b524ac56245e5d71b3f7b2fe9c4d1b82c4fbdd2 100644
--- a/athena/wm/split_view_controller.cc
+++ b/athena/wm/split_view_controller.cc
@@ -62,7 +62,7 @@ bool SplitViewController::IsSplitViewModeActive() const {
void SplitViewController::ActivateSplitMode(aura::Window* left,
aura::Window* right) {
- aura::Window::Windows windows = window_list_provider_->GetWindowList();
+ aura::Window::Windows windows = window_list_provider_->GetCurrentWindowList();
aura::Window::Windows::reverse_iterator iter = windows.rbegin();
if (state_ == ACTIVE) {
if (left_window_ == right)
@@ -97,11 +97,15 @@ void SplitViewController::ActivateSplitMode(aura::Window* left,
SetState(ACTIVE);
if (right_window_ != right) {
right_window_ = right;
- container_->StackChildAtTop(right_window_);
+ // Since the |window_list_provider_| controls directly the order of windows,
+ // it needs to change the window order accordingly.
+ window_list_provider_->MoveToFront(right_window_);
}
if (left_window_ != left) {
left_window_ = left;
- container_->StackChildAtTop(left_window_);
+ // Since the |window_list_provider_| controls directly the order of windows,
+ // it needs to change the window order accordingly.
+ window_list_provider_->MoveToFront(left_window_);
}
UpdateLayout(true);
}
@@ -113,7 +117,7 @@ void SplitViewController::ReplaceWindow(aura::Window* window,
CHECK(window == left_window_ || window == right_window_);
CHECK(replace_with != left_window_ && replace_with != right_window_);
#if !defined(NDEBUG)
- aura::Window::Windows windows = window_list_provider_->GetWindowList();
+ aura::Window::Windows windows = window_list_provider_->GetCurrentWindowList();
DCHECK(std::find(windows.begin(), windows.end(), replace_with) !=
windows.end());
#endif
@@ -257,7 +261,7 @@ void SplitViewController::ScrollBegin(BezelController::Bezel bezel,
return;
SetState(SCROLLING);
- aura::Window::Windows windows = window_list_provider_->GetWindowList();
+ aura::Window::Windows windows = window_list_provider_->GetCurrentWindowList();
CHECK(windows.size() >= 2);
aura::Window::Windows::const_reverse_iterator iter = windows.rbegin();
aura::Window* current_window = *(iter);
@@ -312,7 +316,7 @@ void SplitViewController::ScrollUpdate(float delta) {
bool SplitViewController::CanScroll() {
// TODO(mfomitchev): return false in full screen.
bool result = (!IsSplitViewModeActive() &&
- window_list_provider_->GetWindowList().size() >= 2 &&
+ window_list_provider_->GetCurrentWindowList().size() >= 2 &&
IsLandscapeOrientation(gfx::Screen::GetNativeScreen()->
GetDisplayNearestWindow(container_).rotation()));
return result;

Powered by Google App Engine
This is Rietveld 408576698