Chromium Code Reviews| 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_widget_host_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 RenderWidgetHostConnector { | |
| 20 public: | |
| 21 SelectionPopupController(JNIEnv* env, | |
| 22 const base::android::JavaParamRef<jobject>& obj, | |
| 23 WebContents* web_contents); | |
| 24 | |
| 25 // RendetWidgetHostConnector implementation. | |
| 26 void UpdateRenderProcessConnection( | |
| 27 RenderWidgetHostViewAndroid* old_rwhva, | |
| 28 RenderWidgetHostViewAndroid* new_rhwva) override; | |
| 29 | |
| 30 // Called from native -> java | |
| 31 void OnSelectionEvent(ui::SelectionEventType event, | |
| 32 const gfx::PointF& selection_anchor, | |
| 33 const gfx::RectF& selection_rect); | |
| 34 void OnSelectionChanged(const std::string& text); | |
| 35 | |
| 36 private: | |
|
boliu
2017/04/20 18:17:28
private destructor override (don't want other thin
Jinsuk Kim
2017/04/20 22:55:54
Done.
| |
| 37 JavaObjectWeakGlobalRef java_obj_; | |
| 38 }; | |
| 39 | |
| 40 bool RegisterSelectionPopupController(JNIEnv* env); | |
| 41 | |
| 42 } // namespace content | |
| 43 | |
| 44 #endif // CONTENT_BROWSER_ANDROID_SELECTION_POPUP_CONTROLLER_H_ | |
| OLD | NEW |