Migrate PdfViewPluginBase::cursor_type_
Migrates cursor_type_ from PdfViewPluginBase to PdfViewWebPlugin.
Bug: 1302059
Change-Id: I562337a1dca4abd7f921166579b523109c5d2159
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3704061
Reviewed-by: Nigi <nigi@chromium.org>
Commit-Queue: Nigi <nigi@chromium.org>
Auto-Submit: K. Moon <kmoon@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1013731}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
a39f011d31
commit
1fb4fe7428
@@ -26,7 +26,6 @@
|
|||||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||||
#include "third_party/blink/public/web/web_print_params.h"
|
#include "third_party/blink/public/web/web_print_params.h"
|
||||||
#include "third_party/skia/include/core/SkBitmap.h"
|
#include "third_party/skia/include/core/SkBitmap.h"
|
||||||
#include "ui/base/cursor/mojom/cursor_type.mojom-shared.h"
|
|
||||||
#include "ui/gfx/geometry/rect.h"
|
#include "ui/gfx/geometry/rect.h"
|
||||||
#include "ui/gfx/geometry/vector2d_f.h"
|
#include "ui/gfx/geometry/vector2d_f.h"
|
||||||
|
|
||||||
@@ -298,11 +297,6 @@ class PdfViewPluginBase : public PDFEngine::Client,
|
|||||||
|
|
||||||
void set_url(std::string url) { url_ = std::move(url); }
|
void set_url(std::string url) { url_ = std::move(url); }
|
||||||
|
|
||||||
ui::mojom::CursorType cursor_type() const { return cursor_type_; }
|
|
||||||
void set_cursor_type(ui::mojom::CursorType cursor_type) {
|
|
||||||
cursor_type_ = cursor_type;
|
|
||||||
}
|
|
||||||
|
|
||||||
const std::string& link_under_cursor() const { return link_under_cursor_; }
|
const std::string& link_under_cursor() const { return link_under_cursor_; }
|
||||||
|
|
||||||
virtual bool full_frame() const = 0;
|
virtual bool full_frame() const = 0;
|
||||||
@@ -413,9 +407,6 @@ class PdfViewPluginBase : public PDFEngine::Client,
|
|||||||
// The URL of the PDF document.
|
// The URL of the PDF document.
|
||||||
std::string url_;
|
std::string url_;
|
||||||
|
|
||||||
// The current cursor type.
|
|
||||||
ui::mojom::CursorType cursor_type_ = ui::mojom::CursorType::kPointer;
|
|
||||||
|
|
||||||
// The URL currently under the cursor.
|
// The URL currently under the cursor.
|
||||||
std::string link_under_cursor_;
|
std::string link_under_cursor_;
|
||||||
|
|
||||||
|
@@ -445,7 +445,7 @@ blink::WebInputEventResult PdfViewWebPlugin::HandleInputEvent(
|
|||||||
? blink::WebInputEventResult::kHandledApplication
|
? blink::WebInputEventResult::kHandledApplication
|
||||||
: blink::WebInputEventResult::kNotHandled;
|
: blink::WebInputEventResult::kNotHandled;
|
||||||
|
|
||||||
*cursor = cursor_type();
|
*cursor = cursor_type_;
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -649,7 +649,7 @@ void PdfViewWebPlugin::ProposeDocumentLayout(const DocumentLayout& layout) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void PdfViewWebPlugin::UpdateCursor(ui::mojom::CursorType new_cursor_type) {
|
void PdfViewWebPlugin::UpdateCursor(ui::mojom::CursorType new_cursor_type) {
|
||||||
set_cursor_type(new_cursor_type);
|
cursor_type_ = new_cursor_type;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PdfViewWebPlugin::UpdateTickMarks(
|
void PdfViewWebPlugin::UpdateTickMarks(
|
||||||
|
@@ -32,6 +32,7 @@
|
|||||||
#include "third_party/blink/public/web/web_plugin_container.h"
|
#include "third_party/blink/public/web/web_plugin_container.h"
|
||||||
#include "third_party/blink/public/web/web_plugin_params.h"
|
#include "third_party/blink/public/web/web_plugin_params.h"
|
||||||
#include "third_party/skia/include/core/SkColor.h"
|
#include "third_party/skia/include/core/SkColor.h"
|
||||||
|
#include "ui/base/cursor/mojom/cursor_type.mojom-shared.h"
|
||||||
#include "ui/gfx/geometry/vector2d_f.h"
|
#include "ui/gfx/geometry/vector2d_f.h"
|
||||||
#include "v8/include/v8.h"
|
#include "v8/include/v8.h"
|
||||||
|
|
||||||
@@ -425,6 +426,9 @@ class PdfViewWebPlugin final : public PdfViewPluginBase,
|
|||||||
|
|
||||||
std::unique_ptr<PDFiumEngine> engine_;
|
std::unique_ptr<PDFiumEngine> engine_;
|
||||||
|
|
||||||
|
// The current cursor type.
|
||||||
|
ui::mojom::CursorType cursor_type_ = ui::mojom::CursorType::kPointer;
|
||||||
|
|
||||||
// The id of the current find operation, or -1 if no current operation is
|
// The id of the current find operation, or -1 if no current operation is
|
||||||
// present.
|
// present.
|
||||||
int find_identifier_ = -1;
|
int find_identifier_ = -1;
|
||||||
|
Reference in New Issue
Block a user