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

Unified Diff: content/browser/renderer_host/render_widget_host_view_android.cc

Issue 908033003: Remove dependency from ui/base to cc on non-Android platforms (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/base/BUILD.gn » ('j') | ui/base/BUILD.gn » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_widget_host_view_android.cc
diff --git a/content/browser/renderer_host/render_widget_host_view_android.cc b/content/browser/renderer_host/render_widget_host_view_android.cc
index c249782b86324b842ef4a2404474a232b0702b6e..4df06bd22ea3ddeb28596fbcd9442857db5c0e1e 100644
--- a/content/browser/renderer_host/render_widget_host_view_android.cc
+++ b/content/browser/renderer_host/render_widget_host_view_android.cc
@@ -288,6 +288,32 @@ ui::GestureProvider::Config CreateGestureProviderConfig() {
return config;
}
+ui::SelectionBound::Type ConvertSelectionBoundType(
+ cc::SelectionBoundType type) {
+ switch (type) {
+ case cc::SELECTION_BOUND_LEFT:
+ return ui::SelectionBound::LEFT;
+ case cc::SELECTION_BOUND_RIGHT:
+ return ui::SelectionBound::RIGHT;
+ case cc::SELECTION_BOUND_CENTER:
+ return ui::SelectionBound::CENTER;
+ case cc::SELECTION_BOUND_EMPTY:
+ return ui::SelectionBound::EMPTY;
+ }
+ NOTREACHED() << "Unknown selection bound type";
+ return ui::SelectionBound::EMPTY;
+}
+
+ui::SelectionBound ConvertSelectionBound(
+ const cc::ViewportSelectionBound& bound) {
+ ui::SelectionBound ui_bound;
+ ui_bound.set_type(ConvertSelectionBoundType(bound.type));
+ ui_bound.set_visible(bound.visible);
+ if (ui_bound.type() != ui::SelectionBound::EMPTY)
+ ui_bound.SetEdge(bound.edge_top, bound.edge_bottom);
+ return ui_bound;
+}
+
} // anonymous namespace
ReadbackRequest::ReadbackRequest(float scale,
@@ -1321,8 +1347,8 @@ void RenderWidgetHostViewAndroid::OnFrameMetadataUpdated(
if (selection_controller_) {
selection_controller_->OnSelectionBoundsChanged(
- ui::SelectionBound(frame_metadata.selection_start),
- ui::SelectionBound(frame_metadata.selection_end));
+ ConvertSelectionBound(frame_metadata.selection_start),
+ ConvertSelectionBound(frame_metadata.selection_end));
}
// All offsets and sizes are in CSS pixels.
« no previous file with comments | « no previous file | ui/base/BUILD.gn » ('j') | ui/base/BUILD.gn » ('J')

Powered by Google App Engine
This is Rietveld 408576698