| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "extensions/browser/api/socket/app_firewall_hole_manager.h" | 5 #include "extensions/browser/api/socket/app_firewall_hole_manager.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 | 21 |
| 22 class AppFirewallHoleManagerFactory : public BrowserContextKeyedServiceFactory { | 22 class AppFirewallHoleManagerFactory : public BrowserContextKeyedServiceFactory { |
| 23 public: | 23 public: |
| 24 static AppFirewallHoleManager* GetForBrowserContext(BrowserContext* context, | 24 static AppFirewallHoleManager* GetForBrowserContext(BrowserContext* context, |
| 25 bool create) { | 25 bool create) { |
| 26 return static_cast<AppFirewallHoleManager*>( | 26 return static_cast<AppFirewallHoleManager*>( |
| 27 GetInstance()->GetServiceForBrowserContext(context, create)); | 27 GetInstance()->GetServiceForBrowserContext(context, create)); |
| 28 } | 28 } |
| 29 | 29 |
| 30 static AppFirewallHoleManagerFactory* GetInstance() { | 30 static AppFirewallHoleManagerFactory* GetInstance() { |
| 31 return Singleton<AppFirewallHoleManagerFactory>::get(); | 31 return base::Singleton<AppFirewallHoleManagerFactory>::get(); |
| 32 } | 32 } |
| 33 | 33 |
| 34 AppFirewallHoleManagerFactory() | 34 AppFirewallHoleManagerFactory() |
| 35 : BrowserContextKeyedServiceFactory( | 35 : BrowserContextKeyedServiceFactory( |
| 36 "AppFirewallHoleManager", | 36 "AppFirewallHoleManager", |
| 37 BrowserContextDependencyManager::GetInstance()) { | 37 BrowserContextDependencyManager::GetInstance()) { |
| 38 DependsOn(AppWindowRegistry::Factory::GetInstance()); | 38 DependsOn(AppWindowRegistry::Factory::GetInstance()); |
| 39 } | 39 } |
| 40 | 40 |
| 41 ~AppFirewallHoleManagerFactory() override {} | 41 ~AppFirewallHoleManagerFactory() override {} |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 | 157 |
| 158 void AppFirewallHoleManager::OnAppWindowShown(AppWindow* app_window, | 158 void AppFirewallHoleManager::OnAppWindowShown(AppWindow* app_window, |
| 159 bool was_hidden) { | 159 bool was_hidden) { |
| 160 const auto& range = tracked_holes_.equal_range(app_window->extension_id()); | 160 const auto& range = tracked_holes_.equal_range(app_window->extension_id()); |
| 161 for (auto iter = range.first; iter != range.second; ++iter) { | 161 for (auto iter = range.first; iter != range.second; ++iter) { |
| 162 iter->second->SetVisible(true); | 162 iter->second->SetVisible(true); |
| 163 } | 163 } |
| 164 } | 164 } |
| 165 | 165 |
| 166 } // namespace extensions | 166 } // namespace extensions |
| OLD | NEW |