OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #include "components/omnibox/browser/physical_web_node.h" | |
6 | |
7 #include "base/strings/utf_string_conversions.h" | |
8 #include "base/values.h" | |
9 #include "components/physical_web/data_source/physical_web_data_source.h" | |
10 | |
11 PhysicalWebNode::PhysicalWebNode(const base::DictionaryValue& metadata_item) { | |
12 std::string title; | |
13 std::string url; | |
14 if (metadata_item.GetString(physical_web::kTitleKey, &title)) { | |
15 node_title_ = base::UTF8ToUTF16(title); | |
16 } | |
17 if (metadata_item.GetString(physical_web::kResolvedUrlKey, &url)) { | |
Mark P
2016/12/21 18:57:50
BTW, why do you use the resolved URL key here? Wh
mattreynolds
2016/12/21 22:25:58
The scanned URL is the URL broadcast by the Physic
Mark P
2016/12/21 23:21:40
Nice!
| |
18 node_url_ = GURL(url); | |
19 } | |
20 } | |
21 | |
22 PhysicalWebNode::~PhysicalWebNode() = default; | |
23 | |
24 const base::string16& PhysicalWebNode::GetTitledUrlNodeTitle() const { | |
25 return node_title_; | |
26 } | |
27 | |
28 const GURL& PhysicalWebNode::GetTitledUrlNodeUrl() const { | |
29 return node_url_; | |
30 } | |
OLD | NEW |