Chromium Code Reviews| Index: athena/wm/window_manager_impl.cc |
| diff --git a/athena/wm/window_manager_impl.cc b/athena/wm/window_manager_impl.cc |
| index bbc86735050d849dd93245c9822a90b518377661..0f1565737cbc8efd9812482e5c207478028bd358 100644 |
| --- a/athena/wm/window_manager_impl.cc |
| +++ b/athena/wm/window_manager_impl.cc |
| @@ -192,6 +192,8 @@ void WindowManagerImpl::InstallAccelerators() { |
| const AcceleratorData accelerator_data[] = { |
| {TRIGGER_ON_PRESS, ui::VKEY_F6, ui::EF_NONE, CMD_TOGGLE_OVERVIEW, |
| AF_NONE}, |
| + {TRIGGER_ON_PRESS, ui::VKEY_F6, ui::EF_CONTROL_DOWN, |
| + CMD_TOGGLE_SPLIT_VIEW, AF_NONE}, |
| }; |
| AcceleratorManager::Get()->RegisterAccelerators( |
| accelerator_data, arraysize(accelerator_data), this); |
| @@ -217,6 +219,8 @@ void WindowManagerImpl::OnSplitViewMode(aura::Window* left, |
| } |
| void WindowManagerImpl::OnWindowAdded(aura::Window* new_window) { |
| + // TODO(oshima): Creating a new window should updates the ovewview mode |
| + // instead of exitting. |
| if (new_window->type() == ui::wm::WINDOW_TYPE_NORMAL) |
| SetInOverview(false); |
| } |
| @@ -236,10 +240,31 @@ bool WindowManagerImpl::OnAcceleratorFired(int command_id, |
| case CMD_TOGGLE_OVERVIEW: |
| ToggleOverview(); |
| break; |
| + case CMD_TOGGLE_SPLIT_VIEW: |
| + ToggleSplitview(); |
| + break; |
| } |
| return true; |
| } |
| +void WindowManagerImpl::ToggleSplitview() { |
| + // TODO(oshima): Figure out what to do. |
| + if (IsOverviewModeActive()) |
| + return; |
| + |
| + if (split_view_controller_->IsSplitViewModeActive()) { |
| + split_view_controller_->DeactivateSplitMode(); |
| + // Relayout so that windows are maximzied. |
| + container_->layout_manager()->OnWindowResized(); |
| + } else if (window_list_provider_->GetWindowList().size() > 1) { |
| + const aura::Window::Windows& windows = |
| + window_list_provider_->GetWindowList(); |
| + aura::Window* left = *windows.rbegin(); |
| + aura::Window* right = *(windows.rbegin() + 1); |
| + split_view_controller_->ActivateSplitMode(left, right); |
|
sadrul
2014/08/19 16:27:53
Doing ActivateSplitMode(NULL, NULL) should also wo
oshima
2014/08/19 17:05:33
good to know. done.
|
| + } |
| +} |
| + |
| aura::Window* WindowManagerImpl::GetWindowBehind(aura::Window* window) { |
| const aura::Window::Windows& windows = window_list_provider_->GetWindowList(); |
| aura::Window::Windows::const_reverse_iterator iter = |