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

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

Issue 2140493002: Disable MD History in Incognito windows (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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/macros.h" 10 #include "base/macros.h"
(...skipping 600 matching lines...) Expand 10 before | Expand all | Expand 10 after
611 return stripped_url.is_valid() && 611 return stripped_url.is_valid() &&
612 IsURLAllowedInIncognito(stripped_url, browser_context); 612 IsURLAllowedInIncognito(stripped_url, browser_context);
613 } 613 }
614 // Most URLs are allowed in incognito; the following are exceptions. 614 // Most URLs are allowed in incognito; the following are exceptions.
615 // chrome://extensions is on the list because it redirects to 615 // chrome://extensions is on the list because it redirects to
616 // chrome://settings. 616 // chrome://settings.
617 if (url.scheme() == content::kChromeUIScheme && 617 if (url.scheme() == content::kChromeUIScheme &&
618 (url.host() == chrome::kChromeUISettingsHost || 618 (url.host() == chrome::kChromeUISettingsHost ||
619 url.host() == chrome::kChromeUISettingsFrameHost || 619 url.host() == chrome::kChromeUISettingsFrameHost ||
620 url.host() == chrome::kChromeUIHelpHost || 620 url.host() == chrome::kChromeUIHelpHost ||
621 url.host() == chrome::kChromeUIHistoryHost ||
621 url.host() == chrome::kChromeUIExtensionsHost || 622 url.host() == chrome::kChromeUIExtensionsHost ||
622 url.host() == chrome::kChromeUIBookmarksHost || 623 url.host() == chrome::kChromeUIBookmarksHost ||
623 #if !defined(OS_CHROMEOS) 624 #if !defined(OS_CHROMEOS)
624 url.host() == chrome::kChromeUIChromeSigninHost || 625 url.host() == chrome::kChromeUIChromeSigninHost ||
625 #endif 626 #endif
626 url.host() == chrome::kChromeUIUberHost || 627 url.host() == chrome::kChromeUIUberHost ||
627 url.host() == chrome::kChromeUIThumbnailHost || 628 url.host() == chrome::kChromeUIThumbnailHost ||
628 url.host() == chrome::kChromeUIThumbnailHost2 || 629 url.host() == chrome::kChromeUIThumbnailHost2 ||
629 url.host() == chrome::kChromeUIThumbnailListHost || 630 url.host() == chrome::kChromeUIThumbnailListHost ||
630 url.host() == chrome::kChromeUISuggestionsHost || 631 url.host() == chrome::kChromeUISuggestionsHost ||
(...skipping 16 matching lines...) Expand all
647 bool reverse_on_redirect = false; 648 bool reverse_on_redirect = false;
648 content::BrowserURLHandler::GetInstance()->RewriteURLIfNecessary( 649 content::BrowserURLHandler::GetInstance()->RewriteURLIfNecessary(
649 &rewritten_url, browser_context, &reverse_on_redirect); 650 &rewritten_url, browser_context, &reverse_on_redirect);
650 651
651 // Some URLs are mapped to uber subpages. Do not allow them in incognito. 652 // Some URLs are mapped to uber subpages. Do not allow them in incognito.
652 return !(rewritten_url.scheme() == content::kChromeUIScheme && 653 return !(rewritten_url.scheme() == content::kChromeUIScheme &&
653 rewritten_url.host() == chrome::kChromeUIUberHost); 654 rewritten_url.host() == chrome::kChromeUIUberHost);
654 } 655 }
655 656
656 } // namespace chrome 657 } // 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