OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 #include "chrome/common/render_messages.h" | 47 #include "chrome/common/render_messages.h" |
48 #include "chrome/common/url_constants.h" | 48 #include "chrome/common/url_constants.h" |
49 #include "content/browser/gpu/gpu_process_host_ui_shim.h" | 49 #include "content/browser/gpu/gpu_process_host_ui_shim.h" |
50 #include "content/browser/plugin_service.h" | 50 #include "content/browser/plugin_service.h" |
51 #include "content/browser/renderer_host/render_view_host.h" | 51 #include "content/browser/renderer_host/render_view_host.h" |
52 #include "content/browser/sensors/sensors_provider.h" | 52 #include "content/browser/sensors/sensors_provider.h" |
53 #include "content/browser/tab_contents/tab_contents.h" | 53 #include "content/browser/tab_contents/tab_contents.h" |
54 #include "content/public/browser/browser_thread.h" | 54 #include "content/public/browser/browser_thread.h" |
55 #include "content/public/browser/render_process_host.h" | 55 #include "content/public/browser/render_process_host.h" |
56 #include "content/public/common/content_client.h" | 56 #include "content/public/common/content_client.h" |
| 57 #include "content/public/common/process_type.h" |
57 #include "crypto/nss_util.h" | 58 #include "crypto/nss_util.h" |
58 #include "googleurl/src/gurl.h" | 59 #include "googleurl/src/gurl.h" |
59 #include "grit/browser_resources.h" | 60 #include "grit/browser_resources.h" |
60 #include "grit/chromium_strings.h" | 61 #include "grit/chromium_strings.h" |
61 #include "grit/generated_resources.h" | 62 #include "grit/generated_resources.h" |
62 #include "grit/locale_settings.h" | 63 #include "grit/locale_settings.h" |
63 #include "net/base/escape.h" | 64 #include "net/base/escape.h" |
64 #include "net/base/net_util.h" | 65 #include "net/base/net_util.h" |
65 #include "ui/base/l10n/l10n_util.h" | 66 #include "ui/base/l10n/l10n_util.h" |
66 #include "ui/base/resource/resource_bundle.h" | 67 #include "ui/base/resource/resource_bundle.h" |
(...skipping 1152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1219 // Set the browser & renderer detailed process data. | 1220 // Set the browser & renderer detailed process data. |
1220 DictionaryValue* browser_data = new DictionaryValue(); | 1221 DictionaryValue* browser_data = new DictionaryValue(); |
1221 root.Set("browzr_data", browser_data); | 1222 root.Set("browzr_data", browser_data); |
1222 ListValue* child_data = new ListValue(); | 1223 ListValue* child_data = new ListValue(); |
1223 root.Set("child_data", child_data); | 1224 root.Set("child_data", child_data); |
1224 | 1225 |
1225 ProcessData process = browser_processes[0]; // Chrome is the first browser. | 1226 ProcessData process = browser_processes[0]; // Chrome is the first browser. |
1226 root.SetString("current_browser_name", process.name); | 1227 root.SetString("current_browser_name", process.name); |
1227 | 1228 |
1228 for (size_t index = 0; index < process.processes.size(); index++) { | 1229 for (size_t index = 0; index < process.processes.size(); index++) { |
1229 if (process.processes[index].type == ChildProcessInfo::BROWSER_PROCESS) | 1230 if (process.processes[index].type == content::PROCESS_TYPE_BROWSER) |
1230 BindProcessMetrics(browser_data, &process.processes[index]); | 1231 BindProcessMetrics(browser_data, &process.processes[index]); |
1231 else | 1232 else |
1232 AppendProcess(child_data, &process.processes[index]); | 1233 AppendProcess(child_data, &process.processes[index]); |
1233 } | 1234 } |
1234 | 1235 |
1235 root.SetBoolean("show_other_browsers", | 1236 root.SetBoolean("show_other_browsers", |
1236 browser_defaults::kShowOtherBrowsersInAboutMemory); | 1237 browser_defaults::kShowOtherBrowsersInAboutMemory); |
1237 | 1238 |
1238 std::string data; | 1239 std::string data; |
1239 jstemplate_builder::AppendJsonJS(&root, &data); | 1240 jstemplate_builder::AppendJsonJS(&root, &data); |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1373 } | 1374 } |
1374 | 1375 |
1375 AboutUI::AboutUI(TabContents* contents, const std::string& name) | 1376 AboutUI::AboutUI(TabContents* contents, const std::string& name) |
1376 : ChromeWebUI(contents) { | 1377 : ChromeWebUI(contents) { |
1377 Profile* profile = Profile::FromBrowserContext(contents->browser_context()); | 1378 Profile* profile = Profile::FromBrowserContext(contents->browser_context()); |
1378 ChromeURLDataManager::DataSource* source = | 1379 ChromeURLDataManager::DataSource* source = |
1379 new AboutUIHTMLSource(name, profile); | 1380 new AboutUIHTMLSource(name, profile); |
1380 if (source) | 1381 if (source) |
1381 profile->GetChromeURLDataManager()->AddDataSource(source); | 1382 profile->GetChromeURLDataManager()->AddDataSource(source); |
1382 } | 1383 } |
OLD | NEW |