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

Unified Diff: chrome/browser/local_discovery/device_description.cc

Issue 1553333002: Move cloud print specific files out of local_discovery (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@moveprn
Patch Set: Created 4 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 | « chrome/browser/local_discovery/device_description.h ('k') | chrome/browser/local_discovery/gcd_api_flow.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/local_discovery/device_description.cc
diff --git a/chrome/browser/local_discovery/device_description.cc b/chrome/browser/local_discovery/device_description.cc
deleted file mode 100644
index f3bd4974a293c21adc381d660f348b061c0509d1..0000000000000000000000000000000000000000
--- a/chrome/browser/local_discovery/device_description.cc
+++ /dev/null
@@ -1,58 +0,0 @@
-// Copyright 2014 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 "chrome/browser/local_discovery/device_description.h"
-
-#include <vector>
-
-#include "base/strings/string_number_conversions.h"
-#include "base/strings/string_util.h"
-#include "chrome/browser/local_discovery/privet_constants.h"
-#include "chrome/common/local_discovery/service_discovery_client.h"
-
-namespace local_discovery {
-
-namespace {
-
-std::string GetValueByName(const std::vector<std::string>& metadata,
- const std::string& name) {
- std::string prefix(name + "=");
- for (const std::string& record : metadata) {
- if (base::StartsWith(record, prefix,
- base::CompareCase::INSENSITIVE_ASCII)) {
- return record.substr(prefix.size());
- }
- }
- return std::string();
-}
-
-} // namespace
-
-DeviceDescription::DeviceDescription() : version(0) {
-}
-
-DeviceDescription::DeviceDescription(
- const ServiceDescription& service_description) {
- address = service_description.address;
-
- const std::vector<std::string>& metadata = service_description.metadata;
- if (!base::StringToInt(GetValueByName(metadata, kPrivetTxtKeyVersion),
- &version)) {
- version = 0;
- }
- name = GetValueByName(metadata, kPrivetTxtKeyName);
- description = GetValueByName(metadata, kPrivetTxtKeyDescription);
- if (version >= 3) {
- type = GetValueByName(metadata, kPrivetTxtKeyDevicesClass);
- id = GetValueByName(metadata, kPrivetTxtKeyGcdID);
- } else {
- type = GetValueByName(metadata, kPrivetTxtKeyType);
- id = GetValueByName(metadata, kPrivetTxtKeyID);
- }
-}
-
-DeviceDescription::~DeviceDescription() {
-}
-
-} // namespace local_discovery
« no previous file with comments | « chrome/browser/local_discovery/device_description.h ('k') | chrome/browser/local_discovery/gcd_api_flow.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698