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

Unified Diff: ash/common/wm/maximize_mode/maximize_mode_event_handler.cc

Issue 2736573002: chromeos: Move files in //ash/common to //ash, part 2 (Closed)
Patch Set: Created 3 years, 10 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: ash/common/wm/maximize_mode/maximize_mode_event_handler.cc
diff --git a/ash/common/wm/maximize_mode/maximize_mode_event_handler.cc b/ash/common/wm/maximize_mode/maximize_mode_event_handler.cc
deleted file mode 100644
index b337050d046c8fef5ae1cbe703116caf5c0bcb69..0000000000000000000000000000000000000000
--- a/ash/common/wm/maximize_mode/maximize_mode_event_handler.cc
+++ /dev/null
@@ -1,72 +0,0 @@
-// Copyright 2016 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "ash/common/wm/maximize_mode/maximize_mode_event_handler.h"
-
-#include "ash/common/session/session_state_delegate.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/system/tray/system_tray_delegate.h"
-#include "ui/events/event.h"
-
-namespace ash {
-namespace wm {
-namespace {
-
-// The height of the area in which a touch operation leads to exiting the
-// full screen mode.
-const int kLeaveFullScreenAreaHeightInPixel = 2;
-
-} // namespace
-
-MaximizeModeEventHandler::MaximizeModeEventHandler() {}
-
-MaximizeModeEventHandler::~MaximizeModeEventHandler() {}
-
-bool MaximizeModeEventHandler::ToggleFullscreen(const ui::TouchEvent& event) {
- if (event.type() != ui::ET_TOUCH_PRESSED)
- return false;
-
- const SessionStateDelegate* delegate =
- WmShell::Get()->GetSessionStateDelegate();
-
- if (delegate->IsScreenLocked() ||
- delegate->GetSessionState() != session_manager::SessionState::ACTIVE) {
- return false;
- }
-
- // Find the active window (from the primary screen) to un-fullscreen.
- WmWindow* window = WmShell::Get()->GetActiveWindow();
- if (!window)
- return false;
-
- WindowState* window_state = window->GetWindowState();
- if (!window_state->IsFullscreen() || window_state->in_immersive_fullscreen())
- return false;
-
- // Test that the touch happened in the top or bottom lines.
- int y = event.y();
- if (y >= kLeaveFullScreenAreaHeightInPixel &&
- y < (window->GetBounds().height() - kLeaveFullScreenAreaHeightInPixel)) {
- return false;
- }
-
- // Do not exit fullscreen in kiosk mode.
- SystemTrayDelegate* system_tray_delegate =
- WmShell::Get()->system_tray_delegate();
- if (system_tray_delegate->GetUserLoginStatus() == LoginStatus::KIOSK_APP ||
- system_tray_delegate->GetUserLoginStatus() ==
- LoginStatus::ARC_KIOSK_APP) {
- return false;
- }
-
- WMEvent toggle_fullscreen(WM_EVENT_TOGGLE_FULLSCREEN);
- window->GetWindowState()->OnWMEvent(&toggle_fullscreen);
- return true;
-}
-
-} // namespace wm
-} // namespace ash
« no previous file with comments | « ash/common/wm/maximize_mode/maximize_mode_event_handler.h ('k') | ash/common/wm/maximize_mode/maximize_mode_window_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698