| OLD | NEW |
| 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 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 wm::RemoveTransientChild(parent_, widget_->GetNativeWindow()); | 327 wm::RemoveTransientChild(parent_, widget_->GetNativeWindow()); |
| 328 } | 328 } |
| 329 parent_ = parent ? parent->GetWidget()->GetNativeWindow() : nullptr; | 329 parent_ = parent ? parent->GetWidget()->GetNativeWindow() : nullptr; |
| 330 if (parent_) { | 330 if (parent_) { |
| 331 parent_->AddObserver(this); | 331 parent_->AddObserver(this); |
| 332 if (widget_) | 332 if (widget_) |
| 333 wm::AddTransientChild(parent_, widget_->GetNativeWindow()); | 333 wm::AddTransientChild(parent_, widget_->GetNativeWindow()); |
| 334 } | 334 } |
| 335 } | 335 } |
| 336 | 336 |
| 337 void ShellSurface::Activate() { |
| 338 TRACE_EVENT0("exo", "ShellSurface::Activate"); |
| 339 |
| 340 if (!widget_ || widget_->IsActive()) |
| 341 return; |
| 342 |
| 343 widget_->Activate(); |
| 344 } |
| 345 |
| 337 void ShellSurface::Maximize() { | 346 void ShellSurface::Maximize() { |
| 338 TRACE_EVENT0("exo", "ShellSurface::Maximize"); | 347 TRACE_EVENT0("exo", "ShellSurface::Maximize"); |
| 339 | 348 |
| 340 if (!widget_) | 349 if (!widget_) |
| 341 CreateShellSurfaceWidget(ui::SHOW_STATE_MAXIMIZED); | 350 CreateShellSurfaceWidget(ui::SHOW_STATE_MAXIMIZED); |
| 342 | 351 |
| 343 // Note: This will ask client to configure its surface even if already | 352 // Note: This will ask client to configure its surface even if already |
| 344 // maximized. | 353 // maximized. |
| 345 ScopedConfigure scoped_configure(this, true); | 354 ScopedConfigure scoped_configure(this, true); |
| 346 widget_->Maximize(); | 355 widget_->Maximize(); |
| (...skipping 888 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1235 shadow_overlay_->layer()->Add(shadow->layer()); | 1244 shadow_overlay_->layer()->Add(shadow->layer()); |
| 1236 window->AddChild(shadow_overlay_); | 1245 window->AddChild(shadow_overlay_); |
| 1237 shadow_overlay_->Show(); | 1246 shadow_overlay_->Show(); |
| 1238 } | 1247 } |
| 1239 shadow_overlay_->SetBounds(shadow_bounds); | 1248 shadow_overlay_->SetBounds(shadow_bounds); |
| 1240 shadow->SetContentBounds(gfx::Rect(shadow_bounds.size())); | 1249 shadow->SetContentBounds(gfx::Rect(shadow_bounds.size())); |
| 1241 } | 1250 } |
| 1242 } | 1251 } |
| 1243 | 1252 |
| 1244 } // namespace exo | 1253 } // namespace exo |
| OLD | NEW |