OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef PDF_OUT_OF_PROCESS_INSTANCE_H_ | 5 #ifndef PDF_OUT_OF_PROCESS_INSTANCE_H_ |
6 #define PDF_OUT_OF_PROCESS_INSTANCE_H_ | 6 #define PDF_OUT_OF_PROCESS_INSTANCE_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <string.h> | 9 #include <string.h> |
10 | 10 |
| 11 #include <memory> |
11 #include <queue> | 12 #include <queue> |
12 #include <set> | 13 #include <set> |
13 #include <string> | 14 #include <string> |
14 #include <utility> | 15 #include <utility> |
15 #include <vector> | 16 #include <vector> |
16 | 17 |
17 #include "base/macros.h" | 18 #include "base/macros.h" |
18 #include "base/memory/scoped_ptr.h" | |
19 #include "pdf/paint_manager.h" | 19 #include "pdf/paint_manager.h" |
20 #include "pdf/pdf_engine.h" | 20 #include "pdf/pdf_engine.h" |
21 #include "pdf/preview_mode_client.h" | 21 #include "pdf/preview_mode_client.h" |
22 | 22 |
23 #include "ppapi/c/private/ppb_pdf.h" | 23 #include "ppapi/c/private/ppb_pdf.h" |
24 #include "ppapi/c/private/ppp_pdf.h" | 24 #include "ppapi/c/private/ppp_pdf.h" |
25 #include "ppapi/cpp/dev/printing_dev.h" | 25 #include "ppapi/cpp/dev/printing_dev.h" |
26 #include "ppapi/cpp/dev/scriptable_object_deprecated.h" | 26 #include "ppapi/cpp/dev/scriptable_object_deprecated.h" |
27 #include "ppapi/cpp/graphics_2d.h" | 27 #include "ppapi/cpp/graphics_2d.h" |
28 #include "ppapi/cpp/image_data.h" | 28 #include "ppapi/cpp/image_data.h" |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 // called. | 249 // called. |
250 bool is_printing; | 250 bool is_printing; |
251 // To know whether this was an actual print operation, so we don't double | 251 // To know whether this was an actual print operation, so we don't double |
252 // count UMA logging. | 252 // count UMA logging. |
253 bool print_pages_called_; | 253 bool print_pages_called_; |
254 PP_PrintSettings_Dev pepper_print_settings; | 254 PP_PrintSettings_Dev pepper_print_settings; |
255 }; | 255 }; |
256 | 256 |
257 PrintSettings print_settings_; | 257 PrintSettings print_settings_; |
258 | 258 |
259 scoped_ptr<PDFEngine> engine_; | 259 std::unique_ptr<PDFEngine> engine_; |
260 | 260 |
261 // The PreviewModeClient used for print preview. Will be passed to | 261 // The PreviewModeClient used for print preview. Will be passed to |
262 // |preview_engine_|. | 262 // |preview_engine_|. |
263 scoped_ptr<PreviewModeClient> preview_client_; | 263 std::unique_ptr<PreviewModeClient> preview_client_; |
264 | 264 |
265 // This engine is used to render the individual preview page data. This is | 265 // This engine is used to render the individual preview page data. This is |
266 // used only in print preview mode. This will use |PreviewModeClient| | 266 // used only in print preview mode. This will use |PreviewModeClient| |
267 // interface which has very limited access to the pp::Instance. | 267 // interface which has very limited access to the pp::Instance. |
268 scoped_ptr<PDFEngine> preview_engine_; | 268 std::unique_ptr<PDFEngine> preview_engine_; |
269 | 269 |
270 std::string url_; | 270 std::string url_; |
271 | 271 |
272 // Used for submitting forms. | 272 // Used for submitting forms. |
273 pp::CompletionCallbackFactory<OutOfProcessInstance> form_factory_; | 273 pp::CompletionCallbackFactory<OutOfProcessInstance> form_factory_; |
274 pp::URLLoader form_loader_; | 274 pp::URLLoader form_loader_; |
275 | 275 |
276 // Used for printing without re-entrancy issues. | 276 // Used for printing without re-entrancy issues. |
277 pp::CompletionCallbackFactory<OutOfProcessInstance> print_callback_factory_; | 277 pp::CompletionCallbackFactory<OutOfProcessInstance> print_callback_factory_; |
278 | 278 |
279 // The callback for receiving the password from the page. | 279 // The callback for receiving the password from the page. |
280 scoped_ptr<pp::CompletionCallbackWithOutput<pp::Var> > password_callback_; | 280 std::unique_ptr<pp::CompletionCallbackWithOutput<pp::Var>> password_callback_; |
281 | 281 |
282 // True if we haven't painted the plugin viewport yet. | 282 // True if we haven't painted the plugin viewport yet. |
283 bool first_paint_; | 283 bool first_paint_; |
284 | 284 |
285 DocumentLoadState document_load_state_; | 285 DocumentLoadState document_load_state_; |
286 DocumentLoadState preview_document_load_state_; | 286 DocumentLoadState preview_document_load_state_; |
287 | 287 |
288 // A UMA resource for histogram reporting. | 288 // A UMA resource for histogram reporting. |
289 pp::UMAPrivate uma_; | 289 pp::UMAPrivate uma_; |
290 | 290 |
(...skipping 11 matching lines...) Expand all Loading... |
302 | 302 |
303 // Used to manage loaded print preview page information. A |PreviewPageInfo| | 303 // Used to manage loaded print preview page information. A |PreviewPageInfo| |
304 // consists of data source url string and the page index in the destination | 304 // consists of data source url string and the page index in the destination |
305 // document. | 305 // document. |
306 typedef std::pair<std::string, int> PreviewPageInfo; | 306 typedef std::pair<std::string, int> PreviewPageInfo; |
307 std::queue<PreviewPageInfo> preview_pages_info_; | 307 std::queue<PreviewPageInfo> preview_pages_info_; |
308 | 308 |
309 // Used to signal the browser about focus changes to trigger the OSK. | 309 // Used to signal the browser about focus changes to trigger the OSK. |
310 // TODO(abodenha@chromium.org) Implement full IME support in the plugin. | 310 // TODO(abodenha@chromium.org) Implement full IME support in the plugin. |
311 // http://crbug.com/132565 | 311 // http://crbug.com/132565 |
312 scoped_ptr<pp::TextInput_Dev> text_input_; | 312 std::unique_ptr<pp::TextInput_Dev> text_input_; |
313 | 313 |
314 // The last document load progress value sent to the web page. | 314 // The last document load progress value sent to the web page. |
315 double last_progress_sent_; | 315 double last_progress_sent_; |
316 | 316 |
317 // Whether an update to the number of find results found was sent less than | 317 // Whether an update to the number of find results found was sent less than |
318 // |kFindResultCooldownMs| milliseconds ago. | 318 // |kFindResultCooldownMs| milliseconds ago. |
319 bool recently_sent_find_update_; | 319 bool recently_sent_find_update_; |
320 | 320 |
321 // The tickmarks. | 321 // The tickmarks. |
322 std::vector<pp::Rect> tickmarks_; | 322 std::vector<pp::Rect> tickmarks_; |
(...skipping 18 matching lines...) Expand all Loading... |
341 // The blank space above the first page of the document reserved for the | 341 // The blank space above the first page of the document reserved for the |
342 // toolbar. | 342 // toolbar. |
343 int top_toolbar_height_; | 343 int top_toolbar_height_; |
344 | 344 |
345 DISALLOW_COPY_AND_ASSIGN(OutOfProcessInstance); | 345 DISALLOW_COPY_AND_ASSIGN(OutOfProcessInstance); |
346 }; | 346 }; |
347 | 347 |
348 } // namespace chrome_pdf | 348 } // namespace chrome_pdf |
349 | 349 |
350 #endif // PDF_OUT_OF_PROCESS_INSTANCE_H_ | 350 #endif // PDF_OUT_OF_PROCESS_INSTANCE_H_ |
OLD | NEW |