| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/web_ui_bindings.h" | 5 #include "content/renderer/web_ui_bindings.h" |
| 6 | 6 |
| 7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
| 9 #include "base/values.h" | 9 #include "base/values.h" |
| 10 #include "content/common/view_messages.h" | 10 #include "content/common/view_messages.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 // We currently assume all objects are arrays. | 31 // We currently assume all objects are arrays. |
| 32 std::vector<CppVariant> vector = value.ToVector(); | 32 std::vector<CppVariant> vector = value.ToVector(); |
| 33 ListValue* list = new ListValue(); | 33 ListValue* list = new ListValue(); |
| 34 for (size_t i = 0; i < vector.size(); ++i) { | 34 for (size_t i = 0; i < vector.size(); ++i) { |
| 35 list->Append(CreateValueFromCppVariant(vector[i])); | 35 list->Append(CreateValueFromCppVariant(vector[i])); |
| 36 } | 36 } |
| 37 return list; | 37 return list; |
| 38 } | 38 } |
| 39 | 39 |
| 40 // Covers null and undefined. | 40 // Covers null and undefined. |
| 41 return Value::CreateNullValue(); | 41 return base::NullValue(); |
| 42 } | 42 } |
| 43 | 43 |
| 44 } // namespace | 44 } // namespace |
| 45 | 45 |
| 46 DOMBoundBrowserObject::DOMBoundBrowserObject() | 46 DOMBoundBrowserObject::DOMBoundBrowserObject() |
| 47 : sender_(NULL), | 47 : sender_(NULL), |
| 48 routing_id_(0) { | 48 routing_id_(0) { |
| 49 } | 49 } |
| 50 | 50 |
| 51 DOMBoundBrowserObject::~DOMBoundBrowserObject() { | 51 DOMBoundBrowserObject::~DOMBoundBrowserObject() { |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 *(static_cast<ListValue*>(content.get())))); | 96 *(static_cast<ListValue*>(content.get())))); |
| 97 } | 97 } |
| 98 | 98 |
| 99 void DOMBoundBrowserObject::SetProperty(const std::string& name, | 99 void DOMBoundBrowserObject::SetProperty(const std::string& name, |
| 100 const std::string& value) { | 100 const std::string& value) { |
| 101 CppVariant* cpp_value = new CppVariant; | 101 CppVariant* cpp_value = new CppVariant; |
| 102 cpp_value->Set(value); | 102 cpp_value->Set(value); |
| 103 BindProperty(name, cpp_value); | 103 BindProperty(name, cpp_value); |
| 104 properties_.push_back(cpp_value); | 104 properties_.push_back(cpp_value); |
| 105 } | 105 } |
| OLD | NEW |