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

Unified Diff: chrome/browser/ui/chrome_pages.cc

Issue 2455113003: MD Settings: Fix Client Navigations to Search Query URLs (Closed)
Patch Set: Fix implementation Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/ash/system_tray_delegate_chromeos.cc ('k') | chrome/common/url_constants.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/chrome_pages.cc
diff --git a/chrome/browser/ui/chrome_pages.cc b/chrome/browser/ui/chrome_pages.cc
index 0d4739ee8c6dc5a68cf49c0a4b2d34ed6ac0683a..fd5593c6fe2e21e4e53bc3f471e60e544237edc6 100644
--- a/chrome/browser/ui/chrome_pages.cc
+++ b/chrome/browser/ui/chrome_pages.cc
@@ -44,8 +44,12 @@
#endif
#if defined(OS_CHROMEOS)
+#include "base/feature_list.h"
#include "chrome/browser/chromeos/genius_app/app_id.h"
+#include "chrome/common/chrome_features.h"
+#include "chrome/grit/generated_resources.h"
#include "extensions/browser/extension_registry.h"
+#include "ui/base/l10n/l10n_util.h"
#endif
#if !defined(OS_ANDROID)
@@ -138,6 +142,13 @@ std::string GenerateContentSettingsExceptionsSubPage(ContentSettingsType type) {
site_settings::ContentSettingsTypeToGroupName(type);
}
+#if defined(OS_CHROMEOS)
+std::string GenerateContentSettingsSearchQueryPath(int query_message_id) {
+ return std::string(chrome::kDeprecatedOptionsSearchSubPage) + kHashMark +
+ l10n_util::GetStringUTF8(query_message_id);
+}
+#endif
+
} // namespace
void ShowBookmarkManager(Browser* browser) {
@@ -268,17 +279,34 @@ void ShowSettingsSubPage(Browser* browser, const std::string& sub_page) {
void ShowSettingsSubPageForProfile(Profile* profile,
const std::string& sub_page) {
+ std::string sub_page_path = sub_page;
+
+#if defined(OS_CHROMEOS)
+ if (!base::FeatureList::IsEnabled(features::kMaterialDesignSettings)) {
+ if (sub_page == chrome::kAccessibilitySubPage) {
+ sub_page_path = GenerateContentSettingsSearchQueryPath(
+ IDS_OPTIONS_SETTINGS_SECTION_TITLE_ACCESSIBILITY);
+ } else if (sub_page == chrome::kBluetoothSubPage) {
+ sub_page_path = GenerateContentSettingsSearchQueryPath(
+ IDS_OPTIONS_SETTINGS_SECTION_TITLE_BLUETOOTH);
+ } else if (sub_page == chrome::kDateTimeSubPage) {
+ sub_page_path = GenerateContentSettingsSearchQueryPath(
+ IDS_OPTIONS_SETTINGS_SECTION_TITLE_DATETIME);
+ }
+ }
+#endif
+
if (::switches::SettingsWindowEnabled()) {
content::RecordAction(base::UserMetricsAction("ShowOptions"));
SettingsWindowManager::GetInstance()->ShowChromePageForProfile(
- profile, GetSettingsUrl(sub_page));
+ profile, GetSettingsUrl(sub_page_path));
return;
}
Browser* browser = chrome::FindTabbedBrowser(profile, false);
if (!browser) {
browser = new Browser(Browser::CreateParams(profile));
}
- ShowSettingsSubPageInTabbedBrowser(browser, sub_page);
+ ShowSettingsSubPageInTabbedBrowser(browser, sub_page_path);
}
void ShowSettingsSubPageInTabbedBrowser(Browser* browser,
« no previous file with comments | « chrome/browser/ui/ash/system_tray_delegate_chromeos.cc ('k') | chrome/common/url_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698