| OLD | NEW |
| 1 // Copyright (c) 2011 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_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 DomAutomationController::DomAutomationController() | 13 DomAutomationController::DomAutomationController() |
| 14 : sender_(NULL), | 14 : sender_(NULL), |
| 15 routing_id_(MSG_ROUTING_NONE), | 15 routing_id_(MSG_ROUTING_NONE), |
| 16 automation_id_(MSG_ROUTING_NONE) { | 16 automation_id_(MSG_ROUTING_NONE) { |
| 17 BindCallback("send", base::Bind(&DomAutomationController::Send, | 17 BindCallback("send", base::Bind(&DomAutomationController::Send, |
| 18 base::Unretained(this))); | 18 base::Unretained(this))); |
| 19 BindCallback("setAutomationId", | 19 BindCallback("setAutomationId", |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 // The check here is for NumberType and not Int32 as | 131 // The check here is for NumberType and not Int32 as |
| 132 // KJS::JSType only defines a NumberType (no Int32) | 132 // KJS::JSType only defines a NumberType (no Int32) |
| 133 if (!args[0].isNumber()) { | 133 if (!args[0].isNumber()) { |
| 134 result->SetNull(); | 134 result->SetNull(); |
| 135 return; | 135 return; |
| 136 } | 136 } |
| 137 | 137 |
| 138 automation_id_ = args[0].ToInt32(); | 138 automation_id_ = args[0].ToInt32(); |
| 139 result->Set(true); | 139 result->Set(true); |
| 140 } | 140 } |
| OLD | NEW |