Make USB permissions work in the new permission message system
[chromium-blink-merge.git] / content / child / permissions / permission_observers_registry.cc
blobf8a2f1b6d6170506bfd1f248cc6bd3615807e350
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
3 // found in the LICENSE file.
5 #include "content/child/permissions/permission_observers_registry.h"
7 #include "third_party/WebKit/public/platform/modules/permissions/WebPermissionObserver.h"
9 namespace content {
11 PermissionObserversRegistry::PermissionObserversRegistry() {
14 PermissionObserversRegistry::~PermissionObserversRegistry() {
17 void PermissionObserversRegistry::RegisterObserver(
18 blink::WebPermissionObserver* observer) {
19 observers_.insert(observer);
22 void PermissionObserversRegistry::UnregisterObserver(
23 blink::WebPermissionObserver* observer) {
24 observers_.erase(observer);
27 bool PermissionObserversRegistry::IsObserverRegistered(
28 blink::WebPermissionObserver* observer) const {
29 return observers_.find(observer) != observers_.end();
32 } // namespace content