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

Unified Diff: ui/views/widget/desktop_aura/x11_window_event_filter.cc

Issue 2542493002: Replace kCanMaximize/Minimize/Resize with kResizeBehavior. (Closed)
Patch Set: Fix int->bool compile issue. Created 4 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/widget/desktop_aura/desktop_screen_x11_unittest.cc ('k') | ui/views/widget/native_widget_aura.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/widget/desktop_aura/x11_window_event_filter.cc
diff --git a/ui/views/widget/desktop_aura/x11_window_event_filter.cc b/ui/views/widget/desktop_aura/x11_window_event_filter.cc
index b8a4c388be27a76e4a366cf11d697d3dbaea235c..5e4721c988e12a4a804a988f39ce176725ea3aea 100644
--- a/ui/views/widget/desktop_aura/x11_window_event_filter.cc
+++ b/ui/views/widget/desktop_aura/x11_window_event_filter.cc
@@ -9,6 +9,7 @@
#include <X11/Xatom.h>
#include <X11/Xlib.h>
+#include "services/ui/public/interfaces/window_manager_constants.mojom.h"
#include "ui/aura/client/aura_constants.h"
#include "ui/aura/window.h"
#include "ui/aura/window_delegate.h"
@@ -85,7 +86,8 @@ void X11WindowEventFilter::OnMouseEvent(ui::MouseEvent* event) {
if (event->IsLeftMouseButton() && event->native_event()) {
const gfx::Point x_root_location =
ui::EventSystemLocationFromNative(event->native_event());
- if (target->GetProperty(aura::client::kCanResizeKey) &&
+ if ((target->GetProperty(aura::client::kResizeBehaviorKey) &
+ ui::mojom::kResizeBehaviorCanResize) &&
DispatchHostWindowDragMovement(component, x_root_location)) {
event->StopPropagation();
}
@@ -114,7 +116,8 @@ void X11WindowEventFilter::OnClickedCaption(ui::MouseEvent* event,
window_tree_host_->Minimize();
break;
case LinuxUI::MIDDLE_CLICK_ACTION_TOGGLE_MAXIMIZE:
- if (target->GetProperty(aura::client::kCanMaximizeKey))
+ if (target->GetProperty(aura::client::kResizeBehaviorKey) &
+ ui::mojom::kResizeBehaviorCanMaximize)
ToggleMaximizedState();
break;
}
@@ -125,7 +128,8 @@ void X11WindowEventFilter::OnClickedCaption(ui::MouseEvent* event,
if (event->IsLeftMouseButton() && event->flags() & ui::EF_IS_DOUBLE_CLICK) {
click_component_ = HTNOWHERE;
- if (target->GetProperty(aura::client::kCanMaximizeKey) &&
+ if ((target->GetProperty(aura::client::kResizeBehaviorKey) &
+ ui::mojom::kResizeBehaviorCanMaximize) &&
previous_click_component == HTCAPTION) {
// Our event is a double click in the caption area in a window that can be
// maximized. We are responsible for dispatching this as a minimize/
« no previous file with comments | « ui/views/widget/desktop_aura/desktop_screen_x11_unittest.cc ('k') | ui/views/widget/native_widget_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698