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 CHROME_RENDERER_PRINTING_PRINT_WEB_VIEW_HELPER_H_ | 5 #ifndef CHROME_RENDERER_PRINTING_PRINT_WEB_VIEW_HELPER_H_ |
6 #define CHROME_RENDERER_PRINTING_PRINT_WEB_VIEW_HELPER_H_ | 6 #define CHROME_RENDERER_PRINTING_PRINT_WEB_VIEW_HELPER_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/callback.h" | |
11 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
12 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
13 #include "base/memory/shared_memory.h" | 12 #include "base/memory/shared_memory.h" |
14 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
15 #include "base/time/time.h" | 14 #include "base/time/time.h" |
16 #include "content/public/renderer/render_view_observer.h" | 15 #include "content/public/renderer/render_view_observer.h" |
17 #include "content/public/renderer/render_view_observer_tracker.h" | 16 #include "content/public/renderer/render_view_observer_tracker.h" |
18 #include "printing/metafile_impl.h" | 17 #include "printing/metafile_impl.h" |
19 #include "third_party/WebKit/public/platform/WebCanvas.h" | 18 #include "third_party/WebKit/public/platform/WebCanvas.h" |
20 #include "third_party/WebKit/public/web/WebNode.h" | 19 #include "third_party/WebKit/public/web/WebNode.h" |
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
455 enum PrintPreviewErrorBuckets error_; | 454 enum PrintPreviewErrorBuckets error_; |
456 | 455 |
457 State state_; | 456 State state_; |
458 }; | 457 }; |
459 | 458 |
460 bool print_node_in_progress_; | 459 bool print_node_in_progress_; |
461 PrintPreviewContext print_preview_context_; | 460 PrintPreviewContext print_preview_context_; |
462 bool is_loading_; | 461 bool is_loading_; |
463 bool is_scripted_preview_delayed_; | 462 bool is_scripted_preview_delayed_; |
464 base::WeakPtrFactory<PrintWebViewHelper> weak_ptr_factory_; | 463 base::WeakPtrFactory<PrintWebViewHelper> weak_ptr_factory_; |
465 | |
466 // Used to fix a race condition where the source is a PDF and print preview | |
467 // hangs because RequestPrintPreview is called before DidStopLoading() is | |
468 // called. This is a store for the RequestPrintPreview() call and its | |
469 // parameters so that it can be invoked after DidStopLoading. | |
470 base::Closure on_stop_loading_closure_; | |
471 DISALLOW_COPY_AND_ASSIGN(PrintWebViewHelper); | 464 DISALLOW_COPY_AND_ASSIGN(PrintWebViewHelper); |
472 }; | 465 }; |
473 | 466 |
474 } // namespace printing | 467 } // namespace printing |
475 | 468 |
476 #endif // CHROME_RENDERER_PRINTING_PRINT_WEB_VIEW_HELPER_H_ | 469 #endif // CHROME_RENDERER_PRINTING_PRINT_WEB_VIEW_HELPER_H_ |
OLD | NEW |