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

Unified Diff: ash/frame/custom_frame_view_ash.cc

Issue 2901663003: chromeos: converts WindowState to aura::Window (Closed)
Patch Set: feedback Created 3 years, 7 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 | « ash/frame/custom_frame_view_ash.h ('k') | ash/mus/non_client_frame_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/frame/custom_frame_view_ash.cc
diff --git a/ash/frame/custom_frame_view_ash.cc b/ash/frame/custom_frame_view_ash.cc
index 272752c12e2caf65ba88db6451c00eff1125f655..a236c1293ad2e40bca8f621cb3b81319836fccc6 100644
--- a/ash/frame/custom_frame_view_ash.cc
+++ b/ash/frame/custom_frame_view_ash.cc
@@ -53,7 +53,7 @@ class CustomFrameViewAshWindowStateDelegate : public wm::WindowStateDelegate,
// TODO(pkotwicz): This is a hack. Remove ASAP. http://crbug.com/319048
window_state_ = window_state;
window_state_->AddObserver(this);
- window_state_->window()->aura_window()->AddObserver(this);
+ window_state_->window()->AddObserver(this);
if (!enable_immersive)
return;
@@ -68,7 +68,7 @@ class CustomFrameViewAshWindowStateDelegate : public wm::WindowStateDelegate,
~CustomFrameViewAshWindowStateDelegate() override {
if (window_state_) {
window_state_->RemoveObserver(this);
- window_state_->window()->aura_window()->RemoveObserver(this);
+ window_state_->window()->RemoveObserver(this);
}
}
@@ -76,10 +76,12 @@ class CustomFrameViewAshWindowStateDelegate : public wm::WindowStateDelegate,
// Overridden from wm::WindowStateDelegate:
bool ToggleFullscreen(wm::WindowState* window_state) override {
bool enter_fullscreen = !window_state->IsFullscreen();
- if (enter_fullscreen)
- window_state_->window()->SetShowState(ui::SHOW_STATE_FULLSCREEN);
- else
+ if (enter_fullscreen) {
+ window_state_->window()->SetProperty(aura::client::kShowStateKey,
+ ui::SHOW_STATE_FULLSCREEN);
+ } else {
window_state->Restore();
+ }
if (immersive_fullscreen_controller_) {
immersive_fullscreen_controller_->SetEnabled(
ImmersiveFullscreenController::WINDOW_TYPE_OTHER, enter_fullscreen);
@@ -112,6 +114,9 @@ class CustomFrameViewAshWindowStateDelegate : public wm::WindowStateDelegate,
} // namespace
+// static
+bool CustomFrameViewAsh::use_empty_minimum_size_for_test_ = false;
+
///////////////////////////////////////////////////////////////////////////////
// CustomFrameViewAsh::OverlayView
@@ -319,6 +324,9 @@ const char* CustomFrameViewAsh::GetClassName() const {
}
gfx::Size CustomFrameViewAsh::GetMinimumSize() const {
+ if (use_empty_minimum_size_for_test_)
+ return gfx::Size();
+
gfx::Size min_client_view_size(frame_->client_view()->GetMinimumSize());
return gfx::Size(
std::max(header_view_->GetMinimumWidth(), min_client_view_size.width()),
« no previous file with comments | « ash/frame/custom_frame_view_ash.h ('k') | ash/mus/non_client_frame_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698