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 836 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
847 void AboutMemoryHandler::AppendProcess(ListValue* child_data, | 847 void AboutMemoryHandler::AppendProcess(ListValue* child_data, |
848 ProcessMemoryInformation* info) { | 848 ProcessMemoryInformation* info) { |
849 DCHECK(child_data && info); | 849 DCHECK(child_data && info); |
850 | 850 |
851 // Append a new DictionaryValue for this renderer to our list. | 851 // Append a new DictionaryValue for this renderer to our list. |
852 DictionaryValue* child = new DictionaryValue(); | 852 DictionaryValue* child = new DictionaryValue(); |
853 child_data->Append(child); | 853 child_data->Append(child); |
854 BindProcessMetrics(child, info); | 854 BindProcessMetrics(child, info); |
855 | 855 |
856 std::string child_label( | 856 std::string child_label( |
857 ProcessMemoryInformation::GetFullTypeNameInEnglish(info->type, | 857 ProcessMemoryInformation::GetFullTypeNameInEnglish(info->process_type, |
858 info->renderer_type)); | 858 info->renderer_type)); |
859 if (info->is_diagnostics) | 859 if (info->is_diagnostics) |
860 child_label.append(" (diagnostics)"); | 860 child_label.append(" (diagnostics)"); |
861 child->SetString("child_name", child_label); | 861 child->SetString("child_name", child_label); |
862 ListValue* titles = new ListValue(); | 862 ListValue* titles = new ListValue(); |
863 child->Set("titles", titles); | 863 child->Set("titles", titles); |
864 for (size_t i = 0; i < info->titles.size(); ++i) | 864 for (size_t i = 0; i < info->titles.size(); ++i) |
865 titles->Append(new StringValue(info->titles[i])); | 865 titles->Append(new StringValue(info->titles[i])); |
866 } | 866 } |
867 | 867 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
920 // Set the browser & renderer detailed process data. | 920 // Set the browser & renderer detailed process data. |
921 DictionaryValue* browser_data = new DictionaryValue(); | 921 DictionaryValue* browser_data = new DictionaryValue(); |
922 root->Set("browzr_data", browser_data); | 922 root->Set("browzr_data", browser_data); |
923 ListValue* child_data = new ListValue(); | 923 ListValue* child_data = new ListValue(); |
924 root->Set("child_data", child_data); | 924 root->Set("child_data", child_data); |
925 | 925 |
926 ProcessData process = browser_processes[0]; // Chrome is the first browser. | 926 ProcessData process = browser_processes[0]; // Chrome is the first browser. |
927 root->SetString("current_browser_name", process.name); | 927 root->SetString("current_browser_name", process.name); |
928 | 928 |
929 for (size_t index = 0; index < process.processes.size(); index++) { | 929 for (size_t index = 0; index < process.processes.size(); index++) { |
930 if (process.processes[index].type == content::PROCESS_TYPE_BROWSER) | 930 if (process.processes[index].process_type == content::PROCESS_TYPE_BROWSER) |
931 BindProcessMetrics(browser_data, &process.processes[index]); | 931 BindProcessMetrics(browser_data, &process.processes[index]); |
932 else | 932 else |
933 AppendProcess(child_data, &process.processes[index]); | 933 AppendProcess(child_data, &process.processes[index]); |
934 } | 934 } |
935 | 935 |
936 root->SetBoolean("show_other_browsers", | 936 root->SetBoolean("show_other_browsers", |
937 browser_defaults::kShowOtherBrowsersInAboutMemory); | 937 browser_defaults::kShowOtherBrowsersInAboutMemory); |
938 | 938 |
939 DictionaryValue load_time_data; | 939 DictionaryValue load_time_data; |
940 load_time_data.SetString( | 940 load_time_data.SetString( |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1061 Profile* profile = Profile::FromWebUI(web_ui); | 1061 Profile* profile = Profile::FromWebUI(web_ui); |
1062 | 1062 |
1063 #if defined(ENABLE_THEMES) | 1063 #if defined(ENABLE_THEMES) |
1064 // Set up the chrome://theme/ source. | 1064 // Set up the chrome://theme/ source. |
1065 ThemeSource* theme = new ThemeSource(profile); | 1065 ThemeSource* theme = new ThemeSource(profile); |
1066 content::URLDataSource::Add(profile, theme); | 1066 content::URLDataSource::Add(profile, theme); |
1067 #endif | 1067 #endif |
1068 | 1068 |
1069 content::URLDataSource::Add(profile, new AboutUIHTMLSource(name, profile)); | 1069 content::URLDataSource::Add(profile, new AboutUIHTMLSource(name, profile)); |
1070 } | 1070 } |
OLD | NEW |