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

Side by Side Diff: components/exo/shell_surface.cc

Issue 2157863002: exo: Close widget at the top of ShellSurface dtor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "components/exo/shell_surface.h" 5 #include "components/exo/shell_surface.h"
6 6
7 #include "ash/aura/wm_window_aura.h" 7 #include "ash/aura/wm_window_aura.h"
8 #include "ash/common/shell_window_ids.h" 8 #include "ash/common/shell_window_ids.h"
9 #include "ash/common/wm/window_resizer.h" 9 #include "ash/common/wm/window_resizer.h"
10 #include "ash/common/wm/window_state.h" 10 #include "ash/common/wm/window_state.h"
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 229
230 ShellSurface::ShellSurface(Surface* surface) 230 ShellSurface::ShellSurface(Surface* surface)
231 : ShellSurface(surface, 231 : ShellSurface(surface,
232 nullptr, 232 nullptr,
233 gfx::Rect(), 233 gfx::Rect(),
234 true, 234 true,
235 ash::kShellWindowId_DefaultContainer) {} 235 ash::kShellWindowId_DefaultContainer) {}
236 236
237 ShellSurface::~ShellSurface() { 237 ShellSurface::~ShellSurface() {
238 DCHECK(!scoped_configure_); 238 DCHECK(!scoped_configure_);
239 ash::Shell::GetInstance()->activation_client()->RemoveObserver(this);
240 if (surface_) {
241 if (scale_ != 1.0)
242 surface_->window()->SetTransform(gfx::Transform());
243 surface_->SetSurfaceDelegate(nullptr);
244 surface_->RemoveSurfaceObserver(this);
245 }
246 if (parent_)
247 parent_->RemoveObserver(this);
248 if (resizer_) 239 if (resizer_)
249 EndDrag(false /* revert */); 240 EndDrag(false /* revert */);
250 if (widget_) { 241 if (widget_) {
251 ash::wm::GetWindowState(widget_->GetNativeWindow())->RemoveObserver(this); 242 ash::wm::GetWindowState(widget_->GetNativeWindow())->RemoveObserver(this);
252 widget_->GetNativeWindow()->RemoveObserver(this); 243 widget_->GetNativeWindow()->RemoveObserver(this);
253 if (widget_->IsVisible()) 244 if (widget_->IsVisible())
254 widget_->Hide(); 245 widget_->Hide();
255 widget_->CloseNow(); 246 widget_->CloseNow();
256 } 247 }
248 ash::Shell::GetInstance()->activation_client()->RemoveObserver(this);
249 if (parent_)
250 parent_->RemoveObserver(this);
251 if (surface_) {
252 if (scale_ != 1.0)
253 surface_->window()->SetTransform(gfx::Transform());
254 surface_->SetSurfaceDelegate(nullptr);
255 surface_->RemoveSurfaceObserver(this);
256 }
257 } 257 }
258 258
259 void ShellSurface::AcknowledgeConfigure(uint32_t serial) { 259 void ShellSurface::AcknowledgeConfigure(uint32_t serial) {
260 TRACE_EVENT1("exo", "ShellSurface::AcknowledgeConfigure", "serial", serial); 260 TRACE_EVENT1("exo", "ShellSurface::AcknowledgeConfigure", "serial", serial);
261 261
262 // Apply all configs that are older or equal to |serial|. The result is that 262 // Apply all configs that are older or equal to |serial|. The result is that
263 // the origin of the main surface will move and the resize direction will 263 // the origin of the main surface will move and the resize direction will
264 // change to reflect the acknowledgement of configure request with |serial| 264 // change to reflect the acknowledgement of configure request with |serial|
265 // at the next call to Commit(). 265 // at the next call to Commit().
266 while (!pending_configs_.empty()) { 266 while (!pending_configs_.empty()) {
(...skipping 909 matching lines...) Expand 10 before | Expand all | Expand 10 after
1176 &shadow_bounds); 1176 &shadow_bounds);
1177 shadow_overlay_->SetBounds(shadow_bounds); 1177 shadow_overlay_->SetBounds(shadow_bounds);
1178 shadow_underlay_->SetBounds(shadow_bounds); 1178 shadow_underlay_->SetBounds(shadow_bounds);
1179 shadow->SetContentBounds(gfx::Rect(shadow_bounds.size())); 1179 shadow->SetContentBounds(gfx::Rect(shadow_bounds.size()));
1180 wm::SetShadowType(window, wm::SHADOW_TYPE_RECTANGULAR); 1180 wm::SetShadowType(window, wm::SHADOW_TYPE_RECTANGULAR);
1181 } 1181 }
1182 } 1182 }
1183 } 1183 }
1184 1184
1185 } // namespace exo 1185 } // namespace exo
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698