| 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/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 1132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1143 } | 1143 } |
| 1144 | 1144 |
| 1145 void RenderWidgetHostViewAndroid::OnSetNeedsFlushInput() { | 1145 void RenderWidgetHostViewAndroid::OnSetNeedsFlushInput() { |
| 1146 if (flush_input_requested_ || !content_view_core_) | 1146 if (flush_input_requested_ || !content_view_core_) |
| 1147 return; | 1147 return; |
| 1148 TRACE_EVENT0("input", "RenderWidgetHostViewAndroid::OnSetNeedsFlushInput"); | 1148 TRACE_EVENT0("input", "RenderWidgetHostViewAndroid::OnSetNeedsFlushInput"); |
| 1149 flush_input_requested_ = true; | 1149 flush_input_requested_ = true; |
| 1150 content_view_core_->GetWindowAndroid()->RequestVSyncUpdate(); | 1150 content_view_core_->GetWindowAndroid()->RequestVSyncUpdate(); |
| 1151 } | 1151 } |
| 1152 | 1152 |
| 1153 BrowserAccessibilityManager* | 1153 void RenderWidgetHostViewAndroid::CreateBrowserAccessibilityManagerIfNeeded() { |
| 1154 RenderWidgetHostViewAndroid::CreateBrowserAccessibilityManager( | 1154 if (!host_ || host_->accessibility_mode() != AccessibilityModeComplete) |
| 1155 BrowserAccessibilityDelegate* delegate) { | 1155 return; |
| 1156 base::android::ScopedJavaLocalRef<jobject> obj; | 1156 |
| 1157 if (content_view_core_) | 1157 if (!GetBrowserAccessibilityManager()) { |
| 1158 obj = content_view_core_->GetJavaObject(); | 1158 base::android::ScopedJavaLocalRef<jobject> obj; |
| 1159 return new BrowserAccessibilityManagerAndroid( | 1159 if (content_view_core_) |
| 1160 obj, | 1160 obj = content_view_core_->GetJavaObject(); |
| 1161 BrowserAccessibilityManagerAndroid::GetEmptyDocument(), | 1161 SetBrowserAccessibilityManager( |
| 1162 delegate); | 1162 new BrowserAccessibilityManagerAndroid( |
| 1163 obj, |
| 1164 BrowserAccessibilityManagerAndroid::GetEmptyDocument(), |
| 1165 host_)); |
| 1166 } |
| 1163 } | 1167 } |
| 1164 | 1168 |
| 1165 bool RenderWidgetHostViewAndroid::LockMouse() { | 1169 bool RenderWidgetHostViewAndroid::LockMouse() { |
| 1166 NOTIMPLEMENTED(); | 1170 NOTIMPLEMENTED(); |
| 1167 return false; | 1171 return false; |
| 1168 } | 1172 } |
| 1169 | 1173 |
| 1170 void RenderWidgetHostViewAndroid::UnlockMouse() { | 1174 void RenderWidgetHostViewAndroid::UnlockMouse() { |
| 1171 NOTIMPLEMENTED(); | 1175 NOTIMPLEMENTED(); |
| 1172 } | 1176 } |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1257 } | 1261 } |
| 1258 | 1262 |
| 1259 bool resize = false; | 1263 bool resize = false; |
| 1260 if (content_view_core != content_view_core_) { | 1264 if (content_view_core != content_view_core_) { |
| 1261 ReleaseLocksOnSurface(); | 1265 ReleaseLocksOnSurface(); |
| 1262 resize = true; | 1266 resize = true; |
| 1263 } | 1267 } |
| 1264 | 1268 |
| 1265 content_view_core_ = content_view_core; | 1269 content_view_core_ = content_view_core; |
| 1266 | 1270 |
| 1267 BrowserAccessibilityManager* manager = NULL; | 1271 if (GetBrowserAccessibilityManager()) { |
| 1268 if (host_) | |
| 1269 manager = host_->GetRootBrowserAccessibilityManager(); | |
| 1270 if (manager) { | |
| 1271 base::android::ScopedJavaLocalRef<jobject> obj; | 1272 base::android::ScopedJavaLocalRef<jobject> obj; |
| 1272 if (content_view_core_) | 1273 if (content_view_core_) |
| 1273 obj = content_view_core_->GetJavaObject(); | 1274 obj = content_view_core_->GetJavaObject(); |
| 1274 manager->ToBrowserAccessibilityManagerAndroid()->SetContentViewCore(obj); | 1275 GetBrowserAccessibilityManager()->ToBrowserAccessibilityManagerAndroid()-> |
| 1276 SetContentViewCore(obj); |
| 1275 } | 1277 } |
| 1276 | 1278 |
| 1277 AttachLayers(); | 1279 AttachLayers(); |
| 1278 if (content_view_core_ && !using_synchronous_compositor_) { | 1280 if (content_view_core_ && !using_synchronous_compositor_) { |
| 1279 content_view_core_->GetWindowAndroid()->AddObserver(this); | 1281 content_view_core_->GetWindowAndroid()->AddObserver(this); |
| 1280 observing_root_window_ = true; | 1282 observing_root_window_ = true; |
| 1281 if (needs_begin_frame_) | 1283 if (needs_begin_frame_) |
| 1282 content_view_core_->GetWindowAndroid()->RequestVSyncUpdate(); | 1284 content_view_core_->GetWindowAndroid()->RequestVSyncUpdate(); |
| 1283 } | 1285 } |
| 1284 | 1286 |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1481 results->orientationAngle = display.RotationAsDegree(); | 1483 results->orientationAngle = display.RotationAsDegree(); |
| 1482 results->orientationType = | 1484 results->orientationType = |
| 1483 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); | 1485 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); |
| 1484 gfx::DeviceDisplayInfo info; | 1486 gfx::DeviceDisplayInfo info; |
| 1485 results->depth = info.GetBitsPerPixel(); | 1487 results->depth = info.GetBitsPerPixel(); |
| 1486 results->depthPerComponent = info.GetBitsPerComponent(); | 1488 results->depthPerComponent = info.GetBitsPerComponent(); |
| 1487 results->isMonochrome = (results->depthPerComponent == 0); | 1489 results->isMonochrome = (results->depthPerComponent == 0); |
| 1488 } | 1490 } |
| 1489 | 1491 |
| 1490 } // namespace content | 1492 } // namespace content |
| OLD | NEW |