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

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

Issue 2707263011: Test aria-pressed=mixed on windows (Closed)
Patch Set: git cl try Created 3 years, 6 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_manager_mac.h" 5 #include "content/browser/accessibility/browser_accessibility_manager_mac.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #import "base/mac/mac_util.h" 8 #import "base/mac/mac_util.h"
9 #import "base/mac/scoped_nsobject.h" 9 #import "base/mac/scoped_nsobject.h"
10 #import "base/mac/sdk_forward_declarations.h" 10 #import "base/mac/sdk_forward_declarations.h"
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
404 while (i < old_text.length() && i < new_text.length() && 404 while (i < old_text.length() && i < new_text.length() &&
405 old_text[i] == new_text[i]) { 405 old_text[i] == new_text[i]) {
406 ++i; 406 ++i;
407 } 407 }
408 size_t length = (old_text.length() - i) - (new_text.length() - i); 408 size_t length = (old_text.length() - i) - (new_text.length() - i);
409 base::string16 deleted_text = old_text.substr(i, length); 409 base::string16 deleted_text = old_text.substr(i, length);
410 text_edits_[new_node_data.id] = deleted_text; 410 text_edits_[new_node_data.id] = deleted_text;
411 } 411 }
412 } 412 }
413 413
414 void BrowserAccessibilityManagerMac::OnStateChanged(ui::AXTree* tree,
415 ui::AXNode* ax_node,
416 ui::AXState state,
417 bool new_value) {
418 if (state != ui::AX_STATE_PRESSED)
419 return;
420
421 BrowserAccessibility* node = GetFromID(ax_node->id());
422 NotifyAccessibilityEvent(BrowserAccessibilityEvent::FromTreeChange,
423 ui::AX_EVENT_CHECKED_STATE_CHANGED, node);
424 }
425
426 NSDictionary* BrowserAccessibilityManagerMac:: 414 NSDictionary* BrowserAccessibilityManagerMac::
427 GetUserInfoForSelectedTextChangedNotification() { 415 GetUserInfoForSelectedTextChangedNotification() {
428 NSMutableDictionary* user_info = [[[NSMutableDictionary alloc] init] 416 NSMutableDictionary* user_info = [[[NSMutableDictionary alloc] init]
429 autorelease]; 417 autorelease];
430 [user_info setObject:@YES forKey:NSAccessibilityTextStateSyncKey]; 418 [user_info setObject:@YES forKey:NSAccessibilityTextStateSyncKey];
431 [user_info setObject:@(AXTextStateChangeTypeUnknown) 419 [user_info setObject:@(AXTextStateChangeTypeUnknown)
432 forKey:NSAccessibilityTextStateChangeTypeKey]; 420 forKey:NSAccessibilityTextStateChangeTypeKey];
433 [user_info setObject:@(AXTextSelectionDirectionUnknown) 421 [user_info setObject:@(AXTextSelectionDirectionUnknown)
434 forKey:NSAccessibilityTextSelectionDirection]; 422 forKey:NSAccessibilityTextSelectionDirection];
435 [user_info setObject:@(AXTextSelectionGranularityUnknown) 423 [user_info setObject:@(AXTextSelectionGranularityUnknown)
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
486 NSAccessibilityTextChangeValues : changes, 474 NSAccessibilityTextChangeValues : changes,
487 NSAccessibilityTextChangeElement : native_node 475 NSAccessibilityTextChangeElement : native_node
488 }; 476 };
489 } 477 }
490 478
491 NSView* BrowserAccessibilityManagerMac::GetParentView() { 479 NSView* BrowserAccessibilityManagerMac::GetParentView() {
492 return delegate() ? delegate()->AccessibilityGetAcceleratedWidget() : nullptr; 480 return delegate() ? delegate()->AccessibilityGetAcceleratedWidget() : nullptr;
493 } 481 }
494 482
495 } // namespace content 483 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698