| 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/ax_tree_source_surface.h" |
| 25 #include "components/exo/surface.h" | 26 #include "components/exo/surface.h" |
| 26 #include "ui/aura/client/aura_constants.h" | 27 #include "ui/aura/client/aura_constants.h" |
| 27 #include "ui/aura/client/cursor_client.h" | 28 #include "ui/aura/client/cursor_client.h" |
| 28 #include "ui/aura/window.h" | 29 #include "ui/aura/window.h" |
| 29 #include "ui/aura/window_event_dispatcher.h" | 30 #include "ui/aura/window_event_dispatcher.h" |
| 30 #include "ui/aura/window_property.h" | 31 #include "ui/aura/window_property.h" |
| 31 #include "ui/aura/window_targeter.h" | 32 #include "ui/aura/window_targeter.h" |
| 32 #include "ui/aura/window_tree_host.h" | 33 #include "ui/aura/window_tree_host.h" |
| 33 #include "ui/base/accelerators/accelerator.h" | 34 #include "ui/base/accelerators/accelerator.h" |
| 34 #include "ui/gfx/path.h" | 35 #include "ui/gfx/path.h" |
| (...skipping 829 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 864 if (!geometry_.IsEmpty()) | 865 if (!geometry_.IsEmpty()) |
| 865 return geometry_.size(); | 866 return geometry_.size(); |
| 866 | 867 |
| 867 return surface_ ? surface_->window()->layer()->size() : gfx::Size(); | 868 return surface_ ? surface_->window()->layer()->size() : gfx::Size(); |
| 868 } | 869 } |
| 869 | 870 |
| 870 gfx::Size ShellSurface::GetMinimumSize() const { | 871 gfx::Size ShellSurface::GetMinimumSize() const { |
| 871 return gfx::Size(1, 1); | 872 return gfx::Size(1, 1); |
| 872 } | 873 } |
| 873 | 874 |
| 875 void ShellSurface::GetAccessibleNodeData(ui::AXNodeData* node_data) { |
| 876 if (surface_ && surface_->ax_tree_source()) { |
| 877 ui::AXTreeData data; |
| 878 surface_->ax_tree_source()->GetTreeData(&data); |
| 879 node_data->AddIntAttribute(ui::AX_ATTR_CHILD_TREE_ID, data.tree_id); |
| 880 } |
| 881 } |
| 882 |
| 874 //////////////////////////////////////////////////////////////////////////////// | 883 //////////////////////////////////////////////////////////////////////////////// |
| 875 // ash::wm::WindowStateObserver overrides: | 884 // ash::wm::WindowStateObserver overrides: |
| 876 | 885 |
| 877 void ShellSurface::OnPreWindowStateTypeChange( | 886 void ShellSurface::OnPreWindowStateTypeChange( |
| 878 ash::wm::WindowState* window_state, | 887 ash::wm::WindowState* window_state, |
| 879 ash::wm::WindowStateType old_type) { | 888 ash::wm::WindowStateType old_type) { |
| 880 ash::wm::WindowStateType new_type = window_state->GetStateType(); | 889 ash::wm::WindowStateType new_type = window_state->GetStateType(); |
| 881 if (ash::wm::IsMaximizedOrFullscreenOrPinnedWindowStateType(old_type) || | 890 if (ash::wm::IsMaximizedOrFullscreenOrPinnedWindowStateType(old_type) || |
| 882 ash::wm::IsMaximizedOrFullscreenOrPinnedWindowStateType(new_type)) { | 891 ash::wm::IsMaximizedOrFullscreenOrPinnedWindowStateType(new_type)) { |
| 883 // When transitioning in/out of maximized or fullscreen mode we need to | 892 // When transitioning in/out of maximized or fullscreen mode we need to |
| (...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1503 shadow_overlay_->SetBounds(shadow_bounds); | 1512 shadow_overlay_->SetBounds(shadow_bounds); |
| 1504 shadow->SetContentBounds(gfx::Rect(shadow_bounds.size())); | 1513 shadow->SetContentBounds(gfx::Rect(shadow_bounds.size())); |
| 1505 // Surfaces that can't be activated are usually menus and tooltips. Use a | 1514 // Surfaces that can't be activated are usually menus and tooltips. Use a |
| 1506 // small style shadow for them. | 1515 // small style shadow for them. |
| 1507 if (!activatable_) | 1516 if (!activatable_) |
| 1508 shadow->SetElevation(wm::ShadowElevation::SMALL); | 1517 shadow->SetElevation(wm::ShadowElevation::SMALL); |
| 1509 } | 1518 } |
| 1510 } | 1519 } |
| 1511 | 1520 |
| 1512 } // namespace exo | 1521 } // namespace exo |
| OLD | NEW |