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 <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" |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 base::StringValue version(version_info::GetVersionNumber()); | 171 base::StringValue version(version_info::GetVersionNumber()); |
172 base::StringValue os_string(base::SysInfo::OperatingSystemName() + " " + | 172 base::StringValue os_string(base::SysInfo::OperatingSystemName() + " " + |
173 base::SysInfo::OperatingSystemVersion()); | 173 base::SysInfo::OperatingSystemVersion()); |
174 | 174 |
175 std::vector<const base::Value*> args; | 175 std::vector<const base::Value*> args; |
176 args.push_back(&enabled); | 176 args.push_back(&enabled); |
177 args.push_back(&dynamic_backend); | 177 args.push_back(&dynamic_backend); |
178 args.push_back(&crash_list); | 178 args.push_back(&crash_list); |
179 args.push_back(&version); | 179 args.push_back(&version); |
180 args.push_back(&os_string); | 180 args.push_back(&os_string); |
181 web_ui()->CallJavascriptFunction(crash::kCrashesUIUpdateCrashList, args); | 181 web_ui()->CallJavascriptFunctionUnsafe(crash::kCrashesUIUpdateCrashList, |
| 182 args); |
182 } | 183 } |
183 | 184 |
184 } // namespace | 185 } // namespace |
185 | 186 |
186 /////////////////////////////////////////////////////////////////////////////// | 187 /////////////////////////////////////////////////////////////////////////////// |
187 // | 188 // |
188 // CrashesUI | 189 // CrashesUI |
189 // | 190 // |
190 /////////////////////////////////////////////////////////////////////////////// | 191 /////////////////////////////////////////////////////////////////////////////// |
191 | 192 |
192 CrashesUI::CrashesUI(content::WebUI* web_ui) : WebUIController(web_ui) { | 193 CrashesUI::CrashesUI(content::WebUI* web_ui) : WebUIController(web_ui) { |
193 web_ui->AddMessageHandler(new CrashesDOMHandler()); | 194 web_ui->AddMessageHandler(new CrashesDOMHandler()); |
194 | 195 |
195 // Set up the chrome://crashes/ source. | 196 // Set up the chrome://crashes/ source. |
196 Profile* profile = Profile::FromWebUI(web_ui); | 197 Profile* profile = Profile::FromWebUI(web_ui); |
197 content::WebUIDataSource::Add(profile, CreateCrashesUIHTMLSource()); | 198 content::WebUIDataSource::Add(profile, CreateCrashesUIHTMLSource()); |
198 } | 199 } |
199 | 200 |
200 // static | 201 // static |
201 base::RefCountedMemory* CrashesUI::GetFaviconResourceBytes( | 202 base::RefCountedMemory* CrashesUI::GetFaviconResourceBytes( |
202 ui::ScaleFactor scale_factor) { | 203 ui::ScaleFactor scale_factor) { |
203 return ResourceBundle::GetSharedInstance().LoadDataResourceBytesForScale( | 204 return ResourceBundle::GetSharedInstance().LoadDataResourceBytesForScale( |
204 IDR_CRASH_SAD_FAVICON, scale_factor); | 205 IDR_CRASH_SAD_FAVICON, scale_factor); |
205 } | 206 } |
OLD | NEW |