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

Side by Side Diff: content/browser/accessibility/browser_accessibility_manager_mac.mm

Issue 2161623002: Fix BrowserAccessibilityManagerMac: set empty selected text range. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: y Created 4 years, 4 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 | no next file » | 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_manager_mac.h" 5 #include "content/browser/accessibility/browser_accessibility_manager_mac.h"
6 6
7 #import "base/mac/mac_util.h" 7 #import "base/mac/mac_util.h"
8 #import "base/mac/sdk_forward_declarations.h" 8 #import "base/mac/sdk_forward_declarations.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/strings/sys_string_conversions.h" 10 #include "base/strings/sys_string_conversions.h"
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after
418 [user_info setObject:@(AXTextSelectionGranularityUnknown) 418 [user_info setObject:@(AXTextSelectionGranularityUnknown)
419 forKey:NSAccessibilityTextSelectionGranularity]; 419 forKey:NSAccessibilityTextSelectionGranularity];
420 [user_info setObject:@YES forKey:NSAccessibilityTextSelectionChangedFocus]; 420 [user_info setObject:@YES forKey:NSAccessibilityTextSelectionChangedFocus];
421 421
422 int32_t focus_id = GetTreeData().sel_focus_object_id; 422 int32_t focus_id = GetTreeData().sel_focus_object_id;
423 BrowserAccessibility* focus_object = GetFromID(focus_id); 423 BrowserAccessibility* focus_object = GetFromID(focus_id);
424 if (focus_object) { 424 if (focus_object) {
425 focus_object = focus_object->GetClosestPlatformObject(); 425 focus_object = focus_object->GetClosestPlatformObject();
426 auto native_focus_object = ToBrowserAccessibilityCocoa(focus_object); 426 auto native_focus_object = ToBrowserAccessibilityCocoa(focus_object);
427 if (native_focus_object && [native_focus_object instanceActive]) { 427 if (native_focus_object && [native_focus_object instanceActive]) {
428 [user_info setObject:[native_focus_object selectedTextMarkerRange]
429 forKey:NSAccessibilitySelectedTextMarkerRangeAttribute];
430 [user_info setObject:native_focus_object 428 [user_info setObject:native_focus_object
431 forKey:NSAccessibilityTextChangeElement]; 429 forKey:NSAccessibilityTextChangeElement];
430
431 id selected_text = [native_focus_object selectedTextMarkerRange];
432 if (selected_text) {
433 [user_info setObject:selected_text
434 forKey:NSAccessibilitySelectedTextMarkerRangeAttribute];
435 }
432 } 436 }
433 } 437 }
434 438
435 return user_info; 439 return user_info;
436 } 440 }
437 441
438 NSDictionary* 442 NSDictionary*
439 BrowserAccessibilityManagerMac::GetUserInfoForValueChangedNotification( 443 BrowserAccessibilityManagerMac::GetUserInfoForValueChangedNotification(
440 const BrowserAccessibilityCocoa* native_node, 444 const BrowserAccessibilityCocoa* native_node,
441 const base::string16& deleted_text, 445 const base::string16& deleted_text,
(...skipping 19 matching lines...) Expand all
461 } 465 }
462 466
463 return @{ 467 return @{
464 NSAccessibilityTextStateChangeTypeKey : @(AXTextStateChangeTypeEdit), 468 NSAccessibilityTextStateChangeTypeKey : @(AXTextStateChangeTypeEdit),
465 NSAccessibilityTextChangeValues : changes, 469 NSAccessibilityTextChangeValues : changes,
466 NSAccessibilityTextChangeElement : native_node 470 NSAccessibilityTextChangeElement : native_node
467 }; 471 };
468 } 472 }
469 473
470 } // namespace content 474 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698