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

Unified Diff: chrome/renderer/extensions/automation_internal_custom_bindings.cc

Issue 2903973002: Rich editable text implementation using spannables (Closed)
Patch Set: Make boolean expressions explicit. 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 side-by-side diff with in-line comments
Download patch
Index: chrome/renderer/extensions/automation_internal_custom_bindings.cc
diff --git a/chrome/renderer/extensions/automation_internal_custom_bindings.cc b/chrome/renderer/extensions/automation_internal_custom_bindings.cc
index 9f629dea7457e6d7d23b6f3d388acff05b04d832..4121198fccece808327f84a5ce7313bae31a86fb 100644
--- a/chrome/renderer/extensions/automation_internal_custom_bindings.cc
+++ b/chrome/renderer/extensions/automation_internal_custom_bindings.cc
@@ -742,6 +742,34 @@ AutomationInternalCustomBindings::AutomationInternalCustomBindings(
std::string name_from_str = ui::ToString(name_from);
result.Set(v8::String::NewFromUtf8(isolate, name_from_str.c_str()));
});
+ RouteNodeIDFunction(
+ "GetBold", [](v8::Isolate* isolate, v8::ReturnValue<v8::Value> result,
+ TreeCache* cache, ui::AXNode* node) {
+ bool value = (node->data().GetIntAttribute(ui::AX_ATTR_TEXT_STYLE) &
+ ui::AX_TEXT_STYLE_BOLD) != 0;
+ result.Set(v8::Boolean::New(isolate, value));
+ });
+ RouteNodeIDFunction(
+ "GetItalic", [](v8::Isolate* isolate, v8::ReturnValue<v8::Value> result,
+ TreeCache* cache, ui::AXNode* node) {
+ bool value = (node->data().GetIntAttribute(ui::AX_ATTR_TEXT_STYLE) &
+ ui::AX_TEXT_STYLE_ITALIC) != 0;
+ result.Set(v8::Boolean::New(isolate, value));
+ });
+ RouteNodeIDFunction("GetUnderline", [](v8::Isolate* isolate,
+ v8::ReturnValue<v8::Value> result,
+ TreeCache* cache, ui::AXNode* node) {
+ bool value = (node->data().GetIntAttribute(ui::AX_ATTR_TEXT_STYLE) &
+ ui::AX_TEXT_STYLE_UNDERLINE) != 0;
+ result.Set(v8::Boolean::New(isolate, value));
+ });
+ RouteNodeIDFunction("GetLineThrough", [](v8::Isolate* isolate,
+ v8::ReturnValue<v8::Value> result,
+ TreeCache* cache, ui::AXNode* node) {
+ bool value = (node->data().GetIntAttribute(ui::AX_ATTR_TEXT_STYLE) &
+ ui::AX_TEXT_STYLE_LINE_THROUGH) != 0;
+ result.Set(v8::Boolean::New(isolate, value));
+ });
RouteNodeIDFunction("GetChecked", [](v8::Isolate* isolate,
v8::ReturnValue<v8::Value> result,
TreeCache* cache, ui::AXNode* node) {
« no previous file with comments | « chrome/common/extensions/api/automation.idl ('k') | chrome/renderer/resources/extensions/automation/automation_node.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698