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 687 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
698 } | 698 } |
699 } | 699 } |
700 | 700 |
701 std::string data; | 701 std::string data; |
702 if (query == "json" || query == kStringsJsPath) { | 702 if (query == "json" || query == kStringsJsPath) { |
703 base::JSONWriter::WriteWithOptions( | 703 base::JSONWriter::WriteWithOptions( |
704 &root, | 704 &root, |
705 base::JSONWriter::OPTIONS_PRETTY_PRINT, | 705 base::JSONWriter::OPTIONS_PRETTY_PRINT, |
706 &data); | 706 &data); |
707 if (query == kStringsJsPath) | 707 if (query == kStringsJsPath) |
708 data = "var templateData = " + data + ";"; | 708 data = "loadTimeData.data = " + data + ";"; |
709 } else if (query == "raw") { | 709 } else if (query == "raw") { |
710 // Dump the raw counters which have changed in text format. | 710 // Dump the raw counters which have changed in text format. |
711 data = "<pre>"; | 711 data = "<pre>"; |
712 data.append(base::StringPrintf("Counter changes in the last %ldms\n", | 712 data.append(base::StringPrintf("Counter changes in the last %ldms\n", |
713 static_cast<long int>(time_since_last_sample.InMilliseconds()))); | 713 static_cast<long int>(time_since_last_sample.InMilliseconds()))); |
714 for (size_t i = 0; i < counters->GetSize(); ++i) { | 714 for (size_t i = 0; i < counters->GetSize(); ++i) { |
715 base::Value* entry = NULL; | 715 base::Value* entry = NULL; |
716 bool rv = counters->Get(i, &entry); | 716 bool rv = counters->Get(i, &entry); |
717 if (!rv) | 717 if (!rv) |
718 continue; // None of these should fail. | 718 continue; // None of these should fail. |
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1095 Profile* profile = Profile::FromWebUI(web_ui); | 1095 Profile* profile = Profile::FromWebUI(web_ui); |
1096 | 1096 |
1097 #if defined(ENABLE_THEMES) | 1097 #if defined(ENABLE_THEMES) |
1098 // Set up the chrome://theme/ source. | 1098 // Set up the chrome://theme/ source. |
1099 ThemeSource* theme = new ThemeSource(profile); | 1099 ThemeSource* theme = new ThemeSource(profile); |
1100 content::URLDataSource::Add(profile, theme); | 1100 content::URLDataSource::Add(profile, theme); |
1101 #endif | 1101 #endif |
1102 | 1102 |
1103 content::URLDataSource::Add(profile, new AboutUIHTMLSource(name, profile)); | 1103 content::URLDataSource::Add(profile, new AboutUIHTMLSource(name, profile)); |
1104 } | 1104 } |
OLD | NEW |