| 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 1126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1137 } | 1137 } |
| 1138 | 1138 |
| 1139 void RenderWidgetHostViewAndroid::OnSetNeedsFlushInput() { | 1139 void RenderWidgetHostViewAndroid::OnSetNeedsFlushInput() { |
| 1140 if (flush_input_requested_ || !content_view_core_) | 1140 if (flush_input_requested_ || !content_view_core_) |
| 1141 return; | 1141 return; |
| 1142 TRACE_EVENT0("input", "RenderWidgetHostViewAndroid::OnSetNeedsFlushInput"); | 1142 TRACE_EVENT0("input", "RenderWidgetHostViewAndroid::OnSetNeedsFlushInput"); |
| 1143 flush_input_requested_ = true; | 1143 flush_input_requested_ = true; |
| 1144 content_view_core_->GetWindowAndroid()->RequestVSyncUpdate(); | 1144 content_view_core_->GetWindowAndroid()->RequestVSyncUpdate(); |
| 1145 } | 1145 } |
| 1146 | 1146 |
| 1147 void RenderWidgetHostViewAndroid::CreateBrowserAccessibilityManagerIfNeeded() { | 1147 BrowserAccessibilityManager* |
| 1148 RenderWidgetHostViewAndroid::CreateBrowserAccessibilityManager( |
| 1149 BrowserAccessibilityDelegate* delegate) { |
| 1148 if (!host_ || host_->accessibility_mode() != AccessibilityModeComplete) | 1150 if (!host_ || host_->accessibility_mode() != AccessibilityModeComplete) |
| 1149 return; | 1151 return NULL; |
| 1150 | 1152 |
| 1151 if (!GetBrowserAccessibilityManager()) { | 1153 base::android::ScopedJavaLocalRef<jobject> obj; |
| 1152 base::android::ScopedJavaLocalRef<jobject> obj; | 1154 if (content_view_core_) |
| 1153 if (content_view_core_) | 1155 obj = content_view_core_->GetJavaObject(); |
| 1154 obj = content_view_core_->GetJavaObject(); | 1156 return new BrowserAccessibilityManagerAndroid( |
| 1155 SetBrowserAccessibilityManager( | 1157 obj, |
| 1156 new BrowserAccessibilityManagerAndroid( | 1158 BrowserAccessibilityManagerAndroid::GetEmptyDocument(), |
| 1157 obj, | 1159 delegate); |
| 1158 BrowserAccessibilityManagerAndroid::GetEmptyDocument(), | |
| 1159 host_)); | |
| 1160 } | |
| 1161 } | 1160 } |
| 1162 | 1161 |
| 1163 bool RenderWidgetHostViewAndroid::LockMouse() { | 1162 bool RenderWidgetHostViewAndroid::LockMouse() { |
| 1164 NOTIMPLEMENTED(); | 1163 NOTIMPLEMENTED(); |
| 1165 return false; | 1164 return false; |
| 1166 } | 1165 } |
| 1167 | 1166 |
| 1168 void RenderWidgetHostViewAndroid::UnlockMouse() { | 1167 void RenderWidgetHostViewAndroid::UnlockMouse() { |
| 1169 NOTIMPLEMENTED(); | 1168 NOTIMPLEMENTED(); |
| 1170 } | 1169 } |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1255 } | 1254 } |
| 1256 | 1255 |
| 1257 bool resize = false; | 1256 bool resize = false; |
| 1258 if (content_view_core != content_view_core_) { | 1257 if (content_view_core != content_view_core_) { |
| 1259 ReleaseLocksOnSurface(); | 1258 ReleaseLocksOnSurface(); |
| 1260 resize = true; | 1259 resize = true; |
| 1261 } | 1260 } |
| 1262 | 1261 |
| 1263 content_view_core_ = content_view_core; | 1262 content_view_core_ = content_view_core; |
| 1264 | 1263 |
| 1265 if (GetBrowserAccessibilityManager()) { | 1264 BrowserAccessibilityManager* manager = |
| 1265 host_->GetRootBrowserAccessibilityManager(); |
| 1266 if (manager) { |
| 1266 base::android::ScopedJavaLocalRef<jobject> obj; | 1267 base::android::ScopedJavaLocalRef<jobject> obj; |
| 1267 if (content_view_core_) | 1268 if (content_view_core_) |
| 1268 obj = content_view_core_->GetJavaObject(); | 1269 obj = content_view_core_->GetJavaObject(); |
| 1269 GetBrowserAccessibilityManager()->ToBrowserAccessibilityManagerAndroid()-> | 1270 manager->ToBrowserAccessibilityManagerAndroid()->SetContentViewCore(obj); |
| 1270 SetContentViewCore(obj); | |
| 1271 } | 1271 } |
| 1272 | 1272 |
| 1273 AttachLayers(); | 1273 AttachLayers(); |
| 1274 if (content_view_core_ && !using_synchronous_compositor_) { | 1274 if (content_view_core_ && !using_synchronous_compositor_) { |
| 1275 content_view_core_->GetWindowAndroid()->AddObserver(this); | 1275 content_view_core_->GetWindowAndroid()->AddObserver(this); |
| 1276 observing_root_window_ = true; | 1276 observing_root_window_ = true; |
| 1277 if (needs_begin_frame_) | 1277 if (needs_begin_frame_) |
| 1278 content_view_core_->GetWindowAndroid()->RequestVSyncUpdate(); | 1278 content_view_core_->GetWindowAndroid()->RequestVSyncUpdate(); |
| 1279 } | 1279 } |
| 1280 | 1280 |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1455 results->availableRect = display.work_area(); | 1455 results->availableRect = display.work_area(); |
| 1456 results->deviceScaleFactor = display.device_scale_factor(); | 1456 results->deviceScaleFactor = display.device_scale_factor(); |
| 1457 results->orientationAngle = display.RotationAsDegree(); | 1457 results->orientationAngle = display.RotationAsDegree(); |
| 1458 gfx::DeviceDisplayInfo info; | 1458 gfx::DeviceDisplayInfo info; |
| 1459 results->depth = info.GetBitsPerPixel(); | 1459 results->depth = info.GetBitsPerPixel(); |
| 1460 results->depthPerComponent = info.GetBitsPerComponent(); | 1460 results->depthPerComponent = info.GetBitsPerComponent(); |
| 1461 results->isMonochrome = (results->depthPerComponent == 0); | 1461 results->isMonochrome = (results->depthPerComponent == 0); |
| 1462 } | 1462 } |
| 1463 | 1463 |
| 1464 } // namespace content | 1464 } // namespace content |
| OLD | NEW |