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

Unified Diff: ash/accelerators/accelerator_commands_aura.cc

Issue 2162193003: Separates out accelerators using non-common types (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@accelerators
Patch Set: sim=20 Created 4 years, 5 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 | « ash/accelerators/accelerator_commands_aura.h ('k') | ash/accelerators/accelerator_commands_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/accelerators/accelerator_commands_aura.cc
diff --git a/ash/accelerators/accelerator_commands.cc b/ash/accelerators/accelerator_commands_aura.cc
similarity index 67%
copy from ash/accelerators/accelerator_commands.cc
copy to ash/accelerators/accelerator_commands_aura.cc
index b804d9150aaae5ab68b889a8193b9e7007ca8686..0c5bb9857b5a9f8a8d81cd0c8ecf5d2f1568d1a5 100644
--- a/ash/accelerators/accelerator_commands.cc
+++ b/ash/accelerators/accelerator_commands_aura.cc
@@ -2,59 +2,19 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "ash/accelerators/accelerator_commands.h"
+#include "ash/accelerators/accelerator_commands_aura.h"
-#include "ash/common/wm/mru_window_tracker.h"
#include "ash/common/wm/window_state.h"
-#include "ash/common/wm/wm_event.h"
-#include "ash/common/wm_shell.h"
#include "ash/common/wm_window.h"
#include "ash/display/display_manager.h"
#include "ash/display/display_util.h"
#include "ash/shell.h"
#include "ash/wm/screen_pinning_controller.h"
-#include "ash/wm/window_state_aura.h"
-#include "ash/wm/window_util.h"
#include "base/metrics/user_metrics.h"
namespace ash {
namespace accelerators {
-bool ToggleMinimized() {
- aura::Window* window = wm::GetActiveWindow();
- // Attempt to restore the window that would be cycled through next from
- // the launcher when there is no active window.
- if (!window) {
- MruWindowTracker::WindowList mru_windows(
- WmShell::Get()->mru_window_tracker()->BuildMruWindowList());
- if (!mru_windows.empty())
- mru_windows.front()->GetWindowState()->Activate();
- return true;
- }
- wm::WindowState* window_state = wm::GetWindowState(window);
- if (!window_state->CanMinimize())
- return false;
- window_state->Minimize();
- return true;
-}
-
-void ToggleMaximized() {
- wm::WindowState* window_state = wm::GetActiveWindowState();
- if (!window_state)
- return;
- base::RecordAction(base::UserMetricsAction("Accel_Toggle_Maximized"));
- wm::WMEvent event(wm::WM_EVENT_TOGGLE_MAXIMIZE);
- window_state->OnWMEvent(&event);
-}
-
-void ToggleFullscreen() {
- wm::WindowState* window_state = wm::GetActiveWindowState();
- if (window_state) {
- const wm::WMEvent event(wm::WM_EVENT_TOGGLE_FULLSCREEN);
- window_state->OnWMEvent(&event);
- }
-}
-
void ToggleTouchHudProjection() {
base::RecordAction(base::UserMetricsAction("Accel_Touch_Hud_Clear"));
bool enabled = Shell::GetInstance()->is_touch_hud_projection_enabled();
« no previous file with comments | « ash/accelerators/accelerator_commands_aura.h ('k') | ash/accelerators/accelerator_commands_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698