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

Unified Diff: views/widget/native_widget_views.cc

Issue 7925006: NativeWidgetViews: Implement Maximize. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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
« no previous file with comments | « views/widget/native_widget_views.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/widget/native_widget_views.cc
diff --git a/views/widget/native_widget_views.cc b/views/widget/native_widget_views.cc
index a61a9b99d6ee7fb94db4cde1566d837b9197805d..b9a1e8c0d447a2c30bc39651ee0d88314ed31a52 100644
--- a/views/widget/native_widget_views.cc
+++ b/views/widget/native_widget_views.cc
@@ -5,7 +5,6 @@
#include "views/widget/native_widget_views.h"
#include "ui/gfx/compositor/compositor.h"
-#include "views/desktop/desktop_window_view.h"
#include "views/view.h"
#include "views/views_delegate.h"
#include "views/widget/native_widget_view.h"
@@ -27,6 +26,7 @@ NativeWidgetViews::NativeWidgetViews(internal::NativeWidgetDelegate* delegate)
: delegate_(delegate),
view_(NULL),
active_(false),
+ maximized_(false),
minimized_(false),
always_on_top_(false),
ALLOW_THIS_IN_INITIALIZER_LIST(close_widget_factory_(this)),
@@ -389,7 +389,12 @@ void NativeWidgetViews::SetAlwaysOnTop(bool on_top) {
}
void NativeWidgetViews::Maximize() {
- NOTIMPLEMENTED();
+ if (maximized_)
+ return;
+ maximized_ = true;
+ minimized_ = false;
+ gfx::Size size = GetParentNativeWidget()->GetWindowScreenBounds().size();
+ SetBounds(gfx::Rect(gfx::Point(), size));
}
void NativeWidgetViews::Minimize() {
@@ -421,11 +426,11 @@ void NativeWidgetViews::Minimize() {
view_->SetTransform(transform);
minimized_ = true;
sky 2011/09/19 20:32:47 Could we use an enum to avoid having to update two
sadrul 2011/09/22 17:00:24 Good idea. I updated to use ui::WindowShowState in
+ maximized_ = false;
}
bool NativeWidgetViews::IsMaximized() const {
- // NOTIMPLEMENTED();
- return false;
+ return maximized_;
}
bool NativeWidgetViews::IsMinimized() const {
@@ -434,6 +439,7 @@ bool NativeWidgetViews::IsMinimized() const {
void NativeWidgetViews::Restore() {
minimized_ = false;
+ maximized_ = false;
view_->SetBoundsRect(restored_bounds_);
view_->SetTransform(restored_transform_);
}
« no previous file with comments | « views/widget/native_widget_views.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698