| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "components/supervised_user_error_page/supervised_user_error_page_andro
id.h" | 5 #include "components/supervised_user_error_page/supervised_user_error_page_andro
id.h" |
| 6 | 6 |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "components/grit/components_resources.h" |
| 8 #include "components/supervised_user_error_page/supervised_user_error_page.h" | 9 #include "components/supervised_user_error_page/supervised_user_error_page.h" |
| 9 #include "grit/components_resources.h" | |
| 10 #include "ui/base/resource/resource_bundle.h" | 10 #include "ui/base/resource/resource_bundle.h" |
| 11 | 11 |
| 12 namespace supervised_user_error_page { | 12 namespace supervised_user_error_page { |
| 13 | 13 |
| 14 std::string BuildHtmlFromWebRestrictionsResult( | 14 std::string BuildHtmlFromWebRestrictionsResult( |
| 15 const web_restrictions::mojom::ClientResultPtr& result, | 15 const web_restrictions::mojom::ClientResultPtr& result, |
| 16 const std::string app_locale) { | 16 const std::string app_locale) { |
| 17 // Check if Webview has the resources it needs to build the error page. | 17 // Check if Webview has the resources it needs to build the error page. |
| 18 // It only will have it is built as Monochrome. | 18 // It only will have it is built as Monochrome. |
| 19 if (ResourceBundle::GetSharedInstance().GetRawDataResource( | 19 if (ResourceBundle::GetSharedInstance().GetRawDataResource( |
| 20 IDR_SUPERVISED_USER_BLOCK_INTERSTITIAL_HTML).empty()) { | 20 IDR_SUPERVISED_USER_BLOCK_INTERSTITIAL_HTML).empty()) { |
| 21 return std::string(); | 21 return std::string(); |
| 22 } | 22 } |
| 23 return BuildHtml( | 23 return BuildHtml( |
| 24 result->intParams["Allow access requests"], | 24 result->intParams["Allow access requests"], |
| 25 result->stringParams["Profile image URL"], | 25 result->stringParams["Profile image URL"], |
| 26 result->stringParams["Second profile image URL"], | 26 result->stringParams["Second profile image URL"], |
| 27 result->stringParams["Custodian"], | 27 result->stringParams["Custodian"], |
| 28 result->stringParams["Custodian email"], | 28 result->stringParams["Custodian email"], |
| 29 result->stringParams["Second custodian"], | 29 result->stringParams["Second custodian"], |
| 30 result->stringParams["Second custodian email"], | 30 result->stringParams["Second custodian email"], |
| 31 result->intParams["Is child account"], | 31 result->intParams["Is child account"], |
| 32 static_cast<FilteringBehaviorReason>(result->intParams["Reason"]), | 32 static_cast<FilteringBehaviorReason>(result->intParams["Reason"]), |
| 33 app_locale); | 33 app_locale); |
| 34 } | 34 } |
| 35 | 35 |
| 36 } // namespace supervised_user_error_page | 36 } // namespace supervised_user_error_page |
| OLD | NEW |