| 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 16 matching lines...) Expand all Loading... |
| 27 g_browser_process->profile_manager(), | 27 g_browser_process->profile_manager(), |
| 28 profile)) { | 28 profile)) { |
| 29 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 29 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 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::CookieMonsterDelegate::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::Bind(&ExtensionCookieMonsterDelegate::OnCookieChangedAsyncHelper, |
| 41 this, cookie, removed, cause)); | 41 this, cookie, removed, cause)); |
| 42 } | 42 } |
| 43 | 43 |
| 44 ExtensionCookieMonsterDelegate::~ExtensionCookieMonsterDelegate() {} | 44 ExtensionCookieMonsterDelegate::~ExtensionCookieMonsterDelegate() {} |
| 45 | 45 |
| 46 void ExtensionCookieMonsterDelegate::OnCookieChangedAsyncHelper( | 46 void ExtensionCookieMonsterDelegate::OnCookieChangedAsyncHelper( |
| 47 const net::CanonicalCookie& cookie, | 47 const net::CanonicalCookie& cookie, |
| 48 bool removed, | 48 bool removed, |
| 49 net::CookieMonsterDelegate::ChangeCause cause) { | 49 net::CookieStore::ChangeCause cause) { |
| 50 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 50 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 51 Profile* profile = profile_getter_.Run(); | 51 Profile* profile = profile_getter_.Run(); |
| 52 if (profile) { | 52 if (profile) { |
| 53 ChromeCookieDetails cookie_details(&cookie, removed, cause); | 53 ChromeCookieDetails cookie_details(&cookie, removed, cause); |
| 54 content::NotificationService::current()->Notify( | 54 content::NotificationService::current()->Notify( |
| 55 chrome::NOTIFICATION_COOKIE_CHANGED_FOR_EXTENSIONS, | 55 chrome::NOTIFICATION_COOKIE_CHANGED_FOR_EXTENSIONS, |
| 56 content::Source<Profile>(profile), | 56 content::Source<Profile>(profile), |
| 57 content::Details<ChromeCookieDetails>(&cookie_details)); | 57 content::Details<ChromeCookieDetails>(&cookie_details)); |
| 58 } | 58 } |
| 59 } | 59 } |
| OLD | NEW |