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 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
438 | 438 |
439 } // namespace | 439 } // namespace |
440 | 440 |
441 PrintPreviewUI::PrintPreviewUI(content::WebUI* web_ui) | 441 PrintPreviewUI::PrintPreviewUI(content::WebUI* web_ui) |
442 : ConstrainedWebDialogUI(web_ui), | 442 : ConstrainedWebDialogUI(web_ui), |
443 initial_preview_start_time_(base::TimeTicks::Now()), | 443 initial_preview_start_time_(base::TimeTicks::Now()), |
444 id_(g_print_preview_ui_id_map.Get().Add(this)), | 444 id_(g_print_preview_ui_id_map.Get().Add(this)), |
445 handler_(nullptr), | 445 handler_(nullptr), |
446 source_is_modifiable_(true), | 446 source_is_modifiable_(true), |
447 source_has_selection_(false), | 447 source_has_selection_(false), |
| 448 print_selection_only_(false), |
448 dialog_closed_(false) { | 449 dialog_closed_(false) { |
449 // Set up the chrome://print/ data source. | 450 // Set up the chrome://print/ data source. |
450 Profile* profile = Profile::FromWebUI(web_ui); | 451 Profile* profile = Profile::FromWebUI(web_ui); |
451 content::WebUIDataSource::Add(profile, CreatePrintPreviewUISource()); | 452 content::WebUIDataSource::Add(profile, CreatePrintPreviewUISource()); |
452 | 453 |
453 // Set up the chrome://theme/ source. | 454 // Set up the chrome://theme/ source. |
454 content::URLDataSource::Add(profile, new ThemeSource(profile)); | 455 content::URLDataSource::Add(profile, new ThemeSource(profile)); |
455 | 456 |
456 auto handler = base::MakeUnique<PrintPreviewHandler>(); | 457 auto handler = base::MakeUnique<PrintPreviewHandler>(); |
457 handler_ = handler.get(); | 458 handler_ = handler.get(); |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
691 } | 692 } |
692 | 693 |
693 void PrintPreviewUI::SetSelectedFileForTesting(const base::FilePath& path) { | 694 void PrintPreviewUI::SetSelectedFileForTesting(const base::FilePath& path) { |
694 handler_->FileSelected(path, 0, NULL); | 695 handler_->FileSelected(path, 0, NULL); |
695 } | 696 } |
696 | 697 |
697 void PrintPreviewUI::SetPdfSavedClosureForTesting( | 698 void PrintPreviewUI::SetPdfSavedClosureForTesting( |
698 const base::Closure& closure) { | 699 const base::Closure& closure) { |
699 handler_->SetPdfSavedClosureForTesting(closure); | 700 handler_->SetPdfSavedClosureForTesting(closure); |
700 } | 701 } |
OLD | NEW |