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

Side by Side Diff: chrome/test/webdriver/web_element_id.cc

Issue 7647026: base: Add three helper functions to Values API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix a typo Ceate -> Create Created 9 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/test/webdriver/session.cc ('k') | content/browser/gpu/gpu_data_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « chrome/test/webdriver/session.cc ('k') | content/browser/gpu/gpu_data_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698