Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/views/widget/native_widget_aura.h" | 5 #include "ui/views/widget/native_widget_aura.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
| 9 #include "third_party/skia/include/core/SkRegion.h" | 9 #include "third_party/skia/include/core/SkRegion.h" |
| 10 #include "ui/aura/client/activation_change_observer.h" | 10 #include "ui/aura/client/activation_change_observer.h" |
| (...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 579 ui::SHOW_STATE_MAXIMIZED; | 579 ui::SHOW_STATE_MAXIMIZED; |
| 580 } | 580 } |
| 581 | 581 |
| 582 bool NativeWidgetAura::IsMinimized() const { | 582 bool NativeWidgetAura::IsMinimized() const { |
| 583 return window_->GetProperty(aura::client::kShowStateKey) == | 583 return window_->GetProperty(aura::client::kShowStateKey) == |
| 584 ui::SHOW_STATE_MINIMIZED; | 584 ui::SHOW_STATE_MINIMIZED; |
| 585 } | 585 } |
| 586 | 586 |
| 587 void NativeWidgetAura::Restore() { | 587 void NativeWidgetAura::Restore() { |
| 588 window_->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_NORMAL); | 588 window_->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_NORMAL); |
| 589 /* | |
|
sky
2012/08/29 17:29:20
?
Mr4D (OOO till 08-26)
2012/08/29 18:57:34
Daeng. I left that in while reverting all other ch
| |
| 590 gfx::Rect* restore_bounds = | |
| 591 window_->GetProperty(aura::client::kRestoreBoundsKey); | |
| 592 // If the windows state is already normal, but there is a restore bounds | |
| 593 // stored, we might are on Left/Right maximize mode and only need to restore | |
| 594 if (restore_bounds && !IsMinimized() && !IsMaximized() && !IsFullscreen()) { | |
| 595 // Since there is a restore bound, but no extreme state set, this has to be | |
| 596 // a L/R maximized mode restore. | |
| 597 SetBounds(*restore_bounds); | |
| 598 window_->ClearProperty(aura::client::kRestoreBoundsKey); | |
| 599 } else { | |
| 600 window_->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_NORMAL); | |
| 601 } | |
| 602 */ | |
| 589 } | 603 } |
| 590 | 604 |
| 591 void NativeWidgetAura::SetFullscreen(bool fullscreen) { | 605 void NativeWidgetAura::SetFullscreen(bool fullscreen) { |
| 592 if (IsFullscreen() == fullscreen) | 606 if (IsFullscreen() == fullscreen) |
| 593 return; // Nothing to do. | 607 return; // Nothing to do. |
| 594 | 608 |
| 595 // Save window state before entering full screen so that it could restored | 609 // Save window state before entering full screen so that it could restored |
| 596 // when exiting full screen. | 610 // when exiting full screen. |
| 597 if (fullscreen) | 611 if (fullscreen) |
| 598 saved_window_state_ = window_->GetProperty(aura::client::kShowStateKey); | 612 saved_window_state_ = window_->GetProperty(aura::client::kShowStateKey); |
| (...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1048 return aura::Env::GetInstance()->is_mouse_button_down(); | 1062 return aura::Env::GetInstance()->is_mouse_button_down(); |
| 1049 } | 1063 } |
| 1050 | 1064 |
| 1051 // static | 1065 // static |
| 1052 bool NativeWidgetPrivate::IsTouchDown() { | 1066 bool NativeWidgetPrivate::IsTouchDown() { |
| 1053 return aura::Env::GetInstance()->is_touch_down(); | 1067 return aura::Env::GetInstance()->is_touch_down(); |
| 1054 } | 1068 } |
| 1055 | 1069 |
| 1056 } // namespace internal | 1070 } // namespace internal |
| 1057 } // namespace views | 1071 } // namespace views |
| OLD | NEW |