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 "base/file_version_info.h" | 10 #include "base/file_version_info.h" |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 // This is the top-level URL handler for chrome-internal: URLs, and exposed in | 162 // This is the top-level URL handler for chrome-internal: URLs, and exposed in |
163 // our header file. | 163 // our header file. |
164 bool BrowserAboutHandler::MaybeHandle(GURL* url, | 164 bool BrowserAboutHandler::MaybeHandle(GURL* url, |
165 TabContentsType* result_type) { | 165 TabContentsType* result_type) { |
166 if (!url->SchemeIs(kAboutScheme)) | 166 if (!url->SchemeIs(kAboutScheme)) |
167 return false; | 167 return false; |
168 | 168 |
169 // about:blank is special. Frames are allowed to access about:blank, | 169 // about:blank is special. Frames are allowed to access about:blank, |
170 // but they are not allowed to access other types of about pages. | 170 // but they are not allowed to access other types of about pages. |
171 // Just ignore the about:blank and let the TAB_CONTENTS_WEB handle it. | 171 // Just ignore the about:blank and let the TAB_CONTENTS_WEB handle it. |
172 if (LowerCaseEqualsASCII(url->spec(), chrome::kAboutBlankURL)) { | 172 if (StringToLowerASCII(url->path()) == "blank") { |
173 return false; | 173 return false; |
174 } | 174 } |
175 | 175 |
176 // We create an about:cache mapping to the view-cache: internal URL. | 176 // We create an about:cache mapping to the view-cache: internal URL. |
177 if (StringToLowerASCII(url->path()) == kCachePath) { | 177 if (StringToLowerASCII(url->path()) == kCachePath) { |
178 *url = GURL("view-cache:"); | 178 *url = GURL("view-cache:"); |
179 *result_type = TAB_CONTENTS_WEB; | 179 *result_type = TAB_CONTENTS_WEB; |
180 return true; | 180 return true; |
181 } | 181 } |
182 | 182 |
183 if (LowerCaseEqualsASCII(url->path(), "network")) { | 183 if (LowerCaseEqualsASCII(url->path(), "network")) { |
184 #if defined(OS_WIN) | 184 #if defined(OS_WIN) |
185 // Run the dialog. This will re-use the existing one if it's already up. | 185 // Run the dialog. This will re-use the existing one if it's already up. |
186 AboutNetworkDialog::RunDialog(); | 186 AboutNetworkDialog::RunDialog(); |
187 #else | 187 #else |
188 NOTIMPLEMENTED(); | 188 NOTIMPLEMENTED(); |
189 // TODO(port) Implement this. | 189 // TODO(port) Implement this. |
190 #endif | 190 #endif |
191 | 191 |
192 // Navigate the renderer to about:blank. This is kind of stupid but is the | 192 // Navigate the renderer to about:blank. This is kind of stupid but is the |
193 // easiest thing to do in this situation without adding a lot of complexity | 193 // easiest thing to do in this situation without adding a lot of complexity |
194 // for this developer-only feature. | 194 // for this developer-only feature. |
195 *url = GURL(chrome::kAboutBlankURL); | 195 *url = GURL("about:blank"); |
196 return false; | 196 return false; |
197 } | 197 } |
198 | 198 |
199 #ifdef IPC_MESSAGE_LOG_ENABLED | 199 #ifdef IPC_MESSAGE_LOG_ENABLED |
200 if (LowerCaseEqualsASCII(url->path(), "ipc")) { | 200 if (LowerCaseEqualsASCII(url->path(), "ipc")) { |
201 #if defined(OS_WIN) | 201 #if defined(OS_WIN) |
202 // Run the dialog. This will re-use the existing one if it's already up. | 202 // Run the dialog. This will re-use the existing one if it's already up. |
203 AboutIPCDialog::RunDialog(); | 203 AboutIPCDialog::RunDialog(); |
204 #else | 204 #else |
205 NOTIMPLEMENTED(); | 205 NOTIMPLEMENTED(); |
206 // TODO(port) Implement this. | 206 // TODO(port) Implement this. |
207 #endif | 207 #endif |
208 *url = GURL(chrome::kAboutBlankURL); | 208 *url = GURL("about:blank"); |
209 return false; | 209 return false; |
210 } | 210 } |
211 #endif | 211 #endif |
212 | 212 |
213 // There are a few about URLs that we hand over to the renderer. | 213 // There are a few about URLs that we hand over to the renderer. |
214 // If the renderer wants them, let it have them. | 214 // If the renderer wants them, let it have them. |
215 if (AboutHandler::WillHandle(*url)) | 215 if (AboutHandler::WillHandle(*url)) |
216 return false; | 216 return false; |
217 | 217 |
218 *result_type = TAB_CONTENTS_ABOUT_UI; | 218 *result_type = TAB_CONTENTS_ABOUT_UI; |
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
631 | 631 |
632 AboutSource* about_source = static_cast<AboutSource*>(source_); | 632 AboutSource* about_source = static_cast<AboutSource*>(source_); |
633 about_source->FinishDataRequest(template_html, request_id_); | 633 about_source->FinishDataRequest(template_html, request_id_); |
634 } | 634 } |
635 | 635 |
636 // static | 636 // static |
637 void BrowserAboutHandler::AboutMemory(AboutSource* source, int request_id) { | 637 void BrowserAboutHandler::AboutMemory(AboutSource* source, int request_id) { |
638 // The AboutMemoryHandler cleans itself up. | 638 // The AboutMemoryHandler cleans itself up. |
639 new AboutMemoryHandler(source, request_id); | 639 new AboutMemoryHandler(source, request_id); |
640 } | 640 } |
OLD | NEW |