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 <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 #include "grit/locale_settings.h" | 63 #include "grit/locale_settings.h" |
64 #include "net/base/escape.h" | 64 #include "net/base/escape.h" |
65 #include "net/base/net_util.h" | 65 #include "net/base/net_util.h" |
66 #include "ui/base/l10n/l10n_util.h" | 66 #include "ui/base/l10n/l10n_util.h" |
67 #include "ui/base/resource/resource_bundle.h" | 67 #include "ui/base/resource/resource_bundle.h" |
68 #include "v8/include/v8.h" | 68 #include "v8/include/v8.h" |
69 #include "webkit/glue/user_agent.h" | 69 #include "webkit/glue/user_agent.h" |
70 #include "webkit/glue/webkit_glue.h" | 70 #include "webkit/glue/webkit_glue.h" |
71 #include "webkit/plugins/webplugininfo.h" | 71 #include "webkit/plugins/webplugininfo.h" |
72 | 72 |
| 73 #if defined(OS_LINUX) || defined(OS_OPENBSD) |
| 74 #include "content/public/common/sandbox_linux.h" |
| 75 #include "content/public/browser/zygote_host_linux.h" |
| 76 #endif |
| 77 |
73 #if defined(OS_WIN) | 78 #if defined(OS_WIN) |
74 #include "chrome/browser/enumerate_modules_model_win.h" | 79 #include "chrome/browser/enumerate_modules_model_win.h" |
75 #elif defined(OS_CHROMEOS) | 80 #endif |
| 81 |
| 82 #if defined(OS_CHROMEOS) |
76 #include "chrome/browser/chromeos/cros/cros_library.h" | 83 #include "chrome/browser/chromeos/cros/cros_library.h" |
77 #include "chrome/browser/chromeos/cros/cryptohome_library.h" | 84 #include "chrome/browser/chromeos/cros/cryptohome_library.h" |
78 #include "chrome/browser/chromeos/cros/network_library.h" | 85 #include "chrome/browser/chromeos/cros/network_library.h" |
79 #include "chrome/browser/chromeos/customization_document.h" | 86 #include "chrome/browser/chromeos/customization_document.h" |
80 #include "chrome/browser/chromeos/login/wizard_controller.h" | 87 #include "chrome/browser/chromeos/login/wizard_controller.h" |
81 #include "chrome/browser/chromeos/version_loader.h" | 88 #include "chrome/browser/chromeos/version_loader.h" |
82 #include "chrome/browser/oom_priority_manager.h" | 89 #include "chrome/browser/oom_priority_manager.h" |
83 #include "chromeos/dbus/cryptohome_client.h" | 90 #include "chromeos/dbus/cryptohome_client.h" |
84 #include "chromeos/dbus/dbus_thread_manager.h" | 91 #include "chromeos/dbus/dbus_thread_manager.h" |
85 #include "content/public/browser/zygote_host_linux.h" | |
86 #elif defined(OS_LINUX) || defined(OS_OPENBSD) | |
87 #include "content/public/browser/zygote_host_linux.h" | |
88 #endif | 92 #endif |
89 | 93 |
90 #if defined(USE_ASH) | 94 #if defined(USE_ASH) |
91 #include "ash/wm/frame_painter.h" | 95 #include "ash/wm/frame_painter.h" |
92 #include "base/string_split.h" | 96 #include "base/string_split.h" |
93 #endif | 97 #endif |
94 | 98 |
95 using base::Time; | 99 using base::Time; |
96 using base::TimeDelta; | 100 using base::TimeDelta; |
97 using content::BrowserThread; | 101 using content::BrowserThread; |
(...skipping 943 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1041 AppendBody(&data); | 1045 AppendBody(&data); |
1042 data.append("<h1>"); | 1046 data.append("<h1>"); |
1043 data.append(l10n_util::GetStringUTF8(IDS_ABOUT_SANDBOX_TITLE)); | 1047 data.append(l10n_util::GetStringUTF8(IDS_ABOUT_SANDBOX_TITLE)); |
1044 data.append("</h1>"); | 1048 data.append("</h1>"); |
1045 | 1049 |
1046 const int status = content::ZygoteHost::GetInstance()->GetSandboxStatus(); | 1050 const int status = content::ZygoteHost::GetInstance()->GetSandboxStatus(); |
1047 | 1051 |
1048 data.append("<table>"); | 1052 data.append("<table>"); |
1049 | 1053 |
1050 AboutSandboxRow(&data, "", IDS_ABOUT_SANDBOX_SUID_SANDBOX, | 1054 AboutSandboxRow(&data, "", IDS_ABOUT_SANDBOX_SUID_SANDBOX, |
1051 status & content::ZygoteHost::kSandboxSUID); | 1055 status & content::kSandboxLinuxSUID); |
1052 AboutSandboxRow(&data, " ", IDS_ABOUT_SANDBOX_PID_NAMESPACES, | 1056 AboutSandboxRow(&data, " ", IDS_ABOUT_SANDBOX_PID_NAMESPACES, |
1053 status & content::ZygoteHost::kSandboxPIDNS); | 1057 status & content::kSandboxLinuxPIDNS); |
1054 AboutSandboxRow(&data, " ", IDS_ABOUT_SANDBOX_NET_NAMESPACES, | 1058 AboutSandboxRow(&data, " ", IDS_ABOUT_SANDBOX_NET_NAMESPACES, |
1055 status & content::ZygoteHost::kSandboxNetNS); | 1059 status & content::kSandboxLinuxNetNS); |
1056 AboutSandboxRow(&data, "", IDS_ABOUT_SANDBOX_SECCOMP_SANDBOX, | 1060 AboutSandboxRow(&data, "", IDS_ABOUT_SANDBOX_SECCOMP_SANDBOX, |
1057 status & content::ZygoteHost::kSandboxSeccomp); | 1061 status & content::kSandboxLinuxSeccomp); |
1058 | 1062 |
1059 data.append("</table>"); | 1063 data.append("</table>"); |
1060 | 1064 |
1061 bool good = ((status & content::ZygoteHost::kSandboxSUID) && | 1065 bool good = ((status & content::kSandboxLinuxSUID) && |
1062 (status & content::ZygoteHost::kSandboxPIDNS)) || | 1066 (status & content::kSandboxLinuxPIDNS)) || |
1063 (status & content::ZygoteHost::kSandboxSeccomp); | 1067 (status & content::kSandboxLinuxSeccomp); |
1064 if (good) { | 1068 if (good) { |
1065 data.append("<p style=\"color: green\">"); | 1069 data.append("<p style=\"color: green\">"); |
1066 data.append(l10n_util::GetStringUTF8(IDS_ABOUT_SANDBOX_OK)); | 1070 data.append(l10n_util::GetStringUTF8(IDS_ABOUT_SANDBOX_OK)); |
1067 } else { | 1071 } else { |
1068 data.append("<p style=\"color: red\">"); | 1072 data.append("<p style=\"color: red\">"); |
1069 data.append(l10n_util::GetStringUTF8(IDS_ABOUT_SANDBOX_BAD)); | 1073 data.append(l10n_util::GetStringUTF8(IDS_ABOUT_SANDBOX_BAD)); |
1070 } | 1074 } |
1071 data.append("</p>"); | 1075 data.append("</p>"); |
1072 | 1076 |
1073 AppendFooter(&data); | 1077 AppendFooter(&data); |
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1462 | 1466 |
1463 AboutUI::AboutUI(content::WebUI* web_ui, const std::string& name) | 1467 AboutUI::AboutUI(content::WebUI* web_ui, const std::string& name) |
1464 : WebUIController(web_ui) { | 1468 : WebUIController(web_ui) { |
1465 Profile* profile = Profile::FromWebUI(web_ui); | 1469 Profile* profile = Profile::FromWebUI(web_ui); |
1466 ChromeURLDataManager::DataSource* source = | 1470 ChromeURLDataManager::DataSource* source = |
1467 new AboutUIHTMLSource(name, profile); | 1471 new AboutUIHTMLSource(name, profile); |
1468 if (source) { | 1472 if (source) { |
1469 ChromeURLDataManager::AddDataSource(profile, source); | 1473 ChromeURLDataManager::AddDataSource(profile, source); |
1470 } | 1474 } |
1471 } | 1475 } |
OLD | NEW |