| 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 <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 614 "PrintPreview.RegeneratePreviewRequest.BeforeFirstData", | 614 "PrintPreview.RegeneratePreviewRequest.BeforeFirstData", |
| 615 handler_->regenerate_preview_request_count()); | 615 handler_->regenerate_preview_request_count()); |
| 616 initial_preview_start_time_ = base::TimeTicks(); | 616 initial_preview_start_time_ = base::TimeTicks(); |
| 617 } | 617 } |
| 618 base::Value ui_identifier(id_); | 618 base::Value ui_identifier(id_); |
| 619 base::Value ui_preview_request_id(preview_request_id); | 619 base::Value ui_preview_request_id(preview_request_id); |
| 620 web_ui()->CallJavascriptFunctionUnsafe("updatePrintPreview", ui_identifier, | 620 web_ui()->CallJavascriptFunctionUnsafe("updatePrintPreview", ui_identifier, |
| 621 ui_preview_request_id); | 621 ui_preview_request_id); |
| 622 } | 622 } |
| 623 | 623 |
| 624 void PrintPreviewUI::OnFileSelectionCancelled() { | |
| 625 web_ui()->CallJavascriptFunctionUnsafe("fileSelectionCancelled"); | |
| 626 } | |
| 627 | |
| 628 void PrintPreviewUI::OnCancelPendingPreviewRequest() { | 624 void PrintPreviewUI::OnCancelPendingPreviewRequest() { |
| 629 g_print_preview_request_id_map.Get().Set(id_, -1); | 625 g_print_preview_request_id_map.Get().Set(id_, -1); |
| 630 } | 626 } |
| 631 | 627 |
| 632 void PrintPreviewUI::OnPrintPreviewFailed() { | 628 void PrintPreviewUI::OnPrintPreviewFailed() { |
| 633 handler_->OnPrintPreviewFailed(); | 629 handler_->OnPrintPreviewFailed(); |
| 634 web_ui()->CallJavascriptFunctionUnsafe("printPreviewFailed"); | 630 web_ui()->CallJavascriptFunctionUnsafe("printPreviewFailed"); |
| 635 } | 631 } |
| 636 | 632 |
| 637 void PrintPreviewUI::OnInvalidPrinterSettings() { | 633 void PrintPreviewUI::OnInvalidPrinterSettings() { |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 688 } | 684 } |
| 689 | 685 |
| 690 void PrintPreviewUI::SetSelectedFileForTesting(const base::FilePath& path) { | 686 void PrintPreviewUI::SetSelectedFileForTesting(const base::FilePath& path) { |
| 691 handler_->FileSelected(path, 0, NULL); | 687 handler_->FileSelected(path, 0, NULL); |
| 692 } | 688 } |
| 693 | 689 |
| 694 void PrintPreviewUI::SetPdfSavedClosureForTesting( | 690 void PrintPreviewUI::SetPdfSavedClosureForTesting( |
| 695 const base::Closure& closure) { | 691 const base::Closure& closure) { |
| 696 handler_->SetPdfSavedClosureForTesting(closure); | 692 handler_->SetPdfSavedClosureForTesting(closure); |
| 697 } | 693 } |
| OLD | NEW |