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

Unified Diff: content/browser/android/selection_popup_controller.h

Issue 2792063003: Factor out RenderWidgetHostConnector (Closed)
Patch Set: format Created 3 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/android/selection_popup_controller.h
diff --git a/content/browser/android/selection_popup_controller.h b/content/browser/android/selection_popup_controller.h
new file mode 100644
index 0000000000000000000000000000000000000000..4f4a4b167226245719b88c69fbbea844093fcd23
--- /dev/null
+++ b/content/browser/android/selection_popup_controller.h
@@ -0,0 +1,45 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_BROWSER_ANDROID_SELECTION_POPUP_CONTROLLER_H_
+#define CONTENT_BROWSER_ANDROID_SELECTION_POPUP_CONTROLLER_H_
+
+#include <jni.h>
+
+#include "base/android/jni_weak_ref.h"
+#include "content/browser/android/render_process_connector.h"
+#include "ui/gfx/geometry/rect_f.h"
+#include "ui/touch_selection/selection_event_type.h"
+
+namespace content {
+
+class RenderWidgetHostViewAndroid;
+
+class SelectionPopupController : public RenderProcessConnector {
+ public:
+ SelectionPopupController(JNIEnv* env,
+ const base::android::JavaParamRef<jobject>& obj,
+ WebContents* web_contents);
+ ~SelectionPopupController() override;
+
+ // RendetWidgetHostViewBinder implementation.
+ void UpdateRenderProcessConnection(
+ RenderWidgetHostViewAndroid* old_rwhva,
+ RenderWidgetHostViewAndroid* new_rhwva) override;
+
+ // Called from native -> java
+ void OnSelectionEvent(ui::SelectionEventType event,
+ const gfx::PointF& selection_anchor,
+ const gfx::RectF& selection_rect);
+ void OnSelectionChanged(const std::string& text);
+
+ private:
+ JavaObjectWeakGlobalRef java_obj_;
+};
+
+bool RegisterSelectionPopupController(JNIEnv* env);
+
+} // namespace content
+
+#endif // CONTENT_BROWSER_ANDROID_SELECTION_POPUP_CONTROLLER_H_

Powered by Google App Engine
This is Rietveld 408576698