| 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/firewall_manager_win.h" | 5 #include "chrome/installer/util/firewall_manager_win.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 private: | 96 private: |
| 97 LegacyFirewallManager manager_; | 97 LegacyFirewallManager manager_; |
| 98 DISALLOW_COPY_AND_ASSIGN(FirewallManagerLegacyImpl); | 98 DISALLOW_COPY_AND_ASSIGN(FirewallManagerLegacyImpl); |
| 99 }; | 99 }; |
| 100 | 100 |
| 101 } // namespace | 101 } // namespace |
| 102 | 102 |
| 103 FirewallManager::~FirewallManager() {} | 103 FirewallManager::~FirewallManager() {} |
| 104 | 104 |
| 105 // static | 105 // static |
| 106 scoped_ptr<FirewallManager> FirewallManager::Create( | 106 std::unique_ptr<FirewallManager> FirewallManager::Create( |
| 107 BrowserDistribution* dist, | 107 BrowserDistribution* dist, |
| 108 const base::FilePath& chrome_path) { | 108 const base::FilePath& chrome_path) { |
| 109 // First try to connect to "Windows Firewall with Advanced Security" (Vista+). | 109 // First try to connect to "Windows Firewall with Advanced Security" (Vista+). |
| 110 scoped_ptr<FirewallManagerAdvancedImpl> manager( | 110 std::unique_ptr<FirewallManagerAdvancedImpl> manager( |
| 111 new FirewallManagerAdvancedImpl()); | 111 new FirewallManagerAdvancedImpl()); |
| 112 if (manager->Init(dist->GetDisplayName(), chrome_path)) | 112 if (manager->Init(dist->GetDisplayName(), chrome_path)) |
| 113 return std::move(manager); | 113 return std::move(manager); |
| 114 | 114 |
| 115 // Next try to connect to "Windows Firewall for Windows XP with SP2". | 115 // Next try to connect to "Windows Firewall for Windows XP with SP2". |
| 116 scoped_ptr<FirewallManagerLegacyImpl> legacy_manager( | 116 std::unique_ptr<FirewallManagerLegacyImpl> legacy_manager( |
| 117 new FirewallManagerLegacyImpl()); | 117 new FirewallManagerLegacyImpl()); |
| 118 if (legacy_manager->Init(dist->GetDisplayName(), chrome_path)) | 118 if (legacy_manager->Init(dist->GetDisplayName(), chrome_path)) |
| 119 return std::move(legacy_manager); | 119 return std::move(legacy_manager); |
| 120 | 120 |
| 121 return nullptr; | 121 return nullptr; |
| 122 } | 122 } |
| 123 | 123 |
| 124 FirewallManager::FirewallManager() { | 124 FirewallManager::FirewallManager() { |
| 125 } | 125 } |
| 126 | 126 |
| 127 } // namespace installer | 127 } // namespace installer |
| OLD | NEW |