| 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 #include "chrome/browser/ui/webui/print_preview/print_preview_ui.h" | 5 #include "chrome/browser/ui/webui/print_preview/print_preview_ui.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/feature_list.h" | 10 #include "base/feature_list.h" |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 | 105 |
| 106 DISALLOW_COPY_AND_ASSIGN(PrintPreviewRequestIdMapWithLock); | 106 DISALLOW_COPY_AND_ASSIGN(PrintPreviewRequestIdMapWithLock); |
| 107 }; | 107 }; |
| 108 | 108 |
| 109 // Written to on the UI thread, read from any thread. | 109 // Written to on the UI thread, read from any thread. |
| 110 base::LazyInstance<PrintPreviewRequestIdMapWithLock> | 110 base::LazyInstance<PrintPreviewRequestIdMapWithLock> |
| 111 g_print_preview_request_id_map = LAZY_INSTANCE_INITIALIZER; | 111 g_print_preview_request_id_map = LAZY_INSTANCE_INITIALIZER; |
| 112 | 112 |
| 113 // PrintPreviewUI IDMap used to avoid exposing raw pointer addresses to WebUI. | 113 // PrintPreviewUI IDMap used to avoid exposing raw pointer addresses to WebUI. |
| 114 // Only accessed on the UI thread. | 114 // Only accessed on the UI thread. |
| 115 base::LazyInstance<IDMap<PrintPreviewUI> > | 115 base::LazyInstance<IDMap<PrintPreviewUI*>> g_print_preview_ui_id_map = |
| 116 g_print_preview_ui_id_map = LAZY_INSTANCE_INITIALIZER; | 116 LAZY_INSTANCE_INITIALIZER; |
| 117 | 117 |
| 118 // PrintPreviewUI serves data for chrome://print requests. | 118 // PrintPreviewUI serves data for chrome://print requests. |
| 119 // | 119 // |
| 120 // The format for requesting PDF data is as follows: | 120 // The format for requesting PDF data is as follows: |
| 121 // chrome://print/<PrintPreviewUIID>/<PageIndex>/print.pdf | 121 // chrome://print/<PrintPreviewUIID>/<PageIndex>/print.pdf |
| 122 // | 122 // |
| 123 // Parameters (< > required): | 123 // Parameters (< > required): |
| 124 // <PrintPreviewUIID> = PrintPreview UI ID | 124 // <PrintPreviewUIID> = PrintPreview UI ID |
| 125 // <PageIndex> = Page index is zero-based or | 125 // <PageIndex> = Page index is zero-based or |
| 126 // |printing::COMPLETE_PREVIEW_DOCUMENT_INDEX| to represent | 126 // |printing::COMPLETE_PREVIEW_DOCUMENT_INDEX| to represent |
| (...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 687 } | 687 } |
| 688 | 688 |
| 689 void PrintPreviewUI::SetSelectedFileForTesting(const base::FilePath& path) { | 689 void PrintPreviewUI::SetSelectedFileForTesting(const base::FilePath& path) { |
| 690 handler_->FileSelected(path, 0, NULL); | 690 handler_->FileSelected(path, 0, NULL); |
| 691 } | 691 } |
| 692 | 692 |
| 693 void PrintPreviewUI::SetPdfSavedClosureForTesting( | 693 void PrintPreviewUI::SetPdfSavedClosureForTesting( |
| 694 const base::Closure& closure) { | 694 const base::Closure& closure) { |
| 695 handler_->SetPdfSavedClosureForTesting(closure); | 695 handler_->SetPdfSavedClosureForTesting(closure); |
| 696 } | 696 } |
| OLD | NEW |