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

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

Issue 10911256: Change the way the ToplevelEventHandler is hooked up. It is now both a pre- and post-target event h… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 3 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 | Annotate | Revision Log
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/screen_ash.h" 7 #include "ash/screen_ash.h"
8 #include "ash/wm/property_util.h" 8 #include "ash/wm/property_util.h"
9 #include "ash/wm/window_util.h" 9 #include "ash/wm/window_util.h"
10 #include "ash/wm/workspace/workspace_window_resizer.h" 10 #include "ash/wm/workspace/workspace_window_resizer.h"
11 #include "ui/aura/client/aura_constants.h" 11 #include "ui/aura/client/aura_constants.h"
12 #include "ui/aura/window.h" 12 #include "ui/aura/window.h"
13 #include "ui/aura/window_delegate.h" 13 #include "ui/aura/window_delegate.h"
14 #include "ui/base/events/event.h" 14 #include "ui/base/events/event.h"
15 #include "ui/base/events/event_functions.h"
15 #include "ui/base/hit_test.h" 16 #include "ui/base/hit_test.h"
16 #include "ui/compositor/scoped_layer_animation_settings.h" 17 #include "ui/compositor/scoped_layer_animation_settings.h"
17 #include "ui/gfx/screen.h" 18 #include "ui/gfx/screen.h"
18 19
19 namespace ash { 20 namespace ash {
20 namespace { 21 namespace {
21 22
22 void SingleAxisMaximize(aura::Window* window, const gfx::Rect& maximize_rect) { 23 void SingleAxisMaximize(aura::Window* window, const gfx::Rect& maximize_rect) {
23 gfx::Rect bounds_in_screen = 24 gfx::Rect bounds_in_screen =
24 ScreenAsh::ConvertRectToScreen(window->parent(), window->bounds()); 25 ScreenAsh::ConvertRectToScreen(window->parent(), window->bounds());
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 multi_window_resize_controller_.Show(target, component, 74 multi_window_resize_controller_.Show(target, component,
74 event->location()); 75 event->location());
75 break; 76 break;
76 } 77 }
77 case ui::ET_MOUSE_ENTERED: 78 case ui::ET_MOUSE_ENTERED:
78 break; 79 break;
79 case ui::ET_MOUSE_CAPTURE_CHANGED: 80 case ui::ET_MOUSE_CAPTURE_CHANGED:
80 case ui::ET_MOUSE_EXITED: 81 case ui::ET_MOUSE_EXITED:
81 break; 82 break;
82 case ui::ET_MOUSE_PRESSED: { 83 case ui::ET_MOUSE_PRESSED: {
84 // Maximize behavior is implemented as post-target handling so the target
85 // can cancel it.
86 if (ui::EventCanceledDefaultHandling(*event))
87 return ToplevelWindowEventHandler::OnMouseEvent(event);
88
83 if (event->flags() & ui::EF_IS_DOUBLE_CLICK && 89 if (event->flags() & ui::EF_IS_DOUBLE_CLICK &&
84 target->delegate()->GetNonClientComponent(event->location()) == 90 target->delegate()->GetNonClientComponent(event->location()) ==
85 HTCAPTION) { 91 HTCAPTION) {
86 bool destroyed = false; 92 bool destroyed = false;
87 destroyed_ = &destroyed; 93 destroyed_ = &destroyed;
88 ToggleMaximizedState(target); 94 ToggleMaximizedState(target);
89 if (destroyed) 95 if (destroyed)
90 return ui::ER_UNHANDLED; 96 return ui::ER_UNHANDLED;
91 destroyed_ = NULL; 97 destroyed_ = NULL;
92 } 98 }
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 target->bounds().y(), 166 target->bounds().y(),
161 work_area.width(), 167 work_area.width(),
162 target->bounds().height())); 168 target->bounds().height()));
163 } 169 }
164 } 170 }
165 } 171 }
166 } 172 }
167 173
168 } // namespace internal 174 } // namespace internal
169 } // namespace ash 175 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698