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

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

Issue 447493002: [Android] Force showing insertion handle when paste popup activated (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix for emptiness Created 6 years, 4 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/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 1360 matching lines...) Expand 10 before | Expand all | Expand 10 after
1371 void RenderWidgetHostViewAndroid::MoveCaret(const gfx::Point& point) { 1371 void RenderWidgetHostViewAndroid::MoveCaret(const gfx::Point& point) {
1372 if (host_) 1372 if (host_)
1373 host_->MoveCaret(point); 1373 host_->MoveCaret(point);
1374 } 1374 }
1375 1375
1376 void RenderWidgetHostViewAndroid::HideTextHandles() { 1376 void RenderWidgetHostViewAndroid::HideTextHandles() {
1377 if (selection_controller_) 1377 if (selection_controller_)
1378 selection_controller_->HideAndDisallowShowingAutomatically(); 1378 selection_controller_->HideAndDisallowShowingAutomatically();
1379 } 1379 }
1380 1380
1381 void RenderWidgetHostViewAndroid::OnShowingPastePopup(
1382 const gfx::PointF& point) {
1383 if (!selection_controller_)
1384 return;
1385
1386 // As the paste popup may be triggered *before* the bounds and editability
1387 // of the region have been updated, explicitly set the properties now.
1388 // TODO(jdduke): Remove this workaround when auxiliary paste popup
1389 // notifications are no longer required, crbug.com/398170.
1390 gfx::RectF rect(point, gfx::SizeF());
1391 TouchHandleOrientation orientation = TOUCH_HANDLE_CENTER;
1392 const bool visible = true;
1393 HideTextHandles();
1394 ShowSelectionHandlesAutomatically();
1395 selection_controller_->OnSelectionEditable(true);
1396 selection_controller_->OnSelectionEmpty(true);
1397 selection_controller_->OnSelectionBoundsChanged(
1398 rect, orientation, visible, rect, orientation, visible);
1399 }
1400
1381 SkColor RenderWidgetHostViewAndroid::GetCachedBackgroundColor() const { 1401 SkColor RenderWidgetHostViewAndroid::GetCachedBackgroundColor() const {
1382 return cached_background_color_; 1402 return cached_background_color_;
1383 } 1403 }
1384 1404
1385 void RenderWidgetHostViewAndroid::DidOverscroll( 1405 void RenderWidgetHostViewAndroid::DidOverscroll(
1386 const DidOverscrollParams& params) { 1406 const DidOverscrollParams& params) {
1387 if (!content_view_core_ || !layer_ || !is_showing_) 1407 if (!content_view_core_ || !layer_ || !is_showing_)
1388 return; 1408 return;
1389 1409
1390 const float device_scale_factor = content_view_core_->GetDpiScale(); 1410 const float device_scale_factor = content_view_core_->GetDpiScale();
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
1655 results->orientationAngle = display.RotationAsDegree(); 1675 results->orientationAngle = display.RotationAsDegree();
1656 results->orientationType = 1676 results->orientationType =
1657 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); 1677 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display);
1658 gfx::DeviceDisplayInfo info; 1678 gfx::DeviceDisplayInfo info;
1659 results->depth = info.GetBitsPerPixel(); 1679 results->depth = info.GetBitsPerPixel();
1660 results->depthPerComponent = info.GetBitsPerComponent(); 1680 results->depthPerComponent = info.GetBitsPerComponent();
1661 results->isMonochrome = (results->depthPerComponent == 0); 1681 results->isMonochrome = (results->depthPerComponent == 0);
1662 } 1682 }
1663 1683
1664 } // namespace content 1684 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698