blob: aa87da030ace69caae49fe350f2a748f390188bd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_INSTALLER_UTIL_FIREWALL_MANAGER_WIN_H_
#define CHROME_INSTALLER_UTIL_FIREWALL_MANAGER_WIN_H_
#include "base/memory/scoped_ptr.h"
class BrowserDistribution;
namespace base {
class FilePath;
}
namespace installer {
// Requires that COM be initialized on the calling thread.
class FirewallManager {
public:
virtual ~FirewallManager();
// Creates instance of |FirewallManager|. Implementation chooses best version
// available for current version of Windows.
static scoped_ptr<FirewallManager> Create(BrowserDistribution* dist,
const base::FilePath& chrome_path);
// Returns true if application can one ports for incoming connections without
// triggering firewall alert. It still does not guarantee that traffic
// would pass firewall.
virtual bool CanUseLocalPorts() = 0;
// Installs all windows firewall rules needed by Chrome.
// Return true if operation succeeded. Needs elevation.
virtual bool AddFirewallRules() = 0;
// Removes all windows firewall related to Chrome. Needs elevation.
virtual void RemoveFirewallRules() = 0;
protected:
FirewallManager();
DISALLOW_COPY_AND_ASSIGN(FirewallManager);
};
} // namespace installer
#endif // CHROME_INSTALLER_UTIL_FIREWALL_MANAGER_WIN_H_
|