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"
8 #include "pdf/instance.h"
10 namespace chrome_pdf
{
12 PreviewModeClient::PreviewModeClient(Client
* client
)
16 void PreviewModeClient::DocumentSizeUpdated(const pp::Size
& size
) {
19 void PreviewModeClient::Invalidate(const pp::Rect
& rect
) {
23 void PreviewModeClient::Scroll(const pp::Point
& point
) {
27 void PreviewModeClient::ScrollToX(int position
) {
31 void PreviewModeClient::ScrollToY(int position
) {
35 void PreviewModeClient::ScrollToPage(int page
) {
39 void PreviewModeClient::NavigateTo(const std::string
& url
,
40 bool open_in_new_tab
) {
44 void PreviewModeClient::UpdateCursor(PP_CursorType_Dev cursor
) {
48 void PreviewModeClient::UpdateTickMarks(
49 const std::vector
<pp::Rect
>& tickmarks
) {
53 void PreviewModeClient::NotifyNumberOfFindResultsChanged(int total
,
58 void PreviewModeClient::NotifySelectedFindResultChanged(
59 int current_find_index
) {
63 void PreviewModeClient::GetDocumentPassword(
64 pp::CompletionCallbackWithOutput
<pp::Var
> callback
) {
65 callback
.Run(PP_ERROR_FAILED
);
68 void PreviewModeClient::Alert(const std::string
& message
) {
72 bool PreviewModeClient::Confirm(const std::string
& message
) {
77 std::string
PreviewModeClient::Prompt(const std::string
& question
,
78 const std::string
& default_answer
) {
83 std::string
PreviewModeClient::GetURL() {
88 void PreviewModeClient::Email(const std::string
& to
,
89 const std::string
& cc
,
90 const std::string
& bcc
,
91 const std::string
& subject
,
92 const std::string
& body
) {
96 void PreviewModeClient::Print() {
100 void PreviewModeClient::SubmitForm(const std::string
& url
,
106 std::string
PreviewModeClient::ShowFileSelectionDialog() {
108 return std::string();
111 pp::URLLoader
PreviewModeClient::CreateURLLoader() {
113 return pp::URLLoader();
116 void PreviewModeClient::ScheduleCallback(int id
, int delay_in_ms
) {
120 void PreviewModeClient::SearchString(const base::char16
* string
,
121 const base::char16
* term
,
123 std::vector
<SearchStringResult
>* results
) {
127 void PreviewModeClient::DocumentPaintOccurred() {
131 void PreviewModeClient::DocumentLoadComplete(int page_count
) {
132 client_
->PreviewDocumentLoadComplete();
135 void PreviewModeClient::DocumentLoadFailed() {
136 client_
->PreviewDocumentLoadFailed();
139 pp::Instance
* PreviewModeClient::GetPluginInstance() {
144 void PreviewModeClient::DocumentHasUnsupportedFeature(
145 const std::string
& feature
) {
149 void PreviewModeClient::DocumentLoadProgress(uint32 available
,
153 void PreviewModeClient::FormTextFieldFocusChange(bool in_focus
) {
157 bool PreviewModeClient::IsPrintPreview() {
162 uint32
PreviewModeClient::GetBackgroundColor() {
167 } // namespace chrome_pdf