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

Side by Side Diff: content/browser/accessibility/browser_accessibility.cc

Issue 2746813002: Hide AXPlatformNode on ChromeOS. (Closed)
Patch Set: has_native_accessibility Created 3 years, 9 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
« no previous file with comments | « chrome/browser/ui/views/location_bar/location_icon_view.cc ('k') | ui/accessibility/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/browser/accessibility/browser_accessibility.h" 5 #include "content/browser/accessibility/browser_accessibility.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
11 #include "base/logging.h" 11 #include "base/logging.h"
12 #include "base/strings/string_number_conversions.h" 12 #include "base/strings/string_number_conversions.h"
13 #include "base/strings/string_util.h" 13 #include "base/strings/string_util.h"
14 #include "content/browser/accessibility/browser_accessibility_manager.h" 14 #include "content/browser/accessibility/browser_accessibility_manager.h"
15 #include "content/common/accessibility_messages.h" 15 #include "content/common/accessibility_messages.h"
16 #include "ui/accessibility/ax_role_properties.h" 16 #include "ui/accessibility/ax_role_properties.h"
17 #include "ui/accessibility/ax_text_utils.h" 17 #include "ui/accessibility/ax_text_utils.h"
18 #include "ui/accessibility/platform/ax_platform_node.h" 18 #include "ui/accessibility/platform/ax_platform_unique_id.h"
19 #include "ui/gfx/geometry/rect_conversions.h" 19 #include "ui/gfx/geometry/rect_conversions.h"
20 #include "ui/gfx/geometry/rect_f.h" 20 #include "ui/gfx/geometry/rect_f.h"
21 21
22 namespace content { 22 namespace content {
23 23
24 namespace { 24 namespace {
25 25
26 // Map from unique_id to BrowserAccessibility 26 // Map from unique_id to BrowserAccessibility
27 using UniqueIDMap = base::hash_map<int32_t, BrowserAccessibility*>; 27 using UniqueIDMap = base::hash_map<int32_t, BrowserAccessibility*>;
28 base::LazyInstance<UniqueIDMap>::DestructorAtExit g_unique_id_map = 28 base::LazyInstance<UniqueIDMap>::DestructorAtExit g_unique_id_map =
29 LAZY_INSTANCE_INITIALIZER; 29 LAZY_INSTANCE_INITIALIZER;
30 } 30 }
31 31
32 #if !defined(PLATFORM_HAS_NATIVE_ACCESSIBILITY_IMPL) 32 #if !defined(PLATFORM_HAS_NATIVE_ACCESSIBILITY_IMPL)
33 // static 33 // static
34 BrowserAccessibility* BrowserAccessibility::Create() { 34 BrowserAccessibility* BrowserAccessibility::Create() {
35 return new BrowserAccessibility(); 35 return new BrowserAccessibility();
36 } 36 }
37 #endif 37 #endif
38 38
39 BrowserAccessibility::BrowserAccessibility() 39 BrowserAccessibility::BrowserAccessibility()
40 : manager_(NULL), 40 : manager_(NULL),
41 node_(NULL), 41 node_(NULL),
42 unique_id_(ui::AXPlatformNode::GetNextUniqueId()) { 42 unique_id_(ui::GetNextAXPlatformNodeUniqueId()) {
43 g_unique_id_map.Get()[unique_id_] = this; 43 g_unique_id_map.Get()[unique_id_] = this;
44 } 44 }
45 45
46 BrowserAccessibility::~BrowserAccessibility() { 46 BrowserAccessibility::~BrowserAccessibility() {
47 if (unique_id_) 47 if (unique_id_)
48 g_unique_id_map.Get().erase(unique_id_); 48 g_unique_id_map.Get().erase(unique_id_);
49 } 49 }
50 50
51 // static 51 // static
52 BrowserAccessibility* BrowserAccessibility::GetFromUniqueID(int32_t unique_id) { 52 BrowserAccessibility* BrowserAccessibility::GetFromUniqueID(int32_t unique_id) {
(...skipping 1163 matching lines...) Expand 10 before | Expand all | Expand 10 after
1216 } 1216 }
1217 } 1217 }
1218 1218
1219 node = container; 1219 node = container;
1220 } 1220 }
1221 1221
1222 return gfx::ToEnclosingRect(bounds); 1222 return gfx::ToEnclosingRect(bounds);
1223 } 1223 }
1224 1224
1225 } // namespace content 1225 } // namespace content
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/location_bar/location_icon_view.cc ('k') | ui/accessibility/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698