| 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 <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "ash/common/frame/custom_frame_view_ash.h" | 9 #include "ash/common/frame/custom_frame_view_ash.h" |
| 10 #include "ash/common/shelf/wm_shelf.h" | 10 #include "ash/common/shelf/wm_shelf.h" |
| 11 #include "ash/common/wm/window_resizer.h" | 11 #include "ash/common/wm/window_resizer.h" |
| 12 #include "ash/common/wm/window_state.h" | 12 #include "ash/common/wm/window_state.h" |
| 13 #include "ash/common/wm/window_state_delegate.h" | 13 #include "ash/common/wm/window_state_delegate.h" |
| 14 #include "ash/common/wm_shell.h" | 14 #include "ash/common/wm_shell.h" |
| 15 #include "ash/common/wm_window.h" | 15 #include "ash/common/wm_window.h" |
| 16 #include "ash/public/cpp/shell_window_ids.h" | 16 #include "ash/public/cpp/shell_window_ids.h" |
| 17 #include "ash/wm/window_state_aura.h" | 17 #include "ash/wm/window_state_aura.h" |
| 18 #include "ash/wm/window_util.h" | 18 #include "ash/wm/window_util.h" |
| 19 #include "base/logging.h" | 19 #include "base/logging.h" |
| 20 #include "base/macros.h" | 20 #include "base/macros.h" |
| 21 #include "base/memory/ptr_util.h" | 21 #include "base/memory/ptr_util.h" |
| 22 #include "base/strings/utf_string_conversions.h" | 22 #include "base/strings/utf_string_conversions.h" |
| 23 #include "base/trace_event/trace_event.h" | 23 #include "base/trace_event/trace_event.h" |
| 24 #include "base/trace_event/trace_event_argument.h" | 24 #include "base/trace_event/trace_event_argument.h" |
| 25 #include "components/exo/surface.h" | 25 #include "components/exo/surface.h" |
| 26 #include "ui/aura/client/aura_constants.h" | 26 #include "ui/aura/client/aura_constants.h" |
| 27 #include "ui/aura/client/cursor_client.h" | 27 #include "ui/aura/client/cursor_client.h" |
| 28 #include "ui/aura/window.h" | 28 #include "ui/aura/window.h" |
| 29 #include "ui/aura/window_event_dispatcher.h" | 29 #include "ui/aura/window_event_dispatcher.h" |
| 30 #include "ui/aura/window_property.h" | |
| 31 #include "ui/aura/window_targeter.h" | 30 #include "ui/aura/window_targeter.h" |
| 32 #include "ui/aura/window_tree_host.h" | 31 #include "ui/aura/window_tree_host.h" |
| 33 #include "ui/base/accelerators/accelerator.h" | 32 #include "ui/base/accelerators/accelerator.h" |
| 33 #include "ui/base/class_property.h" |
| 34 #include "ui/gfx/path.h" | 34 #include "ui/gfx/path.h" |
| 35 #include "ui/views/widget/widget.h" | 35 #include "ui/views/widget/widget.h" |
| 36 #include "ui/views/widget/widget_observer.h" | 36 #include "ui/views/widget/widget_observer.h" |
| 37 #include "ui/wm/core/coordinate_conversion.h" | 37 #include "ui/wm/core/coordinate_conversion.h" |
| 38 #include "ui/wm/core/shadow.h" | 38 #include "ui/wm/core/shadow.h" |
| 39 #include "ui/wm/core/shadow_controller.h" | 39 #include "ui/wm/core/shadow_controller.h" |
| 40 #include "ui/wm/core/shadow_types.h" | 40 #include "ui/wm/core/shadow_types.h" |
| 41 #include "ui/wm/core/window_animations.h" | 41 #include "ui/wm/core/window_animations.h" |
| 42 #include "ui/wm/core/window_util.h" | 42 #include "ui/wm/core/window_util.h" |
| 43 | 43 |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 324 aura::Window* window = shell_surface_->widget_->GetNativeWindow(); | 324 aura::Window* window = shell_surface_->widget_->GetNativeWindow(); |
| 325 DCHECK_EQ(window->GetProperty(aura::client::kAnimationsDisabledKey), true); | 325 DCHECK_EQ(window->GetProperty(aura::client::kAnimationsDisabledKey), true); |
| 326 window->SetProperty(aura::client::kAnimationsDisabledKey, | 326 window->SetProperty(aura::client::kAnimationsDisabledKey, |
| 327 saved_animations_disabled_); | 327 saved_animations_disabled_); |
| 328 } | 328 } |
| 329 } | 329 } |
| 330 | 330 |
| 331 //////////////////////////////////////////////////////////////////////////////// | 331 //////////////////////////////////////////////////////////////////////////////// |
| 332 // ShellSurface, public: | 332 // ShellSurface, public: |
| 333 | 333 |
| 334 DEFINE_LOCAL_WINDOW_PROPERTY_KEY(Surface*, kMainSurfaceKey, nullptr) | 334 DEFINE_LOCAL_UI_CLASS_PROPERTY_KEY(Surface*, kMainSurfaceKey, nullptr) |
| 335 | 335 |
| 336 ShellSurface::ShellSurface(Surface* surface, | 336 ShellSurface::ShellSurface(Surface* surface, |
| 337 ShellSurface* parent, | 337 ShellSurface* parent, |
| 338 const gfx::Rect& initial_bounds, | 338 const gfx::Rect& initial_bounds, |
| 339 bool activatable, | 339 bool activatable, |
| 340 bool can_minimize, | 340 bool can_minimize, |
| 341 int container) | 341 int container) |
| 342 : widget_(nullptr), | 342 : widget_(nullptr), |
| 343 surface_(surface), | 343 surface_(surface), |
| 344 parent_(parent ? parent->GetWidget()->GetNativeWindow() : nullptr), | 344 parent_(parent ? parent->GetWidget()->GetNativeWindow() : nullptr), |
| (...skipping 1158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1503 shadow_overlay_->SetBounds(shadow_bounds); | 1503 shadow_overlay_->SetBounds(shadow_bounds); |
| 1504 shadow->SetContentBounds(gfx::Rect(shadow_bounds.size())); | 1504 shadow->SetContentBounds(gfx::Rect(shadow_bounds.size())); |
| 1505 // Surfaces that can't be activated are usually menus and tooltips. Use a | 1505 // Surfaces that can't be activated are usually menus and tooltips. Use a |
| 1506 // small style shadow for them. | 1506 // small style shadow for them. |
| 1507 if (!activatable_) | 1507 if (!activatable_) |
| 1508 shadow->SetElevation(wm::ShadowElevation::SMALL); | 1508 shadow->SetElevation(wm::ShadowElevation::SMALL); |
| 1509 } | 1509 } |
| 1510 } | 1510 } |
| 1511 | 1511 |
| 1512 } // namespace exo | 1512 } // namespace exo |
| OLD | NEW |