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

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

Issue 2873683003: Use BrowserAccessibilityComWin::Destroy to clear delegate and owner. (Closed)
Patch Set: simple Created 3 years, 7 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) 2017 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2017 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_com_win.h" 5 #include "content/browser/accessibility/browser_accessibility_com_win.h"
6 6
7 #include <UIAutomationClient.h> 7 #include <UIAutomationClient.h>
8 #include <UIAutomationCoreApi.h> 8 #include <UIAutomationCoreApi.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 4076 matching lines...) Expand 10 before | Expand all | Expand 10 after
4087 4087
4088 BrowserAccessibilityManager* BrowserAccessibilityComWin::Manager() const { 4088 BrowserAccessibilityManager* BrowserAccessibilityComWin::Manager() const {
4089 auto* owner = GetOwner(); 4089 auto* owner = GetOwner();
4090 DCHECK(owner); 4090 DCHECK(owner);
4091 4091
4092 auto* manager = owner->manager(); 4092 auto* manager = owner->manager();
4093 DCHECK(manager); 4093 DCHECK(manager);
4094 return manager; 4094 return manager;
4095 } 4095 }
4096 4096
4097 //
4098 // AXPlatformNode overrides
4099 //
4100 void BrowserAccessibilityComWin::Destroy() {
4101 // Detach BrowserAccessibilityWin from us.
4102 owner_ = nullptr;
4103 AXPlatformNodeWin::Destroy();
4104 }
4105
4097 std::vector<base::string16> BrowserAccessibilityComWin::ComputeTextAttributes() 4106 std::vector<base::string16> BrowserAccessibilityComWin::ComputeTextAttributes()
4098 const { 4107 const {
4099 std::vector<base::string16> attributes; 4108 std::vector<base::string16> attributes;
4100 4109
4101 // We include list markers for now, but there might be other objects that are 4110 // We include list markers for now, but there might be other objects that are
4102 // auto generated. 4111 // auto generated.
4103 // TODO(nektar): Compute what objects are auto-generated in Blink. 4112 // TODO(nektar): Compute what objects are auto-generated in Blink.
4104 if (GetOwner()->GetRole() == ui::AX_ROLE_LIST_MARKER) 4113 if (GetOwner()->GetRole() == ui::AX_ROLE_LIST_MARKER)
4105 attributes.push_back(L"auto-generated:true"); 4114 attributes.push_back(L"auto-generated:true");
4106 else 4115 else
(...skipping 1618 matching lines...) Expand 10 before | Expand all | Expand 10 after
5725 5734
5726 BrowserAccessibilityComWin* ToBrowserAccessibilityComWin( 5735 BrowserAccessibilityComWin* ToBrowserAccessibilityComWin(
5727 BrowserAccessibility* obj) { 5736 BrowserAccessibility* obj) {
5728 if (!obj || !obj->IsNative()) 5737 if (!obj || !obj->IsNative())
5729 return nullptr; 5738 return nullptr;
5730 auto* result = static_cast<BrowserAccessibilityWin*>(obj)->GetCOM(); 5739 auto* result = static_cast<BrowserAccessibilityWin*>(obj)->GetCOM();
5731 return result; 5740 return result;
5732 } 5741 }
5733 5742
5734 } // namespace content 5743 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698