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

Unified Diff: ui/views/widget/native_widget_aura.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
Index: ui/views/widget/native_widget_aura.cc
diff --git a/ui/views/widget/native_widget_aura.cc b/ui/views/widget/native_widget_aura.cc
index b362c073912dc501d09ff89708fb7655d31af024..2165bc2c067dc4bcb69352cb7a87f6de91d185a8 100644
--- a/ui/views/widget/native_widget_aura.cc
+++ b/ui/views/widget/native_widget_aura.cc
@@ -12,6 +12,7 @@
#include "base/threading/thread_task_runner_handle.h"
#include "build/build_config.h"
#include "services/ui/public/interfaces/window_manager.mojom.h"
+#include "services/ui/public/interfaces/window_manager_constants.mojom.h"
#include "third_party/skia/include/core/SkRegion.h"
#include "ui/aura/client/aura_constants.h"
#include "ui/aura/client/capture_client.h"
@@ -768,12 +769,10 @@ void NativeWidgetAura::OnSizeConstraintsChanged() {
if (is_parallel_widget_in_window_manager_)
return;
- window_->SetProperty(aura::client::kCanMaximizeKey,
- GetWidget()->widget_delegate()->CanMaximize());
- window_->SetProperty(aura::client::kCanMinimizeKey,
- GetWidget()->widget_delegate()->CanMinimize());
- window_->SetProperty(aura::client::kCanResizeKey,
- GetWidget()->widget_delegate()->CanResize());
+ int32_t behavior = ui::mojom::kResizeBehaviorNone;
+ if (GetWidget()->widget_delegate())
+ behavior = GetWidget()->widget_delegate()->GetResizeBehavior();
+ window_->SetProperty(aura::client::kResizeBehaviorKey, behavior);
}
void NativeWidgetAura::RepostNativeEvent(gfx::NativeEvent native_event) {
@@ -792,10 +791,10 @@ gfx::Size NativeWidgetAura::GetMinimumSize() const {
}
gfx::Size NativeWidgetAura::GetMaximumSize() const {
- // If a window have a maximum size, the window should not be
- // maximizable.
+ // A window should not have a maximum size and also be maximizable.
DCHECK(delegate_->GetMaximumSize().IsEmpty() ||
- !window_->GetProperty(aura::client::kCanMaximizeKey));
+ !(window_->GetProperty(aura::client::kResizeBehaviorKey) &
+ ui::mojom::kResizeBehaviorCanMaximize));
return delegate_->GetMaximumSize();
}
« no previous file with comments | « ui/views/widget/desktop_aura/x11_window_event_filter.cc ('k') | ui/views/widget/native_widget_aura_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698