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

Side by Side Diff: ui/views/widget/desktop_aura/x11_window_event_filter.cc

Issue 1608733002: Remove ui/gfx/screen_type_delegate.h (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@metro-mode-4
Patch Set: GetNativeScreen Created 4 years, 11 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
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 "ui/views/widget/desktop_aura/x11_window_event_filter.h" 5 #include "ui/views/widget/desktop_aura/x11_window_event_filter.h"
6 6
7 #include <X11/extensions/XInput.h> 7 #include <X11/extensions/XInput.h>
8 #include <X11/extensions/XInput2.h> 8 #include <X11/extensions/XInput2.h>
9 #include <X11/Xatom.h> 9 #include <X11/Xatom.h>
10 #include <X11/Xlib.h> 10 #include <X11/Xlib.h>
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 event->StopPropagation(); 144 event->StopPropagation();
145 } 145 }
146 } 146 }
147 147
148 void X11WindowEventFilter::OnClickedMaximizeButton(ui::MouseEvent* event) { 148 void X11WindowEventFilter::OnClickedMaximizeButton(ui::MouseEvent* event) {
149 aura::Window* target = static_cast<aura::Window*>(event->target()); 149 aura::Window* target = static_cast<aura::Window*>(event->target());
150 views::Widget* widget = views::Widget::GetWidgetForNativeView(target); 150 views::Widget* widget = views::Widget::GetWidgetForNativeView(target);
151 if (!widget) 151 if (!widget)
152 return; 152 return;
153 153
154 gfx::Screen* screen = gfx::Screen::GetNativeScreen(); 154 gfx::Screen* screen = gfx::Screen::GetScreen();
155 gfx::Rect display_work_area = 155 gfx::Rect display_work_area =
156 screen->GetDisplayNearestWindow(target).work_area(); 156 screen->GetDisplayNearestWindow(target).work_area();
oshima 2016/01/19 20:44:31 inline?
scottmg 2016/01/19 21:55:58 Done.
157 gfx::Rect bounds = widget->GetWindowBoundsInScreen(); 157 gfx::Rect bounds = widget->GetWindowBoundsInScreen();
158 if (event->IsMiddleMouseButton()) { 158 if (event->IsMiddleMouseButton()) {
159 bounds.set_y(display_work_area.y()); 159 bounds.set_y(display_work_area.y());
160 bounds.set_height(display_work_area.height()); 160 bounds.set_height(display_work_area.height());
161 widget->SetBounds(bounds); 161 widget->SetBounds(bounds);
162 event->StopPropagation(); 162 event->StopPropagation();
163 } else if (event->IsRightMouseButton()) { 163 } else if (event->IsRightMouseButton()) {
164 bounds.set_x(display_work_area.x()); 164 bounds.set_x(display_work_area.x());
165 bounds.set_width(display_work_area.width()); 165 bounds.set_width(display_work_area.width());
166 widget->SetBounds(bounds); 166 widget->SetBounds(bounds);
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 event.xclient.data.l[4] = 0; 231 event.xclient.data.l[4] = 0;
232 232
233 XSendEvent(xdisplay_, x_root_window_, False, 233 XSendEvent(xdisplay_, x_root_window_, False,
234 SubstructureRedirectMask | SubstructureNotifyMask, 234 SubstructureRedirectMask | SubstructureNotifyMask,
235 &event); 235 &event);
236 236
237 return true; 237 return true;
238 } 238 }
239 239
240 } // namespace views 240 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698