| 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/macros.h" | 10 #include "base/macros.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 #include "chrome/browser/ui/status_bubble.h" | 29 #include "chrome/browser/ui/status_bubble.h" |
| 30 #include "chrome/browser/ui/tab_helpers.h" | 30 #include "chrome/browser/ui/tab_helpers.h" |
| 31 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 31 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 32 #include "chrome/common/url_constants.h" | 32 #include "chrome/common/url_constants.h" |
| 33 #include "components/prefs/pref_service.h" | 33 #include "components/prefs/pref_service.h" |
| 34 #include "content/public/browser/browser_url_handler.h" | 34 #include "content/public/browser/browser_url_handler.h" |
| 35 #include "content/public/browser/navigation_entry.h" | 35 #include "content/public/browser/navigation_entry.h" |
| 36 #include "content/public/browser/notification_service.h" | 36 #include "content/public/browser/notification_service.h" |
| 37 #include "content/public/browser/render_view_host.h" | 37 #include "content/public/browser/render_view_host.h" |
| 38 #include "content/public/browser/web_contents.h" | 38 #include "content/public/browser/web_contents.h" |
| 39 #include "content/public/common/url_constants.h" |
| 39 #include "extensions/features/features.h" | 40 #include "extensions/features/features.h" |
| 40 | 41 |
| 41 #if defined(USE_ASH) | 42 #if defined(USE_ASH) |
| 42 #include "chrome/browser/ui/ash/multi_user/multi_user_window_manager.h" | 43 #include "chrome/browser/ui/ash/multi_user/multi_user_window_manager.h" |
| 43 #include "components/signin/core/account_id/account_id.h" | 44 #include "components/signin/core/account_id/account_id.h" |
| 44 #endif | 45 #endif |
| 45 | 46 |
| 46 #if defined(USE_AURA) | 47 #if defined(USE_AURA) |
| 47 #include "ui/aura/window.h" | 48 #include "ui/aura/window.h" |
| 48 #endif | 49 #endif |
| (...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 636 IsURLAllowedInIncognito(stripped_url, browser_context); | 637 IsURLAllowedInIncognito(stripped_url, browser_context); |
| 637 } | 638 } |
| 638 // Most URLs are allowed in incognito; the following are exceptions. | 639 // Most URLs are allowed in incognito; the following are exceptions. |
| 639 // chrome://extensions is on the list because it redirects to | 640 // chrome://extensions is on the list because it redirects to |
| 640 // chrome://settings. | 641 // chrome://settings. |
| 641 if (url.scheme() == content::kChromeUIScheme && | 642 if (url.scheme() == content::kChromeUIScheme && |
| 642 (url.host_piece() == chrome::kChromeUISettingsHost || | 643 (url.host_piece() == chrome::kChromeUISettingsHost || |
| 643 url.host_piece() == chrome::kChromeUIMdSettingsHost || | 644 url.host_piece() == chrome::kChromeUIMdSettingsHost || |
| 644 url.host_piece() == chrome::kChromeUISettingsFrameHost || | 645 url.host_piece() == chrome::kChromeUISettingsFrameHost || |
| 645 url.host_piece() == chrome::kChromeUIHelpHost || | 646 url.host_piece() == chrome::kChromeUIHelpHost || |
| 646 url.host_piece() == chrome::kChromeUIHistoryHost || | 647 url.host_piece() == content::kChromeUIHistoryHost || |
| 647 url.host_piece() == chrome::kChromeUIExtensionsHost || | 648 url.host_piece() == chrome::kChromeUIExtensionsHost || |
| 648 url.host_piece() == chrome::kChromeUIBookmarksHost || | 649 url.host_piece() == chrome::kChromeUIBookmarksHost || |
| 649 #if !defined(OS_CHROMEOS) | 650 #if !defined(OS_CHROMEOS) |
| 650 url.host_piece() == chrome::kChromeUIChromeSigninHost || | 651 url.host_piece() == chrome::kChromeUIChromeSigninHost || |
| 651 #endif | 652 #endif |
| 652 url.host_piece() == chrome::kChromeUIUberHost || | 653 url.host_piece() == chrome::kChromeUIUberHost || |
| 653 url.host_piece() == chrome::kChromeUIThumbnailHost || | 654 url.host_piece() == chrome::kChromeUIThumbnailHost || |
| 654 url.host_piece() == chrome::kChromeUIThumbnailHost2 || | 655 url.host_piece() == chrome::kChromeUIThumbnailHost2 || |
| 655 url.host_piece() == chrome::kChromeUIThumbnailListHost || | 656 url.host_piece() == chrome::kChromeUIThumbnailListHost || |
| 656 url.host_piece() == chrome::kChromeUISuggestionsHost || | 657 url.host_piece() == chrome::kChromeUISuggestionsHost || |
| (...skipping 16 matching lines...) Expand all Loading... |
| 673 bool reverse_on_redirect = false; | 674 bool reverse_on_redirect = false; |
| 674 content::BrowserURLHandler::GetInstance()->RewriteURLIfNecessary( | 675 content::BrowserURLHandler::GetInstance()->RewriteURLIfNecessary( |
| 675 &rewritten_url, browser_context, &reverse_on_redirect); | 676 &rewritten_url, browser_context, &reverse_on_redirect); |
| 676 | 677 |
| 677 // Some URLs are mapped to uber subpages. Do not allow them in incognito. | 678 // Some URLs are mapped to uber subpages. Do not allow them in incognito. |
| 678 return !(rewritten_url.scheme_piece() == content::kChromeUIScheme && | 679 return !(rewritten_url.scheme_piece() == content::kChromeUIScheme && |
| 679 rewritten_url.host_piece() == chrome::kChromeUIUberHost); | 680 rewritten_url.host_piece() == chrome::kChromeUIUberHost); |
| 680 } | 681 } |
| 681 | 682 |
| 682 } // namespace chrome | 683 } // namespace chrome |
| OLD | NEW |