| 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 "base/android/jni_android.h" | 5 #include "base/android/jni_android.h" |
| 6 #include "base/android/jni_string.h" | 6 #include "base/android/jni_string.h" |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/time/time.h" | 8 #include "base/time/time.h" |
| 9 #include "chrome/browser/android/cookies/cookies_fetcher.h" | 9 #include "chrome/browser/android/cookies/cookies_fetcher.h" |
| 10 #include "chrome/browser/profiles/profile_manager.h" | 10 #include "chrome/browser/profiles/profile_manager.h" |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 net::CookieMonster* monster = store->GetCookieMonster(); | 154 net::CookieMonster* monster = store->GetCookieMonster(); |
| 155 base::Callback<void(bool success)> cb; | 155 base::Callback<void(bool success)> cb; |
| 156 | 156 |
| 157 monster->SetCookieWithDetailsAsync( | 157 monster->SetCookieWithDetailsAsync( |
| 158 cookie.Source(), cookie.Name(), cookie.Value(), cookie.Domain(), | 158 cookie.Source(), cookie.Name(), cookie.Value(), cookie.Domain(), |
| 159 cookie.Path(), cookie.ExpiryDate(), cookie.IsSecure(), | 159 cookie.Path(), cookie.ExpiryDate(), cookie.IsSecure(), |
| 160 cookie.IsHttpOnly(), cookie.IsFirstPartyOnly(), cookie.Priority(), cb); | 160 cookie.IsHttpOnly(), cookie.IsFirstPartyOnly(), cookie.Priority(), cb); |
| 161 } | 161 } |
| 162 | 162 |
| 163 // JNI functions | 163 // JNI functions |
| 164 static jlong Init(JNIEnv* env, jobject obj) { | 164 static jlong Init(JNIEnv* env, const JavaParamRef<jobject>& obj) { |
| 165 return reinterpret_cast<intptr_t>(new CookiesFetcher(env, obj, 0)); | 165 return reinterpret_cast<intptr_t>(new CookiesFetcher(env, obj, 0)); |
| 166 } | 166 } |
| 167 | 167 |
| 168 // Register native methods | 168 // Register native methods |
| 169 bool RegisterCookiesFetcher(JNIEnv* env) { | 169 bool RegisterCookiesFetcher(JNIEnv* env) { |
| 170 return RegisterNativesImpl(env); | 170 return RegisterNativesImpl(env); |
| 171 } | 171 } |
| OLD | NEW |