| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "ios/chrome/browser/ui/webui/crashes_ui.h" | 5 #include "ios/chrome/browser/ui/webui/crashes_ui.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "base/memory/ptr_util.h" |
| 12 #include "base/memory/ref_counted_memory.h" | 13 #include "base/memory/ref_counted_memory.h" |
| 13 #include "base/strings/utf_string_conversions.h" | 14 #include "base/strings/utf_string_conversions.h" |
| 14 #include "base/sys_info.h" | 15 #include "base/sys_info.h" |
| 15 #include "base/values.h" | 16 #include "base/values.h" |
| 16 #include "components/crash/core/browser/crashes_ui_util.h" | 17 #include "components/crash/core/browser/crashes_ui_util.h" |
| 17 #include "components/grit/components_resources.h" | 18 #include "components/grit/components_resources.h" |
| 18 #include "components/grit/components_scaled_resources.h" | 19 #include "components/grit/components_scaled_resources.h" |
| 19 #include "components/strings/grit/components_chromium_strings.h" | 20 #include "components/strings/grit/components_chromium_strings.h" |
| 20 #include "components/strings/grit/components_strings.h" | 21 #include "components/strings/grit/components_strings.h" |
| 21 #include "components/version_info/version_info.h" | 22 #include "components/version_info/version_info.h" |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 | 143 |
| 143 } // namespace | 144 } // namespace |
| 144 | 145 |
| 145 /////////////////////////////////////////////////////////////////////////////// | 146 /////////////////////////////////////////////////////////////////////////////// |
| 146 // | 147 // |
| 147 // CrashesUI | 148 // CrashesUI |
| 148 // | 149 // |
| 149 /////////////////////////////////////////////////////////////////////////////// | 150 /////////////////////////////////////////////////////////////////////////////// |
| 150 | 151 |
| 151 CrashesUI::CrashesUI(web::WebUIIOS* web_ui) : web::WebUIIOSController(web_ui) { | 152 CrashesUI::CrashesUI(web::WebUIIOS* web_ui) : web::WebUIIOSController(web_ui) { |
| 152 web_ui->AddMessageHandler(new CrashesDOMHandler()); | 153 web_ui->AddMessageHandler(base::MakeUnique<CrashesDOMHandler>()); |
| 153 | 154 |
| 154 // Set up the chrome://crashes/ source. | 155 // Set up the chrome://crashes/ source. |
| 155 web::WebUIIOSDataSource::Add(ios::ChromeBrowserState::FromWebUIIOS(web_ui), | 156 web::WebUIIOSDataSource::Add(ios::ChromeBrowserState::FromWebUIIOS(web_ui), |
| 156 CreateCrashesUIHTMLSource()); | 157 CreateCrashesUIHTMLSource()); |
| 157 } | 158 } |
| 158 | 159 |
| 159 // static | 160 // static |
| 160 base::RefCountedMemory* CrashesUI::GetFaviconResourceBytes( | 161 base::RefCountedMemory* CrashesUI::GetFaviconResourceBytes( |
| 161 ui::ScaleFactor scale_factor) { | 162 ui::ScaleFactor scale_factor) { |
| 162 return ResourceBundle::GetSharedInstance().LoadDataResourceBytesForScale( | 163 return ResourceBundle::GetSharedInstance().LoadDataResourceBytesForScale( |
| 163 IDR_CRASH_SAD_FAVICON, scale_factor); | 164 IDR_CRASH_SAD_FAVICON, scale_factor); |
| 164 } | 165 } |
| OLD | NEW |