| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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_handler.h" | 5 #include "chrome/browser/ui/webui/print_preview_handler.h" |
| 6 | 6 |
| 7 #include <ctype.h> | 7 #include <ctype.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 if (settings.GetInteger(printing::kSettingColor, &color_mode)) { | 182 if (settings.GetInteger(printing::kSettingColor, &color_mode)) { |
| 183 ReportPrintSettingHistogram( | 183 ReportPrintSettingHistogram( |
| 184 printing::isColorModelSelected(color_mode) ? COLOR : BLACK_AND_WHITE); | 184 printing::isColorModelSelected(color_mode) ? COLOR : BLACK_AND_WHITE); |
| 185 } | 185 } |
| 186 } | 186 } |
| 187 | 187 |
| 188 // Callback that stores a PDF file on disk. | 188 // Callback that stores a PDF file on disk. |
| 189 void PrintToPdfCallback(Metafile* metafile, const FilePath& path) { | 189 void PrintToPdfCallback(Metafile* metafile, const FilePath& path) { |
| 190 metafile->SaveTo(path); | 190 metafile->SaveTo(path); |
| 191 // |metafile| must be deleted on the UI thread. | 191 // |metafile| must be deleted on the UI thread. |
| 192 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, | 192 BrowserThread::PostTask( |
| 193 base::Bind(&DeletePointer<Metafile>, metafile)); | 193 BrowserThread::UI, FROM_HERE, |
| 194 base::Bind(&base::DeletePointer<Metafile>, metafile)); |
| 194 } | 195 } |
| 195 | 196 |
| 196 } // namespace | 197 } // namespace |
| 197 | 198 |
| 198 // static | 199 // static |
| 199 FilePath* PrintPreviewHandler::last_saved_path_ = NULL; | 200 FilePath* PrintPreviewHandler::last_saved_path_ = NULL; |
| 200 std::string* PrintPreviewHandler::last_used_printer_cloud_print_data_ = NULL; | 201 std::string* PrintPreviewHandler::last_used_printer_cloud_print_data_ = NULL; |
| 201 std::string* PrintPreviewHandler::last_used_printer_name_ = NULL; | 202 std::string* PrintPreviewHandler::last_used_printer_name_ = NULL; |
| 202 printing::ColorModels PrintPreviewHandler::last_used_color_model_ = | 203 printing::ColorModels PrintPreviewHandler::last_used_color_model_ = |
| 203 printing::UNKNOWN_COLOR_MODEL; | 204 printing::UNKNOWN_COLOR_MODEL; |
| (...skipping 654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 858 return; | 859 return; |
| 859 | 860 |
| 860 // We no longer require the initiator tab details. Remove those details | 861 // We no longer require the initiator tab details. Remove those details |
| 861 // associated with the preview tab to allow the initiator tab to create | 862 // associated with the preview tab to allow the initiator tab to create |
| 862 // another preview tab. | 863 // another preview tab. |
| 863 printing::PrintPreviewTabController* tab_controller = | 864 printing::PrintPreviewTabController* tab_controller = |
| 864 printing::PrintPreviewTabController::GetInstance(); | 865 printing::PrintPreviewTabController::GetInstance(); |
| 865 if (tab_controller) | 866 if (tab_controller) |
| 866 tab_controller->EraseInitiatorTabInfo(preview_tab_wrapper()); | 867 tab_controller->EraseInitiatorTabInfo(preview_tab_wrapper()); |
| 867 } | 868 } |
| OLD | NEW |