| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/renderer/dom_automation_controller.h" | 5 #include "content/renderer/dom_automation_controller.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/json/json_string_value_serializer.h" | 9 #include "base/json/json_string_value_serializer.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| 11 #include "content/common/view_messages.h" | 11 #include "content/common/view_messages.h" |
| 12 | 12 |
| 13 using webkit_glue::CppArgumentList; |
| 14 using webkit_glue::CppVariant; |
| 15 |
| 13 DomAutomationController::DomAutomationController() | 16 DomAutomationController::DomAutomationController() |
| 14 : sender_(NULL), | 17 : sender_(NULL), |
| 15 routing_id_(MSG_ROUTING_NONE), | 18 routing_id_(MSG_ROUTING_NONE), |
| 16 automation_id_(MSG_ROUTING_NONE) { | 19 automation_id_(MSG_ROUTING_NONE) { |
| 17 BindCallback("send", base::Bind(&DomAutomationController::Send, | 20 BindCallback("send", base::Bind(&DomAutomationController::Send, |
| 18 base::Unretained(this))); | 21 base::Unretained(this))); |
| 19 BindCallback("setAutomationId", | 22 BindCallback("setAutomationId", |
| 20 base::Bind(&DomAutomationController::SetAutomationId, | 23 base::Bind(&DomAutomationController::SetAutomationId, |
| 21 base::Unretained(this))); | 24 base::Unretained(this))); |
| 22 BindCallback("sendJSON", base::Bind(&DomAutomationController::SendJSON, | 25 BindCallback("sendJSON", base::Bind(&DomAutomationController::SendJSON, |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 // The check here is for NumberType and not Int32 as | 159 // The check here is for NumberType and not Int32 as |
| 157 // KJS::JSType only defines a NumberType (no Int32) | 160 // KJS::JSType only defines a NumberType (no Int32) |
| 158 if (!args[0].isNumber()) { | 161 if (!args[0].isNumber()) { |
| 159 result->SetNull(); | 162 result->SetNull(); |
| 160 return; | 163 return; |
| 161 } | 164 } |
| 162 | 165 |
| 163 automation_id_ = args[0].ToInt32(); | 166 automation_id_ = args[0].ToInt32(); |
| 164 result->Set(true); | 167 result->Set(true); |
| 165 } | 168 } |
| OLD | NEW |