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/ui/browser_navigator.h" | 5 #include "chrome/browser/ui/browser_navigator.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
(...skipping 659 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
670 IsURLAllowedInIncognito(stripped_url, browser_context); | 670 IsURLAllowedInIncognito(stripped_url, browser_context); |
671 } | 671 } |
672 // Most URLs are allowed in incognito; the following are exceptions. | 672 // Most URLs are allowed in incognito; the following are exceptions. |
673 // chrome://extensions is on the list because it redirects to | 673 // chrome://extensions is on the list because it redirects to |
674 // chrome://settings. | 674 // chrome://settings. |
675 if (url.scheme() == chrome::kChromeUIScheme && | 675 if (url.scheme() == chrome::kChromeUIScheme && |
676 (url.host() == chrome::kChromeUISettingsHost || | 676 (url.host() == chrome::kChromeUISettingsHost || |
677 url.host() == chrome::kChromeUISettingsFrameHost || | 677 url.host() == chrome::kChromeUISettingsFrameHost || |
678 url.host() == chrome::kChromeUIExtensionsHost || | 678 url.host() == chrome::kChromeUIExtensionsHost || |
679 url.host() == chrome::kChromeUIBookmarksHost || | 679 url.host() == chrome::kChromeUIBookmarksHost || |
| 680 #if defined(ENABLE_ENHANCED_BOOKMARKS) |
| 681 url.host() == chrome::kChromeUIEnhancedBookmarksHost || |
| 682 #endif |
680 url.host() == chrome::kChromeUIUberHost)) { | 683 url.host() == chrome::kChromeUIUberHost)) { |
681 return false; | 684 return false; |
682 } | 685 } |
683 | 686 |
684 GURL rewritten_url = url; | 687 GURL rewritten_url = url; |
685 bool reverse_on_redirect = false; | 688 bool reverse_on_redirect = false; |
686 content::BrowserURLHandler::GetInstance()->RewriteURLIfNecessary( | 689 content::BrowserURLHandler::GetInstance()->RewriteURLIfNecessary( |
687 &rewritten_url, browser_context, &reverse_on_redirect); | 690 &rewritten_url, browser_context, &reverse_on_redirect); |
688 | 691 |
689 // Some URLs are mapped to uber subpages. Do not allow them in incognito. | 692 // Some URLs are mapped to uber subpages. Do not allow them in incognito. |
690 return !(rewritten_url.scheme() == chrome::kChromeUIScheme && | 693 return !(rewritten_url.scheme() == chrome::kChromeUIScheme && |
691 rewritten_url.host() == chrome::kChromeUIUberHost); | 694 rewritten_url.host() == chrome::kChromeUIUberHost); |
692 } | 695 } |
693 | 696 |
694 } // namespace chrome | 697 } // namespace chrome |
OLD | NEW |