| 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 "chrome/test/webdriver/web_element_id.h" | 5 #include "chrome/test/webdriver/web_element_id.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/values.h" | 8 #include "base/values.h" |
| 9 | 9 |
| 10 namespace { | 10 namespace { |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 is_valid_ = static_cast<DictionaryValue*>(value)-> | 36 is_valid_ = static_cast<DictionaryValue*>(value)-> |
| 37 GetString(kWebElementKey, &id_); | 37 GetString(kWebElementKey, &id_); |
| 38 } | 38 } |
| 39 } | 39 } |
| 40 | 40 |
| 41 WebElementId::~WebElementId() {} | 41 WebElementId::~WebElementId() {} |
| 42 | 42 |
| 43 Value* WebElementId::ToValue() const { | 43 Value* WebElementId::ToValue() const { |
| 44 CHECK(is_valid_); | 44 CHECK(is_valid_); |
| 45 if (id_.empty()) | 45 if (id_.empty()) |
| 46 return Value::CreateNullValue(); | 46 return base::NullValue(); |
| 47 DictionaryValue* element = new DictionaryValue(); | 47 DictionaryValue* element = new DictionaryValue(); |
| 48 element->SetString(kWebElementKey, id_); | 48 element->SetString(kWebElementKey, id_); |
| 49 return element; | 49 return element; |
| 50 } | 50 } |
| 51 | 51 |
| 52 bool WebElementId::is_valid() const { | 52 bool WebElementId::is_valid() const { |
| 53 return is_valid_; | 53 return is_valid_; |
| 54 } | 54 } |
| 55 | 55 |
| 56 } // namespace webdriver | 56 } // namespace webdriver |
| OLD | NEW |