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 "chrome/renderer/extensions/automation_internal_custom_bindings.h" | 5 #include "chrome/renderer/extensions/automation_internal_custom_bindings.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #include "chrome/common/extensions/manifest_handlers/automation.h" | |
11 #include "content/public/renderer/v8_value_converter.h" | 10 #include "content/public/renderer/v8_value_converter.h" |
12 #include "extensions/common/extension.h" | 11 #include "extensions/common/extension.h" |
13 #include "extensions/common/manifest.h" | 12 #include "extensions/common/manifest.h" |
| 13 #include "extensions/common/permissions/automation_permission_data.h" |
14 #include "extensions/renderer/script_context.h" | 14 #include "extensions/renderer/script_context.h" |
15 #include "ui/accessibility/ax_enums.h" | 15 #include "ui/accessibility/ax_enums.h" |
16 | 16 |
17 namespace { | 17 namespace { |
18 | 18 |
19 // Helper to convert an enum to a V8 object. | 19 // Helper to convert an enum to a V8 object. |
20 template <typename EnumType> | 20 template <typename EnumType> |
21 v8::Local<v8::Object> ToEnumObject(v8::Isolate* isolate, | 21 v8::Local<v8::Object> ToEnumObject(v8::Isolate* isolate, |
22 EnumType start_after, | 22 EnumType start_after, |
23 EnumType end_at) { | 23 EnumType end_at) { |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 ToEnumObject(GetIsolate(), ui::AX_ROLE_NONE, ui::AX_ROLE_LAST)); | 72 ToEnumObject(GetIsolate(), ui::AX_ROLE_NONE, ui::AX_ROLE_LAST)); |
73 | 73 |
74 additions->Set( | 74 additions->Set( |
75 v8::String::NewFromUtf8(GetIsolate(), "StateType"), | 75 v8::String::NewFromUtf8(GetIsolate(), "StateType"), |
76 ToEnumObject(GetIsolate(), ui::AX_STATE_NONE, ui::AX_STATE_LAST)); | 76 ToEnumObject(GetIsolate(), ui::AX_STATE_NONE, ui::AX_STATE_LAST)); |
77 | 77 |
78 args.GetReturnValue().Set(additions); | 78 args.GetReturnValue().Set(additions); |
79 } | 79 } |
80 | 80 |
81 } // namespace extensions | 81 } // namespace extensions |
OLD | NEW |