forked from Pissandshittium/pissandshittium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathurl_list_manager.h
48 lines (34 loc) · 1.26 KB
/
url_list_manager.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// Copyright 2018 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef COMPONENTS_BLOCKED_CONTENT_URL_LIST_MANAGER_H_
#define COMPONENTS_BLOCKED_CONTENT_URL_LIST_MANAGER_H_
#include <stdint.h>
#include "base/observer_list.h"
class GURL;
namespace blocked_content {
// This class manages lists of blocked URLs in order to drive UI surfaces.
// Currently it is used by the redirect / popup blocked UIs.
//
// TODO(csharrison): Currently this object is composed within the framebust /
// popup tab helpers. Eventually those objects could be replaced almost entirely
// by shared logic here.
class UrlListManager {
public:
class Observer {
public:
virtual ~Observer() {}
virtual void BlockedUrlAdded(int32_t id, const GURL& url) = 0;
};
UrlListManager();
UrlListManager(const UrlListManager&) = delete;
UrlListManager& operator=(const UrlListManager&) = delete;
~UrlListManager();
void AddObserver(Observer* observer);
void RemoveObserver(Observer* observer);
void NotifyObservers(int32_t id, const GURL& url);
private:
base::ObserverList<Observer>::Unchecked observers_;
};
} // namespace blocked_content
#endif // COMPONENTS_BLOCKED_CONTENT_URL_LIST_MANAGER_H_