Chromium Code Reviews| 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" | |
| 10 #include "base/gtest_prod_util.h" | 11 #include "base/gtest_prod_util.h" |
| 11 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/memory/shared_memory.h" | 13 #include "base/memory/shared_memory.h" |
| 13 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
| 14 #include "base/time/time.h" | 15 #include "base/time/time.h" |
| 15 #include "content/public/renderer/render_view_observer.h" | 16 #include "content/public/renderer/render_view_observer.h" |
| 16 #include "content/public/renderer/render_view_observer_tracker.h" | 17 #include "content/public/renderer/render_view_observer_tracker.h" |
| 17 #include "printing/metafile_impl.h" | 18 #include "printing/metafile_impl.h" |
| 18 #include "third_party/WebKit/public/platform/WebCanvas.h" | 19 #include "third_party/WebKit/public/platform/WebCanvas.h" |
| 19 #include "third_party/WebKit/public/web/WebNode.h" | 20 #include "third_party/WebKit/public/web/WebNode.h" |
| (...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 454 enum PrintPreviewErrorBuckets error_; | 455 enum PrintPreviewErrorBuckets error_; |
| 455 | 456 |
| 456 State state_; | 457 State state_; |
| 457 }; | 458 }; |
| 458 | 459 |
| 459 bool print_node_in_progress_; | 460 bool print_node_in_progress_; |
| 460 PrintPreviewContext print_preview_context_; | 461 PrintPreviewContext print_preview_context_; |
| 461 bool is_loading_; | 462 bool is_loading_; |
| 462 bool is_scripted_preview_delayed_; | 463 bool is_scripted_preview_delayed_; |
| 463 base::WeakPtrFactory<PrintWebViewHelper> weak_ptr_factory_; | 464 base::WeakPtrFactory<PrintWebViewHelper> weak_ptr_factory_; |
| 465 | |
| 466 // Stores the type of function that should be called when DidStopLoading() is | |
| 467 // called. This is needed due to a race condition that is caused when | |
| 468 // RequestPrintPreview is called with | |
| 469 // |PRINT_PREVIEW_USER_INITIATED_ENTIRE_FRAME| and DidStopLoading() has not | |
| 470 // yet been called. This allows the call to RequestPrintPreview to be | |
| 471 // deferred until DidStopLoading() has actually been called. | |
| 472 PrintPreviewRequestType on_stop_loading_type_; | |
|
ivandavid
2014/08/13 20:58:55
I am using an enum this time because using base::C
Vitaly Buka (NO REVIEWS)
2014/08/13 23:39:45
Actually I like more Closure version.
On 2014/08/
ivandavid
2014/08/14 03:38:13
Done.
ivandavid
2014/08/14 03:38:13
Ok. I re-implemented it.
ivandavid
2014/08/14 03:38:13
Ok. I reimplemented it.
| |
| 464 DISALLOW_COPY_AND_ASSIGN(PrintWebViewHelper); | 473 DISALLOW_COPY_AND_ASSIGN(PrintWebViewHelper); |
| 465 }; | 474 }; |
| 466 | 475 |
| 467 } // namespace printing | 476 } // namespace printing |
| 468 | 477 |
| 469 #endif // CHROME_RENDERER_PRINTING_PRINT_WEB_VIEW_HELPER_H_ | 478 #endif // CHROME_RENDERER_PRINTING_PRINT_WEB_VIEW_HELPER_H_ |
| OLD | NEW |