2016-09-21 23:24:03 +00:00
|
|
|
// Copyright (c) 2016 GitHub, Inc.
|
|
|
|
// Use of this source code is governed by the MIT license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
|
|
|
#ifndef ATOM_BROWSER_NET_ATOM_COOKIE_DELEGATE_H_
|
|
|
|
#define ATOM_BROWSER_NET_ATOM_COOKIE_DELEGATE_H_
|
|
|
|
|
|
|
|
#include "base/observer_list.h"
|
|
|
|
#include "net/cookies/cookie_monster.h"
|
|
|
|
|
|
|
|
namespace atom {
|
|
|
|
|
|
|
|
class AtomCookieDelegate : public net::CookieMonsterDelegate {
|
|
|
|
public:
|
|
|
|
AtomCookieDelegate();
|
|
|
|
~AtomCookieDelegate() override;
|
|
|
|
|
|
|
|
class Observer {
|
|
|
|
public:
|
|
|
|
virtual void OnCookieChanged(const net::CanonicalCookie& cookie,
|
|
|
|
bool removed,
|
2017-01-23 09:53:05 +00:00
|
|
|
net::CookieStore::ChangeCause cause) {}
|
2016-09-21 23:24:03 +00:00
|
|
|
protected:
|
|
|
|
virtual ~Observer() {}
|
|
|
|
};
|
|
|
|
|
|
|
|
void AddObserver(Observer* observer);
|
|
|
|
void RemoveObserver(Observer* observer);
|
|
|
|
|
|
|
|
// net::CookieMonsterDelegate:
|
|
|
|
void OnCookieChanged(const net::CanonicalCookie& cookie,
|
|
|
|
bool removed,
|
2017-01-23 09:53:05 +00:00
|
|
|
net::CookieStore::ChangeCause cause) override;
|
2016-09-21 23:24:03 +00:00
|
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
base::ObserverList<Observer> observers_;
|
|
|
|
|
|
|
|
void NotifyObservers(const net::CanonicalCookie& cookie,
|
|
|
|
bool removed,
|
2017-01-23 09:53:05 +00:00
|
|
|
net::CookieStore::ChangeCause cause);
|
2016-09-21 23:24:03 +00:00
|
|
|
|
|
|
|
DISALLOW_COPY_AND_ASSIGN(AtomCookieDelegate);
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace atom
|
|
|
|
|
|
|
|
#endif // ATOM_BROWSER_NET_ATOM_COOKIE_DELEGATE_H_
|