1b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)// Copyright (c) 2013 The Chromium Authors. All rights reserved. 2b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be 3b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)// found in the LICENSE file. 4b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles) 5b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)#include "base/android/context_types.h" 6b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles) 7b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)#include "base/android/jni_android.h" 8b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)#include "base/android/scoped_java_ref.h" 9b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)#include "base/files/file_path.h" 10b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)#include "jni/ContextTypes_jni.h" 11b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles) 12b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)namespace base { 13b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)namespace android { 14b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles) 15b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)bool IsRunningInWebapp() { 16b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles) JNIEnv* env = AttachCurrentThread(); 17b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles) return static_cast<bool>( 18b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles) Java_ContextTypes_isRunningInWebapp(env, GetApplicationContext())); 19b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)} 20b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles) 21b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)bool RegisterContextTypes(JNIEnv* env) { 22b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles) return RegisterNativesImpl(env); 23b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)} 24b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles) 25b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)} // namespace android 26b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)} // namespace base 27