| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/accessibility_event_recorder.h" | 5 #include "content/browser/accessibility/accessibility_event_recorder.h" |
| 6 | 6 |
| 7 #include <oleacc.h> | 7 #include <oleacc.h> |
| 8 #include <stdint.h> |
| 8 | 9 |
| 9 #include <string> | 10 #include <string> |
| 10 | 11 |
| 11 #include "base/strings/string_number_conversions.h" | 12 #include "base/strings/string_number_conversions.h" |
| 12 #include "base/strings/string_piece.h" | 13 #include "base/strings/string_piece.h" |
| 13 #include "base/strings/string_util.h" | 14 #include "base/strings/string_util.h" |
| 14 #include "base/strings/stringprintf.h" | 15 #include "base/strings/stringprintf.h" |
| 15 #include "base/strings/utf_string_conversions.h" | 16 #include "base/strings/utf_string_conversions.h" |
| 16 #include "base/win/scoped_bstr.h" | 17 #include "base/win/scoped_bstr.h" |
| 17 #include "base/win/scoped_comptr.h" | 18 #include "base/win/scoped_comptr.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 // children, with an "embedded object character" for each non-text child. | 59 // children, with an "embedded object character" for each non-text child. |
| 59 // Pretty-print the embedded object character as <obj> so that test output | 60 // Pretty-print the embedded object character as <obj> so that test output |
| 60 // is human-readable. | 61 // is human-readable. |
| 61 base::StringPiece16 embedded_character( | 62 base::StringPiece16 embedded_character( |
| 62 &BrowserAccessibilityWin::kEmbeddedCharacter, 1); | 63 &BrowserAccessibilityWin::kEmbeddedCharacter, 1); |
| 63 base::ReplaceChars(str16, embedded_character, L"<obj>", &str16); | 64 base::ReplaceChars(str16, embedded_character, L"<obj>", &str16); |
| 64 | 65 |
| 65 return base::UTF16ToUTF8(str16); | 66 return base::UTF16ToUTF8(str16); |
| 66 } | 67 } |
| 67 | 68 |
| 68 std::string AccessibilityEventToStringUTF8(int32 event_id) { | 69 std::string AccessibilityEventToStringUTF8(int32_t event_id) { |
| 69 return base::UTF16ToUTF8(AccessibilityEventToString(event_id)); | 70 return base::UTF16ToUTF8(AccessibilityEventToString(event_id)); |
| 70 } | 71 } |
| 71 | 72 |
| 72 } // namespace | 73 } // namespace |
| 73 | 74 |
| 74 class AccessibilityEventRecorderWin : public AccessibilityEventRecorder { | 75 class AccessibilityEventRecorderWin : public AccessibilityEventRecorder { |
| 75 public: | 76 public: |
| 76 explicit AccessibilityEventRecorderWin(BrowserAccessibilityManager* manager); | 77 explicit AccessibilityEventRecorderWin(BrowserAccessibilityManager* manager); |
| 77 ~AccessibilityEventRecorderWin() override; | 78 ~AccessibilityEventRecorderWin() override; |
| 78 | 79 |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 if (accessibility_hwnd != hwnd) | 287 if (accessibility_hwnd != hwnd) |
| 287 return E_FAIL; | 288 return E_FAIL; |
| 288 | 289 |
| 289 IAccessible* obj = manager_->GetRoot()->ToBrowserAccessibilityWin(); | 290 IAccessible* obj = manager_->GetRoot()->ToBrowserAccessibilityWin(); |
| 290 obj->AddRef(); | 291 obj->AddRef(); |
| 291 *ppv_object = obj; | 292 *ppv_object = obj; |
| 292 return S_OK; | 293 return S_OK; |
| 293 } | 294 } |
| 294 | 295 |
| 295 } // namespace content | 296 } // namespace content |
| OLD | NEW |