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

Unified Diff: ash/wm/window_util.cc

Issue 10914231: Map fullscreen button to maximize (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: fix for review issues 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 side-by-side diff with in-line comments
Download patch
Index: ash/wm/window_util.cc
diff --git a/ash/wm/window_util.cc b/ash/wm/window_util.cc
index cfbacdce8ce6279a66c84cbb283e823adad6ff3c..a05529d2de3cd67e6c6a11025a162faebe7bb35c 100644
--- a/ash/wm/window_util.cc
+++ b/ash/wm/window_util.cc
@@ -14,6 +14,8 @@
#include "ui/aura/root_window.h"
#include "ui/aura/window.h"
#include "ui/compositor/layer.h"
+#include "ui/views/widget/widget.h"
+#include "ui/views/widget/widget_delegate.h"
#include "ui/gfx/display.h"
#include "ui/gfx/screen.h"
@@ -61,6 +63,18 @@ bool CanActivateWindow(aura::Window* window) {
return client && client->CanActivateWindow(window);
}
+bool CanMaximizeWindow(aura::Window* window) {
+ if (!window)
+ return false;
+ views::Widget* widget = views::Widget::GetWidgetForNativeWindow(window);
sky 2012/09/13 00:46:22 Instead of this, add a new property that says whet
sschmitz 2012/09/13 19:34:13 Thanks for your help on this. Done.
+ if (!widget)
+ return false;
+ views::WidgetDelegate* widget_delegate = widget->widget_delegate();
+ if (!widget_delegate)
+ return false;
+ return widget_delegate->CanMaximize();
+}
+
bool IsWindowNormal(aura::Window* window) {
return IsWindowStateNormal(window->GetProperty(aura::client::kShowStateKey));
}

Powered by Google App Engine
This is Rietveld 408576698