-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright 2011 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <string>
#include <vector>
+#include "base/callback_forward.h"
+#include "base/memory/raw_ptr.h"
#include "pdf/pdf_engine.h"
namespace chrome_pdf {
};
explicit PreviewModeClient(Client* client);
- ~PreviewModeClient() override {}
+ ~PreviewModeClient() override;
// PDFEngine::Client implementation.
void ProposeDocumentLayout(const DocumentLayout& layout) override;
- void Invalidate(const pp::Rect& rect) override;
- void DidScroll(const pp::Point& point) override;
+ void Invalidate(const gfx::Rect& rect) override;
+ void DidScroll(const gfx::Vector2d& offset) override;
void ScrollToX(int x_in_screen_coords) override;
- void ScrollToY(int y_in_screen_coords, bool compensate_for_toolbar) override;
- void ScrollBy(const pp::Point& point) override;
+ void ScrollToY(int y_in_screen_coords) override;
+ void ScrollBy(const gfx::Vector2d& scroll_delta) override;
void ScrollToPage(int page) override;
void NavigateTo(const std::string& url,
WindowOpenDisposition disposition) override;
- void UpdateCursor(PP_CursorType_Dev cursor) override;
- void UpdateTickMarks(const std::vector<pp::Rect>& tickmarks) override;
+ void UpdateCursor(ui::mojom::CursorType cursor_type) override;
+ void UpdateTickMarks(const std::vector<gfx::Rect>& tickmarks) override;
void NotifyNumberOfFindResultsChanged(int total, bool final_result) override;
- void NotifySelectedFindResultChanged(int current_find_index) override;
+ void NotifySelectedFindResultChanged(int current_find_index,
+ bool final_result) override;
void GetDocumentPassword(
- pp::CompletionCallbackWithOutput<pp::Var> callback) override;
+ base::OnceCallback<void(const std::string&)> callback) override;
void Alert(const std::string& message) override;
bool Confirm(const std::string& message) override;
std::string Prompt(const std::string& question,
void SubmitForm(const std::string& url,
const void* data,
int length) override;
- pp::URLLoader CreateURLLoader() override;
- std::vector<SearchStringResult> SearchString(const base::char16* string,
- const base::char16* term,
+ std::unique_ptr<UrlLoader> CreateUrlLoader() override;
+ std::vector<SearchStringResult> SearchString(const char16_t* string,
+ const char16_t* term,
bool case_sensitive) override;
- void DocumentLoadComplete(
- const PDFEngine::DocumentFeatures& document_features) override;
+ void DocumentLoadComplete() override;
void DocumentLoadFailed() override;
- pp::Instance* GetPluginInstance() override;
void DocumentHasUnsupportedFeature(const std::string& feature) override;
- void FormTextFieldFocusChange(bool in_focus) override;
- bool IsPrintPreview() override;
- float GetToolbarHeightInScreenCoords() override;
- uint32_t GetBackgroundColor() override;
+ void FormFieldFocusChange(PDFEngine::FocusFieldType type) override;
+ bool IsPrintPreview() const override;
+ SkColor GetBackgroundColor() const override;
+ void SetSelectedText(const std::string& selected_text) override;
+ void SetLinkUnderCursor(const std::string& link_under_cursor) override;
+ bool IsValidLink(const std::string& url) override;
private:
- Client* const client_;
+ const raw_ptr<Client> client_;
};
} // namespace chrome_pdf