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

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

Issue 1821823002: [Media Router] Conditionally enable mDNS on Windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed compile and build dependency issues Created 4 years, 9 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_ui.h" 5 #include "chrome/browser/ui/webui/media_router/media_router_ui.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 10
11 #include "base/guid.h" 11 #include "base/guid.h"
12 #include "base/i18n/string_compare.h" 12 #include "base/i18n/string_compare.h"
13 #include "base/macros.h" 13 #include "base/macros.h"
14 #include "base/strings/string_util.h" 14 #include "base/strings/string_util.h"
15 #include "base/strings/utf_string_conversions.h" 15 #include "base/strings/utf_string_conversions.h"
16 #include "base/trace_event/trace_event.h" 16 #include "base/trace_event/trace_event.h"
17 #include "build/build_config.h"
17 #include "chrome/browser/browser_process.h" 18 #include "chrome/browser/browser_process.h"
18 #include "chrome/browser/media/router/create_presentation_connection_request.h" 19 #include "chrome/browser/media/router/create_presentation_connection_request.h"
19 #include "chrome/browser/media/router/issue.h" 20 #include "chrome/browser/media/router/issue.h"
20 #include "chrome/browser/media/router/issues_observer.h" 21 #include "chrome/browser/media/router/issues_observer.h"
21 #include "chrome/browser/media/router/media_route.h" 22 #include "chrome/browser/media/router/media_route.h"
22 #include "chrome/browser/media/router/media_router.h" 23 #include "chrome/browser/media/router/media_router.h"
23 #include "chrome/browser/media/router/media_router_factory.h" 24 #include "chrome/browser/media/router/media_router_factory.h"
24 #include "chrome/browser/media/router/media_router_metrics.h" 25 #include "chrome/browser/media/router/media_router_metrics.h"
25 #include "chrome/browser/media/router/media_router_mojo_impl.h" 26 #include "chrome/browser/media/router/media_router_mojo_impl.h"
26 #include "chrome/browser/media/router/media_routes_observer.h" 27 #include "chrome/browser/media/router/media_routes_observer.h"
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 OnDefaultPresentationChanged(create_session_request_->presentation_request()); 244 OnDefaultPresentationChanged(create_session_request_->presentation_request());
244 } 245 }
245 246
246 void MediaRouterUI::InitCommon(content::WebContents* initiator) { 247 void MediaRouterUI::InitCommon(content::WebContents* initiator) {
247 DCHECK(initiator); 248 DCHECK(initiator);
248 DCHECK(router_); 249 DCHECK(router_);
249 250
250 TRACE_EVENT_NESTABLE_ASYNC_INSTANT1("media_router", "UI", initiator, 251 TRACE_EVENT_NESTABLE_ASYNC_INSTANT1("media_router", "UI", initiator,
251 "MediaRouterUI::InitCommon", this); 252 "MediaRouterUI::InitCommon", this);
252 253
254 #if defined(OS_WIN)
255 if (!router_->should_enable_mdns_discovery()) {
mark a. foltz 2016/03/24 22:59:33 IMO, this is confusing to read. One solution: 1.
btolsch 2016/03/25 04:40:50 I thought about putting a comment here since that
256 router_->EnableMdnsDiscovery();
257 }
258 #endif
253 // Create |collator_| before |query_result_manager_| so that |collator_| is 259 // Create |collator_| before |query_result_manager_| so that |collator_| is
254 // already set up when we get a callback from |query_result_manager_|. 260 // already set up when we get a callback from |query_result_manager_|.
255 UErrorCode error = U_ZERO_ERROR; 261 UErrorCode error = U_ZERO_ERROR;
256 const std::string& locale = g_browser_process->GetApplicationLocale(); 262 const std::string& locale = g_browser_process->GetApplicationLocale();
257 collator_.reset( 263 collator_.reset(
258 icu::Collator::createInstance(icu::Locale(locale.c_str()), error)); 264 icu::Collator::createInstance(icu::Locale(locale.c_str()), error));
259 if (U_FAILURE(error)) { 265 if (U_FAILURE(error)) {
260 DLOG(ERROR) << "Failed to create collator for locale " << locale; 266 DLOG(ERROR) << "Failed to create collator for locale " << locale;
261 collator_.reset(); 267 collator_.reset();
262 } 268 }
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
577 base::Time::Now() - start_time_); 583 base::Time::Now() - start_time_);
578 start_time_ = base::Time(); 584 start_time_ = base::Time();
579 } 585 }
580 } 586 }
581 587
582 void MediaRouterUI::UpdateMaxDialogHeight(int height) { 588 void MediaRouterUI::UpdateMaxDialogHeight(int height) {
583 handler_->UpdateMaxDialogHeight(height); 589 handler_->UpdateMaxDialogHeight(height);
584 } 590 }
585 591
586 } // namespace media_router 592 } // namespace media_router
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698