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