Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / chrome / installer / util / firewall_manager_win.h
blobaa87da030ace69caae49fe350f2a748f390188bd
1 // Copyright 2014 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.
5 #ifndef CHROME_INSTALLER_UTIL_FIREWALL_MANAGER_WIN_H_
6 #define CHROME_INSTALLER_UTIL_FIREWALL_MANAGER_WIN_H_
8 #include "base/memory/scoped_ptr.h"
10 class BrowserDistribution;
12 namespace base {
13 class FilePath;
16 namespace installer {
18 // Requires that COM be initialized on the calling thread.
19 class FirewallManager {
20 public:
21 virtual ~FirewallManager();
23 // Creates instance of |FirewallManager|. Implementation chooses best version
24 // available for current version of Windows.
25 static scoped_ptr<FirewallManager> Create(BrowserDistribution* dist,
26 const base::FilePath& chrome_path);
28 // Returns true if application can one ports for incoming connections without
29 // triggering firewall alert. It still does not guarantee that traffic
30 // would pass firewall.
31 virtual bool CanUseLocalPorts() = 0;
33 // Installs all windows firewall rules needed by Chrome.
34 // Return true if operation succeeded. Needs elevation.
35 virtual bool AddFirewallRules() = 0;
37 // Removes all windows firewall related to Chrome. Needs elevation.
38 virtual void RemoveFirewallRules() = 0;
40 protected:
41 FirewallManager();
43 DISALLOW_COPY_AND_ASSIGN(FirewallManager);
46 } // namespace installer
48 #endif // CHROME_INSTALLER_UTIL_FIREWALL_MANAGER_WIN_H_