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 1272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1283 } | 1283 } |
1284 | 1284 |
1285 void RenderWidgetHostViewAndroid::OnSetNeedsFlushInput() { | 1285 void RenderWidgetHostViewAndroid::OnSetNeedsFlushInput() { |
1286 if (flush_input_requested_ || !content_view_core_) | 1286 if (flush_input_requested_ || !content_view_core_) |
1287 return; | 1287 return; |
1288 TRACE_EVENT0("input", "RenderWidgetHostViewAndroid::OnSetNeedsFlushInput"); | 1288 TRACE_EVENT0("input", "RenderWidgetHostViewAndroid::OnSetNeedsFlushInput"); |
1289 flush_input_requested_ = true; | 1289 flush_input_requested_ = true; |
1290 content_view_core_->GetWindowAndroid()->RequestVSyncUpdate(); | 1290 content_view_core_->GetWindowAndroid()->RequestVSyncUpdate(); |
1291 } | 1291 } |
1292 | 1292 |
1293 void RenderWidgetHostViewAndroid::CreateBrowserAccessibilityManagerIfNeeded() { | 1293 BrowserAccessibilityManager* |
1294 if (!host_ || host_->accessibility_mode() != AccessibilityModeComplete) | 1294 RenderWidgetHostViewAndroid::CreateBrowserAccessibilityManager( |
1295 return; | 1295 BrowserAccessibilityDelegate* delegate) { |
1296 | 1296 base::android::ScopedJavaLocalRef<jobject> obj; |
1297 if (!GetBrowserAccessibilityManager()) { | 1297 if (content_view_core_) |
1298 base::android::ScopedJavaLocalRef<jobject> obj; | 1298 obj = content_view_core_->GetJavaObject(); |
1299 if (content_view_core_) | 1299 return new BrowserAccessibilityManagerAndroid( |
1300 obj = content_view_core_->GetJavaObject(); | 1300 obj, |
1301 SetBrowserAccessibilityManager( | 1301 BrowserAccessibilityManagerAndroid::GetEmptyDocument(), |
1302 new BrowserAccessibilityManagerAndroid( | 1302 delegate); |
1303 obj, | |
1304 BrowserAccessibilityManagerAndroid::GetEmptyDocument(), | |
1305 host_)); | |
1306 } | |
1307 } | 1303 } |
1308 | 1304 |
1309 bool RenderWidgetHostViewAndroid::LockMouse() { | 1305 bool RenderWidgetHostViewAndroid::LockMouse() { |
1310 NOTIMPLEMENTED(); | 1306 NOTIMPLEMENTED(); |
1311 return false; | 1307 return false; |
1312 } | 1308 } |
1313 | 1309 |
1314 void RenderWidgetHostViewAndroid::UnlockMouse() { | 1310 void RenderWidgetHostViewAndroid::UnlockMouse() { |
1315 NOTIMPLEMENTED(); | 1311 NOTIMPLEMENTED(); |
1316 } | 1312 } |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1412 | 1408 |
1413 bool resize = false; | 1409 bool resize = false; |
1414 if (content_view_core != content_view_core_) { | 1410 if (content_view_core != content_view_core_) { |
1415 selection_controller_.reset(); | 1411 selection_controller_.reset(); |
1416 ReleaseLocksOnSurface(); | 1412 ReleaseLocksOnSurface(); |
1417 resize = true; | 1413 resize = true; |
1418 } | 1414 } |
1419 | 1415 |
1420 content_view_core_ = content_view_core; | 1416 content_view_core_ = content_view_core; |
1421 | 1417 |
1422 if (GetBrowserAccessibilityManager()) { | 1418 BrowserAccessibilityManager* manager = NULL; |
| 1419 if (host_) |
| 1420 manager = host_->GetRootBrowserAccessibilityManager(); |
| 1421 if (manager) { |
1423 base::android::ScopedJavaLocalRef<jobject> obj; | 1422 base::android::ScopedJavaLocalRef<jobject> obj; |
1424 if (content_view_core_) | 1423 if (content_view_core_) |
1425 obj = content_view_core_->GetJavaObject(); | 1424 obj = content_view_core_->GetJavaObject(); |
1426 GetBrowserAccessibilityManager()->ToBrowserAccessibilityManagerAndroid()-> | 1425 manager->ToBrowserAccessibilityManagerAndroid()->SetContentViewCore(obj); |
1427 SetContentViewCore(obj); | |
1428 } | 1426 } |
1429 | 1427 |
1430 AttachLayers(); | 1428 AttachLayers(); |
1431 | 1429 |
1432 if (!content_view_core_) | 1430 if (!content_view_core_) |
1433 return; | 1431 return; |
1434 | 1432 |
1435 if (!using_synchronous_compositor_) { | 1433 if (!using_synchronous_compositor_) { |
1436 content_view_core_->GetWindowAndroid()->AddObserver(this); | 1434 content_view_core_->GetWindowAndroid()->AddObserver(this); |
1437 observing_root_window_ = true; | 1435 observing_root_window_ = true; |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1641 results->orientationAngle = display.RotationAsDegree(); | 1639 results->orientationAngle = display.RotationAsDegree(); |
1642 results->orientationType = | 1640 results->orientationType = |
1643 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); | 1641 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); |
1644 gfx::DeviceDisplayInfo info; | 1642 gfx::DeviceDisplayInfo info; |
1645 results->depth = info.GetBitsPerPixel(); | 1643 results->depth = info.GetBitsPerPixel(); |
1646 results->depthPerComponent = info.GetBitsPerComponent(); | 1644 results->depthPerComponent = info.GetBitsPerComponent(); |
1647 results->isMonochrome = (results->depthPerComponent == 0); | 1645 results->isMonochrome = (results->depthPerComponent == 0); |
1648 } | 1646 } |
1649 | 1647 |
1650 } // namespace content | 1648 } // namespace content |
OLD | NEW |