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