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

Side by Side Diff: chrome/browser/media/router/media_route_provider_util.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
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/media/router/media_route_provider_util.h"
6
7 #include "base/files/file_path.h"
8 #include "base/location.h"
9 #include "base/path_service.h"
10 #include "build/build_config.h"
11 #include "chrome/installer/util/browser_distribution.h"
mark a. foltz 2016/03/24 22:59:32 Do you need to declare any additional deps= in the
btolsch 2016/03/25 04:40:50 I didn't think so because nothing has been failing
12 #include "chrome/installer/util/firewall_manager_win.h"
13 #include "content/public/browser/browser_thread.h"
14
15 namespace media_router {
16
17 #if defined(OS_WIN)
18 namespace {
19
20 void DoCanFirewallUseLocalPorts(MediaRouterMojoImpl* router) {
21 base::FilePath exe_path;
22 if (base::PathService::Get(base::FILE_EXE, &exe_path)) {
23 auto firewall_manager = installer::FirewallManager::Create(
24 BrowserDistribution::GetDistribution(), exe_path);
25 if (firewall_manager && firewall_manager->CanUseLocalPorts()) {
26 content::BrowserThread::PostTask(
27 content::BrowserThread::UI, FROM_HERE,
28 base::Bind(&MediaRouterMojoImpl::EnableMdnsDiscovery,
29 base::Unretained(router)));
30 }
31 }
32 }
33
34 } // namespace
35
36 void CanFirewallUseLocalPorts(MediaRouterMojoImpl* router) {
37 content::BrowserThread::PostTask(
38 content::BrowserThread::FILE, FROM_HERE,
39 base::Bind(&DoCanFirewallUseLocalPorts, router));
40 }
41 #endif
42
43 } // namespace media_router
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698