| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "app/l10n_util.h" | 10 #include "app/l10n_util.h" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 using sync_api::SyncManager; | 58 using sync_api::SyncManager; |
| 59 #endif | 59 #endif |
| 60 | 60 |
| 61 | 61 |
| 62 using base::Time; | 62 using base::Time; |
| 63 using base::TimeDelta; | 63 using base::TimeDelta; |
| 64 | 64 |
| 65 namespace { | 65 namespace { |
| 66 | 66 |
| 67 // The paths used for the about pages. | 67 // The paths used for the about pages. |
| 68 const char kCachePath[] = "cache"; | |
| 69 const char kDnsPath[] = "dns"; | 68 const char kDnsPath[] = "dns"; |
| 70 const char kHistogramsPath[] = "histograms"; | 69 const char kHistogramsPath[] = "histograms"; |
| 71 const char kObjectsPath[] = "objects"; | 70 const char kObjectsPath[] = "objects"; |
| 72 const char kMemoryRedirectPath[] = "memory-redirect"; | 71 const char kMemoryRedirectPath[] = "memory-redirect"; |
| 73 const char kMemoryPath[] = "memory"; | 72 const char kMemoryPath[] = "memory"; |
| 74 const char kPluginsPath[] = "plugins"; | 73 const char kPluginsPath[] = "plugins"; |
| 75 const char kStatsPath[] = "stats"; | 74 const char kStatsPath[] = "stats"; |
| 76 const char kVersionPath[] = "version"; | 75 const char kVersionPath[] = "version"; |
| 77 const char kCreditsPath[] = "credits"; | 76 const char kCreditsPath[] = "credits"; |
| 78 const char kTermsPath[] = "terms"; | 77 const char kTermsPath[] = "terms"; |
| (...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 776 if (LowerCaseEqualsASCII(url->spec(), chrome::kAboutBlankURL)) | 775 if (LowerCaseEqualsASCII(url->spec(), chrome::kAboutBlankURL)) |
| 777 return false; | 776 return false; |
| 778 | 777 |
| 779 // Handle rewriting view-cache URLs. This allows us to load about:cache. | 778 // Handle rewriting view-cache URLs. This allows us to load about:cache. |
| 780 if (LowerCaseEqualsASCII(url->spec(), chrome::kAboutCacheURL)) { | 779 if (LowerCaseEqualsASCII(url->spec(), chrome::kAboutCacheURL)) { |
| 781 // Create an mapping from about:cache to the view-cache: internal URL. | 780 // Create an mapping from about:cache to the view-cache: internal URL. |
| 782 *url = GURL(std::string(chrome::kViewCacheScheme) + ":"); | 781 *url = GURL(std::string(chrome::kViewCacheScheme) + ":"); |
| 783 return true; | 782 return true; |
| 784 } | 783 } |
| 785 | 784 |
| 785 // Handle rewriting net-internal URLs. This allows us to load |
| 786 // about:net-internal. |
| 787 if (StartsWithASCII(url->spec(), chrome::kAboutNetInternalURL, true)) { |
| 788 // Create a mapping from about:net-internal to the view-net-internal: |
| 789 // internal URL. |
| 790 std::string path; |
| 791 size_t split = url->spec().find('/'); |
| 792 if (split != std::string::npos) |
| 793 path = url->spec().substr(split + 1); |
| 794 *url = GURL(std::string(chrome::kViewNetInternalScheme) + ":" + path); |
| 795 return true; |
| 796 } |
| 797 |
| 786 // Handle URL to crash the browser process. | 798 // Handle URL to crash the browser process. |
| 787 if (LowerCaseEqualsASCII(url->spec(), chrome::kAboutBrowserCrash)) { | 799 if (LowerCaseEqualsASCII(url->spec(), chrome::kAboutBrowserCrash)) { |
| 788 // Induce an intentional crash in the browser process. | 800 // Induce an intentional crash in the browser process. |
| 789 int* bad_pointer = NULL; | 801 int* bad_pointer = NULL; |
| 790 *bad_pointer = 42; | 802 *bad_pointer = 42; |
| 791 return true; | 803 return true; |
| 792 } | 804 } |
| 793 | 805 |
| 794 // There are a few about: URLs that we hand over to the renderer. If the | 806 // There are a few about: URLs that we hand over to the renderer. If the |
| 795 // renderer wants them, don't do any rewriting. | 807 // renderer wants them, don't do any rewriting. |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 839 AboutIPCDialog::RunDialog(); | 851 AboutIPCDialog::RunDialog(); |
| 840 return true; | 852 return true; |
| 841 } | 853 } |
| 842 #endif | 854 #endif |
| 843 | 855 |
| 844 #else | 856 #else |
| 845 // TODO(port) Implement this. | 857 // TODO(port) Implement this. |
| 846 #endif | 858 #endif |
| 847 return false; | 859 return false; |
| 848 } | 860 } |
| OLD | NEW |