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

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

Issue 11030017: Add context to gfx::Screen calls in support of simultaneous desktop+ash (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix new addition Created 8 years, 2 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/shell.h"
8 #include "ash/wm/property_util.h" 9 #include "ash/wm/property_util.h"
9 #include "ash/wm/window_util.h" 10 #include "ash/wm/window_util.h"
10 #include "ash/wm/workspace/workspace_window_resizer.h" 11 #include "ash/wm/workspace/workspace_window_resizer.h"
11 #include "ui/aura/client/aura_constants.h" 12 #include "ui/aura/client/aura_constants.h"
12 #include "ui/aura/window.h" 13 #include "ui/aura/window.h"
13 #include "ui/aura/window_delegate.h" 14 #include "ui/aura/window_delegate.h"
14 #include "ui/base/events/event.h" 15 #include "ui/base/events/event.h"
15 #include "ui/base/events/event_functions.h" 16 #include "ui/base/events/event_functions.h"
16 #include "ui/base/hit_test.h" 17 #include "ui/base/hit_test.h"
17 #include "ui/compositor/scoped_layer_animation_settings.h" 18 #include "ui/compositor/scoped_layer_animation_settings.h"
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 } 135 }
135 136
136 void WorkspaceEventHandler::HandleVerticalResizeDoubleClick( 137 void WorkspaceEventHandler::HandleVerticalResizeDoubleClick(
137 aura::Window* target, 138 aura::Window* target,
138 ui::MouseEvent* event) { 139 ui::MouseEvent* event) {
139 if (event->flags() & ui::EF_IS_DOUBLE_CLICK && 140 if (event->flags() & ui::EF_IS_DOUBLE_CLICK &&
140 !wm::IsWindowMaximized(target)) { 141 !wm::IsWindowMaximized(target)) {
141 int component = 142 int component =
142 target->delegate()->GetNonClientComponent(event->location()); 143 target->delegate()->GetNonClientComponent(event->location());
143 gfx::Rect work_area = 144 gfx::Rect work_area =
144 gfx::Screen::GetDisplayNearestWindow(target).work_area(); 145 Shell::GetScreen()->GetDisplayNearestWindow(target).work_area();
145 const gfx::Rect* restore_bounds = 146 const gfx::Rect* restore_bounds =
146 target->GetProperty(aura::client::kRestoreBoundsKey); 147 target->GetProperty(aura::client::kRestoreBoundsKey);
147 if (component == HTBOTTOM || component == HTTOP) { 148 if (component == HTBOTTOM || component == HTTOP) {
148 if (restore_bounds && 149 if (restore_bounds &&
149 (target->bounds().height() == work_area.height() && 150 (target->bounds().height() == work_area.height() &&
150 target->bounds().y() == work_area.y())) { 151 target->bounds().y() == work_area.y())) {
151 SingleAxisUnmaximize(target, *restore_bounds); 152 SingleAxisUnmaximize(target, *restore_bounds);
152 } else { 153 } else {
153 SingleAxisMaximize(target, 154 SingleAxisMaximize(target,
154 gfx::Rect(target->bounds().x(), 155 gfx::Rect(target->bounds().x(),
(...skipping 12 matching lines...) Expand all
167 target->bounds().y(), 168 target->bounds().y(),
168 work_area.width(), 169 work_area.width(),
169 target->bounds().height())); 170 target->bounds().height()));
170 } 171 }
171 } 172 }
172 } 173 }
173 } 174 }
174 175
175 } // namespace internal 176 } // namespace internal
176 } // namespace ash 177 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/workspace/multi_window_resize_controller.cc ('k') | ash/wm/workspace/workspace_event_handler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698