chore: replace absl::optional<T> with std::optional<T> (#40928)

* chore: replace absl::optional<T> with std::optional<T>

* IWYU
This commit is contained in:
Milan Burda 2024-01-10 23:23:35 +01:00 committed by GitHub
parent fac964ac0d
commit 892c9d78a3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
129 changed files with 419 additions and 397 deletions

View file

@ -5,6 +5,7 @@
#ifndef ELECTRON_SHELL_BROWSER_UI_ELECTRON_MENU_MODEL_H_
#define ELECTRON_SHELL_BROWSER_UI_ELECTRON_MENU_MODEL_H_
#include <optional>
#include <string>
#include <vector>
@ -14,7 +15,6 @@
#include "base/memory/weak_ptr.h"
#include "base/observer_list.h"
#include "base/observer_list_types.h"
#include "third_party/abseil-cpp/absl/types/optional.h"
#include "ui/base/models/simple_menu_model.h"
#include "url/gurl.h"
@ -29,9 +29,9 @@ class ElectronMenuModel : public ui::SimpleMenuModel {
SharingItem(const SharingItem&) = delete;
~SharingItem();
absl::optional<std::vector<std::string>> texts;
absl::optional<std::vector<GURL>> urls;
absl::optional<std::vector<base::FilePath>> file_paths;
std::optional<std::vector<std::string>> texts;
std::optional<std::vector<GURL>> urls;
std::optional<std::vector<base::FilePath>> file_paths;
};
#endif
@ -98,7 +98,7 @@ class ElectronMenuModel : public ui::SimpleMenuModel {
bool GetSharingItemAt(size_t index, SharingItem* item) const;
// Set/Get the SharingItem of this menu.
void SetSharingItem(SharingItem item);
const absl::optional<SharingItem>& GetSharingItem() const;
const std::optional<SharingItem>& GetSharingItem() const;
#endif
// ui::SimpleMenuModel:
@ -116,7 +116,7 @@ class ElectronMenuModel : public ui::SimpleMenuModel {
raw_ptr<Delegate> delegate_; // weak ref.
#if BUILDFLAG(IS_MAC)
absl::optional<SharingItem> sharing_item_;
std::optional<SharingItem> sharing_item_;
#endif
base::flat_map<int, std::u16string> toolTips_; // command id -> tooltip