Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(470)

Side by Side Diff: ios/chrome/browser/ui/webui/crashes_ui.cc

Issue 2116673002: [ios] Moved WebUI provider code to ios/web. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Self review Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ios/chrome/browser/ui/webui/crashes_ui.h ('k') | ios/chrome/browser/ui/webui/flags_ui.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/grit/components_resources.h" 17 #include "components/grit/components_resources.h"
18 #include "components/grit/components_scaled_resources.h" 18 #include "components/grit/components_scaled_resources.h"
19 #include "components/strings/grit/components_chromium_strings.h" 19 #include "components/strings/grit/components_chromium_strings.h"
20 #include "components/strings/grit/components_google_chrome_strings.h" 20 #include "components/strings/grit/components_google_chrome_strings.h"
21 #include "components/strings/grit/components_strings.h" 21 #include "components/strings/grit/components_strings.h"
22 #include "components/version_info/version_info.h" 22 #include "components/version_info/version_info.h"
23 #include "ios/chrome/browser/browser_state/chrome_browser_state.h" 23 #include "ios/chrome/browser/browser_state/chrome_browser_state.h"
24 #include "ios/chrome/browser/chrome_url_constants.h" 24 #include "ios/chrome/browser/chrome_url_constants.h"
25 #include "ios/chrome/browser/crash_report/crash_upload_list.h" 25 #include "ios/chrome/browser/crash_report/crash_upload_list.h"
26 #include "ios/chrome/browser/metrics/ios_chrome_metrics_service_accessor.h" 26 #include "ios/chrome/browser/metrics/ios_chrome_metrics_service_accessor.h"
27 #include "ios/chrome/grit/ios_chromium_strings.h" 27 #include "ios/chrome/grit/ios_chromium_strings.h"
28 #include "ios/public/provider/web/web_ui_ios.h"
29 #include "ios/public/provider/web/web_ui_ios_message_handler.h"
30 #include "ios/web/public/web_ui_ios_data_source.h" 28 #include "ios/web/public/web_ui_ios_data_source.h"
29 #include "ios/web/public/webui/web_ui_ios.h"
30 #include "ios/web/public/webui/web_ui_ios_message_handler.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);
38 38
39 for (size_t i = 0; i < crash::kCrashesUILocalizedStringsCount; ++i) { 39 for (size_t i = 0; i < crash::kCrashesUILocalizedStringsCount; ++i) {
40 source->AddLocalizedString( 40 source->AddLocalizedString(
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 }
OLDNEW
« no previous file with comments | « ios/chrome/browser/ui/webui/crashes_ui.h ('k') | ios/chrome/browser/ui/webui/flags_ui.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698