| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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/sessions/chrome_serialized_navigation_driver.h" | 5 #include "chrome/browser/sessions/chrome_serialized_navigation_driver.h" |
| 6 | 6 |
| 7 #include "base/memory/singleton.h" | 7 #include "base/memory/singleton.h" |
| 8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 #include "chrome/common/url_constants.h" | 9 #include "chrome/common/url_constants.h" |
| 10 #include "components/sessions/core/serialized_navigation_entry.h" | 10 #include "components/sessions/core/serialized_navigation_entry.h" |
| 11 #include "content/public/common/referrer.h" | 11 #include "content/public/common/referrer.h" |
| 12 | 12 |
| 13 #if defined(OS_ANDROID) | 13 #if defined(OS_ANDROID) |
| 14 #include "content/public/common/content_features.h" | 14 #include "content/public/common/content_features.h" |
| 15 #include "content/public/common/page_state.h" | 15 #include "content/public/common/page_state.h" |
| 16 #endif | 16 #endif |
| 17 | 17 |
| 18 namespace { | 18 namespace { |
| 19 | 19 |
| 20 bool IsUberOrUberReplacementURL(const GURL& url) { | 20 bool IsUberOrUberReplacementURL(const GURL& url) { |
| 21 return url.SchemeIs(content::kChromeUIScheme) && | 21 return url.SchemeIs(content::kChromeUIScheme) && |
| 22 (url.host_piece() == chrome::kChromeUIHistoryHost || | 22 (url.host_piece() == chrome::kChromeUIHistoryHost || |
| 23 url.host_piece() == chrome::kChromeUIUberHost); | 23 url.host_piece() == chrome::kChromeUIUberHost || |
| 24 url.host_piece() == chrome::kChromeUISettingsHost || |
| 25 url.host_piece() == chrome::kChromeUIHelpHost); |
| 24 } | 26 } |
| 25 | 27 |
| 26 } // namespace | 28 } // namespace |
| 27 | 29 |
| 28 ChromeSerializedNavigationDriver::~ChromeSerializedNavigationDriver() {} | 30 ChromeSerializedNavigationDriver::~ChromeSerializedNavigationDriver() {} |
| 29 | 31 |
| 30 // static | 32 // static |
| 31 ChromeSerializedNavigationDriver* | 33 ChromeSerializedNavigationDriver* |
| 32 ChromeSerializedNavigationDriver::GetInstance() { | 34 ChromeSerializedNavigationDriver::GetInstance() { |
| 33 return base::Singleton< | 35 return base::Singleton< |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 // If the android native history UI has been disabled, redirect | 96 // If the android native history UI has been disabled, redirect |
| 95 // chrome-native://history to the old web UI. | 97 // chrome-native://history to the old web UI. |
| 96 navigation->set_virtual_url(GURL(chrome::kChromeUIHistoryURL)); | 98 navigation->set_virtual_url(GURL(chrome::kChromeUIHistoryURL)); |
| 97 navigation->set_original_request_url(navigation->virtual_url()); | 99 navigation->set_original_request_url(navigation->virtual_url()); |
| 98 navigation->set_encoded_page_state(std::string()); | 100 navigation->set_encoded_page_state(std::string()); |
| 99 } | 101 } |
| 100 #endif // defined(OS_ANDROID) | 102 #endif // defined(OS_ANDROID) |
| 101 } | 103 } |
| 102 | 104 |
| 103 ChromeSerializedNavigationDriver::ChromeSerializedNavigationDriver() {} | 105 ChromeSerializedNavigationDriver::ChromeSerializedNavigationDriver() {} |
| OLD | NEW |