| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/installer/util/advanced_firewall_manager_win.h" | 5 #include "chrome/installer/util/advanced_firewall_manager_win.h" |
| 6 | 6 |
| 7 #include "base/guid.h" | 7 #include "base/guid.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 return base::win::ScopedComPtr<INetFwRule>(); | 129 return base::win::ScopedComPtr<INetFwRule>(); |
| 130 } | 130 } |
| 131 | 131 |
| 132 udp_rule->put_Name(base::win::ScopedBstr(rule_name.c_str())); | 132 udp_rule->put_Name(base::win::ScopedBstr(rule_name.c_str())); |
| 133 udp_rule->put_Description(base::win::ScopedBstr(description.c_str())); | 133 udp_rule->put_Description(base::win::ScopedBstr(description.c_str())); |
| 134 udp_rule->put_ApplicationName( | 134 udp_rule->put_ApplicationName( |
| 135 base::win::ScopedBstr(app_path_.value().c_str())); | 135 base::win::ScopedBstr(app_path_.value().c_str())); |
| 136 udp_rule->put_Protocol(NET_FW_IP_PROTOCOL_UDP); | 136 udp_rule->put_Protocol(NET_FW_IP_PROTOCOL_UDP); |
| 137 udp_rule->put_Direction(NET_FW_RULE_DIR_IN); | 137 udp_rule->put_Direction(NET_FW_RULE_DIR_IN); |
| 138 udp_rule->put_Enabled(VARIANT_TRUE); | 138 udp_rule->put_Enabled(VARIANT_TRUE); |
| 139 udp_rule->put_LocalPorts( | 139 /* udp_rule->put_LocalPorts( |
| 140 base::win::ScopedBstr(base::StringPrintf(L"%u", port).c_str())); | 140 base::win::ScopedBstr(base::StringPrintf(L"%u", port).c_str()));*/ |
| 141 udp_rule->put_Grouping(base::win::ScopedBstr(app_name_.c_str())); | 141 udp_rule->put_Grouping(base::win::ScopedBstr(app_name_.c_str())); |
| 142 udp_rule->put_Profiles(NET_FW_PROFILE2_ALL); | 142 udp_rule->put_Profiles(NET_FW_PROFILE2_ALL); |
| 143 udp_rule->put_Action(NET_FW_ACTION_ALLOW); | 143 udp_rule->put_Action(NET_FW_ACTION_ALLOW); |
| 144 | 144 |
| 145 return udp_rule; | 145 return udp_rule; |
| 146 } | 146 } |
| 147 | 147 |
| 148 void AdvancedFirewallManager::GetAllRules( | 148 void AdvancedFirewallManager::GetAllRules( |
| 149 std::vector<base::win::ScopedComPtr<INetFwRule> >* rules) { | 149 std::vector<base::win::ScopedComPtr<INetFwRule> >* rules) { |
| 150 base::win::ScopedComPtr<IUnknown> rules_enum_unknown; | 150 base::win::ScopedComPtr<IUnknown> rules_enum_unknown; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 !base::FilePath::CompareEqualIgnoreCase(static_cast<BSTR>(path), | 190 !base::FilePath::CompareEqualIgnoreCase(static_cast<BSTR>(path), |
| 191 app_path_.value())) { | 191 app_path_.value())) { |
| 192 continue; | 192 continue; |
| 193 } | 193 } |
| 194 | 194 |
| 195 rules->push_back(rule); | 195 rules->push_back(rule); |
| 196 } | 196 } |
| 197 } | 197 } |
| 198 | 198 |
| 199 } // namespace installer | 199 } // namespace installer |
| OLD | NEW |