Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / browser / profiles / profile_android.h
blob0017b5ba0636165905ff24cb7ee19d17670d8241
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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_PROFILES_PROFILE_ANDROID_H_
6 #define CHROME_BROWSER_PROFILES_PROFILE_ANDROID_H_
8 #include <jni.h>
10 #include "base/android/scoped_java_ref.h"
11 #include "base/compiler_specific.h"
12 #include "base/supports_user_data.h"
14 class Profile;
16 // Android wrapper around profile that provides safer passage from java and
17 // back to native.
18 class ProfileAndroid : public base::SupportsUserData::Data {
19 public:
20 static ProfileAndroid* FromProfile(Profile* profile);
21 static Profile* FromProfileAndroid(jobject obj);
22 static bool RegisterProfileAndroid(JNIEnv* env);
24 static jobject GetLastUsedProfile(JNIEnv* env, jclass clazz);
26 explicit ProfileAndroid(Profile* profile);
27 virtual ~ProfileAndroid();
29 base::android::ScopedJavaLocalRef<jobject> GetJavaObject();
31 private:
32 Profile* profile_; // weak
33 base::android::ScopedJavaGlobalRef<jobject> obj_;
36 #endif // CHROME_BROWSER_PROFILES_PROFILE_ANDROID_H_