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

Side by Side Diff: chrome/browser/media/router/media_route_provider_util_win.cc

Issue 1826403002: [Media Router] Moves mojo-specific code into mojo/ folder (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert change to media_router.mojom to fix compile Created 4 years, 8 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_win.h"
6
7 #include "base/files/file_path.h"
8 #include "base/location.h"
9 #include "base/logging.h"
10 #include "base/path_service.h"
11 #include "chrome/installer/util/browser_distribution.h"
12 #include "chrome/installer/util/firewall_manager_win.h"
13 #include "content/public/browser/browser_thread.h"
14
15 namespace media_router {
16
17 namespace {
18
19 void DoCanFirewallUseLocalPorts(const base::Callback<void(bool)>& callback) {
20 DCHECK_CURRENTLY_ON(content::BrowserThread::FILE);
21 base::FilePath exe_path;
22 bool can_use_local_ports = false;
23 if (!base::PathService::Get(base::FILE_EXE, &exe_path)) {
24 LOG(WARNING) << "Couldn't get path of current executable.";
25 return;
26 }
27 auto firewall_manager = installer::FirewallManager::Create(
28 BrowserDistribution::GetDistribution(), exe_path);
29 if (!firewall_manager) {
30 LOG(WARNING) << "Couldn't get FirewallManager instance.";
31 return;
32 }
33 can_use_local_ports = firewall_manager->CanUseLocalPorts();
34 content::BrowserThread::PostTask(
35 content::BrowserThread::UI, FROM_HERE,
36 base::Bind(callback, can_use_local_ports));
37 }
38
39 } // namespace
40
41 void CanFirewallUseLocalPorts(const base::Callback<void(bool)>& callback) {
42 content::BrowserThread::PostTask(
43 content::BrowserThread::FILE, FROM_HERE,
44 base::Bind(&DoCanFirewallUseLocalPorts, callback));
45 }
46
47 } // namespace media_router
OLDNEW
« no previous file with comments | « chrome/browser/media/router/media_route_provider_util_win.h ('k') | chrome/browser/media/router/media_router.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698