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

Unified Diff: ui/android/window_android.cc

Issue 1409833004: Add DeviceDisplayInfo getter in WindowAndroid. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Pass display area instead of NativeWindow to GLHelperHolder. Created 5 years, 2 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/window_android.cc
diff --git a/ui/android/window_android.cc b/ui/android/window_android.cc
index 5fe7779a2716b142c9818f9a3b8dde01d9d0cd9e..0892bafa0651ad2f3630b7d59cf4cbd8902ff7be 100644
--- a/ui/android/window_android.cc
+++ b/ui/android/window_android.cc
@@ -12,6 +12,7 @@
#include "jni/WindowAndroid_jni.h"
#include "ui/android/window_android_compositor.h"
#include "ui/android/window_android_observer.h"
+#include "ui/gfx/android/device_display_info.h"
namespace ui {
@@ -20,6 +21,9 @@ using base::android::ScopedJavaLocalRef;
WindowAndroid::WindowAndroid(JNIEnv* env, jobject obj) : compositor_(NULL) {
java_window_.Reset(env, obj);
+ // TODO(gsennton) have our device display info depend on our (java) display
+ // context
+ device_display_info_ = make_scoped_ptr(new gfx::DeviceDisplayInfo());
Ted C 2015/11/05 23:15:58 DeviceDisplayInfo seems very tied to the applicati
gsennton 2015/11/06 16:52:14 Right, so the idea would be to no longer hold on t
Ted C 2015/11/25 19:35:52 Again, I don't know what the lifecycles of either
gsennton 2015/12/02 15:37:05 Looking at this again, I don't think we should hol
Ted C 2015/12/03 04:23:56 I think the best approach in many of these cases w
boliu 2015/12/08 08:21:54 +1
gsennton 2015/12/10 12:29:54 Yeah, the idea with this patch is to only add the
}
void WindowAndroid::Destroy(JNIEnv* env, jobject obj) {
@@ -132,6 +136,10 @@ bool WindowAndroid::CanRequestPermission(const std::string& permission) {
base::android::ConvertUTF8ToJavaString(env, permission).obj());
}
+const gfx::DeviceDisplayInfo& WindowAndroid::GetDeviceDisplayInfo() {
AKV 2015/11/04 14:20:48 DCHECK(device_display_info_) ?
boliu 2015/12/08 08:21:54 or just make device_display_info_ const
gsennton 2015/12/10 12:29:54 I don't think we want to make it const since it sh
boliu 2015/12/10 16:38:20 Pointer can be const, pointee (?) don't need to be
gsennton 2015/12/14 18:10:32 Done.
+ return *device_display_info_;
+}
+
// ----------------------------------------------------------------------------
// Native JNI methods
// ----------------------------------------------------------------------------

Powered by Google App Engine
This is Rietveld 408576698