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

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

Issue 2635613002: Replace deprecated calls to GetMetadata in Physical Web omnibox provider (Closed)
Patch Set: fix tests 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
« no previous file with comments | « components/omnibox/browser/physical_web_node.h ('k') | components/omnibox/browser/physical_web_provider.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
index 893da436d9a57ee0611da72bddcf002b754ecee6..86de49ef5cfefb582b6b4407b20d68b146e53854 100644
--- a/components/omnibox/browser/physical_web_node.cc
+++ b/components/omnibox/browser/physical_web_node.cc
@@ -5,18 +5,11 @@
#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(const physical_web::Metadata& metadata_item)
+ : node_title_(base::UTF8ToUTF16(metadata_item.title)),
+ node_url_(metadata_item.resolved_url) {
}
PhysicalWebNode::~PhysicalWebNode() = default;
« no previous file with comments | « components/omnibox/browser/physical_web_node.h ('k') | components/omnibox/browser/physical_web_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698