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

Side by Side Diff: ash/wm/workspace/workspace_event_handler.cc

Issue 2901663003: chromeos: converts WindowState to aura::Window (Closed)
Patch Set: feedback Created 3 years, 7 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 unified diff | Download patch
« no previous file with comments | « ash/wm/window_util.h ('k') | ash/wm/workspace/workspace_layout_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/wm/workspace/workspace_event_handler.h" 5 #include "ash/wm/workspace/workspace_event_handler.h"
6 6
7 #include "ash/shell_port.h" 7 #include "ash/shell_port.h"
8 #include "ash/wm/window_state.h" 8 #include "ash/wm/window_state.h"
9 #include "ash/wm/wm_event.h" 9 #include "ash/wm/wm_event.h"
10 #include "ash/wm_window.h" 10 #include "ash/wm_window.h"
11 #include "ui/aura/window.h"
12 #include "ui/aura/window_delegate.h"
11 #include "ui/base/hit_test.h" 13 #include "ui/base/hit_test.h"
12 #include "ui/events/event.h" 14 #include "ui/events/event.h"
13 15
14 namespace ash { 16 namespace ash {
15 17
16 WorkspaceEventHandler::WorkspaceEventHandler() : click_component_(HTNOWHERE) {} 18 WorkspaceEventHandler::WorkspaceEventHandler() : click_component_(HTNOWHERE) {}
17 19
18 WorkspaceEventHandler::~WorkspaceEventHandler() {} 20 WorkspaceEventHandler::~WorkspaceEventHandler() {}
19 21
20 void WorkspaceEventHandler::OnMouseEvent(ui::MouseEvent* event, 22 void WorkspaceEventHandler::OnMouseEvent(ui::MouseEvent* event,
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 const wm::WMEvent wm_event(wm::WM_EVENT_TOGGLE_MAXIMIZE_CAPTION); 92 const wm::WMEvent wm_event(wm::WM_EVENT_TOGGLE_MAXIMIZE_CAPTION);
91 target->GetWindowState()->OnWMEvent(&wm_event); 93 target->GetWindowState()->OnWMEvent(&wm_event);
92 event->StopPropagation(); 94 event->StopPropagation();
93 } 95 }
94 click_component_ = HTNOWHERE; 96 click_component_ = HTNOWHERE;
95 } 97 }
96 98
97 void WorkspaceEventHandler::HandleVerticalResizeDoubleClick( 99 void WorkspaceEventHandler::HandleVerticalResizeDoubleClick(
98 wm::WindowState* target_state, 100 wm::WindowState* target_state,
99 ui::MouseEvent* event) { 101 ui::MouseEvent* event) {
100 WmWindow* target = target_state->window(); 102 aura::Window* target = target_state->window();
101 if (event->flags() & ui::EF_IS_DOUBLE_CLICK) { 103 if ((event->flags() & ui::EF_IS_DOUBLE_CLICK) != 0 && target->delegate()) {
102 int component = target->GetNonClientComponent(event->location()); 104 const int component =
105 target->delegate()->GetNonClientComponent(event->location());
103 if (component == HTBOTTOM || component == HTTOP) { 106 if (component == HTBOTTOM || component == HTTOP) {
104 ShellPort::Get()->RecordUserMetricsAction( 107 ShellPort::Get()->RecordUserMetricsAction(
105 UMA_TOGGLE_SINGLE_AXIS_MAXIMIZE_BORDER_CLICK); 108 UMA_TOGGLE_SINGLE_AXIS_MAXIMIZE_BORDER_CLICK);
106 const wm::WMEvent wm_event(wm::WM_EVENT_TOGGLE_VERTICAL_MAXIMIZE); 109 const wm::WMEvent wm_event(wm::WM_EVENT_TOGGLE_VERTICAL_MAXIMIZE);
107 target_state->OnWMEvent(&wm_event); 110 target_state->OnWMEvent(&wm_event);
108 event->StopPropagation(); 111 event->StopPropagation();
109 } else if (component == HTLEFT || component == HTRIGHT) { 112 } else if (component == HTLEFT || component == HTRIGHT) {
110 ShellPort::Get()->RecordUserMetricsAction( 113 ShellPort::Get()->RecordUserMetricsAction(
111 UMA_TOGGLE_SINGLE_AXIS_MAXIMIZE_BORDER_CLICK); 114 UMA_TOGGLE_SINGLE_AXIS_MAXIMIZE_BORDER_CLICK);
112 const wm::WMEvent wm_event(wm::WM_EVENT_TOGGLE_HORIZONTAL_MAXIMIZE); 115 const wm::WMEvent wm_event(wm::WM_EVENT_TOGGLE_HORIZONTAL_MAXIMIZE);
113 target_state->OnWMEvent(&wm_event); 116 target_state->OnWMEvent(&wm_event);
114 event->StopPropagation(); 117 event->StopPropagation();
115 } 118 }
116 } 119 }
117 } 120 }
118 121
119 } // namespace ash 122 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/window_util.h ('k') | ash/wm/workspace/workspace_layout_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698