chore: bump chromium to 93.0.4530.0 (master) (#29256)
* chore: bump chromium in DEPS to 92.0.4512.6 * 2887336: [CaptureHandle][#2] Propagate CaptureHandleConfig in browser process2887336
* refactor: base::Optional -> absl::optional * chore: fixup patch indices * chore: bump chromium in DEPS to 92.0.4514.0 * 2899417: Make build work when enable_pdf is set to false.2899417
* 2904731: use BrowserContext instead of Profile in PreconnectManager2904731
* 2295749: fix: check IsSecureEventInputEnabled in constructor before setting SetPasswordInputEnabled to true2295749
* 2893803: Add a GetWebView to RenderFrame.2893803
* 2892345: Implement WebContents::ForEachRenderFrameHost2892345
* chore: fixup patch indices * 2892048: Real instance methods for BrowserContext: remaining 5 methods.2892048
* 2902821: [mojo] Don't require full header includes for referenced interfaces2902821
* 2496500: Remove last deprecated extension Event ctor.2496500
* chore: fixup malformed pepper support patch * chore: bump chromium in DEPS to 92.0.4515.0 * 2908461: Add CreateEmptyPrintPagesParamsPtr() inside print_view_manager_base.cc.2908461
* 2880838: viz: add optional HDRMetadata to TransferableResource2880838
* chore: fixup patch indices * chore: bump chromium in DEPS to 92.0.4515.5 * chore: update patches * chore: bump chromium in DEPS to 92.0.4515.7 * chore: bump chromium in DEPS to 92.0.4515.9 * chore: bump chromium in DEPS to 93.0.4522.0 * chore: bump chromium in DEPS to 93.0.4523.0 * chore: bump chromium in DEPS to 93.0.4524.0 * chore: update patches * chore: enable_pak_file_integrity_checks was reverted * chore: update patches * refactor: base/optional was replaced with absl::optional Refs:2910202
* refactor: replace all usages of base::nullopt with absl::nullopt Refs:2910202
* chore: add missing base::Contains include Refs:2910202
* refactor: replace all usages of base::make_optional with absl::make_optional Refs:2910202
* refactor: replace WorldScriptContext() with GetScriptContextFromWorldId Refs:2893213
* chore: clean up left over opening namespace Refs:95bfe6d08f
* chore: add missing base::Contains include Refs:2910202
* refactor: replace GetCurrentDisplayIterator with the hard checker GetCurrentDisplay This code looks suspicious but if the iterator was invalid before it will also be invalid now. Refs:2893191
* refactor: headers are now passed directly in extensions client Refs:2918906
* refactor: base::DictionaryValue::empty() has been removed Refs:2912424
* chore: add missing includes for network URLLoaderFactory Refs: unknown, probably a side effect of header changes * refactor: make convenience wrapper around AppendArg There is no converter FromV8 for base::StringPiece (apparently its not possible). So we now take in an std::string and use the construct for StringPiece to do implicit conversion. Refs:2905544
* chore: add patch * chore: bump chromium in DEPS to 93.0.4525.0 * chore: update patches * refactor: CanResize has been de-virtualized Refs:2485774
* chore: update resource integrity patch * chore: add character encoding idl patch * chore: bump chromium in DEPS to 93.0.4526.0 * chore: update patches * chore: bump chromium in DEPS to 93.0.4527.0 * chore: bump chromium in DEPS to 93.0.4528.0 * chore: update patches * chore: update idl encoding patch * chore: bump chromium in DEPS to 93.0.4529.0 * chore: update patches * chore: bump chromium in DEPS to 93.0.4530.0 * chore: update patches * fix: only SetCanResize after the widget has been initialized * chore: add patch for vr on windows gn gen * spec: fix focus related tests on linux due to delay in focus swap * chore: remove new usages of base::Optional from main Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com> Co-authored-by: Samuel Attard <sattard@slack-corp.com> Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
This commit is contained in:
parent
8d0ed05c99
commit
8532e1239e
165 changed files with 720 additions and 1048 deletions
|
@ -14,7 +14,6 @@
|
|||
#include "base/environment.h"
|
||||
#include "base/files/file_path.h"
|
||||
#include "base/files/file_util.h"
|
||||
#include "base/optional.h"
|
||||
#include "base/path_service.h"
|
||||
#include "base/system/sys_info.h"
|
||||
#include "chrome/browser/browser_process.h"
|
||||
|
@ -57,6 +56,7 @@
|
|||
#include "shell/common/node_includes.h"
|
||||
#include "shell/common/options_switches.h"
|
||||
#include "shell/common/platform_util.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "ui/gfx/image/image.h"
|
||||
|
||||
#if defined(OS_WIN)
|
||||
|
@ -912,7 +912,7 @@ void App::SetAppPath(const base::FilePath& app_path) {
|
|||
|
||||
#if !defined(OS_MAC)
|
||||
void App::SetAppLogsPath(gin_helper::ErrorThrower thrower,
|
||||
base::Optional<base::FilePath> custom_path) {
|
||||
absl::optional<base::FilePath> custom_path) {
|
||||
if (custom_path.has_value()) {
|
||||
if (!custom_path->IsAbsolute()) {
|
||||
thrower.ThrowError("Path must be absolute");
|
||||
|
@ -965,7 +965,7 @@ base::FilePath App::GetPath(gin_helper::ErrorThrower thrower,
|
|||
// If users try to get the logs path before setting a logs path,
|
||||
// set the path to a sensible default and then try to get it again
|
||||
if (!succeed && name == "logs") {
|
||||
SetAppLogsPath(thrower, base::Optional<base::FilePath>());
|
||||
SetAppLogsPath(thrower, absl::optional<base::FilePath>());
|
||||
succeed = base::PathService::Get(key, &path);
|
||||
}
|
||||
|
||||
|
|
|
@ -175,7 +175,7 @@ class App : public ElectronBrowserClient::Delegate,
|
|||
void ChildProcessDisconnected(int pid);
|
||||
|
||||
void SetAppLogsPath(gin_helper::ErrorThrower thrower,
|
||||
base::Optional<base::FilePath> custom_path);
|
||||
absl::optional<base::FilePath> custom_path);
|
||||
|
||||
// Get/Set the pre-defined path in PathService.
|
||||
base::FilePath GetPath(gin_helper::ErrorThrower thrower,
|
||||
|
|
|
@ -18,7 +18,7 @@ namespace electron {
|
|||
namespace api {
|
||||
|
||||
void App::SetAppLogsPath(gin_helper::ErrorThrower thrower,
|
||||
base::Optional<base::FilePath> custom_path) {
|
||||
absl::optional<base::FilePath> custom_path) {
|
||||
if (custom_path.has_value()) {
|
||||
if (!custom_path->IsAbsolute()) {
|
||||
thrower.ThrowError("Path must be absolute");
|
||||
|
|
|
@ -893,7 +893,7 @@ bool BaseWindow::GetWindowButtonVisibility() const {
|
|||
void BaseWindow::SetTrafficLightPosition(const gfx::Point& position) {
|
||||
// For backward compatibility we treat (0, 0) as resetting to default.
|
||||
if (position.IsOrigin())
|
||||
window_->SetTrafficLightPosition(base::nullopt);
|
||||
window_->SetTrafficLightPosition(absl::nullopt);
|
||||
else
|
||||
window_->SetTrafficLightPosition(position);
|
||||
}
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
#include <utility>
|
||||
|
||||
#include "base/files/file_util.h"
|
||||
#include "base/optional.h"
|
||||
#include "base/task/thread_pool.h"
|
||||
#include "base/threading/thread_restrictions.h"
|
||||
#include "base/trace_event/trace_config.h"
|
||||
|
@ -18,6 +17,7 @@
|
|||
#include "shell/common/gin_helper/dictionary.h"
|
||||
#include "shell/common/gin_helper/promise.h"
|
||||
#include "shell/common/node_includes.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
using content::TracingController;
|
||||
|
||||
|
@ -58,18 +58,18 @@ namespace {
|
|||
|
||||
using CompletionCallback = base::OnceCallback<void(const base::FilePath&)>;
|
||||
|
||||
base::Optional<base::FilePath> CreateTemporaryFileOnIO() {
|
||||
absl::optional<base::FilePath> CreateTemporaryFileOnIO() {
|
||||
base::FilePath temp_file_path;
|
||||
if (!base::CreateTemporaryFile(&temp_file_path))
|
||||
return base::nullopt;
|
||||
return base::make_optional(std::move(temp_file_path));
|
||||
return absl::nullopt;
|
||||
return absl::make_optional(std::move(temp_file_path));
|
||||
}
|
||||
|
||||
void StopTracing(gin_helper::Promise<base::FilePath> promise,
|
||||
base::Optional<base::FilePath> file_path) {
|
||||
absl::optional<base::FilePath> file_path) {
|
||||
auto resolve_or_reject = base::AdaptCallbackForRepeating(base::BindOnce(
|
||||
[](gin_helper::Promise<base::FilePath> promise,
|
||||
const base::FilePath& path, base::Optional<std::string> error) {
|
||||
const base::FilePath& path, absl::optional<std::string> error) {
|
||||
if (error) {
|
||||
promise.RejectWithErrorMessage(error.value());
|
||||
} else {
|
||||
|
@ -79,14 +79,14 @@ void StopTracing(gin_helper::Promise<base::FilePath> promise,
|
|||
std::move(promise), *file_path));
|
||||
if (file_path) {
|
||||
auto endpoint = TracingController::CreateFileEndpoint(
|
||||
*file_path, base::BindRepeating(resolve_or_reject, base::nullopt));
|
||||
*file_path, base::BindRepeating(resolve_or_reject, absl::nullopt));
|
||||
if (!TracingController::GetInstance()->StopTracing(endpoint)) {
|
||||
resolve_or_reject.Run(base::make_optional(
|
||||
resolve_or_reject.Run(absl::make_optional(
|
||||
"Failed to stop tracing (was a trace in progress?)"));
|
||||
}
|
||||
} else {
|
||||
resolve_or_reject.Run(
|
||||
base::make_optional("Failed to create temporary file for trace data"));
|
||||
absl::make_optional("Failed to create temporary file for trace data"));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -96,7 +96,7 @@ v8::Local<v8::Promise> StopRecording(gin_helper::Arguments* args) {
|
|||
|
||||
base::FilePath path;
|
||||
if (args->GetNext(&path) && !path.empty()) {
|
||||
StopTracing(std::move(promise), base::make_optional(path));
|
||||
StopTracing(std::move(promise), absl::make_optional(path));
|
||||
} else {
|
||||
// use a temporary file.
|
||||
base::ThreadPool::PostTaskAndReplyWithResult(
|
||||
|
|
|
@ -131,10 +131,10 @@ bool MatchesCookie(const base::Value& filter,
|
|||
if ((str = filter.FindStringKey("domain")) &&
|
||||
!MatchesDomain(*str, cookie.Domain()))
|
||||
return false;
|
||||
base::Optional<bool> secure_filter = filter.FindBoolKey("secure");
|
||||
absl::optional<bool> secure_filter = filter.FindBoolKey("secure");
|
||||
if (secure_filter && *secure_filter == cookie.IsSecure())
|
||||
return false;
|
||||
base::Optional<bool> session_filter = filter.FindBoolKey("session");
|
||||
absl::optional<bool> session_filter = filter.FindBoolKey("session");
|
||||
if (session_filter && *session_filter != !cookie.IsPersistent())
|
||||
return false;
|
||||
return true;
|
||||
|
@ -162,7 +162,7 @@ void FilterCookieWithStatuses(
|
|||
}
|
||||
|
||||
// Parse dictionary property to CanonicalCookie time correctly.
|
||||
base::Time ParseTimeProperty(const base::Optional<double>& value) {
|
||||
base::Time ParseTimeProperty(const absl::optional<double>& value) {
|
||||
if (!value) // empty time means ignoring the parameter
|
||||
return base::Time();
|
||||
if (*value == 0) // FromDoubleT would convert 0 to empty Time
|
||||
|
|
|
@ -165,7 +165,7 @@ v8::Local<v8::Promise> Debugger::SendCommand(gin::Arguments* args) {
|
|||
pending_requests_.emplace(request_id, std::move(promise));
|
||||
request.SetInteger("id", request_id);
|
||||
request.SetString("method", method);
|
||||
if (!command_params.empty()) {
|
||||
if (!command_params.DictEmpty()) {
|
||||
request.Set("params",
|
||||
base::Value::ToUniquePtrValue(command_params.Clone()));
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
|
||||
#include <vector>
|
||||
|
||||
#include "base/containers/contains.h"
|
||||
#include "base/stl_util.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "gin/dictionary.h"
|
||||
|
|
|
@ -122,7 +122,7 @@ v8::Local<v8::Promise> NetLog::StartLogging(base::FilePath log_path,
|
|||
}
|
||||
|
||||
pending_start_promise_ =
|
||||
base::make_optional<gin_helper::Promise<void>>(args->isolate());
|
||||
absl::make_optional<gin_helper::Promise<void>>(args->isolate());
|
||||
v8::Local<v8::Promise> handle = pending_start_promise_->GetHandle();
|
||||
|
||||
auto command_line_string =
|
||||
|
|
|
@ -6,12 +6,12 @@
|
|||
#define SHELL_BROWSER_API_ELECTRON_API_NET_LOG_H_
|
||||
|
||||
#include "base/callback.h"
|
||||
#include "base/optional.h"
|
||||
#include "base/values.h"
|
||||
#include "gin/handle.h"
|
||||
#include "gin/wrappable.h"
|
||||
#include "services/network/public/mojom/net_log.mojom.h"
|
||||
#include "shell/common/gin_helper/promise.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
namespace gin {
|
||||
class Arguments;
|
||||
|
@ -57,7 +57,7 @@ class NetLog : public gin::Wrappable<NetLog> {
|
|||
|
||||
network::mojom::NetLogExporterPtr net_log_exporter_;
|
||||
|
||||
base::Optional<gin_helper::Promise<void>> pending_start_promise_;
|
||||
absl::optional<gin_helper::Promise<void>> pending_start_promise_;
|
||||
|
||||
scoped_refptr<base::TaskRunner> file_task_runner_;
|
||||
|
||||
|
|
|
@ -264,7 +264,7 @@ void DownloadIdCallback(content::DownloadManager* download_manager,
|
|||
uint32_t id) {
|
||||
download_manager->CreateDownloadItem(
|
||||
base::GenerateGUID(), id, path, path, url_chain, GURL(), GURL(), GURL(),
|
||||
GURL(), base::nullopt, mime_type, mime_type, start_time, base::Time(),
|
||||
GURL(), absl::nullopt, mime_type, mime_type, start_time, base::Time(),
|
||||
etag, last_modified, offset, length, std::string(),
|
||||
download::DownloadItem::INTERRUPTED,
|
||||
download::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS,
|
||||
|
|
|
@ -64,7 +64,7 @@ gin::WrapperInfo Tray::kWrapperInfo = {gin::kEmbedderNativeGin};
|
|||
|
||||
Tray::Tray(v8::Isolate* isolate,
|
||||
v8::Local<v8::Value> image,
|
||||
base::Optional<UUID> guid)
|
||||
absl::optional<UUID> guid)
|
||||
: tray_icon_(TrayIcon::Create(guid)) {
|
||||
SetImage(isolate, image);
|
||||
tray_icon_->AddObserver(this);
|
||||
|
@ -75,7 +75,7 @@ Tray::~Tray() = default;
|
|||
// static
|
||||
gin::Handle<Tray> Tray::New(gin_helper::ErrorThrower thrower,
|
||||
v8::Local<v8::Value> image,
|
||||
base::Optional<UUID> guid,
|
||||
absl::optional<UUID> guid,
|
||||
gin::Arguments* args) {
|
||||
if (!Browser::Get()->is_ready()) {
|
||||
thrower.ThrowError("Cannot create Tray before app is ready");
|
||||
|
@ -226,7 +226,7 @@ void Tray::SetToolTip(const std::string& tool_tip) {
|
|||
}
|
||||
|
||||
void Tray::SetTitle(const std::string& title,
|
||||
const base::Optional<gin_helper::Dictionary>& options,
|
||||
const absl::optional<gin_helper::Dictionary>& options,
|
||||
gin::Arguments* args) {
|
||||
if (!CheckAlive())
|
||||
return;
|
||||
|
|
|
@ -44,7 +44,7 @@ class Tray : public gin::Wrappable<Tray>,
|
|||
// gin_helper::Constructible
|
||||
static gin::Handle<Tray> New(gin_helper::ErrorThrower thrower,
|
||||
v8::Local<v8::Value> image,
|
||||
base::Optional<UUID> guid,
|
||||
absl::optional<UUID> guid,
|
||||
gin::Arguments* args);
|
||||
static v8::Local<v8::ObjectTemplate> FillObjectTemplate(
|
||||
v8::Isolate*,
|
||||
|
@ -56,7 +56,7 @@ class Tray : public gin::Wrappable<Tray>,
|
|||
private:
|
||||
Tray(v8::Isolate* isolate,
|
||||
v8::Local<v8::Value> image,
|
||||
base::Optional<UUID> guid);
|
||||
absl::optional<UUID> guid);
|
||||
~Tray() override;
|
||||
|
||||
// TrayIconObserver:
|
||||
|
@ -87,7 +87,7 @@ class Tray : public gin::Wrappable<Tray>,
|
|||
void SetPressedImage(v8::Isolate* isolate, v8::Local<v8::Value> image);
|
||||
void SetToolTip(const std::string& tool_tip);
|
||||
void SetTitle(const std::string& title,
|
||||
const base::Optional<gin_helper::Dictionary>& options,
|
||||
const absl::optional<gin_helper::Dictionary>& options,
|
||||
gin::Arguments* args);
|
||||
std::string GetTitle();
|
||||
void SetIgnoreDoubleClickEvents(bool ignore);
|
||||
|
|
|
@ -316,7 +316,7 @@ void SimpleURLLoaderWrapper::PinBodyGetter(v8::Local<v8::Value> body_getter) {
|
|||
SimpleURLLoaderWrapper::~SimpleURLLoaderWrapper() = default;
|
||||
|
||||
void SimpleURLLoaderWrapper::OnAuthRequired(
|
||||
const base::Optional<base::UnguessableToken>& window_id,
|
||||
const absl::optional<base::UnguessableToken>& window_id,
|
||||
uint32_t request_id,
|
||||
const GURL& url,
|
||||
bool first_auth_attempt,
|
||||
|
@ -337,7 +337,7 @@ void SimpleURLLoaderWrapper::OnAuthRequired(
|
|||
gin::Arguments* args) {
|
||||
std::u16string username_str, password_str;
|
||||
if (!args->GetNext(&username_str) || !args->GetNext(&password_str)) {
|
||||
auth_responder->OnAuthCredentials(base::nullopt);
|
||||
auth_responder->OnAuthCredentials(absl::nullopt);
|
||||
return;
|
||||
}
|
||||
auth_responder->OnAuthCredentials(
|
||||
|
|
|
@ -68,7 +68,7 @@ class SimpleURLLoaderWrapper
|
|||
|
||||
// network::mojom::URLLoaderNetworkServiceObserver:
|
||||
void OnAuthRequired(
|
||||
const base::Optional<base::UnguessableToken>& window_id,
|
||||
const absl::optional<base::UnguessableToken>& window_id,
|
||||
uint32_t request_id,
|
||||
const GURL& url,
|
||||
bool first_auth_attempt,
|
||||
|
@ -82,7 +82,7 @@ class SimpleURLLoaderWrapper
|
|||
bool fatal,
|
||||
OnSSLCertificateErrorCallback response) override;
|
||||
void OnCertificateRequested(
|
||||
const base::Optional<base::UnguessableToken>& window_id,
|
||||
const absl::optional<base::UnguessableToken>& window_id,
|
||||
const scoped_refptr<net::SSLCertRequestInfo>& cert_info,
|
||||
mojo::PendingRemote<network::mojom::ClientCertificateResponder>
|
||||
client_cert_responder) override {}
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
#include "base/files/file_util.h"
|
||||
#include "base/json/json_reader.h"
|
||||
#include "base/no_destructor.h"
|
||||
#include "base/optional.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "base/task/current_thread.h"
|
||||
#include "base/task/post_task.h"
|
||||
|
@ -122,6 +121,7 @@
|
|||
#include "shell/common/process_util.h"
|
||||
#include "shell/common/v8_value_serializer.h"
|
||||
#include "storage/browser/file_system/isolated_context.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "third_party/blink/public/common/associated_interfaces/associated_interface_provider.h"
|
||||
#include "third_party/blink/public/common/input/web_input_event.h"
|
||||
#include "third_party/blink/public/common/messaging/transferable_message_mojom_traits.h"
|
||||
|
@ -385,7 +385,7 @@ void OnCapturePageDone(gin_helper::Promise<gfx::Image> promise,
|
|||
promise.Resolve(gfx::Image::CreateFrom1xBitmap(bitmap));
|
||||
}
|
||||
|
||||
base::Optional<base::TimeDelta> GetCursorBlinkInterval() {
|
||||
absl::optional<base::TimeDelta> GetCursorBlinkInterval() {
|
||||
#if defined(OS_MAC)
|
||||
base::TimeDelta interval;
|
||||
if (ui::TextInsertionCaretBlinkPeriod(&interval))
|
||||
|
@ -401,7 +401,7 @@ base::Optional<base::TimeDelta> GetCursorBlinkInterval() {
|
|||
: base::TimeDelta::FromMilliseconds(system_msec);
|
||||
}
|
||||
#endif
|
||||
return base::nullopt;
|
||||
return absl::nullopt;
|
||||
}
|
||||
|
||||
#if BUILDFLAG(ENABLE_PRINTING)
|
||||
|
|
|
@ -182,7 +182,7 @@ void WebFrameMain::OnRendererConnectionError() {
|
|||
void WebFrameMain::PostMessage(v8::Isolate* isolate,
|
||||
const std::string& channel,
|
||||
v8::Local<v8::Value> message_value,
|
||||
base::Optional<v8::Local<v8::Value>> transfer) {
|
||||
absl::optional<v8::Local<v8::Value>> transfer) {
|
||||
blink::TransferableMessage transferable_message;
|
||||
if (!electron::SerializeV8Value(isolate, message_value,
|
||||
&transferable_message)) {
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
#include "base/process/process.h"
|
||||
#include "gin/handle.h"
|
||||
#include "gin/wrappable.h"
|
||||
#include "mojo/public/cpp/bindings/remote.h"
|
||||
#include "shell/common/gin_helper/constructible.h"
|
||||
#include "shell/common/gin_helper/pinnable.h"
|
||||
#include "third_party/blink/public/mojom/page/page_visibility_state.mojom-forward.h"
|
||||
|
@ -87,7 +88,7 @@ class WebFrameMain : public gin::Wrappable<WebFrameMain>,
|
|||
void PostMessage(v8::Isolate* isolate,
|
||||
const std::string& channel,
|
||||
v8::Local<v8::Value> message_value,
|
||||
base::Optional<v8::Local<v8::Value>> transfer);
|
||||
absl::optional<v8::Local<v8::Value>> transfer);
|
||||
|
||||
int FrameTreeNodeID() const;
|
||||
std::string Name() const;
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
#include <memory>
|
||||
#include <utility>
|
||||
|
||||
#include "base/optional.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
#if defined(OS_WIN)
|
||||
#include <windows.h>
|
||||
|
@ -34,14 +34,14 @@ mach_port_t TaskForPid(pid_t pid) {
|
|||
return task;
|
||||
}
|
||||
|
||||
base::Optional<mach_task_basic_info_data_t> GetTaskInfo(mach_port_t task) {
|
||||
absl::optional<mach_task_basic_info_data_t> GetTaskInfo(mach_port_t task) {
|
||||
if (task == MACH_PORT_NULL)
|
||||
return base::nullopt;
|
||||
return absl::nullopt;
|
||||
mach_task_basic_info_data_t info = {};
|
||||
mach_msg_type_number_t count = MACH_TASK_BASIC_INFO_COUNT;
|
||||
kern_return_t kr = task_info(task, MACH_TASK_BASIC_INFO,
|
||||
reinterpret_cast<task_info_t>(&info), &count);
|
||||
return (kr == KERN_SUCCESS) ? base::make_optional(info) : base::nullopt;
|
||||
return (kr == KERN_SUCCESS) ? absl::make_optional(info) : absl::nullopt;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
|
|
@ -67,7 +67,7 @@ void BadgeManager::BindServiceWorkerReceiver(
|
|||
std::move(context));
|
||||
}
|
||||
|
||||
std::string BadgeManager::GetBadgeString(base::Optional<int> badge_content) {
|
||||
std::string BadgeManager::GetBadgeString(absl::optional<int> badge_content) {
|
||||
if (!badge_content)
|
||||
return "•";
|
||||
|
||||
|
@ -87,9 +87,9 @@ void BadgeManager::SetBadge(blink::mojom::BadgeValuePtr mojo_value) {
|
|||
return;
|
||||
}
|
||||
|
||||
base::Optional<int> value =
|
||||
mojo_value->is_flag() ? base::nullopt
|
||||
: base::make_optional(mojo_value->get_number());
|
||||
absl::optional<int> value =
|
||||
mojo_value->is_flag() ? absl::nullopt
|
||||
: absl::make_optional(mojo_value->get_number());
|
||||
|
||||
electron::Browser::Get()->SetBadgeCount(value);
|
||||
}
|
||||
|
|
|
@ -9,9 +9,9 @@
|
|||
#include <string>
|
||||
|
||||
#include "base/macros.h"
|
||||
#include "base/optional.h"
|
||||
#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"
|
||||
|
||||
|
@ -41,7 +41,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(base::Optional<int> badge_content);
|
||||
static std::string GetBadgeString(absl::optional<int> badge_content);
|
||||
|
||||
private:
|
||||
// The BindingContext of a mojo request. Allows mojo calls to be tied back
|
||||
|
|
|
@ -109,7 +109,7 @@ class Browser : public WindowListObserver {
|
|||
#endif
|
||||
|
||||
// Set/Get the badge count.
|
||||
bool SetBadgeCount(base::Optional<int> count);
|
||||
bool SetBadgeCount(absl::optional<int> count);
|
||||
int GetBadgeCount();
|
||||
|
||||
#if defined(OS_WIN)
|
||||
|
@ -368,7 +368,7 @@ class Browser : public WindowListObserver {
|
|||
|
||||
#if defined(OS_WIN)
|
||||
void UpdateBadgeContents(HWND hwnd,
|
||||
const base::Optional<std::string>& badge_content,
|
||||
const absl::optional<std::string>& badge_content,
|
||||
const std::string& badge_alt_string);
|
||||
|
||||
// In charge of running taskbar related APIs.
|
||||
|
|
|
@ -51,7 +51,7 @@ bool LaunchXdgUtility(const std::vector<std::string>& argv, int* exit_code) {
|
|||
return process.WaitForExit(exit_code);
|
||||
}
|
||||
|
||||
base::Optional<std::string> GetXdgAppOutput(
|
||||
absl::optional<std::string> GetXdgAppOutput(
|
||||
const std::vector<std::string>& argv) {
|
||||
std::string reply;
|
||||
int success_code;
|
||||
|
@ -60,9 +60,9 @@ base::Optional<std::string> GetXdgAppOutput(
|
|||
&success_code);
|
||||
|
||||
if (!ran_ok || success_code != EXIT_SUCCESS)
|
||||
return base::Optional<std::string>();
|
||||
return absl::optional<std::string>();
|
||||
|
||||
return base::make_optional(reply);
|
||||
return absl::make_optional(reply);
|
||||
}
|
||||
|
||||
bool SetDefaultWebClient(const std::string& protocol) {
|
||||
|
@ -128,7 +128,7 @@ std::u16string Browser::GetApplicationNameForProtocol(const GURL& url) {
|
|||
return base::ASCIIToUTF16(GetXdgAppOutput(argv).value_or(std::string()));
|
||||
}
|
||||
|
||||
bool Browser::SetBadgeCount(base::Optional<int> count) {
|
||||
bool Browser::SetBadgeCount(absl::optional<int> count) {
|
||||
if (IsUnityRunning() && count.has_value()) {
|
||||
unity::SetDownloadCount(count.value());
|
||||
badge_count_ = count.value();
|
||||
|
|
|
@ -218,7 +218,7 @@ std::u16string Browser::GetApplicationNameForProtocol(const GURL& url) {
|
|||
return app_display_name;
|
||||
}
|
||||
|
||||
bool Browser::SetBadgeCount(base::Optional<int> count) {
|
||||
bool Browser::SetBadgeCount(absl::optional<int> count) {
|
||||
DockSetBadgeText(!count.has_value() || count.value() != 0
|
||||
? badging::BadgeManager::GetBadgeString(count)
|
||||
: "");
|
||||
|
|
|
@ -591,10 +591,10 @@ v8::Local<v8::Promise> Browser::GetApplicationInfoForProtocol(
|
|||
return handle;
|
||||
}
|
||||
|
||||
bool Browser::SetBadgeCount(base::Optional<int> count) {
|
||||
base::Optional<std::string> badge_content;
|
||||
bool Browser::SetBadgeCount(absl::optional<int> count) {
|
||||
absl::optional<std::string> badge_content;
|
||||
if (count.has_value() && count.value() == 0) {
|
||||
badge_content = base::nullopt;
|
||||
badge_content = absl::nullopt;
|
||||
} else {
|
||||
badge_content = badging::BadgeManager::GetBadgeString(count);
|
||||
}
|
||||
|
@ -635,7 +635,7 @@ bool Browser::SetBadgeCount(base::Optional<int> count) {
|
|||
|
||||
void Browser::UpdateBadgeContents(
|
||||
HWND hwnd,
|
||||
const base::Optional<std::string>& badge_content,
|
||||
const absl::optional<std::string>& badge_content,
|
||||
const std::string& badge_alt_string) {
|
||||
SkBitmap badge;
|
||||
if (badge_content) {
|
||||
|
|
|
@ -790,7 +790,7 @@ bool ElectronBrowserClient::ArePersistentMediaDeviceIDsAllowed(
|
|||
content::BrowserContext* browser_context,
|
||||
const GURL& scope,
|
||||
const GURL& site_for_cookies,
|
||||
const base::Optional<url::Origin>& top_frame_origin) {
|
||||
const absl::optional<url::Origin>& top_frame_origin) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -947,7 +947,7 @@ bool ElectronBrowserClient::HandleExternalProtocol(
|
|||
bool is_main_frame,
|
||||
ui::PageTransition page_transition,
|
||||
bool has_user_gesture,
|
||||
const base::Optional<url::Origin>& initiating_origin,
|
||||
const absl::optional<url::Origin>& initiating_origin,
|
||||
mojo::PendingRemote<network::mojom::URLLoaderFactory>* out_factory) {
|
||||
base::PostTask(
|
||||
FROM_HERE, {BrowserThread::UI},
|
||||
|
@ -1250,7 +1250,7 @@ void ElectronBrowserClient::CreateWebSocket(
|
|||
WebSocketFactory factory,
|
||||
const GURL& url,
|
||||
const net::SiteForCookies& site_for_cookies,
|
||||
const base::Optional<std::string>& user_agent,
|
||||
const absl::optional<std::string>& user_agent,
|
||||
mojo::PendingRemote<network::mojom::WebSocketHandshakeClient>
|
||||
handshake_client) {
|
||||
v8::Isolate* isolate = JavascriptEnvironment::GetIsolate();
|
||||
|
@ -1288,7 +1288,7 @@ bool ElectronBrowserClient::WillCreateURLLoaderFactory(
|
|||
int render_process_id,
|
||||
URLLoaderFactoryType type,
|
||||
const url::Origin& request_initiator,
|
||||
base::Optional<int64_t> navigation_id,
|
||||
absl::optional<int64_t> navigation_id,
|
||||
ukm::SourceIdObj ukm_source_id,
|
||||
mojo::PendingReceiver<network::mojom::URLLoaderFactory>* factory_receiver,
|
||||
mojo::PendingRemote<network::mojom::TrustedURLLoaderHeaderClient>*
|
||||
|
|
|
@ -187,7 +187,7 @@ class ElectronBrowserClient : public content::ContentBrowserClient,
|
|||
WebSocketFactory factory,
|
||||
const GURL& url,
|
||||
const net::SiteForCookies& site_for_cookies,
|
||||
const base::Optional<std::string>& user_agent,
|
||||
const absl::optional<std::string>& user_agent,
|
||||
mojo::PendingRemote<network::mojom::WebSocketHandshakeClient>
|
||||
handshake_client) override;
|
||||
bool WillInterceptWebSocket(content::RenderFrameHost*) override;
|
||||
|
@ -197,7 +197,7 @@ class ElectronBrowserClient : public content::ContentBrowserClient,
|
|||
int render_process_id,
|
||||
URLLoaderFactoryType type,
|
||||
const url::Origin& request_initiator,
|
||||
base::Optional<int64_t> navigation_id,
|
||||
absl::optional<int64_t> navigation_id,
|
||||
ukm::SourceIdObj ukm_source_id,
|
||||
mojo::PendingReceiver<network::mojom::URLLoaderFactory>* factory_receiver,
|
||||
mojo::PendingRemote<network::mojom::TrustedURLLoaderHeaderClient>*
|
||||
|
@ -232,7 +232,7 @@ class ElectronBrowserClient : public content::ContentBrowserClient,
|
|||
bool is_main_frame,
|
||||
ui::PageTransition page_transition,
|
||||
bool has_user_gesture,
|
||||
const base::Optional<url::Origin>& initiating_origin,
|
||||
const absl::optional<url::Origin>& initiating_origin,
|
||||
mojo::PendingRemote<network::mojom::URLLoaderFactory>* out_factory)
|
||||
override;
|
||||
std::unique_ptr<content::LoginDelegate> CreateLoginDelegate(
|
||||
|
@ -262,7 +262,7 @@ class ElectronBrowserClient : public content::ContentBrowserClient,
|
|||
content::BrowserContext* browser_context,
|
||||
const GURL& scope,
|
||||
const GURL& site_for_cookies,
|
||||
const base::Optional<url::Origin>& top_frame_origin) override;
|
||||
const absl::optional<url::Origin>& top_frame_origin) override;
|
||||
|
||||
// content::RenderProcessHostObserver:
|
||||
void RenderProcessHostDestroyed(content::RenderProcessHost* host) override;
|
||||
|
|
|
@ -154,7 +154,7 @@ ElectronBrowserContext::ElectronBrowserContext(const std::string& partition,
|
|||
|
||||
ElectronBrowserContext::~ElectronBrowserContext() {
|
||||
DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
||||
NotifyWillBeDestroyed(this);
|
||||
NotifyWillBeDestroyed();
|
||||
// Notify any keyed services of browser context destruction.
|
||||
BrowserContextDependencyManager::GetInstance()->DestroyBrowserContextServices(
|
||||
this);
|
||||
|
@ -334,7 +334,7 @@ ElectronBrowserContext::GetURLLoaderFactory() {
|
|||
->WillCreateURLLoaderFactory(
|
||||
this, nullptr, -1,
|
||||
content::ContentBrowserClient::URLLoaderFactoryType::kNavigation,
|
||||
url::Origin(), base::nullopt, ukm::kInvalidSourceIdObj,
|
||||
url::Origin(), absl::nullopt, ukm::kInvalidSourceIdObj,
|
||||
&factory_receiver, &header_client, nullptr, nullptr, nullptr);
|
||||
|
||||
network::mojom::URLLoaderFactoryParamsPtr params =
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
#include "base/base_switches.h"
|
||||
#include "base/command_line.h"
|
||||
#include "base/feature_list.h"
|
||||
#include "base/optional.h"
|
||||
#include "base/path_service.h"
|
||||
#include "base/run_loop.h"
|
||||
#include "base/strings/string_number_conversions.h"
|
||||
|
@ -49,6 +48,7 @@
|
|||
#include "shell/common/gin_helper/trackable_object.h"
|
||||
#include "shell/common/node_bindings.h"
|
||||
#include "shell/common/node_includes.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "ui/base/idle/idle.h"
|
||||
#include "ui/base/l10n/l10n_util.h"
|
||||
#include "ui/base/ui_base_switches.h"
|
||||
|
@ -314,7 +314,7 @@ int ElectronBrowserMainParts::PreCreateThreads() {
|
|||
// We must set this env first to make ui::ResourceBundle accept the custom
|
||||
// locale.
|
||||
std::unique_ptr<base::Environment> env(base::Environment::Create());
|
||||
base::Optional<std::string> lc_all;
|
||||
absl::optional<std::string> lc_all;
|
||||
if (!locale.empty()) {
|
||||
std::string str;
|
||||
if (env->GetVar("LC_ALL", &str))
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
|
||||
#include "base/callback.h"
|
||||
#include "base/metrics/field_trial.h"
|
||||
#include "base/optional.h"
|
||||
#include "base/timer/timer.h"
|
||||
#include "content/public/browser/browser_context.h"
|
||||
#include "content/public/browser/browser_main_parts.h"
|
||||
|
@ -17,6 +16,7 @@
|
|||
#include "electron/buildflags/buildflags.h"
|
||||
#include "mojo/public/cpp/bindings/remote.h"
|
||||
#include "services/device/public/mojom/geolocation_control.mojom.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "ui/views/layout/layout_provider.h"
|
||||
|
||||
class BrowserProcess;
|
||||
|
@ -143,7 +143,7 @@ class ElectronBrowserMainParts : public content::BrowserMainParts {
|
|||
|
||||
// A place to remember the exit code once the message loop is ready.
|
||||
// Before then, we just exit() without any intermediate steps.
|
||||
base::Optional<int> exit_code_;
|
||||
absl::optional<int> exit_code_;
|
||||
|
||||
std::unique_ptr<JavascriptEnvironment> js_env_;
|
||||
std::unique_ptr<Browser> browser_;
|
||||
|
|
|
@ -143,7 +143,7 @@ void ElectronDownloadManagerDelegate::OnDownloadPathGenerated(
|
|||
std::move(callback).Run(path,
|
||||
download::DownloadItem::TARGET_DISPOSITION_PROMPT,
|
||||
download::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS,
|
||||
item->GetMixedContentStatus(), path, base::nullopt,
|
||||
item->GetMixedContentStatus(), path, absl::nullopt,
|
||||
download::DOWNLOAD_INTERRUPT_REASON_NONE);
|
||||
}
|
||||
}
|
||||
|
@ -183,7 +183,7 @@ void ElectronDownloadManagerDelegate::OnDownloadSaveDialogDone(
|
|||
std::move(download_callback)
|
||||
.Run(path, download::DownloadItem::TARGET_DISPOSITION_PROMPT,
|
||||
download::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS,
|
||||
item->GetMixedContentStatus(), path, base::nullopt,
|
||||
item->GetMixedContentStatus(), path, absl::nullopt,
|
||||
interrupt_reason);
|
||||
}
|
||||
|
||||
|
@ -203,7 +203,7 @@ bool ElectronDownloadManagerDelegate::DetermineDownloadTarget(
|
|||
download::DownloadItem::TARGET_DISPOSITION_OVERWRITE,
|
||||
download::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS,
|
||||
download::DownloadItem::MixedContentStatus::UNKNOWN,
|
||||
download->GetForcedFilePath(), base::nullopt,
|
||||
download->GetForcedFilePath(), absl::nullopt,
|
||||
download::DOWNLOAD_INTERRUPT_REASON_NONE);
|
||||
return true;
|
||||
}
|
||||
|
@ -216,7 +216,7 @@ bool ElectronDownloadManagerDelegate::DetermineDownloadTarget(
|
|||
save_path, download::DownloadItem::TARGET_DISPOSITION_OVERWRITE,
|
||||
download::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS,
|
||||
download::DownloadItem::MixedContentStatus::UNKNOWN, save_path,
|
||||
base::nullopt, download::DOWNLOAD_INTERRUPT_REASON_NONE);
|
||||
absl::nullopt, download::DOWNLOAD_INTERRUPT_REASON_NONE);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
#include "base/containers/contains.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/path_service.h"
|
||||
#include "base/stl_util.h"
|
||||
|
|
|
@ -170,12 +170,11 @@ void ElectronExtensionsBrowserClient::LoadResourceFromResourceBundle(
|
|||
mojo::PendingReceiver<network::mojom::URLLoader> loader,
|
||||
const base::FilePath& resource_relative_path,
|
||||
int resource_id,
|
||||
const std::string& content_security_policy,
|
||||
mojo::PendingRemote<network::mojom::URLLoaderClient> client,
|
||||
bool send_cors_header) {
|
||||
scoped_refptr<net::HttpResponseHeaders> headers,
|
||||
mojo::PendingRemote<network::mojom::URLLoaderClient> client) {
|
||||
extensions::chrome_url_request_util::LoadResourceFromResourceBundle(
|
||||
request, std::move(loader), resource_relative_path, resource_id,
|
||||
content_security_policy, std::move(client), send_cors_header);
|
||||
std::move(headers), std::move(client));
|
||||
}
|
||||
|
||||
namespace {
|
||||
|
@ -310,8 +309,8 @@ void ElectronExtensionsBrowserClient::BroadcastEventToRenderers(
|
|||
return;
|
||||
}
|
||||
|
||||
std::unique_ptr<extensions::Event> event(
|
||||
new extensions::Event(histogram_value, event_name, std::move(args)));
|
||||
auto event = std::make_unique<extensions::Event>(histogram_value, event_name,
|
||||
args->TakeList());
|
||||
auto& context_map = ElectronBrowserContext::browser_context_map();
|
||||
for (auto const& entry : context_map) {
|
||||
if (entry.second) {
|
||||
|
|
|
@ -66,9 +66,8 @@ class ElectronExtensionsBrowserClient
|
|||
mojo::PendingReceiver<network::mojom::URLLoader> loader,
|
||||
const base::FilePath& resource_relative_path,
|
||||
int resource_id,
|
||||
const std::string& content_security_policy,
|
||||
mojo::PendingRemote<network::mojom::URLLoaderClient> client,
|
||||
bool send_cors_header) override;
|
||||
scoped_refptr<net::HttpResponseHeaders> headers,
|
||||
mojo::PendingRemote<network::mojom::URLLoaderClient> client) override;
|
||||
bool AllowCrossRendererResourceLoad(
|
||||
const network::ResourceRequest& request,
|
||||
network::mojom::RequestDestination destination,
|
||||
|
|
|
@ -52,7 +52,7 @@ void LoginHandler::EmitEvent(
|
|||
|
||||
api::WebContents* api_web_contents = api::WebContents::From(web_contents());
|
||||
if (!api_web_contents) {
|
||||
std::move(auth_required_callback_).Run(base::nullopt);
|
||||
std::move(auth_required_callback_).Run(absl::nullopt);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -71,7 +71,7 @@ void LoginHandler::EmitEvent(
|
|||
base::BindOnce(&LoginHandler::CallbackFromJS,
|
||||
weak_factory_.GetWeakPtr()));
|
||||
if (!default_prevented && auth_required_callback_) {
|
||||
std::move(auth_required_callback_).Run(base::nullopt);
|
||||
std::move(auth_required_callback_).Run(absl::nullopt);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -81,7 +81,7 @@ void LoginHandler::CallbackFromJS(gin::Arguments* args) {
|
|||
if (auth_required_callback_) {
|
||||
std::u16string username, password;
|
||||
if (!args->GetNext(&username) || !args->GetNext(&password)) {
|
||||
std::move(auth_required_callback_).Run(base::nullopt);
|
||||
std::move(auth_required_callback_).Run(absl::nullopt);
|
||||
return;
|
||||
}
|
||||
std::move(auth_required_callback_)
|
||||
|
|
|
@ -12,13 +12,13 @@
|
|||
|
||||
#include "base/memory/weak_ptr.h"
|
||||
#include "base/observer_list.h"
|
||||
#include "base/optional.h"
|
||||
#include "base/supports_user_data.h"
|
||||
#include "base/values.h"
|
||||
#include "content/public/browser/desktop_media_id.h"
|
||||
#include "content/public/browser/web_contents_user_data.h"
|
||||
#include "extensions/browser/app_window/size_constraints.h"
|
||||
#include "shell/browser/native_window_observer.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "ui/views/widget/widget_delegate.h"
|
||||
|
||||
class SkRegion;
|
||||
|
@ -207,8 +207,8 @@ class NativeWindow : public base::SupportsUserData,
|
|||
#if defined(OS_MAC)
|
||||
virtual void SetWindowButtonVisibility(bool visible) = 0;
|
||||
virtual bool GetWindowButtonVisibility() const = 0;
|
||||
virtual void SetTrafficLightPosition(base::Optional<gfx::Point> position) = 0;
|
||||
virtual base::Optional<gfx::Point> GetTrafficLightPosition() const = 0;
|
||||
virtual void SetTrafficLightPosition(absl::optional<gfx::Point> position) = 0;
|
||||
virtual absl::optional<gfx::Point> GetTrafficLightPosition() const = 0;
|
||||
virtual void RedrawTrafficLights() = 0;
|
||||
virtual void UpdateFrame() = 0;
|
||||
#endif
|
||||
|
|
|
@ -125,8 +125,8 @@ class NativeWindowMac : public NativeWindow,
|
|||
void SetVibrancy(const std::string& type) override;
|
||||
void SetWindowButtonVisibility(bool visible) override;
|
||||
bool GetWindowButtonVisibility() const override;
|
||||
void SetTrafficLightPosition(base::Optional<gfx::Point> position) override;
|
||||
base::Optional<gfx::Point> GetTrafficLightPosition() const override;
|
||||
void SetTrafficLightPosition(absl::optional<gfx::Point> position) override;
|
||||
absl::optional<gfx::Point> GetTrafficLightPosition() const override;
|
||||
void RedrawTrafficLights() override;
|
||||
void UpdateFrame() override;
|
||||
void SetTouchBar(
|
||||
|
@ -196,7 +196,6 @@ class NativeWindowMac : public NativeWindow,
|
|||
|
||||
protected:
|
||||
// views::WidgetDelegate:
|
||||
bool CanResize() const override;
|
||||
views::View* GetContentsView() override;
|
||||
|
||||
// ui::NativeThemeObserver:
|
||||
|
@ -235,8 +234,7 @@ class NativeWindowMac : public NativeWindow,
|
|||
|
||||
bool is_kiosk_ = false;
|
||||
bool zoom_to_page_width_ = false;
|
||||
bool resizable_ = true;
|
||||
base::Optional<gfx::Point> traffic_light_position_;
|
||||
absl::optional<gfx::Point> traffic_light_position_;
|
||||
|
||||
std::queue<bool> pending_transitions_;
|
||||
FullScreenTransitionState fullscreen_transition_state() const {
|
||||
|
@ -258,7 +256,7 @@ class NativeWindowMac : public NativeWindow,
|
|||
|
||||
// The visibility mode of window button controls when explicitly set through
|
||||
// setWindowButtonVisibility().
|
||||
base::Optional<bool> window_button_visibility_;
|
||||
absl::optional<bool> window_button_visibility_;
|
||||
|
||||
// Maximizable window state; necessary for persistence through redraws.
|
||||
bool maximizable_ = true;
|
||||
|
|
|
@ -273,7 +273,8 @@ NativeWindowMac::NativeWindowMac(const gin_helper::Dictionary& options,
|
|||
round((NSHeight(main_screen_rect) - height) / 2), width,
|
||||
height);
|
||||
|
||||
options.Get(options::kResizable, &resizable_);
|
||||
bool resizable = true;
|
||||
options.Get(options::kResizable, &resizable);
|
||||
options.Get(options::kTitleBarStyle, &title_bar_style_);
|
||||
options.Get(options::kZoomToPageWidth, &zoom_to_page_width_);
|
||||
options.Get(options::kSimpleFullScreen, &always_simple_fullscreen_);
|
||||
|
@ -328,7 +329,7 @@ NativeWindowMac::NativeWindowMac(const gin_helper::Dictionary& options,
|
|||
styleMask |= NSMiniaturizableWindowMask;
|
||||
if (closable)
|
||||
styleMask |= NSWindowStyleMaskClosable;
|
||||
if (resizable_)
|
||||
if (resizable)
|
||||
styleMask |= NSResizableWindowMask;
|
||||
if (!useStandardWindow || transparent() || !has_frame())
|
||||
styleMask |= NSTexturedBackgroundWindowMask;
|
||||
|
@ -342,6 +343,7 @@ NativeWindowMac::NativeWindowMac(const gin_helper::Dictionary& options,
|
|||
params.type = views::Widget::InitParams::TYPE_WINDOW;
|
||||
params.native_widget = new ElectronNativeWidgetMac(this, styleMask, widget());
|
||||
widget()->Init(std::move(params));
|
||||
SetCanResize(resizable);
|
||||
window_ = static_cast<ElectronNSWindow*>(
|
||||
widget()->GetNativeWindow().GetNativeNSWindow());
|
||||
|
||||
|
@ -780,6 +782,7 @@ void NativeWindowMac::MoveTop() {
|
|||
|
||||
void NativeWindowMac::SetResizable(bool resizable) {
|
||||
SetStyleMask(resizable, NSWindowStyleMaskResizable);
|
||||
SetCanResize(resizable);
|
||||
}
|
||||
|
||||
bool NativeWindowMac::IsResizable() {
|
||||
|
@ -1462,7 +1465,7 @@ bool NativeWindowMac::GetWindowButtonVisibility() const {
|
|||
}
|
||||
|
||||
void NativeWindowMac::SetTrafficLightPosition(
|
||||
base::Optional<gfx::Point> position) {
|
||||
absl::optional<gfx::Point> position) {
|
||||
traffic_light_position_ = std::move(position);
|
||||
if (buttons_view_) {
|
||||
[buttons_view_ setMargin:traffic_light_position_];
|
||||
|
@ -1470,7 +1473,7 @@ void NativeWindowMac::SetTrafficLightPosition(
|
|||
}
|
||||
}
|
||||
|
||||
base::Optional<gfx::Point> NativeWindowMac::GetTrafficLightPosition() const {
|
||||
absl::optional<gfx::Point> NativeWindowMac::GetTrafficLightPosition() const {
|
||||
return traffic_light_position_;
|
||||
}
|
||||
|
||||
|
@ -1701,10 +1704,6 @@ void NativeWindowMac::SetCollectionBehavior(bool on, NSUInteger flag) {
|
|||
SetMaximizable(was_maximizable);
|
||||
}
|
||||
|
||||
bool NativeWindowMac::CanResize() const {
|
||||
return resizable_;
|
||||
}
|
||||
|
||||
views::View* NativeWindowMac::GetContentsView() {
|
||||
return root_view_.get();
|
||||
}
|
||||
|
|
|
@ -216,6 +216,9 @@ NativeWindowViews::NativeWindowViews(const gin_helper::Dictionary& options,
|
|||
#endif
|
||||
|
||||
widget()->Init(std::move(params));
|
||||
#if defined(OS_WIN)
|
||||
SetCanResize(resizable_);
|
||||
#endif
|
||||
|
||||
bool fullscreen = false;
|
||||
options.Get(options::kFullscreen, &fullscreen);
|
||||
|
@ -714,6 +717,7 @@ void NativeWindowViews::SetResizable(bool resizable) {
|
|||
FlipWindowStyle(GetAcceleratedWidget(), resizable, WS_THICKFRAME);
|
||||
#endif
|
||||
resizable_ = resizable;
|
||||
SetCanResize(resizable_);
|
||||
}
|
||||
|
||||
bool NativeWindowViews::MoveAbove(const std::string& sourceId) {
|
||||
|
@ -764,7 +768,7 @@ bool NativeWindowViews::IsResizable() {
|
|||
if (has_frame())
|
||||
return ::GetWindowLong(GetAcceleratedWidget(), GWL_STYLE) & WS_THICKFRAME;
|
||||
#endif
|
||||
return CanResize();
|
||||
return resizable_;
|
||||
}
|
||||
|
||||
void NativeWindowViews::SetAspectRatio(double aspect_ratio,
|
||||
|
@ -1483,10 +1487,6 @@ views::View* NativeWindowViews::GetInitiallyFocusedView() {
|
|||
return focused_view_;
|
||||
}
|
||||
|
||||
bool NativeWindowViews::CanResize() const {
|
||||
return resizable_;
|
||||
}
|
||||
|
||||
bool NativeWindowViews::CanMaximize() const {
|
||||
return resizable_ && maximizable_;
|
||||
}
|
||||
|
@ -1526,7 +1526,7 @@ bool NativeWindowViews::ShouldDescendIntoChildForEventHandling(
|
|||
return false;
|
||||
|
||||
// And the events on border for dragging resizable frameless window.
|
||||
if (!has_frame() && CanResize()) {
|
||||
if (!has_frame() && resizable_) {
|
||||
auto* frame =
|
||||
static_cast<FramelessView*>(widget()->non_client_view()->frame_view());
|
||||
return frame->ResizingBorderHitTest(location) == HTNOWHERE;
|
||||
|
|
|
@ -185,7 +185,6 @@ class NativeWindowViews : public NativeWindow,
|
|||
// views::WidgetDelegate:
|
||||
void DeleteDelegate() override;
|
||||
views::View* GetInitiallyFocusedView() override;
|
||||
bool CanResize() const override;
|
||||
bool CanMaximize() const override;
|
||||
bool CanMinimize() const override;
|
||||
std::u16string GetWindowTitle() const override;
|
||||
|
|
|
@ -76,7 +76,7 @@ class AsarURLLoader : public network::mojom::URLLoader {
|
|||
const std::vector<std::string>& removed_headers,
|
||||
const net::HttpRequestHeaders& modified_headers,
|
||||
const net::HttpRequestHeaders& modified_cors_exempt_headers,
|
||||
const base::Optional<GURL>& new_url) override {}
|
||||
const absl::optional<GURL>& new_url) override {}
|
||||
void SetPriority(net::RequestPriority priority,
|
||||
int32_t intra_priority_value) override {}
|
||||
void PauseReadingBodyFromNet() override {}
|
||||
|
|
|
@ -25,7 +25,7 @@ void CertVerifierClient::Verify(
|
|||
const scoped_refptr<net::X509Certificate>& certificate,
|
||||
const std::string& hostname,
|
||||
int flags,
|
||||
const base::Optional<std::string>& ocsp_response,
|
||||
const absl::optional<std::string>& ocsp_response,
|
||||
VerifyCallback callback) {
|
||||
VerifyRequestParams params;
|
||||
params.hostname = hostname;
|
||||
|
|
|
@ -39,7 +39,7 @@ class CertVerifierClient : public network::mojom::CertVerifierClient {
|
|||
const scoped_refptr<net::X509Certificate>& certificate,
|
||||
const std::string& hostname,
|
||||
int flags,
|
||||
const base::Optional<std::string>& ocsp_response,
|
||||
const absl::optional<std::string>& ocsp_response,
|
||||
VerifyCallback callback) override;
|
||||
|
||||
private:
|
||||
|
|
|
@ -45,7 +45,7 @@ void NetworkContextService::ConfigureNetworkContextParams(
|
|||
network_context_params->user_agent = browser_context_->GetUserAgent();
|
||||
|
||||
network_context_params->cors_origin_access_list =
|
||||
content::BrowserContext::GetSharedCorsOriginAccessList(browser_context_)
|
||||
browser_context_->GetSharedCorsOriginAccessList()
|
||||
->GetOriginAccessList()
|
||||
.CreateCorsOriginAccessPatternsList();
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ class NodeStreamLoader : public network::mojom::URLLoader {
|
|||
const std::vector<std::string>& removed_headers,
|
||||
const net::HttpRequestHeaders& modified_headers,
|
||||
const net::HttpRequestHeaders& modified_cors_exempt_headers,
|
||||
const base::Optional<GURL>& new_url) override {}
|
||||
const absl::optional<GURL>& new_url) override {}
|
||||
void SetPriority(net::RequestPriority priority,
|
||||
int32_t intra_priority_value) override {}
|
||||
void PauseReadingBodyFromNet() override {}
|
||||
|
|
|
@ -88,11 +88,11 @@ ProxyingURLLoaderFactory::InProgressRequest::~InProgressRequest() {
|
|||
}
|
||||
if (on_before_send_headers_callback_) {
|
||||
std::move(on_before_send_headers_callback_)
|
||||
.Run(net::ERR_ABORTED, base::nullopt);
|
||||
.Run(net::ERR_ABORTED, absl::nullopt);
|
||||
}
|
||||
if (on_headers_received_callback_) {
|
||||
std::move(on_headers_received_callback_)
|
||||
.Run(net::ERR_ABORTED, base::nullopt, base::nullopt);
|
||||
.Run(net::ERR_ABORTED, absl::nullopt, absl::nullopt);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -178,7 +178,7 @@ void ProxyingURLLoaderFactory::InProgressRequest::FollowRedirect(
|
|||
const std::vector<std::string>& removed_headers,
|
||||
const net::HttpRequestHeaders& modified_headers,
|
||||
const net::HttpRequestHeaders& modified_cors_exempt_headers,
|
||||
const base::Optional<GURL>& new_url) {
|
||||
const absl::optional<GURL>& new_url) {
|
||||
if (new_url)
|
||||
request_.url = new_url.value();
|
||||
|
||||
|
@ -331,7 +331,7 @@ void ProxyingURLLoaderFactory::InProgressRequest::OnBeforeSendHeaders(
|
|||
const net::HttpRequestHeaders& headers,
|
||||
OnBeforeSendHeadersCallback callback) {
|
||||
if (!current_request_uses_header_client_) {
|
||||
std::move(callback).Run(net::OK, base::nullopt);
|
||||
std::move(callback).Run(net::OK, absl::nullopt);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -345,7 +345,7 @@ void ProxyingURLLoaderFactory::InProgressRequest::OnHeadersReceived(
|
|||
const net::IPEndPoint& remote_endpoint,
|
||||
OnHeadersReceivedCallback callback) {
|
||||
if (!current_request_uses_header_client_) {
|
||||
std::move(callback).Run(net::OK, base::nullopt, GURL());
|
||||
std::move(callback).Run(net::OK, absl::nullopt, GURL());
|
||||
|
||||
if (for_cors_preflight_) {
|
||||
// CORS preflight is supported only when "extraHeaders" is specified.
|
||||
|
@ -537,7 +537,7 @@ void ProxyingURLLoaderFactory::InProgressRequest::
|
|||
}
|
||||
|
||||
DCHECK(on_headers_received_callback_);
|
||||
base::Optional<std::string> headers;
|
||||
absl::optional<std::string> headers;
|
||||
if (override_headers_) {
|
||||
headers = override_headers_->raw_headers();
|
||||
if (current_request_uses_header_client_) {
|
||||
|
@ -754,7 +754,7 @@ ProxyingURLLoaderFactory::ProxyingURLLoaderFactory(
|
|||
int view_routing_id,
|
||||
uint64_t* request_id_generator,
|
||||
std::unique_ptr<extensions::ExtensionNavigationUIData> navigation_ui_data,
|
||||
base::Optional<int64_t> navigation_id,
|
||||
absl::optional<int64_t> navigation_id,
|
||||
network::mojom::URLLoaderFactoryRequest loader_request,
|
||||
mojo::PendingRemote<network::mojom::URLLoaderFactory> target_factory_remote,
|
||||
mojo::PendingReceiver<network::mojom::TrustedURLLoaderHeaderClient>
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "base/optional.h"
|
||||
#include "content/public/browser/content_browser_client.h"
|
||||
#include "content/public/browser/render_frame_host.h"
|
||||
#include "extensions/browser/api/web_request/web_request_info.h"
|
||||
|
@ -26,6 +25,7 @@
|
|||
#include "shell/browser/api/electron_api_web_request.h"
|
||||
#include "shell/browser/net/electron_url_loader_factory.h"
|
||||
#include "shell/browser/net/web_request_api_interface.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
namespace electron {
|
||||
|
||||
|
@ -69,7 +69,7 @@ class ProxyingURLLoaderFactory
|
|||
const std::vector<std::string>& removed_headers,
|
||||
const net::HttpRequestHeaders& modified_headers,
|
||||
const net::HttpRequestHeaders& modified_cors_exempt_headers,
|
||||
const base::Optional<GURL>& new_url) override;
|
||||
const absl::optional<GURL>& new_url) override;
|
||||
void SetPriority(net::RequestPriority priority,
|
||||
int32_t intra_priority_value) override;
|
||||
void PauseReadingBodyFromNet() override;
|
||||
|
@ -121,7 +121,7 @@ class ProxyingURLLoaderFactory
|
|||
|
||||
ProxyingURLLoaderFactory* factory_;
|
||||
network::ResourceRequest request_;
|
||||
const base::Optional<url::Origin> original_initiator_;
|
||||
const absl::optional<url::Origin> original_initiator_;
|
||||
const uint64_t request_id_ = 0;
|
||||
const int32_t view_routing_id_ = MSG_ROUTING_NONE;
|
||||
const int32_t frame_routing_id_ = MSG_ROUTING_NONE;
|
||||
|
@ -131,7 +131,7 @@ class ProxyingURLLoaderFactory
|
|||
mojo::Receiver<network::mojom::URLLoader> proxied_loader_receiver_;
|
||||
mojo::Remote<network::mojom::URLLoaderClient> target_client_;
|
||||
|
||||
base::Optional<extensions::WebRequestInfo> info_;
|
||||
absl::optional<extensions::WebRequestInfo> info_;
|
||||
|
||||
network::mojom::URLResponseHeadPtr current_response_;
|
||||
scoped_refptr<net::HttpResponseHeaders> override_headers_;
|
||||
|
@ -166,7 +166,7 @@ class ProxyingURLLoaderFactory
|
|||
std::vector<std::string> removed_headers;
|
||||
net::HttpRequestHeaders modified_headers;
|
||||
net::HttpRequestHeaders modified_cors_exempt_headers;
|
||||
base::Optional<GURL> new_url;
|
||||
absl::optional<GURL> new_url;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(FollowRedirectParams);
|
||||
};
|
||||
|
@ -185,7 +185,7 @@ class ProxyingURLLoaderFactory
|
|||
int view_routing_id,
|
||||
uint64_t* request_id_generator,
|
||||
std::unique_ptr<extensions::ExtensionNavigationUIData> navigation_ui_data,
|
||||
base::Optional<int64_t> navigation_id,
|
||||
absl::optional<int64_t> navigation_id,
|
||||
network::mojom::URLLoaderFactoryRequest loader_request,
|
||||
mojo::PendingRemote<network::mojom::URLLoaderFactory>
|
||||
target_factory_remote,
|
||||
|
@ -245,7 +245,7 @@ class ProxyingURLLoaderFactory
|
|||
const int view_routing_id_;
|
||||
uint64_t* request_id_generator_; // managed by ElectronBrowserClient
|
||||
std::unique_ptr<extensions::ExtensionNavigationUIData> navigation_ui_data_;
|
||||
base::Optional<int64_t> navigation_id_;
|
||||
absl::optional<int64_t> navigation_id_;
|
||||
mojo::ReceiverSet<network::mojom::URLLoaderFactory> proxy_receivers_;
|
||||
mojo::Remote<network::mojom::URLLoaderFactory> target_factory_;
|
||||
mojo::Receiver<network::mojom::TrustedURLLoaderHeaderClient>
|
||||
|
|
|
@ -44,17 +44,17 @@ ProxyingWebSocket::ProxyingWebSocket(
|
|||
/*is_download=*/false,
|
||||
/*is_async=*/true,
|
||||
/*is_service_worker_script=*/false,
|
||||
/*navigation_id=*/base::nullopt,
|
||||
/*navigation_id=*/absl::nullopt,
|
||||
/*ukm_source_id=*/ukm::kInvalidSourceIdObj)) {}
|
||||
|
||||
ProxyingWebSocket::~ProxyingWebSocket() {
|
||||
if (on_before_send_headers_callback_) {
|
||||
std::move(on_before_send_headers_callback_)
|
||||
.Run(net::ERR_ABORTED, base::nullopt);
|
||||
.Run(net::ERR_ABORTED, absl::nullopt);
|
||||
}
|
||||
if (on_headers_received_callback_) {
|
||||
std::move(on_headers_received_callback_)
|
||||
.Run(net::ERR_ABORTED, base::nullopt, GURL());
|
||||
.Run(net::ERR_ABORTED, absl::nullopt, GURL());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -230,7 +230,7 @@ void ProxyingWebSocket::StartProxying(
|
|||
WebSocketFactory factory,
|
||||
const GURL& url,
|
||||
const GURL& site_for_cookies,
|
||||
const base::Optional<std::string>& user_agent,
|
||||
const absl::optional<std::string>& user_agent,
|
||||
mojo::PendingRemote<network::mojom::WebSocketHandshakeClient>
|
||||
handshake_client,
|
||||
bool has_extra_headers,
|
||||
|
@ -359,11 +359,11 @@ void ProxyingWebSocket::OnHeadersReceivedComplete(int error_code) {
|
|||
}
|
||||
|
||||
if (on_headers_received_callback_) {
|
||||
base::Optional<std::string> headers;
|
||||
absl::optional<std::string> headers;
|
||||
if (override_headers_)
|
||||
headers = override_headers_->raw_headers();
|
||||
std::move(on_headers_received_callback_)
|
||||
.Run(net::OK, headers, base::nullopt);
|
||||
.Run(net::OK, headers, absl::nullopt);
|
||||
}
|
||||
|
||||
if (override_headers_) {
|
||||
|
@ -385,7 +385,7 @@ void ProxyingWebSocket::OnAuthRequiredComplete(AuthRequiredResponse rv) {
|
|||
switch (rv) {
|
||||
case AuthRequiredResponse::kNoAction:
|
||||
case AuthRequiredResponse::kCancelAuth:
|
||||
std::move(auth_required_callback_).Run(base::nullopt);
|
||||
std::move(auth_required_callback_).Run(absl::nullopt);
|
||||
break;
|
||||
|
||||
case AuthRequiredResponse::kSetAuth:
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "base/optional.h"
|
||||
#include "content/public/browser/content_browser_client.h"
|
||||
#include "extensions/browser/api/web_request/web_request_info.h"
|
||||
#include "mojo/public/cpp/bindings/pending_receiver.h"
|
||||
|
@ -19,6 +18,7 @@
|
|||
#include "services/network/public/mojom/network_context.mojom.h"
|
||||
#include "services/network/public/mojom/websocket.mojom.h"
|
||||
#include "shell/browser/net/web_request_api_interface.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "url/gurl.h"
|
||||
#include "url/origin.h"
|
||||
|
||||
|
@ -96,7 +96,7 @@ class ProxyingWebSocket : public network::mojom::WebSocketHandshakeClient,
|
|||
WebSocketFactory factory,
|
||||
const GURL& url,
|
||||
const GURL& site_for_cookies,
|
||||
const base::Optional<std::string>& user_agent,
|
||||
const absl::optional<std::string>& user_agent,
|
||||
mojo::PendingRemote<network::mojom::WebSocketHandshakeClient>
|
||||
handshake_client,
|
||||
bool has_extra_headers,
|
||||
|
|
|
@ -52,7 +52,7 @@ void ResolveProxyHelper::StartPendingRequest() {
|
|||
receiver_.BindNewPipeAndPassRemote();
|
||||
receiver_.set_disconnect_handler(
|
||||
base::BindOnce(&ResolveProxyHelper::OnProxyLookupComplete,
|
||||
base::Unretained(this), net::ERR_ABORTED, base::nullopt));
|
||||
base::Unretained(this), net::ERR_ABORTED, absl::nullopt));
|
||||
browser_context_->GetDefaultStoragePartition()
|
||||
->GetNetworkContext()
|
||||
->LookUpProxyForURL(pending_requests_.front().url,
|
||||
|
@ -62,7 +62,7 @@ void ResolveProxyHelper::StartPendingRequest() {
|
|||
|
||||
void ResolveProxyHelper::OnProxyLookupComplete(
|
||||
int32_t net_error,
|
||||
const base::Optional<net::ProxyInfo>& proxy_info) {
|
||||
const absl::optional<net::ProxyInfo>& proxy_info) {
|
||||
DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
||||
DCHECK(!pending_requests_.empty());
|
||||
|
||||
|
|
|
@ -9,9 +9,9 @@
|
|||
#include <string>
|
||||
|
||||
#include "base/memory/ref_counted.h"
|
||||
#include "base/optional.h"
|
||||
#include "mojo/public/cpp/bindings/receiver.h"
|
||||
#include "services/network/public/mojom/proxy_lookup_client.mojom.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "url/gurl.h"
|
||||
|
||||
namespace electron {
|
||||
|
@ -55,7 +55,7 @@ class ResolveProxyHelper
|
|||
// network::mojom::ProxyLookupClient implementation.
|
||||
void OnProxyLookupComplete(
|
||||
int32_t net_error,
|
||||
const base::Optional<net::ProxyInfo>& proxy_info) override;
|
||||
const absl::optional<net::ProxyInfo>& proxy_info) override;
|
||||
|
||||
// Self-reference. Owned as long as there's an outstanding proxy lookup.
|
||||
scoped_refptr<ResolveProxyHelper> owned_self_;
|
||||
|
|
|
@ -7,18 +7,14 @@
|
|||
|
||||
#include "base/macros.h"
|
||||
#include "base/memory/ref_counted.h"
|
||||
#include "base/optional.h"
|
||||
#include "chrome/browser/net/proxy_config_monitor.h"
|
||||
#include "mojo/public/cpp/bindings/remote.h"
|
||||
#include "services/network/public/cpp/shared_url_loader_factory.h"
|
||||
#include "services/network/public/mojom/network_context.mojom.h"
|
||||
#include "services/network/public/mojom/network_service.mojom.h"
|
||||
|
||||
namespace network {
|
||||
namespace mojom {
|
||||
class URLLoaderFactory;
|
||||
}
|
||||
class SharedURLLoaderFactory;
|
||||
} // namespace network
|
||||
#include "services/network/public/mojom/url_loader.mojom.h"
|
||||
#include "services/network/public/mojom/url_loader_factory.mojom.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
namespace net_log {
|
||||
class NetExportFileWriter;
|
||||
|
|
|
@ -62,7 +62,7 @@ class URLPipeLoader : public network::mojom::URLLoader,
|
|||
const std::vector<std::string>& removed_headers,
|
||||
const net::HttpRequestHeaders& modified_headers,
|
||||
const net::HttpRequestHeaders& modified_cors_exempt_headers,
|
||||
const base::Optional<GURL>& new_url) override {}
|
||||
const absl::optional<GURL>& new_url) override {}
|
||||
void SetPriority(net::RequestPriority priority,
|
||||
int32_t intra_priority_value) override {}
|
||||
void PauseReadingBodyFromNet() override {}
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
#include "base/callback_helpers.h"
|
||||
#include "base/location.h"
|
||||
#include "base/memory/ptr_util.h"
|
||||
#include "base/optional.h"
|
||||
#include "base/single_thread_task_runner.h"
|
||||
#include "base/task/post_task.h"
|
||||
#include "base/time/time.h"
|
||||
|
@ -32,6 +31,7 @@
|
|||
#include "content/public/browser/render_process_host.h"
|
||||
#include "gpu/command_buffer/client/gl_helper.h"
|
||||
#include "media/base/video_frame.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "third_party/blink/public/common/input/web_input_event.h"
|
||||
#include "third_party/skia/include/core/SkCanvas.h"
|
||||
#include "ui/compositor/compositor.h"
|
||||
|
@ -195,7 +195,7 @@ OffScreenRenderWidgetHostView::OffScreenRenderWidgetHostView(
|
|||
{display::Display(display::kDefaultDisplayId)},
|
||||
display::kDefaultDisplayId, display::kDefaultDisplayId);
|
||||
}
|
||||
display::Display current_display = *display_list_.GetCurrentDisplayIterator();
|
||||
display::Display current_display = display_list_.GetCurrentDisplay();
|
||||
current_display.set_device_scale_factor(kDefaultScaleFactor);
|
||||
display_list_.UpdateDisplay(current_display);
|
||||
|
||||
|
@ -353,7 +353,7 @@ void OffScreenRenderWidgetHostView::SetBackgroundColor(SkColor color) {
|
|||
}
|
||||
}
|
||||
|
||||
base::Optional<SkColor> OffScreenRenderWidgetHostView::GetBackgroundColor() {
|
||||
absl::optional<SkColor> OffScreenRenderWidgetHostView::GetBackgroundColor() {
|
||||
return background_color_;
|
||||
}
|
||||
|
||||
|
@ -498,9 +498,9 @@ gfx::Rect OffScreenRenderWidgetHostView::GetBoundsInRootWindow() {
|
|||
return gfx::Rect(size_);
|
||||
}
|
||||
|
||||
base::Optional<content::DisplayFeature>
|
||||
absl::optional<content::DisplayFeature>
|
||||
OffScreenRenderWidgetHostView::GetDisplayFeature() {
|
||||
return base::nullopt;
|
||||
return absl::nullopt;
|
||||
}
|
||||
|
||||
void OffScreenRenderWidgetHostView::SetDisplayFeatureForTesting(
|
||||
|
@ -1001,7 +1001,7 @@ void OffScreenRenderWidgetHostView::ResizeRootLayer(bool force) {
|
|||
{display::Display(display::kDefaultDisplayId)},
|
||||
display::kDefaultDisplayId, display::kDefaultDisplayId);
|
||||
}
|
||||
display::Display current_display = *display_list_.GetCurrentDisplayIterator();
|
||||
display::Display current_display = display_list_.GetCurrentDisplay();
|
||||
current_display.set_device_scale_factor(scaleFactor);
|
||||
display_list_.UpdateDisplay(current_display);
|
||||
|
||||
|
|
|
@ -88,7 +88,7 @@ class OffScreenRenderWidgetHostView : public content::RenderWidgetHostViewBase,
|
|||
gfx::Size GetVisibleViewportSize() override;
|
||||
void SetInsets(const gfx::Insets&) override;
|
||||
void SetBackgroundColor(SkColor color) override;
|
||||
base::Optional<SkColor> GetBackgroundColor() override;
|
||||
absl::optional<SkColor> GetBackgroundColor() override;
|
||||
void UpdateBackgroundColor() override;
|
||||
blink::mojom::PointerLockResult LockMouse(
|
||||
bool request_unadjusted_movement) override;
|
||||
|
@ -130,7 +130,7 @@ class OffScreenRenderWidgetHostView : public content::RenderWidgetHostViewBase,
|
|||
void GetScreenInfo(blink::ScreenInfo* screen_info) override;
|
||||
void TransformPointToRootSurface(gfx::PointF* point) override;
|
||||
gfx::Rect GetBoundsInRootWindow(void) override;
|
||||
base::Optional<content::DisplayFeature> GetDisplayFeature() override;
|
||||
absl::optional<content::DisplayFeature> GetDisplayFeature() override;
|
||||
void SetDisplayFeatureForTesting(
|
||||
const content::DisplayFeature* display_feature) override;
|
||||
viz::SurfaceId GetCurrentSurfaceId() const override;
|
||||
|
|
|
@ -111,7 +111,7 @@ void OffScreenVideoConsumer::OnFrameCaptured(
|
|||
new FramePinner{std::move(mapping), callbacks_remote.Unbind()});
|
||||
bitmap.setImmutable();
|
||||
|
||||
base::Optional<gfx::Rect> update_rect = info->metadata.capture_update_rect;
|
||||
absl::optional<gfx::Rect> update_rect = info->metadata.capture_update_rect;
|
||||
if (!update_rect.has_value() || update_rect->IsEmpty()) {
|
||||
update_rect = content_rect;
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
|
||||
#include <vector>
|
||||
|
||||
#include "base/containers/contains.h"
|
||||
#include "base/values.h"
|
||||
#include "content/public/common/webplugininfo.h"
|
||||
#include "extensions/buildflags/buildflags.h"
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
#include <utility>
|
||||
|
||||
#include "base/base64.h"
|
||||
#include "base/containers/contains.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "base/values.h"
|
||||
#include "content/public/browser/device_service.h"
|
||||
|
|
|
@ -31,7 +31,7 @@ bool StringToAccelerator(const std::string& shortcut,
|
|||
// Now, parse it into an accelerator.
|
||||
int modifiers = ui::EF_NONE;
|
||||
ui::KeyboardCode key = ui::VKEY_UNKNOWN;
|
||||
base::Optional<char16_t> shifted_char;
|
||||
absl::optional<char16_t> shifted_char;
|
||||
for (const auto& token : tokens) {
|
||||
ui::KeyboardCode code = electron::KeyboardCodeFromStr(token, &shifted_char);
|
||||
if (shifted_char)
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
#include "base/mac/scoped_nsobject.h"
|
||||
#include "base/optional.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "ui/gfx/geometry/point.h"
|
||||
|
||||
// Custom Quit, Minimize and Full Screen button container for frameless
|
||||
|
@ -22,8 +22,8 @@
|
|||
base::scoped_nsobject<NSTrackingArea> tracking_area_;
|
||||
}
|
||||
|
||||
- (id)initWithMargin:(const base::Optional<gfx::Point>&)margin;
|
||||
- (void)setMargin:(const base::Optional<gfx::Point>&)margin;
|
||||
- (id)initWithMargin:(const absl::optional<gfx::Point>&)margin;
|
||||
- (void)setMargin:(const absl::optional<gfx::Point>&)margin;
|
||||
- (void)setShowOnHover:(BOOL)yes;
|
||||
- (void)setNeedsDisplayForButtons;
|
||||
@end
|
||||
|
|
|
@ -23,7 +23,7 @@ const NSWindowButton kButtonTypes[] = {
|
|||
|
||||
@implementation WindowButtonsView
|
||||
|
||||
- (id)initWithMargin:(const base::Optional<gfx::Point>&)margin {
|
||||
- (id)initWithMargin:(const absl::optional<gfx::Point>&)margin {
|
||||
self = [super initWithFrame:NSZeroRect];
|
||||
[self setMargin:margin];
|
||||
|
||||
|
@ -50,7 +50,7 @@ const NSWindowButton kButtonTypes[] = {
|
|||
return self;
|
||||
}
|
||||
|
||||
- (void)setMargin:(const base::Optional<gfx::Point>&)margin {
|
||||
- (void)setMargin:(const absl::optional<gfx::Point>&)margin {
|
||||
margin_ = margin.value_or(gfx::Point(7, 3));
|
||||
}
|
||||
|
||||
|
|
|
@ -98,7 +98,7 @@ void ElectronMenuModel::SetSharingItem(SharingItem item) {
|
|||
sharing_item_.emplace(std::move(item));
|
||||
}
|
||||
|
||||
const base::Optional<ElectronMenuModel::SharingItem>&
|
||||
const absl::optional<ElectronMenuModel::SharingItem>&
|
||||
ElectronMenuModel::GetSharingItem() const {
|
||||
return sharing_item_;
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
#include "base/memory/weak_ptr.h"
|
||||
#include "base/observer_list.h"
|
||||
#include "base/observer_list_types.h"
|
||||
#include "base/optional.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "ui/base/models/simple_menu_model.h"
|
||||
#include "url/gurl.h"
|
||||
|
||||
|
@ -28,9 +28,9 @@ class ElectronMenuModel : public ui::SimpleMenuModel {
|
|||
SharingItem(const SharingItem&) = delete;
|
||||
~SharingItem();
|
||||
|
||||
base::Optional<std::vector<std::string>> texts;
|
||||
base::Optional<std::vector<GURL>> urls;
|
||||
base::Optional<std::vector<base::FilePath>> file_paths;
|
||||
absl::optional<std::vector<std::string>> texts;
|
||||
absl::optional<std::vector<GURL>> urls;
|
||||
absl::optional<std::vector<base::FilePath>> file_paths;
|
||||
};
|
||||
#endif
|
||||
|
||||
|
@ -93,7 +93,7 @@ class ElectronMenuModel : public ui::SimpleMenuModel {
|
|||
bool GetSharingItemAt(int index, SharingItem* item) const;
|
||||
// Set/Get the SharingItem of this menu.
|
||||
void SetSharingItem(SharingItem item);
|
||||
const base::Optional<SharingItem>& GetSharingItem() const;
|
||||
const absl::optional<SharingItem>& GetSharingItem() const;
|
||||
#endif
|
||||
|
||||
// ui::SimpleMenuModel:
|
||||
|
@ -111,7 +111,7 @@ class ElectronMenuModel : public ui::SimpleMenuModel {
|
|||
Delegate* delegate_; // weak ref.
|
||||
|
||||
#if defined(OS_MAC)
|
||||
base::Optional<SharingItem> sharing_item_;
|
||||
absl::optional<SharingItem> sharing_item_;
|
||||
#endif
|
||||
|
||||
std::map<int, std::u16string> toolTips_; // command id -> tooltip
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
namespace file_dialog {
|
||||
|
||||
static GModule* gtk_module;
|
||||
static base::Optional<bool> supports_gtk_file_chooser_native;
|
||||
static absl::optional<bool> supports_gtk_file_chooser_native;
|
||||
|
||||
using dl_gtk_native_dialog_show_t = void (*)(void*);
|
||||
using dl_gtk_native_dialog_destroy_t = void (*)(void*);
|
||||
|
|
|
@ -18,7 +18,7 @@ namespace electron {
|
|||
|
||||
class TrayIcon {
|
||||
public:
|
||||
static TrayIcon* Create(base::Optional<UUID> guid);
|
||||
static TrayIcon* Create(absl::optional<UUID> guid);
|
||||
|
||||
#if defined(OS_WIN)
|
||||
using ImageType = HICON;
|
||||
|
|
|
@ -385,7 +385,7 @@ gfx::Rect TrayIconCocoa::GetBounds() {
|
|||
}
|
||||
|
||||
// static
|
||||
TrayIcon* TrayIcon::Create(base::Optional<UUID> guid) {
|
||||
TrayIcon* TrayIcon::Create(absl::optional<UUID> guid) {
|
||||
return new TrayIconCocoa;
|
||||
}
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@ bool TrayIconGtk::HasClickAction() {
|
|||
}
|
||||
|
||||
// static
|
||||
TrayIcon* TrayIcon::Create(base::Optional<UUID> guid) {
|
||||
TrayIcon* TrayIcon::Create(absl::optional<UUID> guid) {
|
||||
return new TrayIconGtk;
|
||||
}
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
namespace electron {
|
||||
|
||||
// static
|
||||
TrayIcon* TrayIcon::Create(base::Optional<UUID> guid) {
|
||||
TrayIcon* TrayIcon::Create(absl::optional<UUID> guid) {
|
||||
static NotifyIconHost host;
|
||||
return host.CreateNotifyIcon(guid);
|
||||
}
|
||||
|
|
|
@ -148,8 +148,8 @@ bool AutofillPopupView::CanStartDragForView(views::View*,
|
|||
}
|
||||
|
||||
void AutofillPopupView::OnSelectedRowChanged(
|
||||
base::Optional<int> previous_row_selection,
|
||||
base::Optional<int> current_row_selection) {
|
||||
absl::optional<int> previous_row_selection,
|
||||
absl::optional<int> current_row_selection) {
|
||||
SchedulePaint();
|
||||
|
||||
if (current_row_selection) {
|
||||
|
@ -442,7 +442,7 @@ void AutofillPopupView::AcceptSelection(const gfx::Point& point) {
|
|||
AcceptSelectedLine();
|
||||
}
|
||||
|
||||
void AutofillPopupView::SetSelectedLine(base::Optional<int> selected_line) {
|
||||
void AutofillPopupView::SetSelectedLine(absl::optional<int> selected_line) {
|
||||
if (!popup_)
|
||||
return;
|
||||
if (selected_line_ == selected_line)
|
||||
|
@ -485,7 +485,7 @@ void AutofillPopupView::SelectPreviousLine() {
|
|||
}
|
||||
|
||||
void AutofillPopupView::ClearSelection() {
|
||||
SetSelectedLine(base::nullopt);
|
||||
SetSelectedLine(absl::nullopt);
|
||||
}
|
||||
|
||||
void AutofillPopupView::RemoveObserver() {
|
||||
|
|
|
@ -9,10 +9,10 @@
|
|||
|
||||
#include "shell/browser/ui/autofill_popup.h"
|
||||
|
||||
#include "base/optional.h"
|
||||
#include "content/public/browser/native_web_keyboard_event.h"
|
||||
#include "content/public/browser/render_widget_host.h"
|
||||
#include "electron/buildflags/buildflags.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "ui/accessibility/ax_node_data.h"
|
||||
#include "ui/views/drag_controller.h"
|
||||
#include "ui/views/focus/widget_focus_manager.h"
|
||||
|
@ -80,8 +80,8 @@ class AutofillPopupView : public views::WidgetDelegateView,
|
|||
private:
|
||||
friend class AutofillPopup;
|
||||
|
||||
void OnSelectedRowChanged(base::Optional<int> previous_row_selection,
|
||||
base::Optional<int> current_row_selection);
|
||||
void OnSelectedRowChanged(absl::optional<int> previous_row_selection,
|
||||
absl::optional<int> current_row_selection);
|
||||
|
||||
// Draw the given autofill entry in |entry_rect|.
|
||||
void DrawAutofillEntry(gfx::Canvas* canvas,
|
||||
|
@ -118,7 +118,7 @@ class AutofillPopupView : public views::WidgetDelegateView,
|
|||
void AcceptSuggestion(int index);
|
||||
bool AcceptSelectedLine();
|
||||
void AcceptSelection(const gfx::Point& point);
|
||||
void SetSelectedLine(base::Optional<int> selected_line);
|
||||
void SetSelectedLine(absl::optional<int> selected_line);
|
||||
void SetSelection(const gfx::Point& point);
|
||||
void SelectNextLine();
|
||||
void SelectPreviousLine();
|
||||
|
@ -137,7 +137,7 @@ class AutofillPopupView : public views::WidgetDelegateView,
|
|||
base::Time show_time_;
|
||||
|
||||
// The index of the currently selected line
|
||||
base::Optional<int> selected_line_;
|
||||
absl::optional<int> selected_line_;
|
||||
|
||||
#if BUILDFLAG(ENABLE_OSR)
|
||||
std::unique_ptr<OffscreenViewProxy> view_proxy_;
|
||||
|
|
|
@ -43,7 +43,6 @@ class DevToolsWindowDelegate : public views::ClientView,
|
|||
// views::WidgetDelegate:
|
||||
void DeleteDelegate() override { delete this; }
|
||||
views::View* GetInitiallyFocusedView() override { return view_; }
|
||||
bool CanResize() const override { return true; }
|
||||
bool CanMaximize() const override { return true; }
|
||||
bool CanMinimize() const override { return true; }
|
||||
std::u16string GetWindowTitle() const override { return shell_->GetTitle(); }
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
#include "base/callback_helpers.h"
|
||||
#include "base/command_line.h"
|
||||
#include "base/json/json_writer.h"
|
||||
#include "base/optional.h"
|
||||
#include "base/strings/pattern.h"
|
||||
#include "base/strings/string_number_conversions.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
|
@ -41,6 +40,7 @@
|
|||
#include "net/base/escape.h"
|
||||
#include "shell/browser/native_window.h"
|
||||
#include "shell/browser/window_list.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "ui/accessibility/platform/ax_platform_node.h"
|
||||
#include "ui/accessibility/platform/ax_platform_node_delegate.h"
|
||||
#include "ui/base/webui/web_ui_util.h"
|
||||
|
|
|
@ -87,7 +87,7 @@ NotifyIconHost::~NotifyIconHost() {
|
|||
delete ptr;
|
||||
}
|
||||
|
||||
NotifyIcon* NotifyIconHost::CreateNotifyIcon(base::Optional<UUID> guid) {
|
||||
NotifyIcon* NotifyIconHost::CreateNotifyIcon(absl::optional<UUID> guid) {
|
||||
if (guid.has_value()) {
|
||||
for (NotifyIcons::const_iterator i(notify_icons_.begin());
|
||||
i != notify_icons_.end(); ++i) {
|
||||
|
|
|
@ -10,8 +10,8 @@
|
|||
#include <vector>
|
||||
|
||||
#include "base/macros.h"
|
||||
#include "base/optional.h"
|
||||
#include "shell/common/gin_converters/guid_converter.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
const GUID GUID_DEFAULT = {0, 0, 0, {0, 0, 0, 0, 0, 0, 0, 0}};
|
||||
|
||||
|
@ -24,7 +24,7 @@ class NotifyIconHost {
|
|||
NotifyIconHost();
|
||||
~NotifyIconHost();
|
||||
|
||||
NotifyIcon* CreateNotifyIcon(base::Optional<UUID> guid);
|
||||
NotifyIcon* CreateNotifyIcon(absl::optional<UUID> guid);
|
||||
void Remove(NotifyIcon* notify_icon);
|
||||
|
||||
private:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue