| 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/recently_closed_tabs_bridge.h" | 5 #include "chrome/browser/android/recently_closed_tabs_bridge.h" |
| 6 | 6 |
| 7 #include "base/android/jni_string.h" | 7 #include "base/android/jni_string.h" |
| 8 #include "chrome/browser/android/tab_android.h" | 8 #include "chrome/browser/android/tab_android.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/profiles/profile_android.h" | 10 #include "chrome/browser/profiles/profile_android.h" |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 // TabRestoreServiceFactory::GetForProfile() can return NULL (e.g. in | 146 // TabRestoreServiceFactory::GetForProfile() can return NULL (e.g. in |
| 147 // incognito mode). | 147 // incognito mode). |
| 148 if (tab_restore_service_) { | 148 if (tab_restore_service_) { |
| 149 // This does nothing if the tabs have already been loaded or they | 149 // This does nothing if the tabs have already been loaded or they |
| 150 // shouldn't be loaded. | 150 // shouldn't be loaded. |
| 151 tab_restore_service_->LoadTabsFromLastSession(); | 151 tab_restore_service_->LoadTabsFromLastSession(); |
| 152 tab_restore_service_->AddObserver(this); | 152 tab_restore_service_->AddObserver(this); |
| 153 } | 153 } |
| 154 } | 154 } |
| 155 | 155 |
| 156 static jint Init(JNIEnv* env, jobject obj, jobject jprofile) { | 156 static jlong Init(JNIEnv* env, jobject obj, jobject jprofile) { |
| 157 RecentlyClosedTabsBridge* bridge = new RecentlyClosedTabsBridge( | 157 RecentlyClosedTabsBridge* bridge = new RecentlyClosedTabsBridge( |
| 158 ProfileAndroid::FromProfileAndroid(jprofile)); | 158 ProfileAndroid::FromProfileAndroid(jprofile)); |
| 159 return reinterpret_cast<jint>(bridge); | 159 return reinterpret_cast<intptr_t>(bridge); |
| 160 } | 160 } |
| 161 | 161 |
| 162 // static | 162 // static |
| 163 bool RecentlyClosedTabsBridge::Register(JNIEnv* env) { | 163 bool RecentlyClosedTabsBridge::Register(JNIEnv* env) { |
| 164 return RegisterNativesImpl(env); | 164 return RegisterNativesImpl(env); |
| 165 } | 165 } |
| OLD | NEW |