Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(39)

Side by Side Diff: ui/android/window_android.cc

Issue 1419843002: Hold a reference to any kind of context in WindowAndroid. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Pass Context instead of WindowAndroid from native ResourceManager to java side. Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« ui/android/window_android.h ('K') | « ui/android/window_android.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "ui/android/window_android.h" 5 #include "ui/android/window_android.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/android/jni_array.h" 8 #include "base/android/jni_array.h"
9 #include "base/android/jni_string.h" 9 #include "base/android/jni_string.h"
10 #include "base/android/jni_weak_ref.h" 10 #include "base/android/jni_weak_ref.h"
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 } 125 }
126 126
127 bool WindowAndroid::CanRequestPermission(const std::string& permission) { 127 bool WindowAndroid::CanRequestPermission(const std::string& permission) {
128 JNIEnv* env = AttachCurrentThread(); 128 JNIEnv* env = AttachCurrentThread();
129 return Java_WindowAndroid_canRequestPermission( 129 return Java_WindowAndroid_canRequestPermission(
130 env, 130 env,
131 GetJavaObject().obj(), 131 GetJavaObject().obj(),
132 base::android::ConvertUTF8ToJavaString(env, permission).obj()); 132 base::android::ConvertUTF8ToJavaString(env, permission).obj());
133 } 133 }
134 134
135 base::android::ScopedJavaLocalRef<jobject>
136 WindowAndroid::GetJavaDisplayContext() {
137 JNIEnv* env = AttachCurrentThread();
138 return Java_WindowAndroid_getDisplayContext(env, GetJavaObject().obj());
139 }
140
135 // ---------------------------------------------------------------------------- 141 // ----------------------------------------------------------------------------
136 // Native JNI methods 142 // Native JNI methods
137 // ---------------------------------------------------------------------------- 143 // ----------------------------------------------------------------------------
138 144
139 jlong Init(JNIEnv* env, const JavaParamRef<jobject>& obj) { 145 jlong Init(JNIEnv* env, const JavaParamRef<jobject>& obj) {
140 WindowAndroid* window = new WindowAndroid(env, obj); 146 WindowAndroid* window = new WindowAndroid(env, obj);
141 return reinterpret_cast<intptr_t>(window); 147 return reinterpret_cast<intptr_t>(window);
142 } 148 }
143 149
144 } // namespace ui 150 } // namespace ui
OLDNEW
« ui/android/window_android.h ('K') | « ui/android/window_android.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698