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

Unified Diff: chrome/installer/util/legacy_firewall_manager_win.h

Issue 149023010: UDP firewall rules for Windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more xp code Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/installer/util/firewall_manager_win.cc ('k') | chrome/installer/util/legacy_firewall_manager_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/installer/util/legacy_firewall_manager_win.h
diff --git a/chrome/installer/util/legacy_firewall_manager_win.h b/chrome/installer/util/legacy_firewall_manager_win.h
new file mode 100644
index 0000000000000000000000000000000000000000..df30293c1880b4d8661441063d3352261dc6556c
--- /dev/null
+++ b/chrome/installer/util/legacy_firewall_manager_win.h
@@ -0,0 +1,55 @@
+// 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_LEGACY_FIREWALL_MANAGER_WIN_H_
+#define CHROME_INSTALLER_UTIL_LEGACY_FIREWALL_MANAGER_WIN_H_
+
+#include <windows.h>
+#include <netfw.h>
+
+#include "base/basictypes.h"
+#include "base/files/file_path.h"
+#include "base/strings/string16.h"
+#include "base/win/scoped_comptr.h"
+#include "chrome/installer/util/firewall_manager.h"
+
+namespace installer {
+
+class LegacyFirewallManager : public FirewallManager {
+ public:
+ LegacyFirewallManager();
+ virtual ~LegacyFirewallManager();
+
+ bool Init(BrowserDistribution* dist, const base::FilePath& chrome_path);
+
+ // FirewallManager methods.
+ virtual bool AddUDPFirewallRuleIfAbsent() OVERRIDE;
+ virtual void DeleteUDPFirewallRule() OVERRIDE;
+ virtual bool CanUseLocalUDPPort() OVERRIDE;
+
+ private:
+ // Returns the local filewall policy's current profile or an empty pointer in
+ // case of error.
+ base::win::ScopedComPtr<INetFwProfile> GetCurrentProfile();
+
+ // Returns the authorized applications collection for the local firewall
+ // policy's current profile or an empty pointer in case of error.
+ base::win::ScopedComPtr<INetFwAuthorizedApplications>
+ GetAuthorizedApplications();
+
+ base::win::ScopedComPtr<INetFwAuthorizedApplication>
+ CreateChromeAuthorization();
+
+ BrowserDistribution* distribution_;
+ base::FilePath chrome_path_;
+ base::win::ScopedComPtr<INetFwMgr> firewall_manager_;
+ base::win::ScopedComPtr<INetFwProfile> current_profile_;
+ base::win::ScopedComPtr<INetFwAuthorizedApplications> authorized_apps_;
+
+ DISALLOW_COPY_AND_ASSIGN(LegacyFirewallManager);
+};
+
+} // namespace installer
+
+#endif // CHROME_INSTALLER_UTIL_LEGACY_FIREWALL_MANAGER_WIN_H_
« no previous file with comments | « chrome/installer/util/firewall_manager_win.cc ('k') | chrome/installer/util/legacy_firewall_manager_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698