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

Unified Diff: athena/wm/window_manager_impl.cc

Issue 465983002: Add shoftcut (ctrl-f6) to toggle split view (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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/window_manager_impl.h ('k') | athena/wm/window_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..d66f2ed1714d75d7fca4f511d45078bbc8a9fd87 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,27 @@ 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) {
+ split_view_controller_->ActivateSplitMode(NULL, NULL);
+ }
+}
+
aura::Window* WindowManagerImpl::GetWindowBehind(aura::Window* window) {
const aura::Window::Windows& windows = window_list_provider_->GetWindowList();
aura::Window::Windows::const_reverse_iterator iter =
« no previous file with comments | « athena/wm/window_manager_impl.h ('k') | athena/wm/window_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698