mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
refactor: prefer inline constexpr string_view for string constants (#44405)
* refactor: BaseWindow::OnExecuteAppCommand() now takes a std::string_view * refactor: NativeWindow::NotifyWindowExecuteAppCommand() takes a std::string_view * refactor: AppCommandToString() returns a std::string_view, is now constexpr * refactor: make kBrowserBackward, kBrowserForward inline constexpr std::string_view Xref: https://abseil.io/tips/140 https://groups.google.com/a/chromium.org/g/chromium-dev/c/jROTxMo_m2Q/m/HgciN2KsAgAJ * refactor: use inline constexpr string_view for kDevice*Key constants Xref: https://abseil.io/tips/140 https://groups.google.com/a/chromium.org/g/chromium-dev/c/jROTxMo_m2Q/m/HgciN2KsAgAJ * refactor: IsEnvSet now takes a base::cstring_view * refactor: use inline constexpr cstring_view for kRunAsNode * refactor: use inline constexpr string_view for kPDF*PluginName * refactor: use base::FilePath::FromASCII() since "internal-pdf-viewer" is ascii * chore: remove unused shell/common/electron_constants.cc * fixup! refactor: IsEnvSet now takes a base::cstring_view
This commit is contained in:
@@ -665,9 +665,10 @@ void NativeWindow::NotifyWindowAlwaysOnTopChanged() {
|
||||
observer.OnWindowAlwaysOnTopChanged();
|
||||
}
|
||||
|
||||
void NativeWindow::NotifyWindowExecuteAppCommand(const std::string& command) {
|
||||
void NativeWindow::NotifyWindowExecuteAppCommand(
|
||||
const std::string_view command_name) {
|
||||
for (NativeWindowObserver& observer : observers_)
|
||||
observer.OnExecuteAppCommand(command);
|
||||
observer.OnExecuteAppCommand(command_name);
|
||||
}
|
||||
|
||||
void NativeWindow::NotifyTouchBarItemInteraction(const std::string& item_id,
|
||||
|
||||
Reference in New Issue
Block a user