| 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/legacy_firewall_manager_win.h" | 5 #include "chrome/installer/util/legacy_firewall_manager_win.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
| 9 #include "base/win/scoped_bstr.h" | 9 #include "base/win/scoped_bstr.h" |
| 10 | 10 |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 base::win::ScopedComPtr<INetFwAuthorizedApplications> authorized_apps( | 76 base::win::ScopedComPtr<INetFwAuthorizedApplications> authorized_apps( |
| 77 GetAuthorizedApplications()); | 77 GetAuthorizedApplications()); |
| 78 if (!authorized_apps.get()) | 78 if (!authorized_apps.get()) |
| 79 return false; | 79 return false; |
| 80 | 80 |
| 81 // Authorize chrome. | 81 // Authorize chrome. |
| 82 base::win::ScopedComPtr<INetFwAuthorizedApplication> authorization = | 82 base::win::ScopedComPtr<INetFwAuthorizedApplication> authorization = |
| 83 CreateChromeAuthorization(allow); | 83 CreateChromeAuthorization(allow); |
| 84 if (!authorization.get()) | 84 if (!authorization.get()) |
| 85 return false; | 85 return false; |
| 86 HRESULT hr = authorized_apps->Add(authorization); | 86 HRESULT hr = authorized_apps->Add(authorization.get()); |
| 87 DLOG_IF(ERROR, FAILED(hr)) << logging::SystemErrorCodeToString(hr); | 87 DLOG_IF(ERROR, FAILED(hr)) << logging::SystemErrorCodeToString(hr); |
| 88 return SUCCEEDED(hr); | 88 return SUCCEEDED(hr); |
| 89 } | 89 } |
| 90 | 90 |
| 91 void LegacyFirewallManager::DeleteRule() { | 91 void LegacyFirewallManager::DeleteRule() { |
| 92 base::win::ScopedComPtr<INetFwAuthorizedApplications> authorized_apps( | 92 base::win::ScopedComPtr<INetFwAuthorizedApplications> authorized_apps( |
| 93 GetAuthorizedApplications()); | 93 GetAuthorizedApplications()); |
| 94 if (!authorized_apps.get()) | 94 if (!authorized_apps.get()) |
| 95 return; | 95 return; |
| 96 authorized_apps->Remove(base::win::ScopedBstr(app_path_.value().c_str())); | 96 authorized_apps->Remove(base::win::ScopedBstr(app_path_.value().c_str())); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 125 base::win::ScopedBstr(app_path_.value().c_str())); | 125 base::win::ScopedBstr(app_path_.value().c_str())); |
| 126 // IpVersion defaults to NET_FW_IP_VERSION_ANY. | 126 // IpVersion defaults to NET_FW_IP_VERSION_ANY. |
| 127 // Scope defaults to NET_FW_SCOPE_ALL. | 127 // Scope defaults to NET_FW_SCOPE_ALL. |
| 128 // RemoteAddresses defaults to "*". | 128 // RemoteAddresses defaults to "*". |
| 129 chrome_application->put_Enabled(allow ? VARIANT_TRUE : VARIANT_FALSE); | 129 chrome_application->put_Enabled(allow ? VARIANT_TRUE : VARIANT_FALSE); |
| 130 | 130 |
| 131 return chrome_application; | 131 return chrome_application; |
| 132 } | 132 } |
| 133 | 133 |
| 134 } // namespace installer | 134 } // namespace installer |
| OLD | NEW |