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 "chrome/browser/extensions/extension_cookie_monster_delegate.h" | 5 #include "chrome/browser/extensions/extension_cookie_monster_delegate.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/location.h" | 8 #include "base/location.h" |
9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 DCHECK(profile); | 30 DCHECK(profile); |
31 } | 31 } |
32 | 32 |
33 // net::CookieMonsterDelegate implementation. | 33 // net::CookieMonsterDelegate implementation. |
34 void ExtensionCookieMonsterDelegate::OnCookieChanged( | 34 void ExtensionCookieMonsterDelegate::OnCookieChanged( |
35 const net::CanonicalCookie& cookie, | 35 const net::CanonicalCookie& cookie, |
36 bool removed, | 36 bool removed, |
37 net::CookieStore::ChangeCause cause) { | 37 net::CookieStore::ChangeCause cause) { |
38 content::BrowserThread::PostTask( | 38 content::BrowserThread::PostTask( |
39 content::BrowserThread::UI, FROM_HERE, | 39 content::BrowserThread::UI, FROM_HERE, |
40 base::Bind(&ExtensionCookieMonsterDelegate::OnCookieChangedAsyncHelper, | 40 base::BindOnce( |
41 this, cookie, removed, cause)); | 41 &ExtensionCookieMonsterDelegate::OnCookieChangedAsyncHelper, this, |
| 42 cookie, removed, cause)); |
42 } | 43 } |
43 | 44 |
44 ExtensionCookieMonsterDelegate::~ExtensionCookieMonsterDelegate() {} | 45 ExtensionCookieMonsterDelegate::~ExtensionCookieMonsterDelegate() {} |
45 | 46 |
46 void ExtensionCookieMonsterDelegate::OnCookieChangedAsyncHelper( | 47 void ExtensionCookieMonsterDelegate::OnCookieChangedAsyncHelper( |
47 const net::CanonicalCookie& cookie, | 48 const net::CanonicalCookie& cookie, |
48 bool removed, | 49 bool removed, |
49 net::CookieStore::ChangeCause cause) { | 50 net::CookieStore::ChangeCause cause) { |
50 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 51 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
51 Profile* profile = profile_getter_.Run(); | 52 Profile* profile = profile_getter_.Run(); |
52 if (profile) { | 53 if (profile) { |
53 ChromeCookieDetails cookie_details(&cookie, removed, cause); | 54 ChromeCookieDetails cookie_details(&cookie, removed, cause); |
54 content::NotificationService::current()->Notify( | 55 content::NotificationService::current()->Notify( |
55 chrome::NOTIFICATION_COOKIE_CHANGED_FOR_EXTENSIONS, | 56 chrome::NOTIFICATION_COOKIE_CHANGED_FOR_EXTENSIONS, |
56 content::Source<Profile>(profile), | 57 content::Source<Profile>(profile), |
57 content::Details<ChromeCookieDetails>(&cookie_details)); | 58 content::Details<ChromeCookieDetails>(&cookie_details)); |
58 } | 59 } |
59 } | 60 } |
OLD | NEW |