Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(102)

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_android.cc

Issue 1066053002: [Android] Allow custom ActionMode creation via ContentViewClient (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/build_info.h" 9 #include "base/android/build_info.h"
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 1324 matching lines...) Expand 10 before | Expand all | Expand 10 after
1335 } 1335 }
1336 1336
1337 void RenderWidgetHostViewAndroid::SelectBetweenCoordinates( 1337 void RenderWidgetHostViewAndroid::SelectBetweenCoordinates(
1338 const gfx::PointF& base, 1338 const gfx::PointF& base,
1339 const gfx::PointF& extent) { 1339 const gfx::PointF& extent) {
1340 DCHECK(content_view_core_); 1340 DCHECK(content_view_core_);
1341 content_view_core_->SelectBetweenCoordinates(base, extent); 1341 content_view_core_->SelectBetweenCoordinates(base, extent);
1342 } 1342 }
1343 1343
1344 void RenderWidgetHostViewAndroid::OnSelectionEvent( 1344 void RenderWidgetHostViewAndroid::OnSelectionEvent(
1345 ui::SelectionEventType event, 1345 ui::SelectionEventType event) {
1346 const gfx::PointF& position) {
1347 DCHECK(content_view_core_); 1346 DCHECK(content_view_core_);
1347 DCHECK(selection_controller_);
1348 // Showing the selection action bar can alter the current View coordinates in 1348 // Showing the selection action bar can alter the current View coordinates in
1349 // such a way that the current MotionEvent stream is suddenly shifted in 1349 // such a way that the current MotionEvent stream is suddenly shifted in
1350 // space. Avoid the associated scroll jump by pre-emptively cancelling gesture 1350 // space. Avoid the associated scroll jump by pre-emptively cancelling gesture
1351 // detection; scrolling after the selection is activated is unnecessary. 1351 // detection; scrolling after the selection is activated is unnecessary.
1352 if (event == ui::SelectionEventType::SELECTION_SHOWN) 1352 if (event == ui::SelectionEventType::SELECTION_SHOWN)
1353 ResetGestureDetection(); 1353 ResetGestureDetection();
1354 content_view_core_->OnSelectionEvent(event, position); 1354 content_view_core_->OnSelectionEvent(
1355 event, selection_controller_->GetStartPosition(),
1356 selection_controller_->GetRectBetweenBoundsIncludingHandles());
1355 } 1357 }
1356 1358
1357 scoped_ptr<ui::TouchHandleDrawable> 1359 scoped_ptr<ui::TouchHandleDrawable>
1358 RenderWidgetHostViewAndroid::CreateDrawable() { 1360 RenderWidgetHostViewAndroid::CreateDrawable() {
1359 DCHECK(content_view_core_); 1361 DCHECK(content_view_core_);
1360 if (!using_browser_compositor_) 1362 if (!using_browser_compositor_)
1361 return content_view_core_->CreatePopupTouchHandleDrawable(); 1363 return content_view_core_->CreatePopupTouchHandleDrawable();
1362 1364
1363 return scoped_ptr<ui::TouchHandleDrawable>(new CompositedTouchHandleDrawable( 1365 return scoped_ptr<ui::TouchHandleDrawable>(new CompositedTouchHandleDrawable(
1364 content_view_core_->GetLayer().get(), 1366 content_view_core_->GetLayer().get(),
(...skipping 747 matching lines...) Expand 10 before | Expand all | Expand 10 after
2112 results->orientationAngle = display.RotationAsDegree(); 2114 results->orientationAngle = display.RotationAsDegree();
2113 results->orientationType = 2115 results->orientationType =
2114 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); 2116 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display);
2115 gfx::DeviceDisplayInfo info; 2117 gfx::DeviceDisplayInfo info;
2116 results->depth = info.GetBitsPerPixel(); 2118 results->depth = info.GetBitsPerPixel();
2117 results->depthPerComponent = info.GetBitsPerComponent(); 2119 results->depthPerComponent = info.GetBitsPerComponent();
2118 results->isMonochrome = (results->depthPerComponent == 0); 2120 results->isMonochrome = (results->depthPerComponent == 0);
2119 } 2121 }
2120 2122
2121 } // namespace content 2123 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698