OLD | NEW |
---|---|
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/browser_about_handler.h" | 5 #include "chrome/browser/browser_about_handler.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 743 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
754 } | 754 } |
755 | 755 |
756 #endif // OS_WIN | 756 #endif // OS_WIN |
757 | 757 |
758 } | 758 } |
759 | 759 |
760 std::string AboutGpu() { | 760 std::string AboutGpu() { |
761 GPUInfo gpu_info = GpuProcessHost::Get()->gpu_info(); | 761 GPUInfo gpu_info = GpuProcessHost::Get()->gpu_info(); |
762 | 762 |
763 std::string html; | 763 std::string html; |
764 if (!gpu_info.initialized()) { | 764 |
765 html.append("<html><head><title>About GPU</title></head>\n"); | |
766 | |
767 if (gpu_info.progress() != GPUInfo::kComplete) { | |
765 GpuProcessHostUIShim::Get()->CollectGraphicsInfoAsynchronously(); | 768 GpuProcessHostUIShim::Get()->CollectGraphicsInfoAsynchronously(); |
766 // If it's not initialized yet, let the user know and reload the page | 769 |
767 html.append("<html><head><title>About GPU</title></head>\n"); | 770 // If it's not fully initialized yet, set a timeout to reload the page. |
768 html.append("<body onload=\"setTimeout('window.location.reload(true)',"); | 771 html.append("<body onload=\"setTimeout('window.location.reload(true)',"); |
769 html.append("2000)\">\n"); | 772 html.append("2000)\">\n"); |
770 html.append("<h2>GPU Information</h2>\n"); | 773 } else { |
774 html.append("<body>\n"); | |
775 } | |
776 | |
777 html.append("<h2>GPU Information</h2>\n"); | |
778 | |
779 if (gpu_info.progress() == GPUInfo::kUninitialized) { | |
771 html.append("<p>Retrieving GPU information . . .</p>\n"); | 780 html.append("<p>Retrieving GPU information . . .</p>\n"); |
772 html.append("</body></html> "); | |
773 } else { | 781 } else { |
774 html.append("<html><head><title>About GPU</title></head><body>\n"); | |
775 html.append("<h2>GPU Information</h2>\n"); | |
776 html.append("<table><tr>"); | 782 html.append("<table><tr>"); |
777 html.append("<td><strong>Initialization time</strong></td><td>"); | 783 html.append("<td><strong>Initialization time</strong></td><td>"); |
778 html.append(base::Int64ToString( | 784 html.append(base::Int64ToString( |
779 gpu_info.initialization_time().InMilliseconds())); | 785 gpu_info.initialization_time().InMilliseconds())); |
780 html.append("</td></tr><tr><td>"); | 786 html.append("</td></tr><tr><td>"); |
781 html.append("<strong>Vendor ID</strong></td><td>"); | 787 html.append("<strong>Vendor ID</strong></td><td>"); |
782 html.append(base::StringPrintf("0x%04x", gpu_info.vendor_id())); | 788 html.append(base::StringPrintf("0x%04x", gpu_info.vendor_id())); |
783 html.append("</td></tr><tr><td>"); | 789 html.append("</td></tr><tr><td>"); |
784 html.append("<strong>Device ID</strong></td><td>"); | 790 html.append("<strong>Device ID</strong></td><td>"); |
785 html.append(base::StringPrintf("0x%04x", gpu_info.device_id())); | 791 html.append(base::StringPrintf("0x%04x", gpu_info.device_id())); |
786 html.append("</td></tr><tr><td>"); | 792 html.append("</td></tr><tr><td>"); |
787 html.append("<strong>Driver Version</strong></td><td>"); | 793 html.append("<strong>Driver Version</strong></td><td>"); |
788 html.append(WideToASCII(gpu_info.driver_version()).c_str()); | 794 html.append(WideToASCII(gpu_info.driver_version()).c_str()); |
789 html.append("</td></tr><tr><td>"); | 795 html.append("</td></tr><tr><td>"); |
790 html.append("<strong>Pixel Shader Version</strong></td><td>"); | 796 html.append("<strong>Pixel Shader Version</strong></td><td>"); |
791 html.append(VersionNumberToString(gpu_info.pixel_shader_version()).c_str()); | 797 html.append(VersionNumberToString(gpu_info.pixel_shader_version()).c_str()); |
792 html.append("</td></tr><tr><td>"); | 798 html.append("</td></tr><tr><td>"); |
793 html.append("<strong>Vertex Shader Version</strong></td><td>"); | 799 html.append("<strong>Vertex Shader Version</strong></td><td>"); |
794 html.append(VersionNumberToString( | 800 html.append(VersionNumberToString( |
795 gpu_info.vertex_shader_version()).c_str()); | 801 gpu_info.vertex_shader_version()).c_str()); |
796 html.append("</td></tr><tr><td>"); | 802 html.append("</td></tr><tr><td>"); |
797 html.append("<strong>GL Version</strong></td><td>"); | 803 html.append("<strong>GL Version</strong></td><td>"); |
798 html.append(VersionNumberToString(gpu_info.gl_version()).c_str()); | 804 html.append(VersionNumberToString(gpu_info.gl_version()).c_str()); |
799 html.append("</td></tr></table>"); | 805 html.append("</td></tr></table>"); |
800 | 806 |
801 #if defined(OS_WIN) | 807 #if defined(OS_WIN) |
808 if (gpu_info.progress() != GPUInfo::kComplete) { | |
809 html.append("<p>Retrieving DirectX Diagnostics . . .</p>\n"); | |
810 } else { | |
802 html.append("<h2>DirectX Diagnostics</h2>"); | 811 html.append("<h2>DirectX Diagnostics</h2>"); |
803 DxDiagNodeToHTML(&html, gpu_info.dx_diagnostics()); | 812 DxDiagNodeToHTML(&html, gpu_info.dx_diagnostics()); |
813 } | |
Ken Russell (switch to Gerrit)
2010/11/13 02:34:45
Indentation of this block is off.
apatrick_chromium
2010/11/15 21:46:25
Done.
| |
804 #endif | 814 #endif |
815 } | |
805 | 816 |
806 html.append("</body></html>"); | 817 html.append("</body></html>"); |
807 } | 818 |
808 return html; | 819 return html; |
809 } | 820 } |
810 | 821 |
811 // AboutSource ----------------------------------------------------------------- | 822 // AboutSource ----------------------------------------------------------------- |
812 | 823 |
813 AboutSource::AboutSource() | 824 AboutSource::AboutSource() |
814 : DataSource(chrome::kAboutScheme, MessageLoop::current()) { | 825 : DataSource(chrome::kAboutScheme, MessageLoop::current()) { |
815 // This should be a singleton. | 826 // This should be a singleton. |
816 DCHECK(!about_source); | 827 DCHECK(!about_source); |
817 about_source = this; | 828 about_source = this; |
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1197 // Run the dialog. This will re-use the existing one if it's already up. | 1208 // Run the dialog. This will re-use the existing one if it's already up. |
1198 AboutIPCDialog::RunDialog(); | 1209 AboutIPCDialog::RunDialog(); |
1199 return true; | 1210 return true; |
1200 } | 1211 } |
1201 #endif | 1212 #endif |
1202 | 1213 |
1203 #endif // OFFICIAL_BUILD | 1214 #endif // OFFICIAL_BUILD |
1204 | 1215 |
1205 return false; | 1216 return false; |
1206 } | 1217 } |
OLD | NEW |