OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/android/foreign_session_helper.h" | 5 #include "chrome/browser/android/foreign_session_helper.h" |
6 | 6 |
7 #include <jni.h> | 7 #include <jni.h> |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include "base/android/jni_string.h" | 10 #include "base/android/jni_string.h" |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 } | 189 } |
190 | 190 |
191 void ForeignSessionHelper::FireForeignSessionCallback() { | 191 void ForeignSessionHelper::FireForeignSessionCallback() { |
192 if (callback_.is_null()) | 192 if (callback_.is_null()) |
193 return; | 193 return; |
194 | 194 |
195 JNIEnv* env = AttachCurrentThread(); | 195 JNIEnv* env = AttachCurrentThread(); |
196 Java_ForeignSessionCallback_onUpdated(env, callback_); | 196 Java_ForeignSessionCallback_onUpdated(env, callback_); |
197 } | 197 } |
198 | 198 |
199 void ForeignSessionHelper::OnSyncConfigurationCompleted() { | 199 void ForeignSessionHelper::OnSyncConfigurationCompleted( |
| 200 syncer::SyncService* sync) { |
200 FireForeignSessionCallback(); | 201 FireForeignSessionCallback(); |
201 } | 202 } |
202 | 203 |
203 void ForeignSessionHelper::OnForeignSessionUpdated() { | 204 void ForeignSessionHelper::OnForeignSessionUpdated(syncer::SyncService* sync) { |
204 FireForeignSessionCallback(); | 205 FireForeignSessionCallback(); |
205 } | 206 } |
206 | 207 |
207 jboolean ForeignSessionHelper::GetForeignSessions( | 208 jboolean ForeignSessionHelper::GetForeignSessions( |
208 JNIEnv* env, | 209 JNIEnv* env, |
209 const JavaParamRef<jobject>& obj, | 210 const JavaParamRef<jobject>& obj, |
210 const JavaParamRef<jobject>& result) { | 211 const JavaParamRef<jobject>& result) { |
211 OpenTabsUIDelegate* open_tabs = GetOpenTabsUIDelegate(profile_); | 212 OpenTabsUIDelegate* open_tabs = GetOpenTabsUIDelegate(profile_); |
212 if (!open_tabs) | 213 if (!open_tabs) |
213 return false; | 214 return false; |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 const JavaParamRef<jstring>& session_tag) { | 318 const JavaParamRef<jstring>& session_tag) { |
318 OpenTabsUIDelegate* open_tabs = GetOpenTabsUIDelegate(profile_); | 319 OpenTabsUIDelegate* open_tabs = GetOpenTabsUIDelegate(profile_); |
319 if (open_tabs) | 320 if (open_tabs) |
320 open_tabs->DeleteForeignSession(ConvertJavaStringToUTF8(env, session_tag)); | 321 open_tabs->DeleteForeignSession(ConvertJavaStringToUTF8(env, session_tag)); |
321 } | 322 } |
322 | 323 |
323 // static | 324 // static |
324 bool ForeignSessionHelper::RegisterForeignSessionHelper(JNIEnv* env) { | 325 bool ForeignSessionHelper::RegisterForeignSessionHelper(JNIEnv* env) { |
325 return RegisterNativesImpl(env); | 326 return RegisterNativesImpl(env); |
326 } | 327 } |
OLD | NEW |