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:
parent
fac964ac0d
commit
892c9d78a3
129 changed files with 419 additions and 397 deletions
|
@ -67,7 +67,7 @@ void BadgeManager::BindServiceWorkerReceiver(
|
|||
std::move(context));
|
||||
}
|
||||
|
||||
std::string BadgeManager::GetBadgeString(absl::optional<int> badge_content) {
|
||||
std::string BadgeManager::GetBadgeString(std::optional<int> badge_content) {
|
||||
if (!badge_content)
|
||||
return "•";
|
||||
|
||||
|
@ -87,9 +87,9 @@ void BadgeManager::SetBadge(blink::mojom::BadgeValuePtr mojo_value) {
|
|||
return;
|
||||
}
|
||||
|
||||
absl::optional<int> value =
|
||||
mojo_value->is_flag() ? absl::nullopt
|
||||
: absl::make_optional(mojo_value->get_number());
|
||||
std::optional<int> value = mojo_value->is_flag()
|
||||
? std::nullopt
|
||||
: std::make_optional(mojo_value->get_number());
|
||||
|
||||
electron::Browser::Get()->SetBadgeCount(value);
|
||||
}
|
||||
|
|
|
@ -6,11 +6,11 @@
|
|||
#define ELECTRON_SHELL_BROWSER_BADGING_BADGE_MANAGER_H_
|
||||
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
|
||||
#include "components/keyed_service/core/keyed_service.h"
|
||||
#include "mojo/public/cpp/bindings/receiver_set.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "third_party/blink/public/mojom/badging/badging.mojom.h"
|
||||
#include "url/gurl.h"
|
||||
|
||||
|
@ -44,7 +44,7 @@ class BadgeManager : public KeyedService, public blink::mojom::BadgeService {
|
|||
mojo::PendingReceiver<blink::mojom::BadgeService> receiver);
|
||||
|
||||
// Determines the text to put on the badge based on some badge_content.
|
||||
static std::string GetBadgeString(absl::optional<int> badge_content);
|
||||
static std::string GetBadgeString(std::optional<int> badge_content);
|
||||
|
||||
private:
|
||||
// The BindingContext of a mojo request. Allows mojo calls to be tied back
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue