Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(120)

Side by Side Diff: chrome/browser/ui/browser_navigator.cc

Issue 649053003: Add chrome:help to URLs not allowed in incognito (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 724 matching lines...) Expand 10 before | Expand all | Expand 10 after
735 GURL stripped_url(stripped_spec); 735 GURL stripped_url(stripped_spec);
736 return stripped_url.is_valid() && 736 return stripped_url.is_valid() &&
737 IsURLAllowedInIncognito(stripped_url, browser_context); 737 IsURLAllowedInIncognito(stripped_url, browser_context);
738 } 738 }
739 // Most URLs are allowed in incognito; the following are exceptions. 739 // Most URLs are allowed in incognito; the following are exceptions.
740 // chrome://extensions is on the list because it redirects to 740 // chrome://extensions is on the list because it redirects to
741 // chrome://settings. 741 // chrome://settings.
742 if (url.scheme() == content::kChromeUIScheme && 742 if (url.scheme() == content::kChromeUIScheme &&
743 (url.host() == chrome::kChromeUISettingsHost || 743 (url.host() == chrome::kChromeUISettingsHost ||
744 url.host() == chrome::kChromeUISettingsFrameHost || 744 url.host() == chrome::kChromeUISettingsFrameHost ||
745 url.host() == chrome::kChromeUIHelpHost ||
745 url.host() == chrome::kChromeUIExtensionsHost || 746 url.host() == chrome::kChromeUIExtensionsHost ||
746 url.host() == chrome::kChromeUIBookmarksHost || 747 url.host() == chrome::kChromeUIBookmarksHost ||
747 #if !defined(OS_CHROMEOS) 748 #if !defined(OS_CHROMEOS)
748 url.host() == chrome::kChromeUIChromeSigninHost || 749 url.host() == chrome::kChromeUIChromeSigninHost ||
749 #endif 750 #endif
750 url.host() == chrome::kChromeUIUberHost || 751 url.host() == chrome::kChromeUIUberHost ||
751 url.host() == chrome::kChromeUIThumbnailHost || 752 url.host() == chrome::kChromeUIThumbnailHost ||
752 url.host() == chrome::kChromeUIThumbnailHost2 || 753 url.host() == chrome::kChromeUIThumbnailHost2 ||
753 url.host() == chrome::kChromeUIThumbnailListHost || 754 url.host() == chrome::kChromeUIThumbnailListHost ||
754 url.host() == chrome::kChromeUISuggestionsHost || 755 url.host() == chrome::kChromeUISuggestionsHost ||
(...skipping 14 matching lines...) Expand all
769 bool reverse_on_redirect = false; 770 bool reverse_on_redirect = false;
770 content::BrowserURLHandler::GetInstance()->RewriteURLIfNecessary( 771 content::BrowserURLHandler::GetInstance()->RewriteURLIfNecessary(
771 &rewritten_url, browser_context, &reverse_on_redirect); 772 &rewritten_url, browser_context, &reverse_on_redirect);
772 773
773 // Some URLs are mapped to uber subpages. Do not allow them in incognito. 774 // Some URLs are mapped to uber subpages. Do not allow them in incognito.
774 return !(rewritten_url.scheme() == content::kChromeUIScheme && 775 return !(rewritten_url.scheme() == content::kChromeUIScheme &&
775 rewritten_url.host() == chrome::kChromeUIUberHost); 776 rewritten_url.host() == chrome::kChromeUIUberHost);
776 } 777 }
777 778
778 } // namespace chrome 779 } // namespace chrome
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698