feat: add support for share menu on macOS (#25629)
This commit is contained in:
parent
89c04b3c6c
commit
6b6ffbdd10
17 changed files with 316 additions and 6 deletions
|
@ -6,7 +6,9 @@
|
|||
#define SHELL_COMMON_GIN_HELPER_DICTIONARY_H_
|
||||
|
||||
#include <type_traits>
|
||||
#include <utility>
|
||||
|
||||
#include "base/optional.h"
|
||||
#include "gin/dictionary.h"
|
||||
#include "shell/common/gin_converters/std_converter.h"
|
||||
#include "shell/common/gin_helper/function_template.h"
|
||||
|
@ -59,6 +61,18 @@ class Dictionary : public gin::Dictionary {
|
|||
return !result.IsNothing() && result.FromJust();
|
||||
}
|
||||
|
||||
// Like normal Get but put result in an base::Optional.
|
||||
template <typename T>
|
||||
bool GetOptional(base::StringPiece key, base::Optional<T>* out) const {
|
||||
T ret;
|
||||
if (Get(key, &ret)) {
|
||||
out->emplace(std::move(ret));
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
bool GetHidden(base::StringPiece key, T* out) const {
|
||||
v8::Local<v8::Context> context = isolate()->GetCurrentContext();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue