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

Unified Diff: ash/common/wm/workspace/workspace_event_handler.cc

Issue 2736573002: chromeos: Move files in //ash/common to //ash, part 2 (Closed)
Patch Set: Created 3 years, 9 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/workspace/workspace_event_handler.cc
diff --git a/ash/common/wm/workspace/workspace_event_handler.cc b/ash/common/wm/workspace/workspace_event_handler.cc
deleted file mode 100644
index 0e26b168e3c9edbdedcedb47115fe958a8d4f0dc..0000000000000000000000000000000000000000
--- a/ash/common/wm/workspace/workspace_event_handler.cc
+++ /dev/null
@@ -1,119 +0,0 @@
-// Copyright (c) 2012 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/workspace/workspace_event_handler.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 "ui/base/hit_test.h"
-#include "ui/events/event.h"
-
-namespace ash {
-
-WorkspaceEventHandler::WorkspaceEventHandler() : click_component_(HTNOWHERE) {}
-
-WorkspaceEventHandler::~WorkspaceEventHandler() {}
-
-void WorkspaceEventHandler::OnMouseEvent(ui::MouseEvent* event,
- WmWindow* target) {
- if (event->type() == ui::ET_MOUSE_PRESSED && event->IsOnlyLeftMouseButton() &&
- ((event->flags() & (ui::EF_IS_DOUBLE_CLICK | ui::EF_IS_TRIPLE_CLICK)) ==
- 0)) {
- click_component_ = target->GetNonClientComponent(event->location());
- }
-
- if (event->handled())
- return;
-
- switch (event->type()) {
- case ui::ET_MOUSE_MOVED: {
- int component = target->GetNonClientComponent(event->location());
- multi_window_resize_controller_.Show(target, component,
- event->location());
- break;
- }
- case ui::ET_MOUSE_ENTERED:
- break;
- case ui::ET_MOUSE_CAPTURE_CHANGED:
- case ui::ET_MOUSE_EXITED:
- break;
- case ui::ET_MOUSE_PRESSED: {
- wm::WindowState* target_state = target->GetWindowState();
-
- if (event->IsOnlyLeftMouseButton()) {
- if (event->flags() & ui::EF_IS_DOUBLE_CLICK) {
- int component = target->GetNonClientComponent(event->location());
- if (component == HTCAPTION && component == click_component_) {
- WmShell::Get()->RecordUserMetricsAction(
- UMA_TOGGLE_MAXIMIZE_CAPTION_CLICK);
- const wm::WMEvent wm_event(wm::WM_EVENT_TOGGLE_MAXIMIZE_CAPTION);
- target_state->OnWMEvent(&wm_event);
- event->StopPropagation();
- }
- click_component_ = HTNOWHERE;
- }
- } else {
- click_component_ = HTNOWHERE;
- }
-
- HandleVerticalResizeDoubleClick(target_state, event);
- break;
- }
- default:
- break;
- }
-}
-
-void WorkspaceEventHandler::OnGestureEvent(ui::GestureEvent* event,
- WmWindow* target) {
- if (event->handled() || event->type() != ui::ET_GESTURE_TAP)
- return;
-
- int previous_target_component = click_component_;
- click_component_ = target->GetNonClientComponent(event->location());
-
- if (click_component_ != HTCAPTION)
- return;
-
- if (event->details().tap_count() != 2) {
- WmShell::Get()->RecordGestureAction(GESTURE_FRAMEVIEW_TAP);
- return;
- }
-
- if (click_component_ == previous_target_component) {
- WmShell::Get()->RecordUserMetricsAction(
- UMA_TOGGLE_MAXIMIZE_CAPTION_GESTURE);
- WmShell::Get()->RecordGestureAction(GESTURE_MAXIMIZE_DOUBLETAP);
- const wm::WMEvent wm_event(wm::WM_EVENT_TOGGLE_MAXIMIZE_CAPTION);
- target->GetWindowState()->OnWMEvent(&wm_event);
- event->StopPropagation();
- }
- click_component_ = HTNOWHERE;
-}
-
-void WorkspaceEventHandler::HandleVerticalResizeDoubleClick(
- wm::WindowState* target_state,
- ui::MouseEvent* event) {
- WmWindow* target = target_state->window();
- if (event->flags() & ui::EF_IS_DOUBLE_CLICK) {
- int component = target->GetNonClientComponent(event->location());
- if (component == HTBOTTOM || component == HTTOP) {
- WmShell::Get()->RecordUserMetricsAction(
- UMA_TOGGLE_SINGLE_AXIS_MAXIMIZE_BORDER_CLICK);
- const wm::WMEvent wm_event(wm::WM_EVENT_TOGGLE_VERTICAL_MAXIMIZE);
- target_state->OnWMEvent(&wm_event);
- event->StopPropagation();
- } else if (component == HTLEFT || component == HTRIGHT) {
- WmShell::Get()->RecordUserMetricsAction(
- UMA_TOGGLE_SINGLE_AXIS_MAXIMIZE_BORDER_CLICK);
- const wm::WMEvent wm_event(wm::WM_EVENT_TOGGLE_HORIZONTAL_MAXIMIZE);
- target_state->OnWMEvent(&wm_event);
- event->StopPropagation();
- }
- }
-}
-
-} // namespace ash
« no previous file with comments | « ash/common/wm/workspace/workspace_event_handler.h ('k') | ash/common/wm/workspace/workspace_layout_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698