Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CONTENT_PUBLIC_BROWSER_VOICE_INTERACTION_HELPER_H_ | |
| 6 #define CONTENT_PUBLIC_BROWSER_VOICE_INTERACTION_HELPER_H_ | |
| 7 | |
| 8 #include <stdint.h> | |
| 9 | |
| 10 #include <memory> | |
| 11 #include <vector> | |
| 12 | |
| 13 #include "base/callback.h" | |
| 14 #include "base/strings/string16.h" | |
| 15 #include "ui/gfx/geometry/rect.h" | |
| 16 | |
| 17 namespace content { | |
| 18 | |
| 19 class WebContents; | |
| 20 | |
| 21 // An intermediate representation of the Accessibility snapshot | |
| 22 // for voice interaction. The field names are kept consistent | |
| 23 // with AccessibilitySnapshotNode.java. | |
| 24 struct AXViewStructure { | |
| 25 gfx::Rect rect; | |
| 26 base::string16 text; | |
| 27 float text_size; | |
| 28 int32_t color; | |
| 29 int32_t bgcolor; | |
| 30 bool bold; | |
| 31 bool italic; | |
| 32 bool underline; | |
| 33 bool line_through; | |
| 34 | |
| 35 bool has_selection; | |
| 36 int32_t start_selection; | |
| 37 int32_t end_selection; | |
| 38 | |
| 39 std::string class_name; | |
| 40 std::vector<std::unique_ptr<AXViewStructure>> children; | |
| 41 | |
| 42 AXViewStructure(); | |
|
Luis Héctor Chávez
2017/04/03 23:24:12
Do you need the explicit ctor/dtor?
Muyuan
2017/04/04 00:39:39
Yes.. otherwise the CQ dry run just fails with "Co
| |
| 43 ~AXViewStructure(); | |
| 44 DISALLOW_COPY_AND_ASSIGN(AXViewStructure); | |
|
Luis Héctor Chávez
2017/04/03 23:24:12
nit: make this private.
Muyuan
2017/04/04 00:39:39
Done.
| |
| 45 }; | |
| 46 | |
| 47 void GetAXViewStructure( | |
| 48 WebContents* web_contents, | |
| 49 const base::Callback<void(std::unique_ptr<AXViewStructure>)>& callback); | |
| 50 | |
| 51 } // namespace android | |
| 52 | |
| 53 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_VOICE_INTERACTION_HELPER_H_ | |
| OLD | NEW |