| 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/crashes_ui.h" | 5 #include "chrome/browser/ui/webui/crashes_ui.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 #endif | 33 #endif |
| 34 | 34 |
| 35 using content::WebContents; | 35 using content::WebContents; |
| 36 using content::WebUIMessageHandler; | 36 using content::WebUIMessageHandler; |
| 37 | 37 |
| 38 namespace { | 38 namespace { |
| 39 | 39 |
| 40 content::WebUIDataSource* CreateCrashesUIHTMLSource() { | 40 content::WebUIDataSource* CreateCrashesUIHTMLSource() { |
| 41 content::WebUIDataSource* source = | 41 content::WebUIDataSource* source = |
| 42 content::WebUIDataSource::Create(chrome::kChromeUICrashesHost); | 42 content::WebUIDataSource::Create(chrome::kChromeUICrashesHost); |
| 43 source->SetUseJsonJSFormatV2(); | |
| 44 | 43 |
| 45 source->AddLocalizedString("shortProductName", IDS_SHORT_PRODUCT_NAME); | 44 source->AddLocalizedString("shortProductName", IDS_SHORT_PRODUCT_NAME); |
| 46 source->AddLocalizedString("crashesTitle", IDS_CRASHES_TITLE); | 45 source->AddLocalizedString("crashesTitle", IDS_CRASHES_TITLE); |
| 47 source->AddLocalizedString("crashCountFormat", | 46 source->AddLocalizedString("crashCountFormat", |
| 48 IDS_CRASHES_CRASH_COUNT_BANNER_FORMAT); | 47 IDS_CRASHES_CRASH_COUNT_BANNER_FORMAT); |
| 49 source->AddLocalizedString("crashHeaderFormat", | 48 source->AddLocalizedString("crashHeaderFormat", |
| 50 IDS_CRASHES_CRASH_HEADER_FORMAT); | 49 IDS_CRASHES_CRASH_HEADER_FORMAT); |
| 51 source->AddLocalizedString("crashTimeFormat", IDS_CRASHES_CRASH_TIME_FORMAT); | 50 source->AddLocalizedString("crashTimeFormat", IDS_CRASHES_CRASH_TIME_FORMAT); |
| 52 source->AddLocalizedString("bugLinkText", IDS_CRASHES_BUG_LINK_LABEL); | 51 source->AddLocalizedString("bugLinkText", IDS_CRASHES_BUG_LINK_LABEL); |
| 53 source->AddLocalizedString("noCrashesMessage", | 52 source->AddLocalizedString("noCrashesMessage", |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 Profile* profile = Profile::FromWebUI(web_ui); | 198 Profile* profile = Profile::FromWebUI(web_ui); |
| 200 content::WebUIDataSource::Add(profile, CreateCrashesUIHTMLSource()); | 199 content::WebUIDataSource::Add(profile, CreateCrashesUIHTMLSource()); |
| 201 } | 200 } |
| 202 | 201 |
| 203 // static | 202 // static |
| 204 base::RefCountedMemory* CrashesUI::GetFaviconResourceBytes( | 203 base::RefCountedMemory* CrashesUI::GetFaviconResourceBytes( |
| 205 ui::ScaleFactor scale_factor) { | 204 ui::ScaleFactor scale_factor) { |
| 206 return ResourceBundle::GetSharedInstance(). | 205 return ResourceBundle::GetSharedInstance(). |
| 207 LoadDataResourceBytesForScale(IDR_SAD_FAVICON, scale_factor); | 206 LoadDataResourceBytesForScale(IDR_SAD_FAVICON, scale_factor); |
| 208 } | 207 } |
| OLD | NEW |