| 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/id_map.h" | 10 #include "base/id_map.h" |
| (...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 386 source->AddResourcePath("images/mobile.png", IDR_PRINT_PREVIEW_IMAGES_MOBILE); | 386 source->AddResourcePath("images/mobile.png", IDR_PRINT_PREVIEW_IMAGES_MOBILE); |
| 387 source->AddResourcePath("images/mobile_shared.png", | 387 source->AddResourcePath("images/mobile_shared.png", |
| 388 IDR_PRINT_PREVIEW_IMAGES_MOBILE_SHARED); | 388 IDR_PRINT_PREVIEW_IMAGES_MOBILE_SHARED); |
| 389 source->SetDefaultResource(IDR_PRINT_PREVIEW_HTML); | 389 source->SetDefaultResource(IDR_PRINT_PREVIEW_HTML); |
| 390 source->SetRequestFilter(base::Bind(&HandleRequestCallback)); | 390 source->SetRequestFilter(base::Bind(&HandleRequestCallback)); |
| 391 source->OverrideContentSecurityPolicyChildSrc("child-src 'self';"); | 391 source->OverrideContentSecurityPolicyChildSrc("child-src 'self';"); |
| 392 source->DisableDenyXFrameOptions(); | 392 source->DisableDenyXFrameOptions(); |
| 393 source->OverrideContentSecurityPolicyObjectSrc("object-src 'self';"); | 393 source->OverrideContentSecurityPolicyObjectSrc("object-src 'self';"); |
| 394 source->AddLocalizedString("moreOptionsLabel", IDS_MORE_OPTIONS_LABEL); | 394 source->AddLocalizedString("moreOptionsLabel", IDS_MORE_OPTIONS_LABEL); |
| 395 source->AddLocalizedString("lessOptionsLabel", IDS_LESS_OPTIONS_LABEL); | 395 source->AddLocalizedString("lessOptionsLabel", IDS_LESS_OPTIONS_LABEL); |
| 396 #if defined(OS_CHROMEOS) |
| 397 source->AddString("localPrintersManagementURL", |
| 398 chrome::kChromeUIMdCupsSettingsURL); |
| 399 #endif |
| 396 return source; | 400 return source; |
| 397 } | 401 } |
| 398 | 402 |
| 399 PrintPreviewUI::TestingDelegate* g_testing_delegate = NULL; | 403 PrintPreviewUI::TestingDelegate* g_testing_delegate = NULL; |
| 400 | 404 |
| 401 } // namespace | 405 } // namespace |
| 402 | 406 |
| 403 PrintPreviewUI::PrintPreviewUI(content::WebUI* web_ui) | 407 PrintPreviewUI::PrintPreviewUI(content::WebUI* web_ui) |
| 404 : ConstrainedWebDialogUI(web_ui), | 408 : ConstrainedWebDialogUI(web_ui), |
| 405 initial_preview_start_time_(base::TimeTicks::Now()), | 409 initial_preview_start_time_(base::TimeTicks::Now()), |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 661 } | 665 } |
| 662 | 666 |
| 663 void PrintPreviewUI::SetSelectedFileForTesting(const base::FilePath& path) { | 667 void PrintPreviewUI::SetSelectedFileForTesting(const base::FilePath& path) { |
| 664 handler_->FileSelected(path, 0, NULL); | 668 handler_->FileSelected(path, 0, NULL); |
| 665 } | 669 } |
| 666 | 670 |
| 667 void PrintPreviewUI::SetPdfSavedClosureForTesting( | 671 void PrintPreviewUI::SetPdfSavedClosureForTesting( |
| 668 const base::Closure& closure) { | 672 const base::Closure& closure) { |
| 669 handler_->SetPdfSavedClosureForTesting(closure); | 673 handler_->SetPdfSavedClosureForTesting(closure); |
| 670 } | 674 } |
| OLD | NEW |