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