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

Side by Side Diff: chrome/browser/ui/webui/media_router/media_router_webui_message_handler.cc

Issue 1920293004: Hide pseudo sinks when user has no hosted domain. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Pseudo sink empty domain test Created 4 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/webui/media_router/media_router_webui_message_handle r.h" 5 #include "chrome/browser/ui/webui/media_router/media_router_webui_message_handle r.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/metrics/histogram_macros.h" 10 #include "base/metrics/histogram_macros.h"
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 sink_val->SetString("name", sink.name()); 99 sink_val->SetString("name", sink.name());
100 sink_val->SetInteger("iconType", sink.icon_type()); 100 sink_val->SetInteger("iconType", sink.icon_type());
101 if (!sink.description().empty()) 101 if (!sink.description().empty())
102 sink_val->SetString("description", sink.description()); 102 sink_val->SetString("description", sink.description());
103 103
104 if (!user_domain.empty() && !sink.domain().empty()) { 104 if (!user_domain.empty() && !sink.domain().empty()) {
105 std::string domain = sink.domain(); 105 std::string domain = sink.domain();
106 // Convert default domains to user domain 106 // Convert default domains to user domain
107 if (sink.domain() == "default") { 107 if (sink.domain() == "default") {
108 domain = user_domain; 108 domain = user_domain;
109 if (domain == "NO_HOSTED_DOMAIN") { 109 if (domain == Profile::kNoHostedDomainFound) {
amp 2016/04/27 23:26:19 Thanks for updating this reference. :)
110 // Default domain will be empty for non-dasher accounts. 110 // Default domain will be empty for non-dasher accounts.
111 domain.clear(); 111 domain.clear();
112 } 112 }
113 } 113 }
114 114
115 sink_val->SetString("domain", domain); 115 sink_val->SetString("domain", domain);
116 116
117 show_email = true; 117 show_email = true;
118 if (!domain.empty() && domain != user_domain) 118 if (!domain.empty() && domain != user_domain)
119 show_domain = true; 119 show_domain = true;
(...skipping 750 matching lines...) Expand 10 before | Expand all | Expand 10 after
870 #endif // defined(GOOGLE_CHROME_BUILD) 870 #endif // defined(GOOGLE_CHROME_BUILD)
871 871
872 return AccountInfo(); 872 return AccountInfo();
873 } 873 }
874 874
875 void MediaRouterWebUIMessageHandler::SetWebUIForTest(content::WebUI* web_ui) { 875 void MediaRouterWebUIMessageHandler::SetWebUIForTest(content::WebUI* web_ui) {
876 set_web_ui(web_ui); 876 set_web_ui(web_ui);
877 } 877 }
878 878
879 } // namespace media_router 879 } // namespace media_router
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698