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

Unified Diff: ui/android/resources/resource_manager_impl.cc

Issue 1578353002: Pull the Activity context from WindowAndroid if possible (Closed) Base URL: https://chromium.googlesource.com/a/chromium/src.git@2564
Patch Set: Created 4 years, 11 months 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 side-by-side diff with in-line comments
Download patch
Index: ui/android/resources/resource_manager_impl.cc
diff --git a/ui/android/resources/resource_manager_impl.cc b/ui/android/resources/resource_manager_impl.cc
index a4f237331db4b9764c99be761a169c4f43d0a309..c5dd3b6cf58dda532210d33b19e8b7089a0dec77 100644
--- a/ui/android/resources/resource_manager_impl.cc
+++ b/ui/android/resources/resource_manager_impl.cc
@@ -13,6 +13,7 @@
#include "cc/resources/scoped_ui_resource.h"
#include "jni/ResourceManager_jni.h"
#include "ui/android/resources/ui_resource_provider.h"
+#include "ui/android/window_android.h"
#include "ui/gfx/android/java_bitmap.h"
#include "ui/gfx/geometry/rect.h"
@@ -27,11 +28,13 @@ ResourceManagerImpl* ResourceManagerImpl::FromJavaObject(jobject jobj) {
jobj));
}
-ResourceManagerImpl::ResourceManagerImpl() : host_(nullptr) {
+ResourceManagerImpl::ResourceManagerImpl(gfx::NativeWindow native_window)
+ : host_(nullptr) {
JNIEnv* env = base::android::AttachCurrentThread();
java_obj_.Reset(env, Java_ResourceManager_create(
- env, base::android::GetApplicationContext(),
- reinterpret_cast<intptr_t>(this)).obj());
+ env, native_window->GetJavaObject().obj(),
+ reinterpret_cast<intptr_t>(this))
+ .obj());
DCHECK(!java_obj_.is_null());
}
« no previous file with comments | « ui/android/resources/resource_manager_impl.h ('k') | ui/android/resources/resource_manager_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698