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

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

Issue 2763803002: BrowserAccessibility should own a AXPlatformNode. (Closed)
Patch Set: Windows Only Created 3 years, 8 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 | « no previous file | content/browser/accessibility/browser_accessibility.cc » ('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 #ifndef CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_H_ 5 #ifndef CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_H_
6 #define CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_H_ 6 #define CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <map> 10 #include <map>
11 #include <utility> 11 #include <utility>
12 #include <vector> 12 #include <vector>
13 13
14 #include "base/macros.h" 14 #include "base/macros.h"
15 #include "base/strings/string16.h" 15 #include "base/strings/string16.h"
16 #include "base/strings/string_split.h" 16 #include "base/strings/string_split.h"
17 #include "build/build_config.h" 17 #include "build/build_config.h"
18 #include "content/browser/accessibility/ax_platform_position.h" 18 #include "content/browser/accessibility/ax_platform_position.h"
19 #include "content/common/content_export.h" 19 #include "content/common/content_export.h"
20 #include "third_party/WebKit/public/web/WebAXEnums.h" 20 #include "third_party/WebKit/public/web/WebAXEnums.h"
21 #include "ui/accessibility/ax_node.h" 21 #include "ui/accessibility/ax_node.h"
22 #include "ui/accessibility/ax_node_data.h" 22 #include "ui/accessibility/ax_node_data.h"
23 #include "ui/accessibility/ax_range.h" 23 #include "ui/accessibility/ax_range.h"
24 #include "ui/accessibility/ax_text_utils.h" 24 #include "ui/accessibility/ax_text_utils.h"
25 #include "ui/accessibility/platform/ax_platform_node.h"
25 #include "ui/accessibility/platform/ax_platform_node_delegate.h" 26 #include "ui/accessibility/platform/ax_platform_node_delegate.h"
26 27
27 // Set PLATFORM_HAS_NATIVE_ACCESSIBILITY_IMPL if this platform has 28 // Set PLATFORM_HAS_NATIVE_ACCESSIBILITY_IMPL if this platform has
28 // a platform-specific subclass of BrowserAccessibility and 29 // a platform-specific subclass of BrowserAccessibility and
29 // BrowserAccessibilityManager. 30 // BrowserAccessibilityManager.
30 #undef PLATFORM_HAS_NATIVE_ACCESSIBILITY_IMPL 31 #undef PLATFORM_HAS_NATIVE_ACCESSIBILITY_IMPL
31 32
32 #if defined(OS_WIN) 33 #if defined(OS_WIN)
33 #define PLATFORM_HAS_NATIVE_ACCESSIBILITY_IMPL 1 34 #define PLATFORM_HAS_NATIVE_ACCESSIBILITY_IMPL 1
34 #endif 35 #endif
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 387
387 // The manager of this tree of accessibility objects. 388 // The manager of this tree of accessibility objects.
388 BrowserAccessibilityManager* manager_; 389 BrowserAccessibilityManager* manager_;
389 390
390 // The underlying node. 391 // The underlying node.
391 ui::AXNode* node_; 392 ui::AXNode* node_;
392 393
393 // A unique ID, since node IDs are frame-local. 394 // A unique ID, since node IDs are frame-local.
394 int32_t unique_id_; 395 int32_t unique_id_;
395 396
397 // The platform-specific object that implements the accessibility APIs for
398 // this node. Currently some of the platform-specific code is implemented by
399 // subclasses of BrowserAccessibility and some by |platform_node_|, but
400 // eventually we want all of that code to be in AXPlatformNode. See
401 // http://crbug.com/703369
402 ui::AXPlatformNode* platform_node_;
403
396 private: 404 private:
397 // |GetInnerText| recursively includes all the text from descendants such as 405 // |GetInnerText| recursively includes all the text from descendants such as
398 // text found in any embedded object. In contrast, |GetText| might include a 406 // text found in any embedded object. In contrast, |GetText| might include a
399 // special character in the place of every embedded object instead of its 407 // special character in the place of every embedded object instead of its
400 // text, depending on the platform. 408 // text, depending on the platform.
401 base::string16 GetInnerText() const; 409 base::string16 GetInnerText() const;
402 410
403 // If a bounding rectangle is empty, compute it based on the union of its 411 // If a bounding rectangle is empty, compute it based on the union of its
404 // children, since most accessibility APIs don't like elements with no 412 // children, since most accessibility APIs don't like elements with no
405 // bounds, but "virtual" elements in the accessibility tree that don't 413 // bounds, but "virtual" elements in the accessibility tree that don't
406 // correspond to a layed-out element sometimes don't have bounds. 414 // correspond to a layed-out element sometimes don't have bounds.
407 void FixEmptyBounds(gfx::RectF* bounds) const; 415 void FixEmptyBounds(gfx::RectF* bounds) const;
408 416
409 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibility); 417 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibility);
410 }; 418 };
411 419
412 } // namespace content 420 } // namespace content
413 421
414 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_H_ 422 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/accessibility/browser_accessibility.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698