Namespace of ChangeCause has changed

This commit is contained in:
Cheng Zhao 2017-01-23 18:53:05 +09:00 committed by Kevin Sawicki
parent d4e3dade39
commit 231173aa90
4 changed files with 18 additions and 14 deletions

View file

@ -56,19 +56,19 @@ struct Converter<net::CanonicalCookie> {
}; };
template<> template<>
struct Converter<AtomCookieDelegate::ChangeCause> { struct Converter<net::CookieStore::ChangeCause> {
static v8::Local<v8::Value> ToV8(v8::Isolate* isolate, static v8::Local<v8::Value> ToV8(v8::Isolate* isolate,
const AtomCookieDelegate::ChangeCause& val) { const net::CookieStore::ChangeCause& val) {
switch (val) { switch (val) {
case AtomCookieDelegate::ChangeCause::CHANGE_COOKIE_EXPLICIT: case net::CookieStore::ChangeCause::EXPLICIT:
return mate::StringToV8(isolate, "explicit"); return mate::StringToV8(isolate, "explicit");
case AtomCookieDelegate::ChangeCause::CHANGE_COOKIE_OVERWRITE: case net::CookieStore::ChangeCause::OVERWRITE:
return mate::StringToV8(isolate, "overwrite"); return mate::StringToV8(isolate, "overwrite");
case AtomCookieDelegate::ChangeCause::CHANGE_COOKIE_EXPIRED: case net::CookieStore::ChangeCause::EXPIRED:
return mate::StringToV8(isolate, "expired"); return mate::StringToV8(isolate, "expired");
case AtomCookieDelegate::ChangeCause::CHANGE_COOKIE_EVICTED: case net::CookieStore::ChangeCause::EVICTED:
return mate::StringToV8(isolate, "evicted"); return mate::StringToV8(isolate, "evicted");
case AtomCookieDelegate::ChangeCause::CHANGE_COOKIE_EXPIRED_OVERWRITE: case net::CookieStore::ChangeCause::EXPIRED_OVERWRITE:
return mate::StringToV8(isolate, "expired-overwrite"); return mate::StringToV8(isolate, "expired-overwrite");
default: default:
return mate::StringToV8(isolate, "unknown"); return mate::StringToV8(isolate, "unknown");
@ -266,7 +266,7 @@ void Cookies::Set(const base::DictionaryValue& details,
void Cookies::OnCookieChanged(const net::CanonicalCookie& cookie, void Cookies::OnCookieChanged(const net::CanonicalCookie& cookie,
bool removed, bool removed,
AtomCookieDelegate::ChangeCause cause) { net::CookieStore::ChangeCause cause) {
Emit("changed", cookie, cause, removed); Emit("changed", cookie, cause, removed);
} }

View file

@ -57,7 +57,7 @@ class Cookies : public mate::TrackableObject<Cookies>,
// AtomCookieDelegate::Observer: // AtomCookieDelegate::Observer:
void OnCookieChanged(const net::CanonicalCookie& cookie, void OnCookieChanged(const net::CanonicalCookie& cookie,
bool removed, bool removed,
AtomCookieDelegate::ChangeCause cause) override; net::CookieStore::ChangeCause cause) override;
private: private:
net::URLRequestContextGetter* request_context_getter_; net::URLRequestContextGetter* request_context_getter_;

View file

@ -23,14 +23,18 @@ void AtomCookieDelegate::RemoveObserver(Observer* observer) {
} }
void AtomCookieDelegate::NotifyObservers( void AtomCookieDelegate::NotifyObservers(
const net::CanonicalCookie& cookie, bool removed, ChangeCause cause) { const net::CanonicalCookie& cookie,
bool removed,
net::CookieStore::ChangeCause cause) {
FOR_EACH_OBSERVER(Observer, FOR_EACH_OBSERVER(Observer,
observers_, observers_,
OnCookieChanged(cookie, removed, cause)); OnCookieChanged(cookie, removed, cause));
} }
void AtomCookieDelegate::OnCookieChanged( void AtomCookieDelegate::OnCookieChanged(
const net::CanonicalCookie& cookie, bool removed, ChangeCause cause) { const net::CanonicalCookie& cookie,
bool removed,
net::CookieStore::ChangeCause cause) {
content::BrowserThread::PostTask( content::BrowserThread::PostTask(
content::BrowserThread::UI, content::BrowserThread::UI,
FROM_HERE, FROM_HERE,

View file

@ -19,7 +19,7 @@ class AtomCookieDelegate : public net::CookieMonsterDelegate {
public: public:
virtual void OnCookieChanged(const net::CanonicalCookie& cookie, virtual void OnCookieChanged(const net::CanonicalCookie& cookie,
bool removed, bool removed,
ChangeCause cause) {} net::CookieStore::ChangeCause cause) {}
protected: protected:
virtual ~Observer() {} virtual ~Observer() {}
}; };
@ -30,7 +30,7 @@ class AtomCookieDelegate : public net::CookieMonsterDelegate {
// net::CookieMonsterDelegate: // net::CookieMonsterDelegate:
void OnCookieChanged(const net::CanonicalCookie& cookie, void OnCookieChanged(const net::CanonicalCookie& cookie,
bool removed, bool removed,
ChangeCause cause) override; net::CookieStore::ChangeCause cause) override;
private: private:
@ -38,7 +38,7 @@ class AtomCookieDelegate : public net::CookieMonsterDelegate {
void NotifyObservers(const net::CanonicalCookie& cookie, void NotifyObservers(const net::CanonicalCookie& cookie,
bool removed, bool removed,
ChangeCause cause); net::CookieStore::ChangeCause cause);
DISALLOW_COPY_AND_ASSIGN(AtomCookieDelegate); DISALLOW_COPY_AND_ASSIGN(AtomCookieDelegate);
}; };