| 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/ref_counted_memory.h" | 12 #include "base/memory/ref_counted_memory.h" |
| 13 #include "base/strings/utf_string_conversions.h" | 13 #include "base/strings/utf_string_conversions.h" |
| 14 #include "base/sys_info.h" | 14 #include "base/sys_info.h" |
| 15 #include "base/values.h" | 15 #include "base/values.h" |
| 16 #include "components/crash/core/browser/crashes_ui_util.h" | 16 #include "components/crash/core/browser/crashes_ui_util.h" |
| 17 #include "components/version_info/version_info.h" | 17 #include "components/version_info/version_info.h" |
| 18 #include "grit/components_chromium_strings.h" | 18 #include "grit/components_chromium_strings.h" |
| 19 #include "grit/components_google_chrome_strings.h" | 19 #include "grit/components_google_chrome_strings.h" |
| 20 #include "grit/components_resources.h" | 20 #include "grit/components_resources.h" |
| 21 #include "grit/components_scaled_resources.h" | 21 #include "grit/components_scaled_resources.h" |
| 22 #include "grit/components_strings.h" | 22 #include "grit/components_strings.h" |
| 23 #include "ios/chrome/browser/browser_state/chrome_browser_state.h" |
| 23 #include "ios/chrome/browser/chrome_url_constants.h" | 24 #include "ios/chrome/browser/chrome_url_constants.h" |
| 24 #include "ios/chrome/browser/crash_report/crash_upload_list.h" | 25 #include "ios/chrome/browser/crash_report/crash_upload_list.h" |
| 25 #include "ios/chrome/browser/metrics/ios_chrome_metrics_service_accessor.h" | 26 #include "ios/chrome/browser/metrics/ios_chrome_metrics_service_accessor.h" |
| 26 #include "ios/chrome/grit/ios_chromium_strings.h" | 27 #include "ios/chrome/grit/ios_chromium_strings.h" |
| 27 #include "ios/public/provider/chrome/browser/browser_state/chrome_browser_state.
h" | |
| 28 #include "ios/public/provider/web/web_ui_ios.h" | 28 #include "ios/public/provider/web/web_ui_ios.h" |
| 29 #include "ios/public/provider/web/web_ui_ios_message_handler.h" | 29 #include "ios/public/provider/web/web_ui_ios_message_handler.h" |
| 30 #include "ios/web/public/web_ui_ios_data_source.h" | 30 #include "ios/web/public/web_ui_ios_data_source.h" |
| 31 #include "ui/base/resource/resource_bundle.h" | 31 #include "ui/base/resource/resource_bundle.h" |
| 32 | 32 |
| 33 namespace { | 33 namespace { |
| 34 | 34 |
| 35 web::WebUIIOSDataSource* CreateCrashesUIHTMLSource() { | 35 web::WebUIIOSDataSource* CreateCrashesUIHTMLSource() { |
| 36 web::WebUIIOSDataSource* source = | 36 web::WebUIIOSDataSource* source = |
| 37 web::WebUIIOSDataSource::Create(kChromeUICrashesHost); | 37 web::WebUIIOSDataSource::Create(kChromeUICrashesHost); |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 web::WebUIIOSDataSource::Add(ios::ChromeBrowserState::FromWebUIIOS(web_ui), | 154 web::WebUIIOSDataSource::Add(ios::ChromeBrowserState::FromWebUIIOS(web_ui), |
| 155 CreateCrashesUIHTMLSource()); | 155 CreateCrashesUIHTMLSource()); |
| 156 } | 156 } |
| 157 | 157 |
| 158 // static | 158 // static |
| 159 base::RefCountedMemory* CrashesUI::GetFaviconResourceBytes( | 159 base::RefCountedMemory* CrashesUI::GetFaviconResourceBytes( |
| 160 ui::ScaleFactor scale_factor) { | 160 ui::ScaleFactor scale_factor) { |
| 161 return ResourceBundle::GetSharedInstance().LoadDataResourceBytesForScale( | 161 return ResourceBundle::GetSharedInstance().LoadDataResourceBytesForScale( |
| 162 IDR_CRASH_SAD_FAVICON, scale_factor); | 162 IDR_CRASH_SAD_FAVICON, scale_factor); |
| 163 } | 163 } |
| OLD | NEW |