| Index: ash/wm/workspace/workspace_event_handler.cc
|
| diff --git a/ash/wm/workspace/workspace_event_handler.cc b/ash/wm/workspace/workspace_event_handler.cc
|
| index 0643a52bf5c88053f29815ac9a0466b3d46d5459..5db36d903efe382f8792a5987a3b6b16baf872db 100644
|
| --- a/ash/wm/workspace/workspace_event_handler.cc
|
| +++ b/ash/wm/workspace/workspace_event_handler.cc
|
| @@ -6,8 +6,8 @@
|
|
|
| #include "ash/shell_port.h"
|
| #include "ash/wm/window_state.h"
|
| +#include "ash/wm/window_util.h"
|
| #include "ash/wm/wm_event.h"
|
| -#include "ash/wm_window.h"
|
| #include "ui/aura/window.h"
|
| #include "ui/aura/window_delegate.h"
|
| #include "ui/base/hit_test.h"
|
| @@ -20,11 +20,11 @@ WorkspaceEventHandler::WorkspaceEventHandler() : click_component_(HTNOWHERE) {}
|
| WorkspaceEventHandler::~WorkspaceEventHandler() {}
|
|
|
| void WorkspaceEventHandler::OnMouseEvent(ui::MouseEvent* event,
|
| - WmWindow* target) {
|
| + aura::Window* 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());
|
| + click_component_ = wm::GetNonClientComponent(target, event->location());
|
| }
|
|
|
| if (event->handled())
|
| @@ -32,8 +32,8 @@ void WorkspaceEventHandler::OnMouseEvent(ui::MouseEvent* event,
|
|
|
| switch (event->type()) {
|
| case ui::ET_MOUSE_MOVED: {
|
| - int component = target->GetNonClientComponent(event->location());
|
| - multi_window_resize_controller_.Show(target->aura_window(), component,
|
| + int component = wm::GetNonClientComponent(target, event->location());
|
| + multi_window_resize_controller_.Show(target, component,
|
| event->location());
|
| break;
|
| }
|
| @@ -43,11 +43,11 @@ void WorkspaceEventHandler::OnMouseEvent(ui::MouseEvent* event,
|
| case ui::ET_MOUSE_EXITED:
|
| break;
|
| case ui::ET_MOUSE_PRESSED: {
|
| - wm::WindowState* target_state = target->GetWindowState();
|
| + wm::WindowState* target_state = wm::GetWindowState(target);
|
|
|
| if (event->IsOnlyLeftMouseButton()) {
|
| if (event->flags() & ui::EF_IS_DOUBLE_CLICK) {
|
| - int component = target->GetNonClientComponent(event->location());
|
| + int component = wm::GetNonClientComponent(target, event->location());
|
| if (component == HTCAPTION && component == click_component_) {
|
| ShellPort::Get()->RecordUserMetricsAction(
|
| UMA_TOGGLE_MAXIMIZE_CAPTION_CLICK);
|
| @@ -70,12 +70,12 @@ void WorkspaceEventHandler::OnMouseEvent(ui::MouseEvent* event,
|
| }
|
|
|
| void WorkspaceEventHandler::OnGestureEvent(ui::GestureEvent* event,
|
| - WmWindow* target) {
|
| + aura::Window* target) {
|
| if (event->handled() || event->type() != ui::ET_GESTURE_TAP)
|
| return;
|
|
|
| int previous_target_component = click_component_;
|
| - click_component_ = target->GetNonClientComponent(event->location());
|
| + click_component_ = wm::GetNonClientComponent(target, event->location());
|
|
|
| if (click_component_ != HTCAPTION)
|
| return;
|
| @@ -90,7 +90,7 @@ void WorkspaceEventHandler::OnGestureEvent(ui::GestureEvent* event,
|
| UMA_TOGGLE_MAXIMIZE_CAPTION_GESTURE);
|
| ShellPort::Get()->RecordGestureAction(GESTURE_MAXIMIZE_DOUBLETAP);
|
| const wm::WMEvent wm_event(wm::WM_EVENT_TOGGLE_MAXIMIZE_CAPTION);
|
| - target->GetWindowState()->OnWMEvent(&wm_event);
|
| + wm::GetWindowState(target)->OnWMEvent(&wm_event);
|
| event->StopPropagation();
|
| }
|
| click_component_ = HTNOWHERE;
|
| @@ -101,8 +101,7 @@ void WorkspaceEventHandler::HandleVerticalResizeDoubleClick(
|
| ui::MouseEvent* event) {
|
| aura::Window* target = target_state->window();
|
| if ((event->flags() & ui::EF_IS_DOUBLE_CLICK) != 0 && target->delegate()) {
|
| - const int component =
|
| - target->delegate()->GetNonClientComponent(event->location());
|
| + const int component = wm::GetNonClientComponent(target, event->location());
|
| if (component == HTBOTTOM || component == HTTOP) {
|
| ShellPort::Get()->RecordUserMetricsAction(
|
| UMA_TOGGLE_SINGLE_AXIS_MAXIMIZE_BORDER_CLICK);
|
|
|