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

Side by Side Diff: ui/gfx/android/shared_device_display_info.cc

Issue 219963002: Update SharedDeviveDisplay from ScreenOrientationListener. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 8 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 unified diff | Download patch
« no previous file with comments | « ui/android/java/src/org/chromium/ui/gfx/DeviceDisplayInfo.java ('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/gfx/android/shared_device_display_info.h" 5 #include "ui/gfx/android/shared_device_display_info.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/android/jni_string.h" 8 #include "base/android/jni_string.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "jni/DeviceDisplayInfo_jni.h" 10 #include "jni/DeviceDisplayInfo_jni.h"
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 106
107 SharedDeviceDisplayInfo::SharedDeviceDisplayInfo() 107 SharedDeviceDisplayInfo::SharedDeviceDisplayInfo()
108 : display_height_(0), 108 : display_height_(0),
109 display_width_(0), 109 display_width_(0),
110 bits_per_pixel_(0), 110 bits_per_pixel_(0),
111 bits_per_component_(0), 111 bits_per_component_(0),
112 dip_scale_(0), 112 dip_scale_(0),
113 smallest_dip_width_(0) { 113 smallest_dip_width_(0) {
114 JNIEnv* env = base::android::AttachCurrentThread(); 114 JNIEnv* env = base::android::AttachCurrentThread();
115 j_device_info_.Reset( 115 j_device_info_.Reset(
116 Java_DeviceDisplayInfo_createWithListener(env, 116 Java_DeviceDisplayInfo_create(
117 base::android::GetApplicationContext())); 117 env, base::android::GetApplicationContext()));
118 UpdateDisplayInfo(env, j_device_info_.obj(), 118 UpdateDisplayInfo(env, j_device_info_.obj(),
119 Java_DeviceDisplayInfo_getDisplayHeight(env, j_device_info_.obj()), 119 Java_DeviceDisplayInfo_getDisplayHeight(env, j_device_info_.obj()),
120 Java_DeviceDisplayInfo_getDisplayWidth(env, j_device_info_.obj()), 120 Java_DeviceDisplayInfo_getDisplayWidth(env, j_device_info_.obj()),
121 Java_DeviceDisplayInfo_getPhysicalDisplayHeight(env, 121 Java_DeviceDisplayInfo_getPhysicalDisplayHeight(env,
122 j_device_info_.obj()), 122 j_device_info_.obj()),
123 Java_DeviceDisplayInfo_getPhysicalDisplayWidth(env, j_device_info_.obj()), 123 Java_DeviceDisplayInfo_getPhysicalDisplayWidth(env, j_device_info_.obj()),
124 Java_DeviceDisplayInfo_getBitsPerPixel(env, j_device_info_.obj()), 124 Java_DeviceDisplayInfo_getBitsPerPixel(env, j_device_info_.obj()),
125 Java_DeviceDisplayInfo_getBitsPerComponent(env, j_device_info_.obj()), 125 Java_DeviceDisplayInfo_getBitsPerComponent(env, j_device_info_.obj()),
126 Java_DeviceDisplayInfo_getDIPScale(env, j_device_info_.obj()), 126 Java_DeviceDisplayInfo_getDIPScale(env, j_device_info_.obj()),
127 Java_DeviceDisplayInfo_getSmallestDIPWidth(env, j_device_info_.obj())); 127 Java_DeviceDisplayInfo_getSmallestDIPWidth(env, j_device_info_.obj()));
(...skipping 16 matching lines...) Expand all
144 display_width_ = static_cast<int>(display_width); 144 display_width_ = static_cast<int>(display_width);
145 physical_display_height_ = static_cast<int>(physical_display_height); 145 physical_display_height_ = static_cast<int>(physical_display_height);
146 physical_display_width_ = static_cast<int>(physical_display_width); 146 physical_display_width_ = static_cast<int>(physical_display_width);
147 bits_per_pixel_ = static_cast<int>(bits_per_pixel); 147 bits_per_pixel_ = static_cast<int>(bits_per_pixel);
148 bits_per_component_ = static_cast<int>(bits_per_component); 148 bits_per_component_ = static_cast<int>(bits_per_component);
149 dip_scale_ = static_cast<double>(dip_scale); 149 dip_scale_ = static_cast<double>(dip_scale);
150 smallest_dip_width_ = static_cast<int>(smallest_dip_width); 150 smallest_dip_width_ = static_cast<int>(smallest_dip_width);
151 } 151 }
152 152
153 } // namespace gfx 153 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/android/java/src/org/chromium/ui/gfx/DeviceDisplayInfo.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698