| 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 1189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1200 void RenderWidgetHostViewAndroid::CreateBrowserAccessibilityManagerIfNeeded() { | 1200 void RenderWidgetHostViewAndroid::CreateBrowserAccessibilityManagerIfNeeded() { |
| 1201 if (!host_ || host_->accessibility_mode() != AccessibilityModeComplete) | 1201 if (!host_ || host_->accessibility_mode() != AccessibilityModeComplete) |
| 1202 return; | 1202 return; |
| 1203 | 1203 |
| 1204 if (!GetBrowserAccessibilityManager()) { | 1204 if (!GetBrowserAccessibilityManager()) { |
| 1205 base::android::ScopedJavaLocalRef<jobject> obj; | 1205 base::android::ScopedJavaLocalRef<jobject> obj; |
| 1206 if (content_view_core_) | 1206 if (content_view_core_) |
| 1207 obj = content_view_core_->GetJavaObject(); | 1207 obj = content_view_core_->GetJavaObject(); |
| 1208 SetBrowserAccessibilityManager( | 1208 SetBrowserAccessibilityManager( |
| 1209 new BrowserAccessibilityManagerAndroid( | 1209 new BrowserAccessibilityManagerAndroid( |
| 1210 obj, BrowserAccessibilityManagerAndroid::GetEmptyDocument(), this)); | 1210 obj, |
| 1211 BrowserAccessibilityManagerAndroid::GetEmptyDocument(), |
| 1212 host_)); |
| 1211 } | 1213 } |
| 1212 } | 1214 } |
| 1213 | 1215 |
| 1214 void RenderWidgetHostViewAndroid::SetAccessibilityFocus(int acc_obj_id) { | |
| 1215 if (!host_) | |
| 1216 return; | |
| 1217 | |
| 1218 host_->AccessibilitySetFocus(acc_obj_id); | |
| 1219 } | |
| 1220 | |
| 1221 void RenderWidgetHostViewAndroid::AccessibilityDoDefaultAction(int acc_obj_id) { | |
| 1222 if (!host_) | |
| 1223 return; | |
| 1224 | |
| 1225 host_->AccessibilityDoDefaultAction(acc_obj_id); | |
| 1226 } | |
| 1227 | |
| 1228 void RenderWidgetHostViewAndroid::AccessibilityScrollToMakeVisible( | |
| 1229 int acc_obj_id, gfx::Rect subfocus) { | |
| 1230 if (!host_) | |
| 1231 return; | |
| 1232 | |
| 1233 host_->AccessibilityScrollToMakeVisible(acc_obj_id, subfocus); | |
| 1234 } | |
| 1235 | |
| 1236 void RenderWidgetHostViewAndroid::AccessibilityScrollToPoint( | |
| 1237 int acc_obj_id, gfx::Point point) { | |
| 1238 if (!host_) | |
| 1239 return; | |
| 1240 | |
| 1241 host_->AccessibilityScrollToPoint(acc_obj_id, point); | |
| 1242 } | |
| 1243 | |
| 1244 void RenderWidgetHostViewAndroid::AccessibilitySetTextSelection( | |
| 1245 int acc_obj_id, int start_offset, int end_offset) { | |
| 1246 if (!host_) | |
| 1247 return; | |
| 1248 | |
| 1249 host_->AccessibilitySetTextSelection( | |
| 1250 acc_obj_id, start_offset, end_offset); | |
| 1251 } | |
| 1252 | |
| 1253 gfx::Point RenderWidgetHostViewAndroid::GetLastTouchEventLocation() const { | |
| 1254 NOTIMPLEMENTED(); | |
| 1255 // Only used on Win8 | |
| 1256 return gfx::Point(); | |
| 1257 } | |
| 1258 | |
| 1259 void RenderWidgetHostViewAndroid::FatalAccessibilityTreeError() { | |
| 1260 if (!host_) | |
| 1261 return; | |
| 1262 | |
| 1263 host_->FatalAccessibilityTreeError(); | |
| 1264 SetBrowserAccessibilityManager(NULL); | |
| 1265 } | |
| 1266 | |
| 1267 bool RenderWidgetHostViewAndroid::LockMouse() { | 1216 bool RenderWidgetHostViewAndroid::LockMouse() { |
| 1268 NOTIMPLEMENTED(); | 1217 NOTIMPLEMENTED(); |
| 1269 return false; | 1218 return false; |
| 1270 } | 1219 } |
| 1271 | 1220 |
| 1272 void RenderWidgetHostViewAndroid::UnlockMouse() { | 1221 void RenderWidgetHostViewAndroid::UnlockMouse() { |
| 1273 NOTIMPLEMENTED(); | 1222 NOTIMPLEMENTED(); |
| 1274 } | 1223 } |
| 1275 | 1224 |
| 1276 // Methods called from the host to the render | 1225 // Methods called from the host to the render |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1505 // RenderWidgetHostView, public: | 1454 // RenderWidgetHostView, public: |
| 1506 | 1455 |
| 1507 // static | 1456 // static |
| 1508 RenderWidgetHostView* | 1457 RenderWidgetHostView* |
| 1509 RenderWidgetHostView::CreateViewForWidget(RenderWidgetHost* widget) { | 1458 RenderWidgetHostView::CreateViewForWidget(RenderWidgetHost* widget) { |
| 1510 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(widget); | 1459 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(widget); |
| 1511 return new RenderWidgetHostViewAndroid(rwhi, NULL); | 1460 return new RenderWidgetHostViewAndroid(rwhi, NULL); |
| 1512 } | 1461 } |
| 1513 | 1462 |
| 1514 } // namespace content | 1463 } // namespace content |
| OLD | NEW |