1 // Copyright (c) 2011 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.
5 #include "pdf/preview_mode_client.h"
7 #include "base/logging.h"
11 PreviewModeClient::PreviewModeClient(Client
* client
)
15 void PreviewModeClient::DocumentSizeUpdated(const pp::Size
& size
) {
18 void PreviewModeClient::Invalidate(const pp::Rect
& rect
) {
22 void PreviewModeClient::Scroll(const pp::Point
& point
) {
26 void PreviewModeClient::ScrollToX(int position
) {
30 void PreviewModeClient::ScrollToY(int position
) {
34 void PreviewModeClient::ScrollToPage(int page
) {
38 void PreviewModeClient::NavigateTo(const std::string
& url
,
39 bool open_in_new_tab
) {
43 void PreviewModeClient::UpdateCursor(PP_CursorType_Dev cursor
) {
47 void PreviewModeClient::UpdateTickMarks(
48 const std::vector
<pp::Rect
>& tickmarks
) {
52 void PreviewModeClient::NotifyNumberOfFindResultsChanged(int total
,
57 void PreviewModeClient::NotifySelectedFindResultChanged(
58 int current_find_index
) {
62 void PreviewModeClient::GetDocumentPassword(
63 pp::CompletionCallbackWithOutput
<pp::Var
> callback
) {
64 callback
.Run(PP_ERROR_FAILED
);
67 void PreviewModeClient::Alert(const std::string
& message
) {
71 bool PreviewModeClient::Confirm(const std::string
& message
) {
76 std::string
PreviewModeClient::Prompt(const std::string
& question
,
77 const std::string
& default_answer
) {
82 std::string
PreviewModeClient::GetURL() {
87 void PreviewModeClient::Email(const std::string
& to
,
88 const std::string
& cc
,
89 const std::string
& bcc
,
90 const std::string
& subject
,
91 const std::string
& body
) {
95 void PreviewModeClient::Print() {
99 void PreviewModeClient::SubmitForm(const std::string
& url
,
105 std::string
PreviewModeClient::ShowFileSelectionDialog() {
107 return std::string();
110 pp::URLLoader
PreviewModeClient::CreateURLLoader() {
112 return pp::URLLoader();
115 void PreviewModeClient::ScheduleCallback(int id
, int delay_in_ms
) {
119 void PreviewModeClient::SearchString(const base::char16
* string
,
120 const base::char16
* term
,
122 std::vector
<SearchStringResult
>* results
) {
126 void PreviewModeClient::DocumentPaintOccurred() {
130 void PreviewModeClient::DocumentLoadComplete(int page_count
) {
131 client_
->PreviewDocumentLoadComplete();
134 void PreviewModeClient::DocumentLoadFailed() {
135 client_
->PreviewDocumentLoadFailed();
138 pp::Instance
* PreviewModeClient::GetPluginInstance() {
143 void PreviewModeClient::DocumentHasUnsupportedFeature(
144 const std::string
& feature
) {
148 void PreviewModeClient::DocumentLoadProgress(uint32 available
,
152 void PreviewModeClient::FormTextFieldFocusChange(bool in_focus
) {
156 bool PreviewModeClient::IsPrintPreview() {
161 uint32
PreviewModeClient::GetBackgroundColor() {
166 } // namespace chrome_pdf