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

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

Issue 2640123004: Initial support for native accessibility in ARC (Closed)
Patch Set: Address various feedback. Created 3 years, 10 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
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 <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/accessibility/ax_node_data.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"
35 #include "ui/views/widget/widget.h" 36 #include "ui/views/widget/widget.h"
(...skipping 828 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 int32_t id = GetWidget()->GetNativeWindow()->GetProperty(
877 aura::client::kAccessibleChildTreeIdKey);
878 if (id)
879 node_data->AddIntAttribute(ui::AX_ATTR_CHILD_TREE_ID, id);
880 }
881
874 //////////////////////////////////////////////////////////////////////////////// 882 ////////////////////////////////////////////////////////////////////////////////
875 // ash::wm::WindowStateObserver overrides: 883 // ash::wm::WindowStateObserver overrides:
876 884
877 void ShellSurface::OnPreWindowStateTypeChange( 885 void ShellSurface::OnPreWindowStateTypeChange(
878 ash::wm::WindowState* window_state, 886 ash::wm::WindowState* window_state,
879 ash::wm::WindowStateType old_type) { 887 ash::wm::WindowStateType old_type) {
880 ash::wm::WindowStateType new_type = window_state->GetStateType(); 888 ash::wm::WindowStateType new_type = window_state->GetStateType();
881 if (ash::wm::IsMaximizedOrFullscreenOrPinnedWindowStateType(old_type) || 889 if (ash::wm::IsMaximizedOrFullscreenOrPinnedWindowStateType(old_type) ||
882 ash::wm::IsMaximizedOrFullscreenOrPinnedWindowStateType(new_type)) { 890 ash::wm::IsMaximizedOrFullscreenOrPinnedWindowStateType(new_type)) {
883 // When transitioning in/out of maximized or fullscreen mode we need to 891 // When transitioning in/out of maximized or fullscreen mode we need to
(...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after
1503 shadow_overlay_->SetBounds(shadow_bounds); 1511 shadow_overlay_->SetBounds(shadow_bounds);
1504 shadow->SetContentBounds(gfx::Rect(shadow_bounds.size())); 1512 shadow->SetContentBounds(gfx::Rect(shadow_bounds.size()));
1505 // Surfaces that can't be activated are usually menus and tooltips. Use a 1513 // Surfaces that can't be activated are usually menus and tooltips. Use a
1506 // small style shadow for them. 1514 // small style shadow for them.
1507 if (!activatable_) 1515 if (!activatable_)
1508 shadow->SetElevation(wm::ShadowElevation::SMALL); 1516 shadow->SetElevation(wm::ShadowElevation::SMALL);
1509 } 1517 }
1510 } 1518 }
1511 1519
1512 } // namespace exo 1520 } // namespace exo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698