| 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 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_COOKIE_MONSTER_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_COOKIE_MONSTER_DELEGATE_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_COOKIE_MONSTER_DELEGATE_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_COOKIE_MONSTER_DELEGATE_H_ |
| 7 | 7 |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "net/cookies/cookie_monster.h" | 10 #include "net/cookies/cookie_monster.h" |
| 11 | 11 |
| 12 class Profile; | 12 class Profile; |
| 13 | 13 |
| 14 // Sends cookie-change notifications from the UI thread via | 14 // Sends cookie-change notifications from the UI thread via |
| 15 // chrome::NOTIFICATION_COOKIE_CHANGED_FOR_EXTENSIONS. | 15 // chrome::NOTIFICATION_COOKIE_CHANGED_FOR_EXTENSIONS. |
| 16 class ExtensionCookieMonsterDelegate : public net::CookieMonsterDelegate { | 16 class ExtensionCookieMonsterDelegate : public net::CookieMonsterDelegate { |
| 17 public: | 17 public: |
| 18 explicit ExtensionCookieMonsterDelegate(Profile* profile); | 18 explicit ExtensionCookieMonsterDelegate(Profile* profile); |
| 19 | 19 |
| 20 // net::CookieMonsterDelegate implementation. | 20 // net::CookieMonsterDelegate implementation. |
| 21 void OnCookieChanged( | 21 void OnCookieChanged( |
| 22 const net::CanonicalCookie& cookie, | 22 const net::CanonicalCookie& cookie, |
| 23 bool removed, | 23 bool removed, |
| 24 net::CookieMonsterDelegate::ChangeCause cause) override; | 24 net::CookieStore::ChangeCause cause) override; |
| 25 | 25 |
| 26 private: | 26 private: |
| 27 ~ExtensionCookieMonsterDelegate() override; | 27 ~ExtensionCookieMonsterDelegate() override; |
| 28 | 28 |
| 29 void OnCookieChangedAsyncHelper( | 29 void OnCookieChangedAsyncHelper( |
| 30 const net::CanonicalCookie& cookie, | 30 const net::CanonicalCookie& cookie, |
| 31 bool removed, | 31 bool removed, |
| 32 net::CookieMonsterDelegate::ChangeCause cause); | 32 net::CookieStore::ChangeCause cause); |
| 33 | 33 |
| 34 const base::Callback<Profile*(void)> profile_getter_; | 34 const base::Callback<Profile*(void)> profile_getter_; |
| 35 | 35 |
| 36 DISALLOW_COPY_AND_ASSIGN(ExtensionCookieMonsterDelegate); | 36 DISALLOW_COPY_AND_ASSIGN(ExtensionCookieMonsterDelegate); |
| 37 }; | 37 }; |
| 38 | 38 |
| 39 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_COOKIE_MONSTER_DELEGATE_H_ | 39 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_COOKIE_MONSTER_DELEGATE_H_ |
| OLD | NEW |