| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/browser/renderer_host/render_widget_host_view_android.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_android.h" |
| 6 | 6 |
| 7 #include <android/bitmap.h> | 7 #include <android/bitmap.h> |
| 8 | 8 |
| 9 #include "base/android/sys_utils.h" | 9 #include "base/android/sys_utils.h" |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 1146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1157 } | 1157 } |
| 1158 | 1158 |
| 1159 void RenderWidgetHostViewAndroid::OnSetNeedsFlushInput() { | 1159 void RenderWidgetHostViewAndroid::OnSetNeedsFlushInput() { |
| 1160 if (flush_input_requested_ || !content_view_core_) | 1160 if (flush_input_requested_ || !content_view_core_) |
| 1161 return; | 1161 return; |
| 1162 TRACE_EVENT0("input", "RenderWidgetHostViewAndroid::OnSetNeedsFlushInput"); | 1162 TRACE_EVENT0("input", "RenderWidgetHostViewAndroid::OnSetNeedsFlushInput"); |
| 1163 flush_input_requested_ = true; | 1163 flush_input_requested_ = true; |
| 1164 content_view_core_->GetWindowAndroid()->RequestVSyncUpdate(); | 1164 content_view_core_->GetWindowAndroid()->RequestVSyncUpdate(); |
| 1165 } | 1165 } |
| 1166 | 1166 |
| 1167 void RenderWidgetHostViewAndroid::CreateBrowserAccessibilityManagerIfNeeded() { | 1167 BrowserAccessibilityManager* |
| 1168 RenderWidgetHostViewAndroid::CreateBrowserAccessibilityManager( |
| 1169 BrowserAccessibilityDelegate* delegate) { |
| 1168 if (!host_ || host_->accessibility_mode() != AccessibilityModeComplete) | 1170 if (!host_ || host_->accessibility_mode() != AccessibilityModeComplete) |
| 1169 return; | 1171 return NULL; |
| 1170 | 1172 |
| 1171 if (!GetBrowserAccessibilityManager()) { | 1173 base::android::ScopedJavaLocalRef<jobject> obj; |
| 1172 base::android::ScopedJavaLocalRef<jobject> obj; | 1174 if (content_view_core_) |
| 1173 if (content_view_core_) | 1175 obj = content_view_core_->GetJavaObject(); |
| 1174 obj = content_view_core_->GetJavaObject(); | 1176 return new BrowserAccessibilityManagerAndroid( |
| 1175 SetBrowserAccessibilityManager( | 1177 obj, |
| 1176 new BrowserAccessibilityManagerAndroid( | 1178 BrowserAccessibilityManagerAndroid::GetEmptyDocument(), |
| 1177 obj, | 1179 delegate); |
| 1178 BrowserAccessibilityManagerAndroid::GetEmptyDocument(), | |
| 1179 host_)); | |
| 1180 } | |
| 1181 } | 1180 } |
| 1182 | 1181 |
| 1183 bool RenderWidgetHostViewAndroid::LockMouse() { | 1182 bool RenderWidgetHostViewAndroid::LockMouse() { |
| 1184 NOTIMPLEMENTED(); | 1183 NOTIMPLEMENTED(); |
| 1185 return false; | 1184 return false; |
| 1186 } | 1185 } |
| 1187 | 1186 |
| 1188 void RenderWidgetHostViewAndroid::UnlockMouse() { | 1187 void RenderWidgetHostViewAndroid::UnlockMouse() { |
| 1189 NOTIMPLEMENTED(); | 1188 NOTIMPLEMENTED(); |
| 1190 } | 1189 } |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1256 } | 1255 } |
| 1257 | 1256 |
| 1258 bool resize = false; | 1257 bool resize = false; |
| 1259 if (content_view_core != content_view_core_) { | 1258 if (content_view_core != content_view_core_) { |
| 1260 ReleaseLocksOnSurface(); | 1259 ReleaseLocksOnSurface(); |
| 1261 resize = true; | 1260 resize = true; |
| 1262 } | 1261 } |
| 1263 | 1262 |
| 1264 content_view_core_ = content_view_core; | 1263 content_view_core_ = content_view_core; |
| 1265 | 1264 |
| 1266 if (GetBrowserAccessibilityManager()) { | 1265 BrowserAccessibilityManager* manager = |
| 1266 host_->GetRootBrowserAccessibilityManager(); |
| 1267 if (manager) { |
| 1267 base::android::ScopedJavaLocalRef<jobject> obj; | 1268 base::android::ScopedJavaLocalRef<jobject> obj; |
| 1268 if (content_view_core_) | 1269 if (content_view_core_) |
| 1269 obj = content_view_core_->GetJavaObject(); | 1270 obj = content_view_core_->GetJavaObject(); |
| 1270 GetBrowserAccessibilityManager()->ToBrowserAccessibilityManagerAndroid()-> | 1271 manager->ToBrowserAccessibilityManagerAndroid()->SetContentViewCore(obj); |
| 1271 SetContentViewCore(obj); | |
| 1272 } | 1272 } |
| 1273 | 1273 |
| 1274 AttachLayers(); | 1274 AttachLayers(); |
| 1275 if (content_view_core_ && !using_synchronous_compositor_) { | 1275 if (content_view_core_ && !using_synchronous_compositor_) { |
| 1276 content_view_core_->GetWindowAndroid()->AddObserver(this); | 1276 content_view_core_->GetWindowAndroid()->AddObserver(this); |
| 1277 observing_root_window_ = true; | 1277 observing_root_window_ = true; |
| 1278 if (needs_begin_frame_) | 1278 if (needs_begin_frame_) |
| 1279 content_view_core_->GetWindowAndroid()->RequestVSyncUpdate(); | 1279 content_view_core_->GetWindowAndroid()->RequestVSyncUpdate(); |
| 1280 } | 1280 } |
| 1281 | 1281 |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1452 results->availableRect = display.work_area(); | 1452 results->availableRect = display.work_area(); |
| 1453 results->deviceScaleFactor = display.device_scale_factor(); | 1453 results->deviceScaleFactor = display.device_scale_factor(); |
| 1454 results->orientationAngle = display.RotationAsDegree(); | 1454 results->orientationAngle = display.RotationAsDegree(); |
| 1455 gfx::DeviceDisplayInfo info; | 1455 gfx::DeviceDisplayInfo info; |
| 1456 results->depth = info.GetBitsPerPixel(); | 1456 results->depth = info.GetBitsPerPixel(); |
| 1457 results->depthPerComponent = info.GetBitsPerComponent(); | 1457 results->depthPerComponent = info.GetBitsPerComponent(); |
| 1458 results->isMonochrome = (results->depthPerComponent == 0); | 1458 results->isMonochrome = (results->depthPerComponent == 0); |
| 1459 } | 1459 } |
| 1460 | 1460 |
| 1461 } // namespace content | 1461 } // namespace content |
| OLD | NEW |