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

Unified Diff: views/widget/native_widget_aura.cc

Issue 8400063: Move maximize/fullscreen/restore to shell (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove OVERRIDE from .cc Created 9 years, 2 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 | « ui/aura_shell/workspace/workspace_manager_unittest.cc ('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_aura.cc
diff --git a/views/widget/native_widget_aura.cc b/views/widget/native_widget_aura.cc
index 230235a539ba4476403e7a32a65e2350143f1568..9a96befea4237406ca533afcf47da9b043eafb42 100644
--- a/views/widget/native_widget_aura.cc
+++ b/views/widget/native_widget_aura.cc
@@ -5,6 +5,7 @@
#include "views/widget/native_widget_aura.h"
#include "base/bind.h"
+#include "ui/aura/aura_constants.h"
#include "ui/aura/desktop.h"
#include "ui/aura/desktop_observer.h"
#include "ui/aura/event.h"
@@ -123,6 +124,7 @@ void NativeWidgetAura::InitNativeWidget(const Widget::InitParams& params) {
Widget::InitParams::Type window_type =
params.child ? Widget::InitParams::TYPE_CONTROL : params.type;
window_->SetType(GetAuraWindowTypeForWidgetType(window_type));
+ window_->SetIntProperty(aura::kShowStateKey, ui::SHOW_STATE_NORMAL);
window_->Init(params.create_texture_for_layer ?
ui::Layer::LAYER_HAS_TEXTURE :
ui::Layer::LAYER_HAS_NO_TEXTURE);
@@ -277,7 +279,8 @@ void NativeWidgetAura::CenterWindow(const gfx::Size& size) {
void NativeWidgetAura::GetWindowPlacement(
gfx::Rect* bounds,
ui::WindowShowState* maximized) const {
- *maximized = window_->show_state();
+ *maximized = static_cast<ui::WindowShowState>(
+ window_->GetIntProperty(aura::kShowStateKey));
}
void NativeWidgetAura::SetWindowTitle(const string16& title) {
@@ -377,15 +380,9 @@ void NativeWidgetAura::ShowMaximizedWithBounds(
}
void NativeWidgetAura::ShowWithWindowState(ui::WindowShowState state) {
- switch (state) {
- case ui::SHOW_STATE_MAXIMIZED:
- window_->Maximize();
- break;
- case ui::SHOW_STATE_FULLSCREEN:
- window_->Fullscreen();
- break;
- default:
- break;
+ if (state == ui::SHOW_STATE_MAXIMIZED ||
+ state == ui::SHOW_STATE_FULLSCREEN) {
+ window_->SetIntProperty(aura::kShowStateKey, state);
}
window_->Show();
if (can_activate_ && (state != ui::SHOW_STATE_INACTIVE ||
@@ -415,7 +412,7 @@ void NativeWidgetAura::SetAlwaysOnTop(bool on_top) {
}
void NativeWidgetAura::Maximize() {
- window_->Maximize();
+ window_->SetIntProperty(aura::kShowStateKey, ui::SHOW_STATE_MAXIMIZED);
}
void NativeWidgetAura::Minimize() {
@@ -423,23 +420,28 @@ void NativeWidgetAura::Minimize() {
}
bool NativeWidgetAura::IsMaximized() const {
- return window_->show_state() == ui::SHOW_STATE_MAXIMIZED;
+ return window_->GetIntProperty(aura::kShowStateKey) ==
+ ui::SHOW_STATE_MAXIMIZED;
}
bool NativeWidgetAura::IsMinimized() const {
- return window_->show_state() == ui::SHOW_STATE_MINIMIZED;
+ return window_->GetIntProperty(aura::kShowStateKey) ==
+ ui::SHOW_STATE_MINIMIZED;
}
void NativeWidgetAura::Restore() {
- window_->Restore();
+ window_->SetIntProperty(aura::kShowStateKey, ui::SHOW_STATE_NORMAL);
}
void NativeWidgetAura::SetFullscreen(bool fullscreen) {
- fullscreen ? window_->Fullscreen() : window_->Restore();
+ window_->SetIntProperty(
+ aura::kShowStateKey,
+ fullscreen ? ui::SHOW_STATE_FULLSCREEN : ui::SHOW_STATE_NORMAL);
}
bool NativeWidgetAura::IsFullscreen() const {
- return window_->show_state() == ui::SHOW_STATE_FULLSCREEN;
+ return window_->GetIntProperty(aura::kShowStateKey) ==
+ ui::SHOW_STATE_FULLSCREEN;
}
void NativeWidgetAura::SetOpacity(unsigned char opacity) {
« no previous file with comments | « ui/aura_shell/workspace/workspace_manager_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698