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/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 27 matching lines...) Expand all Loading... |
38 #include "chrome/browser/profiles/profile_manager.h" | 38 #include "chrome/browser/profiles/profile_manager.h" |
39 #include "chrome/browser/ui/browser_dialogs.h" | 39 #include "chrome/browser/ui/browser_dialogs.h" |
40 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" | 40 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" |
41 #include "chrome/common/about_handler.h" | 41 #include "chrome/common/about_handler.h" |
42 #include "chrome/common/chrome_paths.h" | 42 #include "chrome/common/chrome_paths.h" |
43 #include "chrome/common/chrome_version_info.h" | 43 #include "chrome/common/chrome_version_info.h" |
44 #include "chrome/common/jstemplate_builder.h" | 44 #include "chrome/common/jstemplate_builder.h" |
45 #include "chrome/common/net/gaia/google_service_auth_error.h" | 45 #include "chrome/common/net/gaia/google_service_auth_error.h" |
46 #include "chrome/common/render_messages.h" | 46 #include "chrome/common/render_messages.h" |
47 #include "chrome/common/url_constants.h" | 47 #include "chrome/common/url_constants.h" |
48 #include "content/browser/gpu/gpu_process_host.h" | 48 #include "content/browser/gpu/gpu_process_host_ui_shim.h" |
49 #include "content/browser/plugin_service.h" | 49 #include "content/browser/plugin_service.h" |
50 #include "content/browser/renderer_host/render_process_host.h" | 50 #include "content/browser/renderer_host/render_process_host.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/common/gpu/gpu_messages.h" | |
54 #include "content/public/browser/browser_thread.h" | 53 #include "content/public/browser/browser_thread.h" |
55 #include "content/public/common/content_client.h" | 54 #include "content/public/common/content_client.h" |
56 #include "crypto/nss_util.h" | 55 #include "crypto/nss_util.h" |
57 #include "googleurl/src/gurl.h" | 56 #include "googleurl/src/gurl.h" |
58 #include "grit/browser_resources.h" | 57 #include "grit/browser_resources.h" |
59 #include "grit/chromium_strings.h" | 58 #include "grit/chromium_strings.h" |
60 #include "grit/generated_resources.h" | 59 #include "grit/generated_resources.h" |
61 #include "grit/locale_settings.h" | 60 #include "grit/locale_settings.h" |
62 #include "net/base/escape.h" | 61 #include "net/base/escape.h" |
63 #include "net/base/net_util.h" | 62 #include "net/base/net_util.h" |
(...skipping 1489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1553 replacements.SetHostStr(host); | 1552 replacements.SetHostStr(host); |
1554 if (!path.empty()) | 1553 if (!path.empty()) |
1555 replacements.SetPathStr(path); | 1554 replacements.SetPathStr(path); |
1556 *url = url->ReplaceComponents(replacements); | 1555 *url = url->ReplaceComponents(replacements); |
1557 | 1556 |
1558 // Handle URLs to crash the browser or wreck the gpu process. | 1557 // Handle URLs to crash the browser or wreck the gpu process. |
1559 if (host == chrome::kChromeUIBrowserCrashHost) { | 1558 if (host == chrome::kChromeUIBrowserCrashHost) { |
1560 // Induce an intentional crash in the browser process. | 1559 // Induce an intentional crash in the browser process. |
1561 CHECK(false); | 1560 CHECK(false); |
1562 } else if (host == chrome::kChromeUIGpuCleanHost) { | 1561 } else if (host == chrome::kChromeUIGpuCleanHost) { |
1563 GpuProcessHost::SendOnIO( | 1562 GpuProcessHostUIShim* shim = GpuProcessHostUIShim::FromID(0); |
1564 0, content::CAUSE_FOR_GPU_LAUNCH_NO_LAUNCH, new GpuMsg_Clean()); | 1563 if (shim) |
| 1564 shim->SimulateRemoveAllContext(); |
1565 } else if (host == chrome::kChromeUIGpuCrashHost) { | 1565 } else if (host == chrome::kChromeUIGpuCrashHost) { |
1566 GpuProcessHost::SendOnIO( | 1566 GpuProcessHostUIShim* shim = GpuProcessHostUIShim::FromID(0); |
1567 0, content::CAUSE_FOR_GPU_LAUNCH_ABOUT_GPUCRASH, new GpuMsg_Crash()); | 1567 if (shim) |
| 1568 shim->SimulateCrash(); |
1568 } else if (host == chrome::kChromeUIGpuHangHost) { | 1569 } else if (host == chrome::kChromeUIGpuHangHost) { |
1569 GpuProcessHost::SendOnIO( | 1570 GpuProcessHostUIShim* shim = GpuProcessHostUIShim::FromID(0); |
1570 0, content::CAUSE_FOR_GPU_LAUNCH_ABOUT_GPUHANG, new GpuMsg_Hang()); | 1571 if (shim) |
| 1572 shim->SimulateHang(); |
1571 #if defined(OS_CHROMEOS) | 1573 #if defined(OS_CHROMEOS) |
1572 } else if (host == chrome::kChromeUIRotateHost) { | 1574 } else if (host == chrome::kChromeUIRotateHost) { |
1573 sensors::ScreenOrientation change; | 1575 sensors::ScreenOrientation change; |
1574 std::string query(url->query()); | 1576 std::string query(url->query()); |
1575 if (query == "left") { | 1577 if (query == "left") { |
1576 change.upward = sensors::ScreenOrientation::LEFT; | 1578 change.upward = sensors::ScreenOrientation::LEFT; |
1577 } else if (query == "right") { | 1579 } else if (query == "right") { |
1578 change.upward = sensors::ScreenOrientation::RIGHT; | 1580 change.upward = sensors::ScreenOrientation::RIGHT; |
1579 } else if (query == "top") { | 1581 } else if (query == "top") { |
1580 change.upward = sensors::ScreenOrientation::TOP; | 1582 change.upward = sensors::ScreenOrientation::TOP; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1612 return false; | 1614 return false; |
1613 } | 1615 } |
1614 | 1616 |
1615 std::vector<std::string> ChromePaths() { | 1617 std::vector<std::string> ChromePaths() { |
1616 std::vector<std::string> paths; | 1618 std::vector<std::string> paths; |
1617 paths.reserve(arraysize(kChromePaths)); | 1619 paths.reserve(arraysize(kChromePaths)); |
1618 for (size_t i = 0; i < arraysize(kChromePaths); i++) | 1620 for (size_t i = 0; i < arraysize(kChromePaths); i++) |
1619 paths.push_back(kChromePaths[i]); | 1621 paths.push_back(kChromePaths[i]); |
1620 return paths; | 1622 return paths; |
1621 } | 1623 } |
OLD | NEW |