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_PRETTY_PRINT, | 711 base::JSONWriter::OPTIONS_DO_NOT_ESCAPE | |
| 712 base::JSONWriter::OPTIONS_PRETTY_PRINT, |
712 &data); | 713 &data); |
713 if (query == kStringsJsPath) | 714 if (query == kStringsJsPath) |
714 data = "var templateData = " + data + ";"; | 715 data = "var templateData = " + data + ";"; |
715 } else if (query == "raw") { | 716 } else if (query == "raw") { |
716 // Dump the raw counters which have changed in text format. | 717 // Dump the raw counters which have changed in text format. |
717 data = "<pre>"; | 718 data = "<pre>"; |
718 data.append(base::StringPrintf("Counter changes in the last %ldms\n", | 719 data.append(base::StringPrintf("Counter changes in the last %ldms\n", |
719 static_cast<long int>(time_since_last_sample.InMilliseconds()))); | 720 static_cast<long int>(time_since_last_sample.InMilliseconds()))); |
720 for (size_t i = 0; i < counters->GetSize(); ++i) { | 721 for (size_t i = 0; i < counters->GetSize(); ++i) { |
721 Value* entry = NULL; | 722 Value* entry = NULL; |
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1085 Profile* profile = Profile::FromWebUI(web_ui); | 1086 Profile* profile = Profile::FromWebUI(web_ui); |
1086 | 1087 |
1087 #if defined(ENABLE_THEMES) | 1088 #if defined(ENABLE_THEMES) |
1088 // Set up the chrome://theme/ source. | 1089 // Set up the chrome://theme/ source. |
1089 ThemeSource* theme = new ThemeSource(profile); | 1090 ThemeSource* theme = new ThemeSource(profile); |
1090 content::URLDataSource::Add(profile, theme); | 1091 content::URLDataSource::Add(profile, theme); |
1091 #endif | 1092 #endif |
1092 | 1093 |
1093 content::URLDataSource::Add(profile, new AboutUIHTMLSource(name, profile)); | 1094 content::URLDataSource::Add(profile, new AboutUIHTMLSource(name, profile)); |
1094 } | 1095 } |
OLD | NEW |