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

Unified Diff: chrome/browser/ui/webui/media_router/media_cast_mode.cc

Issue 1363593003: [Media Router] Set timeout for route creation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changes per imcheng@'s comments and offline conversation. Rebase (forgot to upload separately, sorry!). Created 5 years, 3 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: chrome/browser/ui/webui/media_router/media_cast_mode.cc
diff --git a/chrome/browser/ui/webui/media_router/media_cast_mode.cc b/chrome/browser/ui/webui/media_router/media_cast_mode.cc
index 2ea1bbc6de85094c0b931cab798d0ccaaa1e0df1..b9cc136489d10c67b0dc033f90ecfd1843206e6b 100644
--- a/chrome/browser/ui/webui/media_router/media_cast_mode.cc
+++ b/chrome/browser/ui/webui/media_router/media_cast_mode.cc
@@ -7,35 +7,17 @@
#include "base/logging.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/grit/generated_resources.h"
-#include "net/base/registry_controlled_domains/registry_controlled_domain.h"
#include "ui/base/l10n/l10n_util.h"
namespace media_router {
-namespace {
-
-std::string TruncateHostToRegisteredDomain(const std::string& host) {
- const std::string truncated =
- net::registry_controlled_domains::GetDomainAndRegistry(
- host,
- net::registry_controlled_domains::EXCLUDE_PRIVATE_REGISTRIES);
- // The truncation will be empty in some scenarios (e.g. host is
- // simply an IP address). Fail gracefully.
- if (truncated.empty()) {
- return host;
- }
- return truncated;
-}
-
-} // namespace
-
std::string MediaCastModeToDescription(
MediaCastMode mode, const std::string& host) {
switch (mode) {
case MediaCastMode::DEFAULT:
return l10n_util::GetStringFUTF8(
IDS_MEDIA_ROUTER_DEFAULT_CAST_MODE,
- base::UTF8ToUTF16(TruncateHostToRegisteredDomain(host)));
+ base::UTF8ToUTF16(host));
case MediaCastMode::TAB_MIRROR:
return l10n_util::GetStringUTF8(
IDS_MEDIA_ROUTER_TAB_MIRROR_CAST_MODE);

Powered by Google App Engine
This is Rietveld 408576698