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