-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add link from a11y settings to trackpad system settings on Mac
Adds a link row in chrome://settings/accessibility that opens the trackpad pane in Mac's system settings. This is only shown when the OverscrollHistoryNavigationSetting feature is enabled. Screenshot: https://screenshot.googleplex.com/9zu9Qa9zwRgWyLY Low-Coverage-Reason: Handler does not have any business logic, only used to respond to a call from settings webui. Bug: 1473415 Change-Id: Ic56d5e1a23578b45a132ef89441dc33bc0467872 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4786249 Reviewed-by: Francois Pierre Doray <fdoray@chromium.org> Commit-Queue: Charles Meng <charlesmeng@chromium.org> Reviewed-by: Avi Drissman <avi@chromium.org> Cr-Commit-Position: refs/heads/main@{#1184945}
- Loading branch information
Charles Meng
authored and
Chromium LUCI CQ
committed
Aug 17, 2023
1 parent
365895c
commit 4a9eff0
Showing
13 changed files
with
145 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...me/app/settings_strings_grdp/IDS_SETTINGS_OVERSCROLL_HISTORY_NAVIGATION_SUBTITLE.png.sha1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
cdebeaa249f8a57f557a5bdeac45413fdd1beff6 | ||
94a1d4d14c96739eeabac4f467f60d8b34692c13 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
chrome/browser/resources/settings_shared/mac_system_settings_browser_proxy.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Copyright 2023 The Chromium Authors | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
export interface MacSystemSettingsBrowserProxy { | ||
openTrackpadGesturesSettings(): void; | ||
} | ||
|
||
export class MacSystemSettingsBrowserProxyImpl implements | ||
MacSystemSettingsBrowserProxy { | ||
openTrackpadGesturesSettings() { | ||
chrome.send('openTrackpadGesturesSettings'); | ||
} | ||
|
||
static getInstance(): MacSystemSettingsBrowserProxy { | ||
return instance || (instance = new MacSystemSettingsBrowserProxyImpl()); | ||
} | ||
|
||
static setInstance(obj: MacSystemSettingsBrowserProxy) { | ||
instance = obj; | ||
} | ||
} | ||
|
||
let instance: MacSystemSettingsBrowserProxy|null = null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
chrome/browser/ui/webui/settings/mac_system_settings_handler.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// Copyright 2023 The Chromium Authors | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#include "chrome/browser/ui/webui/settings/mac_system_settings_handler.h" | ||
|
||
#include "base/mac/mac_util.h" | ||
|
||
using content::WebContents; | ||
|
||
namespace settings { | ||
|
||
MacSystemSettingsHandler::MacSystemSettingsHandler() = default; | ||
MacSystemSettingsHandler::~MacSystemSettingsHandler() = default; | ||
|
||
void MacSystemSettingsHandler::RegisterMessages() { | ||
web_ui()->RegisterMessageCallback( | ||
"openTrackpadGesturesSettings", | ||
base::BindRepeating( | ||
&MacSystemSettingsHandler::HandleOpenTrackpadGesturesSettings, | ||
base::Unretained(this))); | ||
} | ||
|
||
void MacSystemSettingsHandler::HandleOpenTrackpadGesturesSettings( | ||
const base::Value::List& args) { | ||
DCHECK(IsJavascriptAllowed()); | ||
// TODO(crbug.com/1473415): Figure out how to directly open the more gestures | ||
// subpane. Currently this only opens the first subpane of trackpad settings. | ||
base::mac::OpenSystemSettingsPane(base::mac::SystemSettingsPane::kTrackpad); | ||
} | ||
|
||
} // namespace settings |
32 changes: 32 additions & 0 deletions
32
chrome/browser/ui/webui/settings/mac_system_settings_handler.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// Copyright 2023 The Chromium Authors | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#ifndef CHROME_BROWSER_UI_WEBUI_SETTINGS_MAC_SYSTEM_SETTINGS_HANDLER_H_ | ||
#define CHROME_BROWSER_UI_WEBUI_SETTINGS_MAC_SYSTEM_SETTINGS_HANDLER_H_ | ||
|
||
#include "chrome/browser/ui/webui/settings/settings_page_ui_handler.h" | ||
|
||
namespace settings { | ||
|
||
class MacSystemSettingsHandler : public SettingsPageUIHandler { | ||
public: | ||
MacSystemSettingsHandler(); | ||
|
||
MacSystemSettingsHandler(const MacSystemSettingsHandler&) = delete; | ||
MacSystemSettingsHandler& operator=(const MacSystemSettingsHandler&) = delete; | ||
|
||
~MacSystemSettingsHandler() override; | ||
|
||
// SettingsPageUIHandler implementation. | ||
void RegisterMessages() override; | ||
void OnJavascriptAllowed() override {} | ||
void OnJavascriptDisallowed() override {} | ||
|
||
private: | ||
void HandleOpenTrackpadGesturesSettings(const base::Value::List& args); | ||
}; | ||
|
||
} // namespace settings | ||
|
||
#endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_MAC_SYSTEM_SETTINGS_HANDLER_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters