| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CONTENT_BROWSER_ANDROID_SELECTION_POPUP_CONTROLLER_H_ |
| 6 #define CONTENT_BROWSER_ANDROID_SELECTION_POPUP_CONTROLLER_H_ |
| 7 |
| 8 #include <jni.h> |
| 9 |
| 10 #include "base/android/jni_weak_ref.h" |
| 11 #include "content/browser/android/render_process_connector.h" |
| 12 #include "ui/gfx/geometry/rect_f.h" |
| 13 #include "ui/touch_selection/selection_event_type.h" |
| 14 |
| 15 namespace content { |
| 16 |
| 17 class RenderWidgetHostViewAndroid; |
| 18 |
| 19 class SelectionPopupController : public RenderProcessConnector { |
| 20 public: |
| 21 SelectionPopupController(JNIEnv* env, |
| 22 const base::android::JavaParamRef<jobject>& obj, |
| 23 WebContents* web_contents); |
| 24 ~SelectionPopupController() override; |
| 25 |
| 26 // RendetWidgetHostViewBinder implementation. |
| 27 void UpdateRenderProcessConnection( |
| 28 RenderWidgetHostViewAndroid* old_rwhva, |
| 29 RenderWidgetHostViewAndroid* new_rhwva) override; |
| 30 |
| 31 // Called from native -> java |
| 32 void OnSelectionEvent(ui::SelectionEventType event, |
| 33 const gfx::PointF& selection_anchor, |
| 34 const gfx::RectF& selection_rect); |
| 35 void OnSelectionChanged(const std::string& text); |
| 36 |
| 37 private: |
| 38 JavaObjectWeakGlobalRef java_obj_; |
| 39 }; |
| 40 |
| 41 bool RegisterSelectionPopupController(JNIEnv* env); |
| 42 |
| 43 } // namespace content |
| 44 |
| 45 #endif // CONTENT_BROWSER_ANDROID_SELECTION_POPUP_CONTROLLER_H_ |
| OLD | NEW |