summaryrefslogtreecommitdiff
path: root/chromium/content/browser/browser_plugin
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/content/browser/browser_plugin')
-rw-r--r--chromium/content/browser/browser_plugin/browser_plugin_embedder.h2
-rw-r--r--chromium/content/browser/browser_plugin/browser_plugin_guest.cc31
-rw-r--r--chromium/content/browser/browser_plugin/browser_plugin_guest.h12
3 files changed, 21 insertions, 24 deletions
diff --git a/chromium/content/browser/browser_plugin/browser_plugin_embedder.h b/chromium/content/browser/browser_plugin/browser_plugin_embedder.h
index 75be4643fad..1cb9017cc8d 100644
--- a/chromium/content/browser/browser_plugin/browser_plugin_embedder.h
+++ b/chromium/content/browser/browser_plugin/browser_plugin_embedder.h
@@ -17,7 +17,7 @@
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "content/common/content_export.h"
-#include "third_party/blink/public/platform/web_drag_operation.h"
+#include "third_party/blink/public/common/page/web_drag_operation.h"
namespace content {
diff --git a/chromium/content/browser/browser_plugin/browser_plugin_guest.cc b/chromium/content/browser/browser_plugin/browser_plugin_guest.cc
index 8641ed5e5d9..eebdfe9dd83 100644
--- a/chromium/content/browser/browser_plugin/browser_plugin_guest.cc
+++ b/chromium/content/browser/browser_plugin/browser_plugin_guest.cc
@@ -35,8 +35,6 @@
#include "content/common/content_constants_internal.h"
#include "content/common/drag_messages.h"
#include "content/common/frame_visual_properties.h"
-#include "content/common/input/ime_text_span_conversions.h"
-#include "content/common/text_input_state.h"
#include "content/common/view_messages.h"
#include "content/common/widget_messages.h"
#include "content/public/browser/browser_context.h"
@@ -380,9 +378,10 @@ void BrowserPluginGuest::RenderProcessGone(base::TerminationStatus status) {
void BrowserPluginGuest::DidSetHasTouchEventHandlers(bool accept) {
}
-void BrowserPluginGuest::DidTextInputStateChange(const TextInputState& params) {
+void BrowserPluginGuest::DidTextInputStateChange(
+ const ui::mojom::TextInputState& params) {
// Save the state of text input so we can restore it on focus.
- last_text_input_state_ = std::make_unique<TextInputState>(params);
+ last_text_input_state_ = params.Clone();
SendTextInputTypeChangedToView(static_cast<RenderWidgetHostViewBase*>(
web_contents()->GetRenderWidgetHostView()));
@@ -460,28 +459,25 @@ void BrowserPluginGuest::OnDragStatusUpdate(int browser_plugin_instance_id,
void BrowserPluginGuest::OnExecuteEditCommand(int browser_plugin_instance_id,
const std::string& name) {
- RenderFrameHostImpl* focused_frame =
- static_cast<RenderFrameHostImpl*>(web_contents()->GetFocusedFrame());
- if (!focused_frame || !focused_frame->GetFrameInputHandler())
+ blink::mojom::FrameWidgetInputHandler* focused_frame_widget_input_handler =
+ GetWebContents()->GetFocusedFrameWidgetInputHandler();
+ if (!focused_frame_widget_input_handler)
return;
- focused_frame->GetFrameInputHandler()->ExecuteEditCommand(name,
- base::nullopt);
+ focused_frame_widget_input_handler->ExecuteEditCommand(name, base::nullopt);
}
void BrowserPluginGuest::OnImeCommitText(
int browser_plugin_instance_id,
const base::string16& text,
- const std::vector<blink::WebImeTextSpan>& ime_text_spans,
+ const std::vector<ui::ImeTextSpan>& ime_text_spans,
const gfx::Range& replacement_range,
int relative_cursor_pos) {
- std::vector<ui::ImeTextSpan> ui_ime_text_spans =
- ConvertBlinkImeTextSpansToUiImeTextSpans(ime_text_spans);
GetWebContents()
->GetRenderViewHost()
->GetWidget()
->GetWidgetInputHandler()
- ->ImeCommitText(text, ui_ime_text_spans, replacement_range,
+ ->ImeCommitText(text, ime_text_spans, replacement_range,
relative_cursor_pos, base::OnceClosure());
}
@@ -500,10 +496,11 @@ void BrowserPluginGuest::OnExtendSelectionAndDelete(
int browser_plugin_instance_id,
int before,
int after) {
- RenderFrameHostImpl* rfh = static_cast<RenderFrameHostImpl*>(
- web_contents()->GetFocusedFrame());
- if (rfh && rfh->GetFrameInputHandler())
- rfh->GetFrameInputHandler()->ExtendSelectionAndDelete(before, after);
+ blink::mojom::FrameWidgetInputHandler* focused_frame_widget_input_handler =
+ GetWebContents()->GetFocusedFrameWidgetInputHandler();
+ if (!focused_frame_widget_input_handler)
+ return;
+ focused_frame_widget_input_handler->ExtendSelectionAndDelete(before, after);
}
void BrowserPluginGuest::OnSetFocus(int browser_plugin_instance_id,
diff --git a/chromium/content/browser/browser_plugin/browser_plugin_guest.h b/chromium/content/browser/browser_plugin/browser_plugin_guest.h
index f92c7dafc9b..15fc0995bef 100644
--- a/chromium/content/browser/browser_plugin/browser_plugin_guest.h
+++ b/chromium/content/browser/browser_plugin/browser_plugin_guest.h
@@ -40,13 +40,14 @@
#include "content/public/common/screen_info.h"
#include "mojo/public/cpp/bindings/pending_remote.h"
#include "third_party/blink/public/common/input/web_input_event.h"
+#include "third_party/blink/public/common/page/web_drag_operation.h"
#include "third_party/blink/public/mojom/choosers/popup_menu.mojom.h"
#include "third_party/blink/public/mojom/input/focus_type.mojom-forward.h"
#include "third_party/blink/public/mojom/input/input_event_result.mojom-shared.h"
#include "third_party/blink/public/mojom/input/input_handler.mojom-forward.h"
-#include "third_party/blink/public/platform/web_drag_operation.h"
#include "third_party/blink/public/web/web_drag_status.h"
-#include "third_party/blink/public/web/web_ime_text_span.h"
+#include "ui/base/ime/ime_text_span.h"
+#include "ui/base/ime/mojom/text_input_state.mojom.h"
#include "ui/base/ime/text_input_mode.h"
#include "ui/base/ime/text_input_type.h"
#include "ui/gfx/geometry/rect.h"
@@ -71,7 +72,6 @@ class RenderWidgetHostViewBase;
class SiteInstance;
struct FrameVisualProperties;
struct ScreenInfo;
-struct TextInputState;
// A browser plugin guest provides functionality for WebContents to operate in
// the guest role and implements guest-specific overrides for ViewHostMsg_*
@@ -173,7 +173,7 @@ class CONTENT_EXPORT BrowserPluginGuest : public GuestHost,
// Methods to handle events from InputEventShim.
void DidSetHasTouchEventHandlers(bool accept);
- void DidTextInputStateChange(const TextInputState& params);
+ void DidTextInputStateChange(const ui::mojom::TextInputState& params);
void DidUnlockMouse();
// WebContentsObserver implementation.
@@ -292,7 +292,7 @@ class CONTENT_EXPORT BrowserPluginGuest : public GuestHost,
void OnImeCommitText(int instance_id,
const base::string16& text,
- const std::vector<blink::WebImeTextSpan>& ime_text_spans,
+ const std::vector<ui::ImeTextSpan>& ime_text_spans,
const gfx::Range& replacement_range,
int relative_cursor_pos);
void OnImeFinishComposingText(int instance_id, bool keep_selection);
@@ -337,7 +337,7 @@ class CONTENT_EXPORT BrowserPluginGuest : public GuestHost,
// Text input type states.
// Using scoped_ptr to avoid including the header file: view_messages.h.
- std::unique_ptr<const TextInputState> last_text_input_state_;
+ ui::mojom::TextInputStatePtr last_text_input_state_;
// The is the routing ID for a swapped out RenderView for the guest
// WebContents in the embedder's process.