| 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/about_ui.h" | 5 #include "chrome/browser/ui/webui/about_ui.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 701 break; | 701 break; |
| 702 default: | 702 default: |
| 703 NOTREACHED(); | 703 NOTREACHED(); |
| 704 } | 704 } |
| 705 } | 705 } |
| 706 | 706 |
| 707 std::string data; | 707 std::string data; |
| 708 if (query == "json" || query == kStringsJsPath) { | 708 if (query == "json" || query == kStringsJsPath) { |
| 709 base::JSONWriter::WriteWithOptions( | 709 base::JSONWriter::WriteWithOptions( |
| 710 &root, | 710 &root, |
| 711 base::JSONWriter::OPTIONS_DO_NOT_ESCAPE | | 711 base::JSONWriter::OPTIONS_PRETTY_PRINT, |
| 712 base::JSONWriter::OPTIONS_PRETTY_PRINT, | |
| 713 &data); | 712 &data); |
| 714 if (query == kStringsJsPath) | 713 if (query == kStringsJsPath) |
| 715 data = "var templateData = " + data + ";"; | 714 data = "var templateData = " + data + ";"; |
| 716 } else if (query == "raw") { | 715 } else if (query == "raw") { |
| 717 // Dump the raw counters which have changed in text format. | 716 // Dump the raw counters which have changed in text format. |
| 718 data = "<pre>"; | 717 data = "<pre>"; |
| 719 data.append(base::StringPrintf("Counter changes in the last %ldms\n", | 718 data.append(base::StringPrintf("Counter changes in the last %ldms\n", |
| 720 static_cast<long int>(time_since_last_sample.InMilliseconds()))); | 719 static_cast<long int>(time_since_last_sample.InMilliseconds()))); |
| 721 for (size_t i = 0; i < counters->GetSize(); ++i) { | 720 for (size_t i = 0; i < counters->GetSize(); ++i) { |
| 722 Value* entry = NULL; | 721 Value* entry = NULL; |
| (...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1086 Profile* profile = Profile::FromWebUI(web_ui); | 1085 Profile* profile = Profile::FromWebUI(web_ui); |
| 1087 | 1086 |
| 1088 #if defined(ENABLE_THEMES) | 1087 #if defined(ENABLE_THEMES) |
| 1089 // Set up the chrome://theme/ source. | 1088 // Set up the chrome://theme/ source. |
| 1090 ThemeSource* theme = new ThemeSource(profile); | 1089 ThemeSource* theme = new ThemeSource(profile); |
| 1091 content::URLDataSource::Add(profile, theme); | 1090 content::URLDataSource::Add(profile, theme); |
| 1092 #endif | 1091 #endif |
| 1093 | 1092 |
| 1094 content::URLDataSource::Add(profile, new AboutUIHTMLSource(name, profile)); | 1093 content::URLDataSource::Add(profile, new AboutUIHTMLSource(name, profile)); |
| 1095 } | 1094 } |
| OLD | NEW |