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

Side by Side Diff: chrome/browser/sessions/chrome_serialized_navigation_driver.cc

Issue 2830983005: Remove old webui History page on desktop and mobile (Closed)
Patch Set: axe more android stuff Created 3 years, 7 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
OLDNEW
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"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 if (navigation->virtual_url().SchemeIs(content::kChromeUIScheme) && 69 if (navigation->virtual_url().SchemeIs(content::kChromeUIScheme) &&
70 (navigation->virtual_url().host_piece() == chrome::kChromeUIWelcomeHost || 70 (navigation->virtual_url().host_piece() == chrome::kChromeUIWelcomeHost ||
71 navigation->virtual_url().host_piece() == chrome::kChromeUINewTabHost)) { 71 navigation->virtual_url().host_piece() == chrome::kChromeUINewTabHost)) {
72 navigation->set_virtual_url(GURL(chrome::kChromeUINativeNewTabURL)); 72 navigation->set_virtual_url(GURL(chrome::kChromeUINativeNewTabURL));
73 navigation->set_original_request_url(navigation->virtual_url()); 73 navigation->set_original_request_url(navigation->virtual_url());
74 navigation->set_encoded_page_state( 74 navigation->set_encoded_page_state(
75 content::PageState::CreateFromURL(navigation->virtual_url()) 75 content::PageState::CreateFromURL(navigation->virtual_url())
76 .ToEncodedData()); 76 .ToEncodedData());
77 } 77 }
78 78
79 if (base::FeatureList::IsEnabled(features::kNativeAndroidHistoryManager) && 79 if (navigation->virtual_url().SchemeIs(content::kChromeUIScheme) &&
80 navigation->virtual_url().SchemeIs(content::kChromeUIScheme) && 80 navigation->virtual_url().host_piece() == chrome::kChromeUIHistoryHost) {
81 (navigation->virtual_url().host_piece() == chrome::kChromeUIHistoryHost ||
82 navigation->virtual_url().host_piece() ==
83 chrome::kChromeUIHistoryFrameHost)) {
84 // Rewrite the old history Web UI to the new android native history. 81 // Rewrite the old history Web UI to the new android native history.
85 navigation->set_virtual_url(GURL(chrome::kChromeUINativeHistoryURL)); 82 navigation->set_virtual_url(GURL(chrome::kChromeUINativeHistoryURL));
86 navigation->set_original_request_url(navigation->virtual_url()); 83 navigation->set_original_request_url(navigation->virtual_url());
87 navigation->set_encoded_page_state( 84 navigation->set_encoded_page_state(
88 content::PageState::CreateFromURL(navigation->virtual_url()) 85 content::PageState::CreateFromURL(navigation->virtual_url())
89 .ToEncodedData()); 86 .ToEncodedData());
90 } else if (!base::FeatureList::IsEnabled(
91 features::kNativeAndroidHistoryManager) &&
92 navigation->virtual_url().SchemeIs(
93 chrome::kChromeUINativeScheme) &&
94 navigation->virtual_url().host_piece() ==
95 chrome::kChromeUIHistoryHost) {
96 // If the android native history UI has been disabled, redirect
97 // chrome-native://history to the old web UI.
98 navigation->set_virtual_url(GURL(chrome::kChromeUIHistoryURL));
99 navigation->set_original_request_url(navigation->virtual_url());
100 navigation->set_encoded_page_state(std::string());
101 } 87 }
102 #endif // defined(OS_ANDROID) 88 #endif // defined(OS_ANDROID)
103 } 89 }
104 90
105 ChromeSerializedNavigationDriver::ChromeSerializedNavigationDriver() {} 91 ChromeSerializedNavigationDriver::ChromeSerializedNavigationDriver() {}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698