| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/chrome_content_browser_client.h" | 5 #include "chrome/browser/chrome_content_browser_client.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 #if defined(ENABLE_ENHANCED_BOOKMARKS) | 376 #if defined(ENABLE_ENHANCED_BOOKMARKS) |
| 377 url->DomainIs(chrome::kChromeUIEnhancedBookmarksHost) || | 377 url->DomainIs(chrome::kChromeUIEnhancedBookmarksHost) || |
| 378 #endif | 378 #endif |
| 379 url->DomainIs(chrome::kChromeUIHistoryHost))) { | 379 url->DomainIs(chrome::kChromeUIHistoryHost))) { |
| 380 // Rewrite with new tab URL | 380 // Rewrite with new tab URL |
| 381 *url = GURL(chrome::kChromeUINewTabURL); | 381 *url = GURL(chrome::kChromeUINewTabURL); |
| 382 } | 382 } |
| 383 } | 383 } |
| 384 #endif | 384 #endif |
| 385 | 385 |
| 386 // Special case the new tab page. In older versions of Chrome, the new tab | |
| 387 // page was hosted at chrome-internal:<blah>. This might be in people's saved | |
| 388 // sessions or bookmarks, so we say any URL with that scheme triggers the new | |
| 389 // tab page. | |
| 390 if (url->SchemeIs(chrome::kChromeInternalScheme)) { | |
| 391 // Rewrite it with the proper new tab URL. | |
| 392 *url = GURL(chrome::kChromeUINewTabURL); | |
| 393 } | |
| 394 | |
| 395 return true; | 386 return true; |
| 396 } | 387 } |
| 397 | 388 |
| 398 // Reverse URL handler for Web UI. Maps "chrome://chrome/foo/" to | 389 // Reverse URL handler for Web UI. Maps "chrome://chrome/foo/" to |
| 399 // "chrome://foo/". | 390 // "chrome://foo/". |
| 400 bool HandleWebUIReverse(GURL* url, content::BrowserContext* browser_context) { | 391 bool HandleWebUIReverse(GURL* url, content::BrowserContext* browser_context) { |
| 401 if (!url->is_valid() || !url->SchemeIs(chrome::kChromeUIScheme)) | 392 if (!url->is_valid() || !url->SchemeIs(chrome::kChromeUIScheme)) |
| 402 return false; | 393 return false; |
| 403 | 394 |
| 404 return RemoveUberHost(url); | 395 return RemoveUberHost(url); |
| (...skipping 2244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2649 return IsExtensionOrSharedModuleWhitelisted(url, extension_set, | 2640 return IsExtensionOrSharedModuleWhitelisted(url, extension_set, |
| 2650 allowed_file_handle_origins_) || | 2641 allowed_file_handle_origins_) || |
| 2651 IsHostAllowedByCommandLine(url, extension_set, | 2642 IsHostAllowedByCommandLine(url, extension_set, |
| 2652 switches::kAllowNaClFileHandleAPI); | 2643 switches::kAllowNaClFileHandleAPI); |
| 2653 #else | 2644 #else |
| 2654 return false; | 2645 return false; |
| 2655 #endif | 2646 #endif |
| 2656 } | 2647 } |
| 2657 | 2648 |
| 2658 } // namespace chrome | 2649 } // namespace chrome |
| OLD | NEW |