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

Unified Diff: components/omnibox/browser/physical_web_node.cc

Issue 2591053002: Show PhysicalWebProvider suggestions with omnibox input (Closed)
Patch Set: sync with changes in prereq CL Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: components/omnibox/browser/physical_web_node.cc
diff --git a/components/omnibox/browser/physical_web_node.cc b/components/omnibox/browser/physical_web_node.cc
new file mode 100644
index 0000000000000000000000000000000000000000..893da436d9a57ee0611da72bddcf002b754ecee6
--- /dev/null
+++ b/components/omnibox/browser/physical_web_node.cc
@@ -0,0 +1,30 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "components/omnibox/browser/physical_web_node.h"
+
+#include "base/strings/utf_string_conversions.h"
+#include "base/values.h"
+#include "components/physical_web/data_source/physical_web_data_source.h"
+
+PhysicalWebNode::PhysicalWebNode(const base::DictionaryValue& metadata_item) {
+ std::string title;
+ std::string url;
+ if (metadata_item.GetString(physical_web::kTitleKey, &title)) {
+ node_title_ = base::UTF8ToUTF16(title);
+ }
+ if (metadata_item.GetString(physical_web::kResolvedUrlKey, &url)) {
+ node_url_ = GURL(url);
+ }
+}
+
+PhysicalWebNode::~PhysicalWebNode() = default;
+
+const base::string16& PhysicalWebNode::GetTitledUrlNodeTitle() const {
+ return node_title_;
+}
+
+const GURL& PhysicalWebNode::GetTitledUrlNodeUrl() const {
+ return node_url_;
+}

Powered by Google App Engine
This is Rietveld 408576698