| 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 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 402 source->OverrideContentSecurityPolicyObjectSrc("object-src 'self';"); | 402 source->OverrideContentSecurityPolicyObjectSrc("object-src 'self';"); |
| 403 source->AddLocalizedString("moreOptionsLabel", IDS_MORE_OPTIONS_LABEL); | 403 source->AddLocalizedString("moreOptionsLabel", IDS_MORE_OPTIONS_LABEL); |
| 404 source->AddLocalizedString("lessOptionsLabel", IDS_LESS_OPTIONS_LABEL); | 404 source->AddLocalizedString("lessOptionsLabel", IDS_LESS_OPTIONS_LABEL); |
| 405 | 405 |
| 406 bool scaling_enabled = base::FeatureList::IsEnabled(features::kPrintScaling); | 406 bool scaling_enabled = base::FeatureList::IsEnabled(features::kPrintScaling); |
| 407 source->AddBoolean("scalingEnabled", scaling_enabled); | 407 source->AddBoolean("scalingEnabled", scaling_enabled); |
| 408 | 408 |
| 409 #if defined(OS_CHROMEOS) | 409 #if defined(OS_CHROMEOS) |
| 410 bool cups_and_md_settings_enabled = | 410 bool cups_and_md_settings_enabled = |
| 411 base::CommandLine::ForCurrentProcess()->HasSwitch( | 411 base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 412 ::switches::kEnableNativeCups) && | 412 ::switches::kEnableNativeCups); |
| 413 base::FeatureList::IsEnabled(features::kMaterialDesignSettings); | |
| 414 source->AddBoolean("showLocalManageButton", cups_and_md_settings_enabled); | 413 source->AddBoolean("showLocalManageButton", cups_and_md_settings_enabled); |
| 415 #else | 414 #else |
| 416 source->AddBoolean("showLocalManageButton", true); | 415 source->AddBoolean("showLocalManageButton", true); |
| 417 #endif | 416 #endif |
| 418 return source; | 417 return source; |
| 419 } | 418 } |
| 420 | 419 |
| 421 PrintPreviewUI::TestingDelegate* g_testing_delegate = NULL; | 420 PrintPreviewUI::TestingDelegate* g_testing_delegate = NULL; |
| 422 | 421 |
| 423 } // namespace | 422 } // namespace |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 684 } | 683 } |
| 685 | 684 |
| 686 void PrintPreviewUI::SetSelectedFileForTesting(const base::FilePath& path) { | 685 void PrintPreviewUI::SetSelectedFileForTesting(const base::FilePath& path) { |
| 687 handler_->FileSelected(path, 0, NULL); | 686 handler_->FileSelected(path, 0, NULL); |
| 688 } | 687 } |
| 689 | 688 |
| 690 void PrintPreviewUI::SetPdfSavedClosureForTesting( | 689 void PrintPreviewUI::SetPdfSavedClosureForTesting( |
| 691 const base::Closure& closure) { | 690 const base::Closure& closure) { |
| 692 handler_->SetPdfSavedClosureForTesting(closure); | 691 handler_->SetPdfSavedClosureForTesting(closure); |
| 693 } | 692 } |
| OLD | NEW |