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

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

Issue 2154213007: Replace gfx::Rect with gfx::RectF in ui::AXNodeData (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix win compile Created 4 years, 5 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 (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 "base/strings/utf_string_conversions.h" 14 #include "base/strings/utf_string_conversions.h"
15 #include "content/browser/accessibility/browser_accessibility_manager.h" 15 #include "content/browser/accessibility/browser_accessibility_manager.h"
16 #include "content/common/accessibility_messages.h" 16 #include "content/common/accessibility_messages.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_node.h"
19 #include "ui/gfx/geometry/rect_conversions.h"
19 #include "ui/gfx/geometry/rect_f.h" 20 #include "ui/gfx/geometry/rect_f.h"
20 21
21 namespace content { 22 namespace content {
22 23
23 namespace { 24 namespace {
24 25
25 // Map from unique_id to BrowserAccessibility 26 // Map from unique_id to BrowserAccessibility
26 using UniqueIDMap = base::hash_map<int32_t, BrowserAccessibility*>; 27 using UniqueIDMap = base::hash_map<int32_t, BrowserAccessibility*>;
27 base::LazyInstance<UniqueIDMap> g_unique_id_map = LAZY_INSTANCE_INITIALIZER; 28 base::LazyInstance<UniqueIDMap> g_unique_id_map = LAZY_INSTANCE_INITIALIZER;
28 29
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 333
333 const ui::AXNodeData& BrowserAccessibility::GetData() const { 334 const ui::AXNodeData& BrowserAccessibility::GetData() const {
334 CR_DEFINE_STATIC_LOCAL(ui::AXNodeData, empty_data, ()); 335 CR_DEFINE_STATIC_LOCAL(ui::AXNodeData, empty_data, ());
335 if (node_) 336 if (node_)
336 return node_->data(); 337 return node_->data();
337 else 338 else
338 return empty_data; 339 return empty_data;
339 } 340 }
340 341
341 gfx::Rect BrowserAccessibility::GetLocation() const { 342 gfx::Rect BrowserAccessibility::GetLocation() const {
342 return GetData().location; 343 return gfx::ToEnclosingRect(GetData().location);
343 } 344 }
344 345
345 int32_t BrowserAccessibility::GetRole() const { 346 int32_t BrowserAccessibility::GetRole() const {
346 return GetData().role; 347 return GetData().role;
347 } 348 }
348 349
349 int32_t BrowserAccessibility::GetState() const { 350 int32_t BrowserAccessibility::GetState() const {
350 return GetData().state; 351 return GetData().state;
351 } 352 }
352 353
(...skipping 850 matching lines...) Expand 10 before | Expand all | Expand 10 after
1203 break; 1204 break;
1204 1205
1205 manager = root->GetParent()->manager(); 1206 manager = root->GetParent()->manager();
1206 root = manager->GetRoot(); 1207 root = manager->GetRoot();
1207 } 1208 }
1208 1209
1209 return bounds; 1210 return bounds;
1210 } 1211 }
1211 1212
1212 } // namespace content 1213 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698