Chromium Code Reviews| 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 29 matching lines...) Expand all Loading... | |
| 40 #include "chrome/common/chrome_paths.h" | 40 #include "chrome/common/chrome_paths.h" |
| 41 #include "chrome/common/chrome_version_info.h" | 41 #include "chrome/common/chrome_version_info.h" |
| 42 #include "chrome/common/jstemplate_builder.h" | 42 #include "chrome/common/jstemplate_builder.h" |
| 43 #include "chrome/common/net/gaia/google_service_auth_error.h" | 43 #include "chrome/common/net/gaia/google_service_auth_error.h" |
| 44 #include "chrome/common/render_messages.h" | 44 #include "chrome/common/render_messages.h" |
| 45 #include "chrome/common/url_constants.h" | 45 #include "chrome/common/url_constants.h" |
| 46 #include "content/browser/browser_thread.h" | 46 #include "content/browser/browser_thread.h" |
| 47 #include "content/browser/gpu/gpu_process_host.h" | 47 #include "content/browser/gpu/gpu_process_host.h" |
| 48 #include "content/browser/renderer_host/render_process_host.h" | 48 #include "content/browser/renderer_host/render_process_host.h" |
| 49 #include "content/browser/renderer_host/render_view_host.h" | 49 #include "content/browser/renderer_host/render_view_host.h" |
| 50 #include "content/browser/sensors/sensors_provider.h" | |
| 50 #include "content/common/gpu/gpu_messages.h" | 51 #include "content/common/gpu/gpu_messages.h" |
| 51 #include "crypto/nss_util.h" | 52 #include "crypto/nss_util.h" |
| 52 #include "googleurl/src/gurl.h" | 53 #include "googleurl/src/gurl.h" |
| 53 #include "grit/browser_resources.h" | 54 #include "grit/browser_resources.h" |
| 54 #include "grit/chromium_strings.h" | 55 #include "grit/chromium_strings.h" |
| 55 #include "grit/generated_resources.h" | 56 #include "grit/generated_resources.h" |
| 56 #include "grit/locale_settings.h" | 57 #include "grit/locale_settings.h" |
| 57 #include "net/base/escape.h" | 58 #include "net/base/escape.h" |
| 58 #include "net/base/net_util.h" | 59 #include "net/base/net_util.h" |
| 59 #include "ui/base/l10n/l10n_util.h" | 60 #include "ui/base/l10n/l10n_util.h" |
| (...skipping 1434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1494 CHECK(false); | 1495 CHECK(false); |
| 1495 } else if (host == chrome::kChromeUIGpuCleanHost) { | 1496 } else if (host == chrome::kChromeUIGpuCleanHost) { |
| 1496 GpuProcessHost::SendOnIO( | 1497 GpuProcessHost::SendOnIO( |
| 1497 0, content::CAUSE_FOR_GPU_LAUNCH_NO_LAUNCH, new GpuMsg_Clean()); | 1498 0, content::CAUSE_FOR_GPU_LAUNCH_NO_LAUNCH, new GpuMsg_Clean()); |
| 1498 } else if (host == chrome::kChromeUIGpuCrashHost) { | 1499 } else if (host == chrome::kChromeUIGpuCrashHost) { |
| 1499 GpuProcessHost::SendOnIO( | 1500 GpuProcessHost::SendOnIO( |
| 1500 0, content::CAUSE_FOR_GPU_LAUNCH_ABOUT_GPUCRASH, new GpuMsg_Crash()); | 1501 0, content::CAUSE_FOR_GPU_LAUNCH_ABOUT_GPUCRASH, new GpuMsg_Crash()); |
| 1501 } else if (host == chrome::kChromeUIGpuHangHost) { | 1502 } else if (host == chrome::kChromeUIGpuHangHost) { |
| 1502 GpuProcessHost::SendOnIO( | 1503 GpuProcessHost::SendOnIO( |
| 1503 0, content::CAUSE_FOR_GPU_LAUNCH_ABOUT_GPUHANG, new GpuMsg_Hang()); | 1504 0, content::CAUSE_FOR_GPU_LAUNCH_ABOUT_GPUHANG, new GpuMsg_Hang()); |
| 1505 #if defined(OS_CHROMEOS) | |
| 1506 } else if (host == chrome::kChromeUIRotateHost) { | |
| 1507 sensors::ScreenOrientation change; | |
| 1508 std::string query(url->query()); | |
| 1509 if (query == "left") { | |
| 1510 change.upward = sensors::ScreenOrientation::LEFT; | |
| 1511 } else if (query == "right") { | |
| 1512 change.upward = sensors::ScreenOrientation::RIGHT; | |
| 1513 } else if (query == "top") { | |
| 1514 change.upward = sensors::ScreenOrientation::TOP; | |
| 1515 } else if (query == "bottom") { | |
| 1516 change.upward = sensors::ScreenOrientation::BOTTOM; | |
| 1517 } | |
|
sky
2011/08/17 16:39:42
else NOTREACHED?
| |
| 1518 sensors::Provider::GetInstance()->ScreenOrientationChanged(change); | |
| 1519 host = chrome::kChromeUIBlankHost; | |
|
sky
2011/08/17 16:39:42
Add a comment as to why you need to reset the host
| |
| 1520 *url = GURL(chrome::kChromeUIBlankHost); | |
| 1521 #endif | |
| 1504 } | 1522 } |
| 1505 | 1523 |
| 1506 // Initialize any potentially corresponding AboutSource handler. | 1524 // Initialize any potentially corresponding AboutSource handler. |
| 1507 InitializeAboutDataSource(host, browser_context); | 1525 InitializeAboutDataSource(host, browser_context); |
| 1508 return true; | 1526 return true; |
| 1509 } | 1527 } |
| 1510 | 1528 |
| 1511 bool HandleNonNavigationAboutURL(const GURL& url) { | 1529 bool HandleNonNavigationAboutURL(const GURL& url) { |
| 1512 // chrome://ipc/ is currently buggy, so we disable it for official builds. | 1530 // chrome://ipc/ is currently buggy, so we disable it for official builds. |
| 1513 #if !defined(OFFICIAL_BUILD) | 1531 #if !defined(OFFICIAL_BUILD) |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 1525 return false; | 1543 return false; |
| 1526 } | 1544 } |
| 1527 | 1545 |
| 1528 std::vector<std::string> ChromePaths() { | 1546 std::vector<std::string> ChromePaths() { |
| 1529 std::vector<std::string> paths; | 1547 std::vector<std::string> paths; |
| 1530 paths.reserve(arraysize(kChromePaths)); | 1548 paths.reserve(arraysize(kChromePaths)); |
| 1531 for (size_t i = 0; i < arraysize(kChromePaths); i++) | 1549 for (size_t i = 0; i < arraysize(kChromePaths); i++) |
| 1532 paths.push_back(kChromePaths[i]); | 1550 paths.push_back(kChromePaths[i]); |
| 1533 return paths; | 1551 return paths; |
| 1534 } | 1552 } |
| OLD | NEW |