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

Side by Side Diff: chrome/browser/browser_about_handler.cc

Issue 2352553002: [MD History] Run MD History on chrome://chrome/history. (Closed)
Patch Set: Created 4 years, 3 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 | chrome/browser/resources/md_history/app.html » ('j') | 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/browser_about_handler.h" 5 #include "chrome/browser/browser_about_handler.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 #endif // defined(ENABLE_EXTENSIONS) 80 #endif // defined(ENABLE_EXTENSIONS)
81 // Redirect chrome://history. 81 // Redirect chrome://history.
82 } else if (host == chrome::kChromeUIHistoryHost) { 82 } else if (host == chrome::kChromeUIHistoryHost) {
83 #if defined(OS_ANDROID) 83 #if defined(OS_ANDROID)
84 // On Android, redirect directly to chrome://history-frame since 84 // On Android, redirect directly to chrome://history-frame since
85 // uber page is unsupported. 85 // uber page is unsupported.
86 host = chrome::kChromeUIHistoryFrameHost; 86 host = chrome::kChromeUIHistoryFrameHost;
87 #else 87 #else
88 // Material design history is handled on the top-level chrome://history 88 // Material design history is handled on the top-level chrome://history
89 // host. 89 // host.
90 if (MdHistoryUI::IsEnabled(Profile::FromBrowserContext(browser_context))) { 90 host = chrome::kChromeUIUberHost;
91 host = chrome::kChromeUIHistoryHost; 91 path = chrome::kChromeUIHistoryHost + url->path();
92 path = url->path();
93 } else {
94 host = chrome::kChromeUIUberHost;
95 path = chrome::kChromeUIHistoryHost + url->path();
96 }
97 #endif 92 #endif
98 // Redirect chrome://settings, unless MD settings is enabled. 93 // Redirect chrome://settings, unless MD settings is enabled.
99 } else if (host == chrome::kChromeUISettingsHost) { 94 } else if (host == chrome::kChromeUISettingsHost) {
100 if (base::FeatureList::IsEnabled(features::kMaterialDesignSettings)) { 95 if (base::FeatureList::IsEnabled(features::kMaterialDesignSettings)) {
101 return true; // Prevent further rewriting - this is a valid URL. 96 return true; // Prevent further rewriting - this is a valid URL.
102 } else if (::switches::AboutInSettingsEnabled()) { 97 } else if (::switches::AboutInSettingsEnabled()) {
103 host = chrome::kChromeUISettingsFrameHost; 98 host = chrome::kChromeUISettingsFrameHost;
104 } else { 99 } else {
105 host = chrome::kChromeUIUberHost; 100 host = chrome::kChromeUIUberHost;
106 path = chrome::kChromeUISettingsHost + url->path(); 101 path = chrome::kChromeUISettingsHost + url->path();
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 FROM_HERE, base::Bind(&chrome::AttemptRestart)); 135 FROM_HERE, base::Bind(&chrome::AttemptRestart));
141 return true; 136 return true;
142 } else if (base::LowerCaseEqualsASCII(spec, chrome::kChromeUIQuitURL)) { 137 } else if (base::LowerCaseEqualsASCII(spec, chrome::kChromeUIQuitURL)) {
143 base::ThreadTaskRunnerHandle::Get()->PostTask( 138 base::ThreadTaskRunnerHandle::Get()->PostTask(
144 FROM_HERE, base::Bind(&chrome::AttemptExit)); 139 FROM_HERE, base::Bind(&chrome::AttemptExit));
145 return true; 140 return true;
146 } 141 }
147 142
148 return false; 143 return false;
149 } 144 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/resources/md_history/app.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698