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

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
« athena/wm/split_view_controller.cc ('K') | « athena/wm/split_view_controller.cc ('k') | no next file » | 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 47e49b64584e8948dc8408d24f1f17a7e993b4bd..357baa5018590af8da47b63bb6cce8b3226e9bb8 100644
--- a/athena/wm/window_manager_impl.cc
+++ b/athena/wm/window_manager_impl.cc
@@ -47,6 +47,7 @@ class WindowManagerImpl : public WindowManager,
private:
enum Command {
CMD_TOGGLE_OVERVIEW,
+ CMD_TOGGLE_SPLIT_VIEW,
};
// Sets whether overview mode is active.
@@ -163,7 +164,7 @@ void WindowManagerImpl::ToggleOverview() {
}
bool WindowManagerImpl::IsOverviewModeActive() {
- return overview_;
+ return !!overview_;
}
void WindowManagerImpl::SetInOverview(bool active) {
@@ -179,9 +180,8 @@ void WindowManagerImpl::SetInOverview(bool active) {
aura::Window::Windows::iterator it;
for (it = window_list.begin(); it != window_list.end(); ++it)
container_->StackChildAtTop(*it);
- overview_ = WindowOverviewMode::Create(container_.get(),
- mru_window_tracker_.get(),
- this);
+ overview_ = WindowOverviewMode::Create(
+ container_.get(), mru_window_tracker_.get(), this);
} else {
overview_.reset();
FOR_EACH_OBSERVER(WindowManagerObserver, observers_,
@@ -193,6 +193,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);
@@ -213,6 +215,8 @@ void WindowManagerImpl::OnSelectWindow(aura::Window* window) {
}
void WindowManagerImpl::OnWindowAdded(aura::Window* new_window) {
+ // TODO(oshima): Creating a new window should simply updates the overview
+ // mode.
if (new_window->type() == ui::wm::WINDOW_TYPE_NORMAL)
SetInOverview(false);
}
@@ -232,6 +236,9 @@ bool WindowManagerImpl::OnAcceleratorFired(int command_id,
case CMD_TOGGLE_OVERVIEW:
ToggleOverview();
break;
+ case CMD_TOGGLE_SPLIT_VIEW:
+ split_view_controller_->ToggleSplitView();
+ break;
}
return true;
}
« athena/wm/split_view_controller.cc ('K') | « athena/wm/split_view_controller.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698