chore: used nested namespaces (#34737)

This commit is contained in:
David Sanders 2022-06-29 12:55:47 -07:00 committed by GitHub
parent 0d4e417594
commit 5d120359f6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
122 changed files with 246 additions and 738 deletions

View file

@ -19,17 +19,13 @@ TEMPLATE_H = """
#define FUSE_EXPORT __attribute__((visibility("default"))) #define FUSE_EXPORT __attribute__((visibility("default")))
#endif #endif
namespace electron { namespace electron::fuses {
namespace fuses {
extern const volatile char kFuseWire[]; extern const volatile char kFuseWire[];
{getters} {getters}
} // namespace fuses } // namespace electron::fuses
} // namespace electron
#endif // ELECTRON_FUSES_H_ #endif // ELECTRON_FUSES_H_
""" """
@ -37,17 +33,13 @@ extern const volatile char kFuseWire[];
TEMPLATE_CC = """ TEMPLATE_CC = """
#include "electron/fuses.h" #include "electron/fuses.h"
namespace electron { namespace electron::fuses {
namespace fuses {
const volatile char kFuseWire[] = { /* sentinel */ {sentinel}, /* fuse_version */ {fuse_version}, /* fuse_wire_length */ {fuse_wire_length}, /* fuse_wire */ {initial_config}}; const volatile char kFuseWire[] = { /* sentinel */ {sentinel}, /* fuse_version */ {fuse_version}, /* fuse_wire_length */ {fuse_wire_length}, /* fuse_wire */ {initial_config}};
{getters} {getters}
} } // namespace electron:fuses
}
""" """
with open(os.path.join(dir_path, "fuses.json5"), 'r') as f: with open(os.path.join(dir_path, "fuses.json5"), 'r') as f:

View file

@ -8,9 +8,7 @@ TEMPLATE = """
#include "node_native_module.h" #include "node_native_module.h"
#include "node_internals.h" #include "node_internals.h"
namespace node {{ namespace node::native_module {{
namespace native_module {{
{definitions} {definitions}
@ -18,9 +16,7 @@ void NativeModuleLoader::LoadEmbedderJavaScriptSource() {{
{initializers} {initializers}
}} }}
}} // namespace native_module }} // namespace node::native_module
}} // namespace node
""" """
def main(): def main():

View file

@ -453,9 +453,7 @@ struct Converter<net::SecureDnsMode> {
}; };
} // namespace gin } // namespace gin
namespace electron { namespace electron::api {
namespace api {
gin::WrapperInfo App::kWrapperInfo = {gin::kEmbedderNativeGin}; gin::WrapperInfo App::kWrapperInfo = {gin::kEmbedderNativeGin};
@ -1822,9 +1820,7 @@ const char* App::GetTypeName() {
return "App"; return "App";
} }
} // namespace api } // namespace electron::api
} // namespace electron
namespace { namespace {

View file

@ -13,9 +13,7 @@
#import <Cocoa/Cocoa.h> #import <Cocoa/Cocoa.h>
#import <sys/sysctl.h> #import <sys/sysctl.h>
namespace electron { namespace electron::api {
namespace api {
void App::SetAppLogsPath(gin_helper::ErrorThrower thrower, void App::SetAppLogsPath(gin_helper::ErrorThrower thrower,
absl::optional<base::FilePath> custom_path) { absl::optional<base::FilePath> custom_path) {
@ -82,6 +80,4 @@ bool App::IsRunningUnderARM64Translation() const {
return proc_translated == 1; return proc_translated == 1;
} }
} // namespace api } // namespace electron::api
} // namespace electron

View file

@ -10,9 +10,7 @@
#include "base/strings/sys_string_conversions.h" #include "base/strings/sys_string_conversions.h"
namespace electron { namespace electron::api {
namespace api {
// Callback passed to js which will stop accessing the given bookmark. // Callback passed to js which will stop accessing the given bookmark.
void OnStopAccessingSecurityScopedResource(NSURL* bookmarkUrl) { void OnStopAccessingSecurityScopedResource(NSURL* bookmarkUrl) {
@ -64,6 +62,4 @@ base::RepeatingCallback<void()> App::StartAccessingSecurityScopedResource(
bookmarkUrl); bookmarkUrl);
} }
} // namespace api } // namespace electron::api
} // namespace electron

View file

@ -16,9 +16,7 @@
#include "shell/common/gin_helper/object_template_builder.h" #include "shell/common/gin_helper/object_template_builder.h"
#include "shell/common/node_includes.h" #include "shell/common/node_includes.h"
namespace electron { namespace electron::api {
namespace api {
gin::WrapperInfo AutoUpdater::kWrapperInfo = {gin::kEmbedderNativeGin}; gin::WrapperInfo AutoUpdater::kWrapperInfo = {gin::kEmbedderNativeGin};
@ -134,9 +132,7 @@ const char* AutoUpdater::GetTypeName() {
return "AutoUpdater"; return "AutoUpdater";
} }
} // namespace api } // namespace electron::api
} // namespace electron
namespace { namespace {

View file

@ -13,9 +13,7 @@
#include "shell/browser/event_emitter_mixin.h" #include "shell/browser/event_emitter_mixin.h"
#include "shell/browser/window_list_observer.h" #include "shell/browser/window_list_observer.h"
namespace electron { namespace electron::api {
namespace api {
class AutoUpdater : public gin::Wrappable<AutoUpdater>, class AutoUpdater : public gin::Wrappable<AutoUpdater>,
public gin_helper::EventEmitterMixin<AutoUpdater>, public gin_helper::EventEmitterMixin<AutoUpdater>,
@ -60,8 +58,6 @@ class AutoUpdater : public gin::Wrappable<AutoUpdater>,
void QuitAndInstall(); void QuitAndInstall();
}; };
} // namespace api } // namespace electron::api
} // namespace electron
#endif // ELECTRON_SHELL_BROWSER_API_ELECTRON_API_AUTO_UPDATER_H_ #endif // ELECTRON_SHELL_BROWSER_API_ELECTRON_API_AUTO_UPDATER_H_

View file

@ -58,9 +58,7 @@ struct Converter<electron::TaskbarHost::ThumbarButton> {
} // namespace gin } // namespace gin
#endif #endif
namespace electron { namespace electron::api {
namespace api {
namespace { namespace {
@ -1323,9 +1321,7 @@ void BaseWindow::BuildPrototype(v8::Isolate* isolate,
.SetProperty("id", &BaseWindow::GetID); .SetProperty("id", &BaseWindow::GetID);
} }
} // namespace api } // namespace electron::api
} // namespace electron
namespace { namespace {

View file

@ -19,9 +19,7 @@
#include "shell/common/gin_helper/error_thrower.h" #include "shell/common/gin_helper/error_thrower.h"
#include "shell/common/gin_helper/trackable_object.h" #include "shell/common/gin_helper/trackable_object.h"
namespace electron { namespace electron::api {
namespace api {
class View; class View;
@ -282,8 +280,6 @@ class BaseWindow : public gin_helper::TrackableObject<BaseWindow>,
base::WeakPtrFactory<BaseWindow> weak_factory_{this}; base::WeakPtrFactory<BaseWindow> weak_factory_{this};
}; };
} // namespace api } // namespace electron::api
} // namespace electron
#endif // ELECTRON_SHELL_BROWSER_API_ELECTRON_API_BASE_WINDOW_H_ #endif // ELECTRON_SHELL_BROWSER_API_ELECTRON_API_BASE_WINDOW_H_

View file

@ -67,9 +67,7 @@ int32_t GetNextId() {
} // namespace } // namespace
namespace electron { namespace electron::api {
namespace api {
gin::WrapperInfo BrowserView::kWrapperInfo = {gin::kEmbedderNativeGin}; gin::WrapperInfo BrowserView::kWrapperInfo = {gin::kEmbedderNativeGin};
@ -200,9 +198,7 @@ v8::Local<v8::ObjectTemplate> BrowserView::FillObjectTemplate(
.Build(); .Build();
} }
} // namespace api } // namespace electron::api
} // namespace electron
namespace { namespace {

View file

@ -28,9 +28,7 @@ namespace gin_helper {
class Dictionary; class Dictionary;
} }
namespace electron { namespace electron::api {
namespace api {
class WebContents; class WebContents;
@ -90,8 +88,6 @@ class BrowserView : public gin::Wrappable<BrowserView>,
int32_t id_; int32_t id_;
}; };
} // namespace api } // namespace electron::api
} // namespace electron
#endif // ELECTRON_SHELL_BROWSER_API_ELECTRON_API_BROWSER_VIEW_H_ #endif // ELECTRON_SHELL_BROWSER_API_ELECTRON_API_BROWSER_VIEW_H_

View file

@ -33,9 +33,7 @@
#include "shell/browser/ui/views/win_frame_view.h" #include "shell/browser/ui/views/win_frame_view.h"
#endif #endif
namespace electron { namespace electron::api {
namespace api {
BrowserWindow::BrowserWindow(gin::Arguments* args, BrowserWindow::BrowserWindow(gin::Arguments* args,
const gin_helper::Dictionary& options) const gin_helper::Dictionary& options)
@ -607,9 +605,7 @@ v8::Local<v8::Value> BrowserWindow::From(v8::Isolate* isolate,
return v8::Null(isolate); return v8::Null(isolate);
} }
} // namespace api } // namespace electron::api
} // namespace electron
namespace { namespace {

View file

@ -14,9 +14,7 @@
#include "shell/browser/ui/drag_util.h" #include "shell/browser/ui/drag_util.h"
#include "shell/common/gin_helper/error_thrower.h" #include "shell/common/gin_helper/error_thrower.h"
namespace electron { namespace electron::api {
namespace api {
class BrowserWindow : public BaseWindow, class BrowserWindow : public BaseWindow,
public content::RenderWidgetHost::InputEventObserver, public content::RenderWidgetHost::InputEventObserver,
@ -133,8 +131,6 @@ class BrowserWindow : public BaseWindow,
base::WeakPtrFactory<BrowserWindow> weak_factory_{this}; base::WeakPtrFactory<BrowserWindow> weak_factory_{this};
}; };
} // namespace api } // namespace electron::api
} // namespace electron
#endif // ELECTRON_SHELL_BROWSER_API_ELECTRON_API_BROWSER_WINDOW_H_ #endif // ELECTRON_SHELL_BROWSER_API_ELECTRON_API_BROWSER_WINDOW_H_

View file

@ -15,9 +15,7 @@
#include "shell/browser/ui/cocoa/electron_inspectable_web_contents_view.h" #include "shell/browser/ui/cocoa/electron_inspectable_web_contents_view.h"
#include "shell/browser/ui/inspectable_web_contents_view.h" #include "shell/browser/ui/inspectable_web_contents_view.h"
namespace electron { namespace electron::api {
namespace api {
void BrowserWindow::OverrideNSWindowContentView( void BrowserWindow::OverrideNSWindowContentView(
InspectableWebContentsView* view) { InspectableWebContentsView* view) {
@ -102,6 +100,4 @@ void BrowserWindow::UpdateDraggableRegions(
[[webView window] setMovableByWindowBackground:YES]; [[webView window] setMovableByWindowBackground:YES];
} }
} // namespace api } // namespace electron::api
} // namespace electron

View file

@ -8,9 +8,7 @@
#include "shell/browser/native_window_views.h" #include "shell/browser/native_window_views.h"
#include "ui/aura/window.h" #include "ui/aura/window.h"
namespace electron { namespace electron::api {
namespace api {
void BrowserWindow::UpdateDraggableRegions( void BrowserWindow::UpdateDraggableRegions(
const std::vector<mojom::DraggableRegionPtr>& regions) { const std::vector<mojom::DraggableRegionPtr>& regions) {
@ -36,6 +34,4 @@ void BrowserWindow::UpdateDraggableRegions(
->UpdateDraggableRegions(draggable_regions_); ->UpdateDraggableRegions(draggable_regions_);
} }
} // namespace api } // namespace electron::api
} // namespace electron

View file

@ -91,9 +91,7 @@ struct Converter<net::CookieChangeCause> {
} // namespace gin } // namespace gin
namespace electron { namespace electron::api {
namespace api {
namespace { namespace {
@ -397,6 +395,4 @@ const char* Cookies::GetTypeName() {
return "Cookies"; return "Cookies";
} }
} // namespace api } // namespace electron::api
} // namespace electron

View file

@ -64,11 +64,7 @@ bool g_crash_reporter_initialized = false;
} // namespace } // namespace
namespace electron { namespace electron::api::crash_reporter {
namespace api {
namespace crash_reporter {
#if defined(MAS_BUILD) #if defined(MAS_BUILD)
namespace { namespace {
@ -196,11 +192,7 @@ void Start(const std::string& submit_url,
#endif #endif
} }
} // namespace crash_reporter } // namespace electron::api::crash_reporter
} // namespace api
} // namespace electron
namespace { namespace {

View file

@ -9,11 +9,7 @@
#include <string> #include <string>
#include "base/files/file_path.h" #include "base/files/file_path.h"
namespace electron { namespace electron::api::crash_reporter {
namespace api {
namespace crash_reporter {
bool IsCrashReporterEnabled(); bool IsCrashReporterEnabled();
@ -32,10 +28,6 @@ void Start(const std::string& submit_url,
const std::map<std::string, std::string>& extra, const std::map<std::string, std::string>& extra,
bool is_node_process); bool is_node_process);
} // namespace crash_reporter } // namespace electron::api::crash_reporter
} // namespace api
} // namespace electron
#endif // ELECTRON_SHELL_BROWSER_API_ELECTRON_API_CRASH_REPORTER_H_ #endif // ELECTRON_SHELL_BROWSER_API_ELECTRON_API_CRASH_REPORTER_H_

View file

@ -18,9 +18,7 @@
#include "shell/common/node_includes.h" #include "shell/common/node_includes.h"
namespace electron { namespace electron::api {
namespace api {
namespace { namespace {
@ -181,6 +179,4 @@ gin::Handle<DataPipeHolder> DataPipeHolder::From(v8::Isolate* isolate,
return gin::Handle<DataPipeHolder>(); return gin::Handle<DataPipeHolder>();
} }
} // namespace api } // namespace electron::api
} // namespace electron

View file

@ -13,9 +13,7 @@
#include "services/network/public/cpp/data_element.h" #include "services/network/public/cpp/data_element.h"
#include "services/network/public/mojom/data_pipe_getter.mojom.h" #include "services/network/public/mojom/data_pipe_getter.mojom.h"
namespace electron { namespace electron::api {
namespace api {
// Retains reference to the data pipe. // Retains reference to the data pipe.
class DataPipeHolder : public gin::Wrappable<DataPipeHolder> { class DataPipeHolder : public gin::Wrappable<DataPipeHolder> {
@ -49,8 +47,6 @@ class DataPipeHolder : public gin::Wrappable<DataPipeHolder> {
mojo::Remote<network::mojom::DataPipeGetter> data_pipe_; mojo::Remote<network::mojom::DataPipeGetter> data_pipe_;
}; };
} // namespace api } // namespace electron::api
} // namespace electron
#endif // ELECTRON_SHELL_BROWSER_API_ELECTRON_API_DATA_PIPE_HOLDER_H_ #endif // ELECTRON_SHELL_BROWSER_API_ELECTRON_API_DATA_PIPE_HOLDER_H_

View file

@ -20,9 +20,7 @@
using content::DevToolsAgentHost; using content::DevToolsAgentHost;
namespace electron { namespace electron::api {
namespace api {
gin::WrapperInfo Debugger::kWrapperInfo = {gin::kEmbedderNativeGin}; gin::WrapperInfo Debugger::kWrapperInfo = {gin::kEmbedderNativeGin};
@ -206,6 +204,4 @@ const char* Debugger::GetTypeName() {
return "Debugger"; return "Debugger";
} }
} // namespace api } // namespace electron::api
} // namespace electron

View file

@ -22,9 +22,7 @@ class DevToolsAgentHost;
class WebContents; class WebContents;
} // namespace content } // namespace content
namespace electron { namespace electron::api {
namespace api {
class Debugger : public gin::Wrappable<Debugger>, class Debugger : public gin::Wrappable<Debugger>,
public gin_helper::EventEmitterMixin<Debugger>, public gin_helper::EventEmitterMixin<Debugger>,
@ -74,8 +72,6 @@ class Debugger : public gin::Wrappable<Debugger>,
int previous_request_id_ = 0; int previous_request_id_ = 0;
}; };
} // namespace api } // namespace electron::api
} // namespace electron
#endif // ELECTRON_SHELL_BROWSER_API_ELECTRON_API_DEBUGGER_H_ #endif // ELECTRON_SHELL_BROWSER_API_ELECTRON_API_DEBUGGER_H_

View file

@ -59,9 +59,7 @@ struct Converter<electron::api::DesktopCapturer::Source> {
} // namespace gin } // namespace gin
namespace electron { namespace electron::api {
namespace api {
gin::WrapperInfo DesktopCapturer::kWrapperInfo = {gin::kEmbedderNativeGin}; gin::WrapperInfo DesktopCapturer::kWrapperInfo = {gin::kEmbedderNativeGin};
@ -217,9 +215,7 @@ const char* DesktopCapturer::GetTypeName() {
return "DesktopCapturer"; return "DesktopCapturer";
} }
} // namespace api } // namespace electron::api
} // namespace electron
namespace { namespace {

View file

@ -15,9 +15,7 @@
#include "gin/wrappable.h" #include "gin/wrappable.h"
#include "shell/common/gin_helper/pinnable.h" #include "shell/common/gin_helper/pinnable.h"
namespace electron { namespace electron::api {
namespace api {
class DesktopCapturer : public gin::Wrappable<DesktopCapturer>, class DesktopCapturer : public gin::Wrappable<DesktopCapturer>,
public gin_helper::Pinnable<DesktopCapturer>, public gin_helper::Pinnable<DesktopCapturer>,
@ -77,8 +75,6 @@ class DesktopCapturer : public gin::Wrappable<DesktopCapturer>,
base::WeakPtrFactory<DesktopCapturer> weak_ptr_factory_{this}; base::WeakPtrFactory<DesktopCapturer> weak_ptr_factory_{this};
}; };
} // namespace api } // namespace electron::api
} // namespace electron
#endif // ELECTRON_SHELL_BROWSER_API_ELECTRON_API_DESKTOP_CAPTURER_H_ #endif // ELECTRON_SHELL_BROWSER_API_ELECTRON_API_DESKTOP_CAPTURER_H_

View file

@ -48,9 +48,7 @@ struct Converter<download::DownloadItem::DownloadState> {
} // namespace gin } // namespace gin
namespace electron { namespace electron::api {
namespace api {
namespace { namespace {
@ -301,6 +299,4 @@ gin::Handle<DownloadItem> DownloadItem::FromOrCreate(
return handle; return handle;
} }
} // namespace api } // namespace electron::api
} // namespace electron

View file

@ -18,9 +18,7 @@
class GURL; class GURL;
namespace electron { namespace electron::api {
namespace api {
class DownloadItem : public gin::Wrappable<DownloadItem>, class DownloadItem : public gin::Wrappable<DownloadItem>,
public gin_helper::Pinnable<DownloadItem>, public gin_helper::Pinnable<DownloadItem>,
@ -87,8 +85,6 @@ class DownloadItem : public gin::Wrappable<DownloadItem>,
base::WeakPtrFactory<DownloadItem> weak_factory_{this}; base::WeakPtrFactory<DownloadItem> weak_factory_{this};
}; };
} // namespace api } // namespace electron::api
} // namespace electron
#endif // ELECTRON_SHELL_BROWSER_API_ELECTRON_API_DOWNLOAD_ITEM_H_ #endif // ELECTRON_SHELL_BROWSER_API_ELECTRON_API_DOWNLOAD_ITEM_H_

View file

@ -51,9 +51,7 @@ bool MapHasMediaKeys(
} // namespace } // namespace
namespace electron { namespace electron::api {
namespace api {
gin::WrapperInfo GlobalShortcut::kWrapperInfo = {gin::kEmbedderNativeGin}; gin::WrapperInfo GlobalShortcut::kWrapperInfo = {gin::kEmbedderNativeGin};
@ -182,9 +180,7 @@ const char* GlobalShortcut::GetTypeName() {
return "GlobalShortcut"; return "GlobalShortcut";
} }
} // namespace api } // namespace electron::api
} // namespace electron
namespace { namespace {

View file

@ -14,9 +14,7 @@
#include "gin/wrappable.h" #include "gin/wrappable.h"
#include "ui/base/accelerators/accelerator.h" #include "ui/base/accelerators/accelerator.h"
namespace electron { namespace electron::api {
namespace api {
class GlobalShortcut : public extensions::GlobalShortcutListener::Observer, class GlobalShortcut : public extensions::GlobalShortcutListener::Observer,
public gin::Wrappable<GlobalShortcut> { public gin::Wrappable<GlobalShortcut> {
@ -56,8 +54,6 @@ class GlobalShortcut : public extensions::GlobalShortcutListener::Observer,
AcceleratorCallbackMap accelerator_callback_map_; AcceleratorCallbackMap accelerator_callback_map_;
}; };
} // namespace api } // namespace electron::api
} // namespace electron
#endif // ELECTRON_SHELL_BROWSER_API_ELECTRON_API_GLOBAL_SHORTCUT_H_ #endif // ELECTRON_SHELL_BROWSER_API_ELECTRON_API_GLOBAL_SHORTCUT_H_

View file

@ -135,9 +135,7 @@ struct Converter<in_app_purchase::Product> {
} // namespace gin } // namespace gin
namespace electron { namespace electron::api {
namespace api {
gin::WrapperInfo InAppPurchase::kWrapperInfo = {gin::kEmbedderNativeGin}; gin::WrapperInfo InAppPurchase::kWrapperInfo = {gin::kEmbedderNativeGin};
@ -211,9 +209,7 @@ void InAppPurchase::OnTransactionsUpdated(
} }
#endif #endif
} // namespace api } // namespace electron::api
} // namespace electron
namespace { namespace {

View file

@ -16,9 +16,7 @@
#include "shell/browser/mac/in_app_purchase_product.h" #include "shell/browser/mac/in_app_purchase_product.h"
#include "v8/include/v8.h" #include "v8/include/v8.h"
namespace electron { namespace electron::api {
namespace api {
class InAppPurchase : public gin::Wrappable<InAppPurchase>, class InAppPurchase : public gin::Wrappable<InAppPurchase>,
public gin_helper::EventEmitterMixin<InAppPurchase>, public gin_helper::EventEmitterMixin<InAppPurchase>,
@ -51,8 +49,6 @@ class InAppPurchase : public gin::Wrappable<InAppPurchase>,
const std::vector<in_app_purchase::Transaction>& transactions) override; const std::vector<in_app_purchase::Transaction>& transactions) override;
}; };
} // namespace api } // namespace electron::api
} // namespace electron
#endif // ELECTRON_SHELL_BROWSER_API_ELECTRON_API_IN_APP_PURCHASE_H_ #endif // ELECTRON_SHELL_BROWSER_API_ELECTRON_API_IN_APP_PURCHASE_H_

View file

@ -44,9 +44,7 @@ struct Converter<SharingItem> {
#endif #endif
namespace electron { namespace electron::api {
namespace api {
gin::WrapperInfo Menu::kWrapperInfo = {gin::kEmbedderNativeGin}; gin::WrapperInfo Menu::kWrapperInfo = {gin::kEmbedderNativeGin};
@ -301,9 +299,7 @@ v8::Local<v8::ObjectTemplate> Menu::FillObjectTemplate(
.Build(); .Build();
} }
} // namespace api } // namespace electron::api
} // namespace electron
namespace { namespace {

View file

@ -16,9 +16,7 @@
#include "shell/common/gin_helper/constructible.h" #include "shell/common/gin_helper/constructible.h"
#include "shell/common/gin_helper/pinnable.h" #include "shell/common/gin_helper/pinnable.h"
namespace electron { namespace electron::api {
namespace api {
class Menu : public gin::Wrappable<Menu>, class Menu : public gin::Wrappable<Menu>,
public gin_helper::EventEmitterMixin<Menu>, public gin_helper::EventEmitterMixin<Menu>,
@ -123,9 +121,7 @@ class Menu : public gin::Wrappable<Menu>,
bool WorksWhenHiddenAt(int index) const; bool WorksWhenHiddenAt(int index) const;
}; };
} // namespace api } // namespace electron::api
} // namespace electron
namespace gin { namespace gin {

View file

@ -13,9 +13,7 @@
using base::scoped_nsobject; using base::scoped_nsobject;
namespace electron { namespace electron::api {
namespace api {
class MenuMac : public Menu { class MenuMac : public Menu {
protected: protected:
@ -50,8 +48,6 @@ class MenuMac : public Menu {
base::WeakPtrFactory<MenuMac> weak_factory_{this}; base::WeakPtrFactory<MenuMac> weak_factory_{this};
}; };
} // namespace api } // namespace electron::api
} // namespace electron
#endif // ELECTRON_SHELL_BROWSER_API_ELECTRON_API_MENU_MAC_H_ #endif // ELECTRON_SHELL_BROWSER_API_ELECTRON_API_MENU_MAC_H_

View file

@ -42,9 +42,7 @@ ui::Accelerator GetAcceleratorFromKeyEquivalentAndModifierMask(
} // namespace } // namespace
namespace electron { namespace electron::api {
namespace api {
MenuMac::MenuMac(gin::Arguments* args) : Menu(args) {} MenuMac::MenuMac(gin::Arguments* args) : Menu(args) {}
@ -262,6 +260,4 @@ gin::Handle<Menu> Menu::New(gin::Arguments* args) {
return handle; return handle;
} }
} // namespace api } // namespace electron::api
} // namespace electron

View file

@ -13,9 +13,7 @@
using views::MenuRunner; using views::MenuRunner;
namespace electron { namespace electron::api {
namespace api {
MenuViews::MenuViews(gin::Arguments* args) : Menu(args) {} MenuViews::MenuViews(gin::Arguments* args) : Menu(args) {}
@ -91,6 +89,4 @@ gin::Handle<Menu> Menu::New(gin::Arguments* args) {
return handle; return handle;
} }
} // namespace api } // namespace electron::api
} // namespace electron

View file

@ -13,9 +13,7 @@
#include "ui/display/screen.h" #include "ui/display/screen.h"
#include "ui/views/controls/menu/menu_runner.h" #include "ui/views/controls/menu/menu_runner.h"
namespace electron { namespace electron::api {
namespace api {
class MenuViews : public Menu { class MenuViews : public Menu {
public: public:
@ -39,8 +37,6 @@ class MenuViews : public Menu {
base::WeakPtrFactory<MenuViews> weak_factory_{this}; base::WeakPtrFactory<MenuViews> weak_factory_{this};
}; };
} // namespace api } // namespace electron::api
} // namespace electron
#endif // ELECTRON_SHELL_BROWSER_API_ELECTRON_API_MENU_VIEWS_H_ #endif // ELECTRON_SHELL_BROWSER_API_ELECTRON_API_MENU_VIEWS_H_

View file

@ -16,9 +16,7 @@
#include "ui/gfx/color_utils.h" #include "ui/gfx/color_utils.h"
#include "ui/native_theme/native_theme.h" #include "ui/native_theme/native_theme.h"
namespace electron { namespace electron::api {
namespace api {
gin::WrapperInfo NativeTheme::kWrapperInfo = {gin::kEmbedderNativeGin}; gin::WrapperInfo NativeTheme::kWrapperInfo = {gin::kEmbedderNativeGin};
@ -117,9 +115,7 @@ const char* NativeTheme::GetTypeName() {
return "NativeTheme"; return "NativeTheme";
} }
} // namespace api } // namespace electron::api
} // namespace electron
namespace { namespace {

View file

@ -11,9 +11,7 @@
#include "ui/native_theme/native_theme.h" #include "ui/native_theme/native_theme.h"
#include "ui/native_theme/native_theme_observer.h" #include "ui/native_theme/native_theme_observer.h"
namespace electron { namespace electron::api {
namespace api {
class NativeTheme : public gin::Wrappable<NativeTheme>, class NativeTheme : public gin::Wrappable<NativeTheme>,
public gin_helper::EventEmitterMixin<NativeTheme>, public gin_helper::EventEmitterMixin<NativeTheme>,
@ -57,9 +55,7 @@ class NativeTheme : public gin::Wrappable<NativeTheme>,
ui::NativeTheme* web_theme_; ui::NativeTheme* web_theme_;
}; };
} // namespace api } // namespace electron::api
} // namespace electron
namespace gin { namespace gin {

View file

@ -7,9 +7,7 @@
#include "base/mac/sdk_forward_declarations.h" #include "base/mac/sdk_forward_declarations.h"
#include "shell/browser/mac/electron_application.h" #include "shell/browser/mac/electron_application.h"
namespace electron { namespace electron::api {
namespace api {
void NativeTheme::UpdateMacOSAppearanceForOverrideValue( void NativeTheme::UpdateMacOSAppearanceForOverrideValue(
ui::NativeTheme::ThemeSource override) { ui::NativeTheme::ThemeSource override) {
@ -32,6 +30,4 @@ void NativeTheme::UpdateMacOSAppearanceForOverrideValue(
} }
} }
} // namespace api } // namespace electron::api
} // namespace electron

View file

@ -45,9 +45,7 @@ struct Converter<electron::NotificationAction> {
} // namespace gin } // namespace gin
namespace electron { namespace electron::api {
namespace api {
gin::WrapperInfo Notification::kWrapperInfo = {gin::kEmbedderNativeGin}; gin::WrapperInfo Notification::kWrapperInfo = {gin::kEmbedderNativeGin};
@ -284,9 +282,7 @@ v8::Local<v8::ObjectTemplate> Notification::FillObjectTemplate(
.Build(); .Build();
} }
} // namespace api } // namespace electron::api
} // namespace electron
namespace { namespace {

View file

@ -25,9 +25,7 @@ template <typename T>
class Handle; class Handle;
} // namespace gin } // namespace gin
namespace electron { namespace electron::api {
namespace api {
class Notification : public gin::Wrappable<Notification>, class Notification : public gin::Wrappable<Notification>,
public gin_helper::EventEmitterMixin<Notification>, public gin_helper::EventEmitterMixin<Notification>,
@ -117,8 +115,6 @@ class Notification : public gin::Wrappable<Notification>,
base::WeakPtr<electron::Notification> notification_; base::WeakPtr<electron::Notification> notification_;
}; };
} // namespace api } // namespace electron::api
} // namespace electron
#endif // ELECTRON_SHELL_BROWSER_API_ELECTRON_API_NOTIFICATION_H_ #endif // ELECTRON_SHELL_BROWSER_API_ELECTRON_API_NOTIFICATION_H_

View file

@ -35,9 +35,7 @@ struct Converter<ui::IdleState> {
} // namespace gin } // namespace gin
namespace electron { namespace electron::api {
namespace api {
gin::WrapperInfo PowerMonitor::kWrapperInfo = {gin::kEmbedderNativeGin}; gin::WrapperInfo PowerMonitor::kWrapperInfo = {gin::kEmbedderNativeGin};
@ -116,9 +114,7 @@ const char* PowerMonitor::GetTypeName() {
return "PowerMonitor"; return "PowerMonitor";
} }
} // namespace api } // namespace electron::api
} // namespace electron
namespace { namespace {

View file

@ -15,9 +15,7 @@
#include "shell/browser/lib/power_observer_linux.h" #include "shell/browser/lib/power_observer_linux.h"
#endif #endif
namespace electron { namespace electron::api {
namespace api {
class PowerMonitor : public gin::Wrappable<PowerMonitor>, class PowerMonitor : public gin::Wrappable<PowerMonitor>,
public gin_helper::EventEmitterMixin<PowerMonitor>, public gin_helper::EventEmitterMixin<PowerMonitor>,
@ -86,8 +84,6 @@ class PowerMonitor : public gin::Wrappable<PowerMonitor>,
#endif #endif
}; };
} // namespace api } // namespace electron::api
} // namespace electron
#endif // ELECTRON_SHELL_BROWSER_API_ELECTRON_API_POWER_MONITOR_H_ #endif // ELECTRON_SHELL_BROWSER_API_ELECTRON_API_POWER_MONITOR_H_

View file

@ -108,9 +108,7 @@
@end @end
namespace electron { namespace electron::api {
namespace api {
static MacLockMonitor* g_lock_monitor = nil; static MacLockMonitor* g_lock_monitor = nil;
@ -120,6 +118,4 @@ void PowerMonitor::InitPlatformSpecificMonitors() {
[g_lock_monitor addEmitter:this]; [g_lock_monitor addEmitter:this];
} }
} // namespace api } // namespace electron::api
} // namespace electron

View file

@ -37,9 +37,7 @@ struct Converter<device::mojom::WakeLockType> {
} // namespace gin } // namespace gin
namespace electron { namespace electron::api {
namespace api {
gin::WrapperInfo PowerSaveBlocker::kWrapperInfo = {gin::kEmbedderNativeGin}; gin::WrapperInfo PowerSaveBlocker::kWrapperInfo = {gin::kEmbedderNativeGin};
@ -126,9 +124,7 @@ gin::ObjectTemplateBuilder PowerSaveBlocker::GetObjectTemplateBuilder(
.SetMethod("isStarted", &PowerSaveBlocker::IsStarted); .SetMethod("isStarted", &PowerSaveBlocker::IsStarted);
} }
} // namespace api } // namespace electron::api
} // namespace electron
namespace { namespace {

View file

@ -13,9 +13,7 @@
#include "mojo/public/cpp/bindings/remote.h" #include "mojo/public/cpp/bindings/remote.h"
#include "services/device/public/mojom/wake_lock.mojom.h" #include "services/device/public/mojom/wake_lock.mojom.h"
namespace electron { namespace electron::api {
namespace api {
class PowerSaveBlocker : public gin::Wrappable<PowerSaveBlocker> { class PowerSaveBlocker : public gin::Wrappable<PowerSaveBlocker> {
public: public:
@ -56,8 +54,6 @@ class PowerSaveBlocker : public gin::Wrappable<PowerSaveBlocker> {
mojo::Remote<device::mojom::WakeLock> wake_lock_; mojo::Remote<device::mojom::WakeLock> wake_lock_;
}; };
} // namespace api } // namespace electron::api
} // namespace electron
#endif // ELECTRON_SHELL_BROWSER_API_ELECTRON_API_POWER_SAVE_BLOCKER_H_ #endif // ELECTRON_SHELL_BROWSER_API_ELECTRON_API_POWER_SAVE_BLOCKER_H_

View file

@ -38,9 +38,7 @@ struct Converter<printing::PrinterBasicInfo> {
} // namespace gin } // namespace gin
namespace electron { namespace electron::api {
namespace api {
#if BUILDFLAG(ENABLE_PRINTING) #if BUILDFLAG(ENABLE_PRINTING)
printing::PrinterList GetPrinterList(v8::Isolate* isolate) { printing::PrinterList GetPrinterList(v8::Isolate* isolate) {
@ -89,9 +87,7 @@ v8::Local<v8::Promise> GetPrinterListAsync(v8::Isolate* isolate) {
} }
#endif #endif
} // namespace api } // namespace electron::api
} // namespace electron
namespace { namespace {

View file

@ -78,8 +78,7 @@ struct Converter<CustomScheme> {
} // namespace gin } // namespace gin
namespace electron { namespace electron::api {
namespace api {
gin::WrapperInfo Protocol::kWrapperInfo = {gin::kEmbedderNativeGin}; gin::WrapperInfo Protocol::kWrapperInfo = {gin::kEmbedderNativeGin};
@ -312,8 +311,7 @@ const char* Protocol::GetTypeName() {
return "Protocol"; return "Protocol";
} }
} // namespace api } // namespace electron::api
} // namespace electron
namespace { namespace {

View file

@ -15,9 +15,7 @@
#include "shell/common/node_includes.h" #include "shell/common/node_includes.h"
#include "shell/common/platform_util.h" #include "shell/common/platform_util.h"
namespace electron { namespace electron::safestorage {
namespace safestorage {
static const char* kEncryptionVersionPrefixV10 = "v10"; static const char* kEncryptionVersionPrefixV10 = "v10";
static const char* kEncryptionVersionPrefixV11 = "v11"; static const char* kEncryptionVersionPrefixV11 = "v11";
@ -119,9 +117,7 @@ std::string DecryptString(v8::Isolate* isolate, v8::Local<v8::Value> buffer) {
return plaintext; return plaintext;
} }
} // namespace safestorage } // namespace electron::safestorage
} // namespace electron
void Initialize(v8::Local<v8::Object> exports, void Initialize(v8::Local<v8::Object> exports,
v8::Local<v8::Value> unused, v8::Local<v8::Value> unused,

View file

@ -7,9 +7,7 @@
#include "base/dcheck_is_on.h" #include "base/dcheck_is_on.h"
namespace electron { namespace electron::safestorage {
namespace safestorage {
// Used in a DCHECK to validate that our assumption that the network context // Used in a DCHECK to validate that our assumption that the network context
// manager has initialized before app ready holds true. Only used in the // manager has initialized before app ready holds true. Only used in the
@ -18,8 +16,6 @@ namespace safestorage {
void SetElectronCryptoReady(bool ready); void SetElectronCryptoReady(bool ready);
#endif #endif
} // namespace safestorage } // namespace electron::safestorage
} // namespace electron
#endif // ELECTRON_SHELL_BROWSER_API_ELECTRON_API_SAFE_STORAGE_H_ #endif // ELECTRON_SHELL_BROWSER_API_ELECTRON_API_SAFE_STORAGE_H_

View file

@ -24,9 +24,7 @@
#include "ui/display/win/screen_win.h" #include "ui/display/win/screen_win.h"
#endif #endif
namespace electron { namespace electron::api {
namespace api {
gin::WrapperInfo Screen::kWrapperInfo = {gin::kEmbedderNativeGin}; gin::WrapperInfo Screen::kWrapperInfo = {gin::kEmbedderNativeGin};
@ -166,9 +164,7 @@ const char* Screen::GetTypeName() {
return "Screen"; return "Screen";
} }
} // namespace api } // namespace electron::api
} // namespace electron
namespace { namespace {

View file

@ -19,9 +19,7 @@ class Rect;
class Screen; class Screen;
} // namespace gfx } // namespace gfx
namespace electron { namespace electron::api {
namespace api {
class Screen : public gin::Wrappable<Screen>, class Screen : public gin::Wrappable<Screen>,
public gin_helper::EventEmitterMixin<Screen>, public gin_helper::EventEmitterMixin<Screen>,
@ -58,8 +56,6 @@ class Screen : public gin::Wrappable<Screen>,
display::Screen* screen_; display::Screen* screen_;
}; };
} // namespace api } // namespace electron::api
} // namespace electron
#endif // ELECTRON_SHELL_BROWSER_API_ELECTRON_API_SCREEN_H_ #endif // ELECTRON_SHELL_BROWSER_API_ELECTRON_API_SCREEN_H_

View file

@ -21,9 +21,7 @@
#include "shell/common/gin_helper/function_template_extensions.h" #include "shell/common/gin_helper/function_template_extensions.h"
#include "shell/common/node_includes.h" #include "shell/common/node_includes.h"
namespace electron { namespace electron::api {
namespace api {
namespace { namespace {
@ -162,6 +160,4 @@ const char* ServiceWorkerContext::GetTypeName() {
return "ServiceWorkerContext"; return "ServiceWorkerContext";
} }
} // namespace api } // namespace electron::api
} // namespace electron

View file

@ -242,9 +242,7 @@ struct Converter<network::mojom::SSLConfigPtr> {
} // namespace gin } // namespace gin
namespace electron { namespace electron::api {
namespace api {
namespace { namespace {
@ -1255,9 +1253,7 @@ const char* Session::GetTypeName() {
return "Session"; return "Session";
} }
} // namespace api } // namespace electron::api
} // namespace electron
namespace { namespace {

View file

@ -13,9 +13,7 @@
#include "ui/gfx/color_utils.h" #include "ui/gfx/color_utils.h"
#include "ui/native_theme/native_theme.h" #include "ui/native_theme/native_theme.h"
namespace electron { namespace electron::api {
namespace api {
gin::WrapperInfo SystemPreferences::kWrapperInfo = {gin::kEmbedderNativeGin}; gin::WrapperInfo SystemPreferences::kWrapperInfo = {gin::kEmbedderNativeGin};
@ -117,9 +115,7 @@ const char* SystemPreferences::GetTypeName() {
return "SystemPreferences"; return "SystemPreferences";
} }
} // namespace api } // namespace electron::api
} // namespace electron
namespace { namespace {

View file

@ -21,9 +21,7 @@
#include "ui/gfx/sys_color_change_listener.h" #include "ui/gfx/sys_color_change_listener.h"
#endif #endif
namespace electron { namespace electron::api {
namespace api {
#if BUILDFLAG(IS_MAC) #if BUILDFLAG(IS_MAC)
enum class NotificationCenterKind { enum class NotificationCenterKind {
@ -168,8 +166,6 @@ class SystemPreferences
#endif #endif
}; };
} // namespace api } // namespace electron::api
} // namespace electron
#endif // ELECTRON_SHELL_BROWSER_API_ELECTRON_API_SYSTEM_PREFERENCES_H_ #endif // ELECTRON_SHELL_BROWSER_API_ELECTRON_API_SYSTEM_PREFERENCES_H_

View file

@ -86,9 +86,7 @@ struct Converter<NSAppearance*> {
} // namespace gin } // namespace gin
namespace electron { namespace electron::api {
namespace api {
namespace { namespace {
@ -657,6 +655,4 @@ void SystemPreferences::SetAppLevelAppearance(gin::Arguments* args) {
} }
} }
} // namespace api } // namespace electron::api
} // namespace electron

View file

@ -56,9 +56,7 @@ struct Converter<electron::TrayIcon::IconType> {
} // namespace gin } // namespace gin
namespace electron { namespace electron::api {
namespace api {
gin::WrapperInfo Tray::kWrapperInfo = {gin::kEmbedderNativeGin}; gin::WrapperInfo Tray::kWrapperInfo = {gin::kEmbedderNativeGin};
@ -422,9 +420,7 @@ v8::Local<v8::ObjectTemplate> Tray::FillObjectTemplate(
.Build(); .Build();
} }
} // namespace api } // namespace electron::api
} // namespace electron
namespace { namespace {

View file

@ -29,9 +29,7 @@ namespace gin_helper {
class Dictionary; class Dictionary;
} }
namespace electron { namespace electron::api {
namespace api {
class Menu; class Menu;
@ -113,8 +111,6 @@ class Tray : public gin::Wrappable<Tray>,
std::unique_ptr<TrayIcon> tray_icon_; std::unique_ptr<TrayIcon> tray_icon_;
}; };
} // namespace api } // namespace electron::api
} // namespace electron
#endif // ELECTRON_SHELL_BROWSER_API_ELECTRON_API_TRAY_H_ #endif // ELECTRON_SHELL_BROWSER_API_ELECTRON_API_TRAY_H_

View file

@ -70,9 +70,7 @@ struct Converter<network::mojom::CredentialsMode> {
} // namespace gin } // namespace gin
namespace electron { namespace electron::api {
namespace api {
namespace { namespace {
@ -614,6 +612,4 @@ const char* SimpleURLLoaderWrapper::GetTypeName() {
return "SimpleURLLoaderWrapper"; return "SimpleURLLoaderWrapper";
} }
} // namespace api } // namespace electron::api
} // namespace electron

View file

@ -33,9 +33,7 @@ class SimpleURLLoader;
struct ResourceRequest; struct ResourceRequest;
} // namespace network } // namespace network
namespace electron { namespace electron::api {
namespace api {
/** Wraps a SimpleURLLoader to make it usable from JavaScript */ /** Wraps a SimpleURLLoader to make it usable from JavaScript */
class SimpleURLLoaderWrapper class SimpleURLLoaderWrapper
@ -123,8 +121,6 @@ class SimpleURLLoaderWrapper
base::WeakPtrFactory<SimpleURLLoaderWrapper> weak_factory_{this}; base::WeakPtrFactory<SimpleURLLoaderWrapper> weak_factory_{this};
}; };
} // namespace api } // namespace electron::api
} // namespace electron
#endif // ELECTRON_SHELL_BROWSER_API_ELECTRON_API_URL_LOADER_H_ #endif // ELECTRON_SHELL_BROWSER_API_ELECTRON_API_URL_LOADER_H_

View file

@ -8,9 +8,7 @@
#include "shell/common/gin_helper/object_template_builder.h" #include "shell/common/gin_helper/object_template_builder.h"
#include "shell/common/node_includes.h" #include "shell/common/node_includes.h"
namespace electron { namespace electron::api {
namespace api {
View::View(views::View* view) : view_(view) { View::View(views::View* view) : view_(view) {
view_->set_owned_by_client(); view_->set_owned_by_client();
@ -55,9 +53,7 @@ void View::BuildPrototype(v8::Isolate* isolate,
#endif #endif
} }
} // namespace api } // namespace electron::api
} // namespace electron
namespace { namespace {

View file

@ -12,9 +12,7 @@
#include "shell/common/gin_helper/wrappable.h" #include "shell/common/gin_helper/wrappable.h"
#include "ui/views/view.h" #include "ui/views/view.h"
namespace electron { namespace electron::api {
namespace api {
class View : public gin_helper::Wrappable<View> { class View : public gin_helper::Wrappable<View> {
public: public:
@ -49,8 +47,6 @@ class View : public gin_helper::Wrappable<View> {
views::View* view_ = nullptr; views::View* view_ = nullptr;
}; };
} // namespace api } // namespace electron::api
} // namespace electron
#endif // ELECTRON_SHELL_BROWSER_API_ELECTRON_API_VIEW_H_ #endif // ELECTRON_SHELL_BROWSER_API_ELECTRON_API_VIEW_H_

View file

@ -372,9 +372,7 @@ struct Converter<scoped_refptr<content::DevToolsAgentHost>> {
} // namespace gin } // namespace gin
namespace electron { namespace electron::api {
namespace api {
namespace { namespace {
@ -4145,9 +4143,7 @@ WebContents* WebContents::FromID(int32_t id) {
// static // static
gin::WrapperInfo WebContents::kWrapperInfo = {gin::kEmbedderNativeGin}; gin::WrapperInfo WebContents::kWrapperInfo = {gin::kEmbedderNativeGin};
} // namespace api } // namespace electron::api
} // namespace electron
namespace { namespace {

View file

@ -17,9 +17,7 @@
// have to isolate the usage of WebContentsImpl into a clean file to fix it: // have to isolate the usage of WebContentsImpl into a clean file to fix it:
// error C2371: 'ssize_t': redefinition; different basic types // error C2371: 'ssize_t': redefinition; different basic types
namespace electron { namespace electron::api {
namespace api {
void WebContents::DetachFromOuterFrame() { void WebContents::DetachFromOuterFrame() {
// See detach_webview_frame.patch on how to detach. // See detach_webview_frame.patch on how to detach.
@ -55,6 +53,4 @@ OffScreenRenderWidgetHostView* WebContents::GetOffScreenRenderWidgetHostView()
} }
#endif #endif
} // namespace api } // namespace electron::api
} // namespace electron

View file

@ -15,9 +15,7 @@
- (void)redispatchKeyEvent:(NSEvent*)event; - (void)redispatchKeyEvent:(NSEvent*)event;
@end @end
namespace electron { namespace electron::api {
namespace api {
bool WebContents::IsFocused() const { bool WebContents::IsFocused() const {
auto* view = web_contents()->GetRenderWidgetHostView(); auto* view = web_contents()->GetRenderWidgetHostView();
@ -81,6 +79,4 @@ bool WebContents::PlatformHandleKeyboardEvent(
return false; return false;
} }
} // namespace api } // namespace electron::api
} // namespace electron

View file

@ -19,9 +19,7 @@
#include "shell/browser/ui/cocoa/delayed_native_view_host.h" #include "shell/browser/ui/cocoa/delayed_native_view_host.h"
#endif #endif
namespace electron { namespace electron::api {
namespace api {
WebContentsView::WebContentsView(v8::Isolate* isolate, WebContentsView::WebContentsView(v8::Isolate* isolate,
gin::Handle<WebContents> web_contents) gin::Handle<WebContents> web_contents)
@ -105,9 +103,7 @@ void WebContentsView::BuildPrototype(
.SetProperty("webContents", &WebContentsView::GetWebContents); .SetProperty("webContents", &WebContentsView::GetWebContents);
} }
} // namespace api } // namespace electron::api
} // namespace electron
namespace { namespace {

View file

@ -12,9 +12,7 @@ namespace gin_helper {
class Dictionary; class Dictionary;
} }
namespace electron { namespace electron::api {
namespace api {
class WebContents; class WebContents;
@ -53,8 +51,6 @@ class WebContentsView : public View, public content::WebContentsObserver {
api::WebContents* api_web_contents_; api::WebContents* api_web_contents_;
}; };
} // namespace api } // namespace electron::api
} // namespace electron
#endif // ELECTRON_SHELL_BROWSER_API_ELECTRON_API_WEB_CONTENTS_VIEW_H_ #endif // ELECTRON_SHELL_BROWSER_API_ELECTRON_API_WEB_CONTENTS_VIEW_H_

View file

@ -52,9 +52,7 @@ struct Converter<blink::mojom::PageVisibilityState> {
} // namespace gin } // namespace gin
namespace electron { namespace electron::api {
namespace api {
typedef std::unordered_map<int, WebFrameMain*> WebFrameMainIdMap; typedef std::unordered_map<int, WebFrameMain*> WebFrameMainIdMap;
@ -391,9 +389,7 @@ const char* WebFrameMain::GetTypeName() {
return "WebFrameMain"; return "WebFrameMain";
} }
} // namespace api } // namespace electron::api
} // namespace electron
namespace { namespace {

View file

@ -28,9 +28,7 @@ namespace gin {
class Arguments; class Arguments;
} }
namespace electron { namespace electron::api {
namespace api {
class WebContents; class WebContents;
@ -131,8 +129,6 @@ class WebFrameMain : public gin::Wrappable<WebFrameMain>,
base::WeakPtrFactory<WebFrameMain> weak_factory_{this}; base::WeakPtrFactory<WebFrameMain> weak_factory_{this};
}; };
} // namespace api } // namespace electron::api
} // namespace electron
#endif // ELECTRON_SHELL_BROWSER_API_ELECTRON_API_WEB_FRAME_MAIN_H_ #endif // ELECTRON_SHELL_BROWSER_API_ELECTRON_API_WEB_FRAME_MAIN_H_

View file

@ -81,9 +81,7 @@ struct Converter<extensions::WebRequestResourceType> {
} // namespace gin } // namespace gin
namespace electron { namespace electron::api {
namespace api {
namespace { namespace {
@ -551,6 +549,4 @@ gin::Handle<WebRequest> WebRequest::From(
return gin::CreateHandle(isolate, user_data->data); return gin::CreateHandle(isolate, user_data->data);
} }
} // namespace api } // namespace electron::api
} // namespace electron

View file

@ -19,9 +19,7 @@ namespace content {
class BrowserContext; class BrowserContext;
} }
namespace electron { namespace electron::api {
namespace api {
class WebRequest : public gin::Wrappable<WebRequest>, public WebRequestAPI { class WebRequest : public gin::Wrappable<WebRequest>, public WebRequestAPI {
public: public:
@ -151,8 +149,6 @@ class WebRequest : public gin::Wrappable<WebRequest>, public WebRequestAPI {
content::BrowserContext* browser_context_; content::BrowserContext* browser_context_;
}; };
} // namespace api } // namespace electron::api
} // namespace electron
#endif // ELECTRON_SHELL_BROWSER_API_ELECTRON_API_WEB_REQUEST_H_ #endif // ELECTRON_SHELL_BROWSER_API_ELECTRON_API_WEB_REQUEST_H_

View file

@ -17,9 +17,7 @@
#include "ui/gfx/image/image.h" #include "ui/gfx/image/image.h"
#include "ui/gfx/skbitmap_operations.h" #include "ui/gfx/skbitmap_operations.h"
namespace electron { namespace electron::api {
namespace api {
constexpr static int kMaxFrameRate = 30; constexpr static int kMaxFrameRate = 30;
@ -180,6 +178,4 @@ gfx::Size FrameSubscriber::GetRenderViewSize() const {
gfx::ScaleSize(gfx::SizeF(size), view->GetDeviceScaleFactor())); gfx::ScaleSize(gfx::SizeF(size), view->GetDeviceScaleFactor()));
} }
} // namespace api } // namespace electron::api
} // namespace electron

View file

@ -22,9 +22,7 @@ class Image;
class Rect; class Rect;
} // namespace gfx } // namespace gfx
namespace electron { namespace electron::api {
namespace api {
class WebContents; class WebContents;
@ -77,8 +75,6 @@ class FrameSubscriber : public content::WebContentsObserver,
base::WeakPtrFactory<FrameSubscriber> weak_ptr_factory_{this}; base::WeakPtrFactory<FrameSubscriber> weak_ptr_factory_{this};
}; };
} // namespace api } // namespace electron::api
} // namespace electron
#endif // ELECTRON_SHELL_BROWSER_API_FRAME_SUBSCRIBER_H_ #endif // ELECTRON_SHELL_BROWSER_API_FRAME_SUBSCRIBER_H_

View file

@ -11,9 +11,7 @@
#include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents.h"
#include "shell/browser/electron_browser_context.h" #include "shell/browser/electron_browser_context.h"
namespace electron { namespace electron::api {
namespace api {
SavePageHandler::SavePageHandler(content::WebContents* web_contents, SavePageHandler::SavePageHandler(content::WebContents* web_contents,
gin_helper::Promise<void> promise) gin_helper::Promise<void> promise)
@ -65,6 +63,4 @@ void SavePageHandler::Destroy(download::DownloadItem* item) {
delete this; delete this;
} }
} // namespace api } // namespace electron::api
} // namespace electron

View file

@ -19,9 +19,7 @@ namespace content {
class WebContents; class WebContents;
} }
namespace electron { namespace electron::api {
namespace api {
// A self-destroyed class for handling save page request. // A self-destroyed class for handling save page request.
class SavePageHandler : public content::DownloadManager::Observer, class SavePageHandler : public content::DownloadManager::Observer,
@ -48,8 +46,6 @@ class SavePageHandler : public content::DownloadManager::Observer,
gin_helper::Promise<void> promise_; gin_helper::Promise<void> promise_;
}; };
} // namespace api } // namespace electron::api
} // namespace electron
#endif // ELECTRON_SHELL_BROWSER_API_SAVE_PAGE_HANDLER_H_ #endif // ELECTRON_SHELL_BROWSER_API_SAVE_PAGE_HANDLER_H_

View file

@ -9,8 +9,7 @@
#include "ui/events/event_constants.h" #include "ui/events/event_constants.h"
#include "v8/include/v8.h" #include "v8/include/v8.h"
namespace electron { namespace electron::api {
namespace api {
constexpr int mouse_button_flags = constexpr int mouse_button_flags =
(ui::EF_RIGHT_MOUSE_BUTTON | ui::EF_LEFT_MOUSE_BUTTON | (ui::EF_RIGHT_MOUSE_BUTTON | ui::EF_LEFT_MOUSE_BUTTON |
@ -29,5 +28,4 @@ v8::Local<v8::Object> CreateEventFromFlags(int flags) {
.Build(); .Build();
} }
} // namespace api } // namespace electron::api
} // namespace electron

View file

@ -11,12 +11,10 @@ template <typename T>
class Local; class Local;
} // namespace v8 } // namespace v8
namespace electron { namespace electron::api {
namespace api {
v8::Local<v8::Object> CreateEventFromFlags(int flags); v8::Local<v8::Object> CreateEventFromFlags(int flags);
} // namespace api } // namespace electron::api
} // namespace electron
#endif // ELECTRON_SHELL_BROWSER_API_UI_EVENT_H_ #endif // ELECTRON_SHELL_BROWSER_API_UI_EVENT_H_

View file

@ -10,9 +10,7 @@
#include "shell/common/gin_helper/object_template_builder.h" #include "shell/common/gin_helper/object_template_builder.h"
#include "shell/common/node_includes.h" #include "shell/common/node_includes.h"
namespace electron { namespace electron::api {
namespace api {
ImageView::ImageView() : View(new views::ImageView()) { ImageView::ImageView() : View(new views::ImageView()) {
view()->set_owned_by_client(); view()->set_owned_by_client();
@ -40,9 +38,7 @@ void ImageView::BuildPrototype(v8::Isolate* isolate,
.SetMethod("setImage", &ImageView::SetImage); .SetMethod("setImage", &ImageView::SetImage);
} }
} // namespace api } // namespace electron::api
} // namespace electron
namespace { namespace {

View file

@ -10,9 +10,7 @@
#include "ui/gfx/image/image.h" #include "ui/gfx/image/image.h"
#include "ui/views/controls/image_view.h" #include "ui/views/controls/image_view.h"
namespace electron { namespace electron::api {
namespace api {
class ImageView : public View { class ImageView : public View {
public: public:
@ -32,8 +30,6 @@ class ImageView : public View {
} }
}; };
} // namespace api } // namespace electron::api
} // namespace electron
#endif // ELECTRON_SHELL_BROWSER_API_VIEWS_ELECTRON_API_IMAGE_VIEW_H_ #endif // ELECTRON_SHELL_BROWSER_API_VIEWS_ELECTRON_API_IMAGE_VIEW_H_

View file

@ -7,9 +7,7 @@
#include "gin/public/wrapper_info.h" #include "gin/public/wrapper_info.h"
#include "shell/browser/api/electron_api_event_emitter.h" #include "shell/browser/api/electron_api_event_emitter.h"
namespace gin_helper { namespace gin_helper::internal {
namespace internal {
gin::WrapperInfo kWrapperInfo = {gin::kEmbedderNativeGin}; gin::WrapperInfo kWrapperInfo = {gin::kEmbedderNativeGin};
@ -40,6 +38,4 @@ v8::Local<v8::FunctionTemplate> GetEventEmitterTemplate(v8::Isolate* isolate) {
return tmpl; return tmpl;
} }
} // namespace internal } // namespace gin_helper::internal
} // namespace gin_helper

View file

@ -39,9 +39,7 @@
#include "device/fido/win/webauthn_api.h" #include "device/fido/win/webauthn_api.h"
#endif // BUILDFLAG(IS_WIN) #endif // BUILDFLAG(IS_WIN)
namespace extensions { namespace extensions::api {
namespace api {
namespace { namespace {
@ -307,5 +305,4 @@ CryptotokenPrivateRecordSignRequestFunction::Run() {
return RespondNow(NoArguments()); return RespondNow(NoArguments());
} }
} // namespace api } // namespace extensions::api
} // namespace extensions

View file

@ -14,8 +14,7 @@ class PrefRegistrySyncable;
// Implementations for chrome.cryptotokenPrivate API functions. // Implementations for chrome.cryptotokenPrivate API functions.
namespace extensions { namespace extensions::api {
namespace api {
// void CryptotokenRegisterProfilePrefs( // void CryptotokenRegisterProfilePrefs(
// user_prefs::PrefRegistrySyncable* registry); // user_prefs::PrefRegistrySyncable* registry);
@ -80,7 +79,6 @@ class CryptotokenPrivateRecordSignRequestFunction : public ExtensionFunction {
ResponseAction Run() override; ResponseAction Run() override;
}; };
} // namespace api } // namespace extensions::api
} // namespace extensions
#endif // ELECTRON_SHELL_BROWSER_EXTENSIONS_API_CRYPTOTOKEN_PRIVATE_CRYPTOTOKEN_PRIVATE_API_H_ #endif // ELECTRON_SHELL_BROWSER_EXTENSIONS_API_CRYPTOTOKEN_PRIVATE_CRYPTOTOKEN_PRIVATE_API_H_

View file

@ -7,8 +7,7 @@
#include "extensions/browser/updater/update_service_factory.h" #include "extensions/browser/updater/update_service_factory.h"
#include "shell/browser/extensions/electron_extension_system_factory.h" #include "shell/browser/extensions/electron_extension_system_factory.h"
namespace extensions { namespace extensions::electron {
namespace electron {
void EnsureBrowserContextKeyedServiceFactoriesBuilt() { void EnsureBrowserContextKeyedServiceFactoriesBuilt() {
// TODO(rockot): Remove this once UpdateService is supported across all // TODO(rockot): Remove this once UpdateService is supported across all
@ -18,5 +17,4 @@ void EnsureBrowserContextKeyedServiceFactoriesBuilt() {
ElectronExtensionSystemFactory::GetInstance(); ElectronExtensionSystemFactory::GetInstance();
} }
} // namespace electron } // namespace extensions::electron
} // namespace extensions

View file

@ -5,14 +5,12 @@
#ifndef ELECTRON_SHELL_BROWSER_EXTENSIONS_ELECTRON_BROWSER_CONTEXT_KEYED_SERVICE_FACTORIES_H_ #ifndef ELECTRON_SHELL_BROWSER_EXTENSIONS_ELECTRON_BROWSER_CONTEXT_KEYED_SERVICE_FACTORIES_H_
#define ELECTRON_SHELL_BROWSER_EXTENSIONS_ELECTRON_BROWSER_CONTEXT_KEYED_SERVICE_FACTORIES_H_ #define ELECTRON_SHELL_BROWSER_EXTENSIONS_ELECTRON_BROWSER_CONTEXT_KEYED_SERVICE_FACTORIES_H_
namespace extensions { namespace extensions::electron {
namespace electron {
// Ensures the existence of any BrowserContextKeyedServiceFactory provided by // Ensures the existence of any BrowserContextKeyedServiceFactory provided by
// the core extensions code. // the core extensions code.
void EnsureBrowserContextKeyedServiceFactoriesBuilt(); void EnsureBrowserContextKeyedServiceFactoriesBuilt();
} // namespace electron } // namespace extensions::electron
} // namespace extensions
#endif // ELECTRON_SHELL_BROWSER_EXTENSIONS_ELECTRON_BROWSER_CONTEXT_KEYED_SERVICE_FACTORIES_H_ #endif // ELECTRON_SHELL_BROWSER_EXTENSIONS_ELECTRON_BROWSER_CONTEXT_KEYED_SERVICE_FACTORIES_H_

View file

@ -15,9 +15,7 @@
#include "base/process/launch.h" #include "base/process/launch.h"
#include "base/synchronization/waitable_event.h" #include "base/synchronization/waitable_event.h"
namespace relauncher { namespace relauncher::internal {
namespace internal {
// this is global to be visible to the sa_handler // this is global to be visible to the sa_handler
base::WaitableEvent parentWaiter; base::WaitableEvent parentWaiter;
@ -68,6 +66,4 @@ int LaunchProgram(const StringVector& relauncher_args,
return process.IsValid() ? 0 : 1; return process.IsValid() ? 0 : 1;
} }
} // namespace internal } // namespace relauncher::internal
} // namespace relauncher

View file

@ -16,9 +16,7 @@
#include "base/process/launch.h" #include "base/process/launch.h"
#include "base/strings/sys_string_conversions.h" #include "base/strings/sys_string_conversions.h"
namespace relauncher { namespace relauncher::internal {
namespace internal {
void RelauncherSynchronizeWithParent() { void RelauncherSynchronizeWithParent() {
base::ScopedFD relauncher_sync_fd(kRelauncherSyncFD); base::ScopedFD relauncher_sync_fd(kRelauncherSyncFD);
@ -91,6 +89,4 @@ int LaunchProgram(const StringVector& relauncher_args,
return process.IsValid() ? 0 : 1; return process.IsValid() ? 0 : 1;
} }
} // namespace internal } // namespace relauncher::internal
} // namespace relauncher

View file

@ -14,9 +14,7 @@
#include "sandbox/win/src/win_utils.h" #include "sandbox/win/src/win_utils.h"
#include "ui/base/win/shell.h" #include "ui/base/win/shell.h"
namespace relauncher { namespace relauncher::internal {
namespace internal {
namespace { namespace {
@ -125,6 +123,4 @@ int LaunchProgram(const StringVector& relauncher_args,
return process.IsValid() ? 0 : 1; return process.IsValid() ? 0 : 1;
} }
} // namespace internal } // namespace relauncher::internal
} // namespace relauncher

View file

@ -152,9 +152,7 @@ void DeleteTempDirectory(const base::FilePath& dir_path) {
} // namespace } // namespace
namespace electron { namespace electron::gtkui {
namespace gtkui {
AppIndicatorIcon::AppIndicatorIcon(std::string id, AppIndicatorIcon::AppIndicatorIcon(std::string id,
const gfx::ImageSkia& image, const gfx::ImageSkia& image,
@ -375,6 +373,4 @@ void AppIndicatorIcon::OnClickActionReplacementMenuItemActivated() {
delegate()->OnClick(); delegate()->OnClick();
} }
} // namespace gtkui } // namespace electron::gtkui
} // namespace electron

View file

@ -28,9 +28,7 @@ namespace ui {
class MenuModel; class MenuModel;
} }
namespace electron { namespace electron::gtkui {
namespace gtkui {
class AppIndicatorIconMenu; class AppIndicatorIconMenu;
@ -111,8 +109,6 @@ class AppIndicatorIcon : public views::StatusIconLinux {
base::WeakPtrFactory<AppIndicatorIcon> weak_factory_{this}; base::WeakPtrFactory<AppIndicatorIcon> weak_factory_{this};
}; };
} // namespace gtkui } // namespace electron::gtkui
} // namespace electron
#endif // ELECTRON_SHELL_BROWSER_UI_GTK_APP_INDICATOR_ICON_H_ #endif // ELECTRON_SHELL_BROWSER_UI_GTK_APP_INDICATOR_ICON_H_

View file

@ -11,9 +11,7 @@
#include "shell/browser/ui/gtk/menu_util.h" #include "shell/browser/ui/gtk/menu_util.h"
#include "ui/base/models/menu_model.h" #include "ui/base/models/menu_model.h"
namespace electron { namespace electron::gtkui {
namespace gtkui {
AppIndicatorIconMenu::AppIndicatorIconMenu(ui::MenuModel* model) AppIndicatorIconMenu::AppIndicatorIconMenu(ui::MenuModel* model)
: menu_model_(model) { : menu_model_(model) {
@ -115,6 +113,4 @@ void AppIndicatorIconMenu::OnMenuItemActivated(GtkWidget* menu_item) {
ExecuteCommand(model, id); ExecuteCommand(model, id);
} }
} // namespace gtkui } // namespace electron::gtkui
} // namespace electron

View file

@ -15,9 +15,7 @@ namespace ui {
class MenuModel; class MenuModel;
} }
namespace electron { namespace electron::gtkui {
namespace gtkui {
// The app indicator icon's menu. // The app indicator icon's menu.
class AppIndicatorIconMenu { class AppIndicatorIconMenu {
@ -70,8 +68,6 @@ class AppIndicatorIconMenu {
bool block_activation_ = false; bool block_activation_ = false;
}; };
} // namespace gtkui } // namespace electron::gtkui
} // namespace electron
#endif // ELECTRON_SHELL_BROWSER_UI_GTK_APP_INDICATOR_ICON_MENU_H_ #endif // ELECTRON_SHELL_BROWSER_UI_GTK_APP_INDICATOR_ICON_MENU_H_

View file

@ -15,9 +15,7 @@
G_GNUC_BEGIN_IGNORE_DEPRECATIONS G_GNUC_BEGIN_IGNORE_DEPRECATIONS
namespace electron { namespace electron::gtkui {
namespace gtkui {
GtkStatusIcon::GtkStatusIcon(const gfx::ImageSkia& image, GtkStatusIcon::GtkStatusIcon(const gfx::ImageSkia& image,
const std::u16string& tool_tip) { const std::u16string& tool_tip) {
@ -81,6 +79,4 @@ void GtkStatusIcon::OnContextMenuRequested(GtkStatusIcon* status_icon,
} }
} }
} // namespace gtkui } // namespace electron::gtkui
} // namespace electron

View file

@ -21,9 +21,8 @@ namespace ui {
class MenuModel; class MenuModel;
} }
namespace electron { namespace electron::gtkui {
namespace gtkui {
class AppIndicatorIconMenu; class AppIndicatorIconMenu;
// Status icon implementation which uses the system tray X11 spec (via // Status icon implementation which uses the system tray X11 spec (via
@ -58,8 +57,6 @@ class GtkStatusIcon : public views::StatusIconLinux {
std::unique_ptr<AppIndicatorIconMenu> menu_; std::unique_ptr<AppIndicatorIconMenu> menu_;
}; };
} // namespace gtkui } // namespace electron::gtkui
} // namespace electron
#endif // ELECTRON_SHELL_BROWSER_UI_GTK_GTK_STATUS_ICON_H_ #endif // ELECTRON_SHELL_BROWSER_UI_GTK_GTK_STATUS_ICON_H_

View file

@ -30,9 +30,7 @@
#include "ui/ozone/public/ozone_platform.h" #include "ui/ozone/public/ozone_platform.h"
#endif #endif
namespace electron { namespace electron::gtkui {
namespace gtkui {
namespace { namespace {
@ -330,6 +328,4 @@ void SetMenuItemInfo(GtkWidget* widget, void* block_activation_ptr) {
} }
} }
} // namespace gtkui } // namespace electron::gtkui
} // namespace electron

View file

@ -15,9 +15,7 @@ namespace ui {
class MenuModel; class MenuModel;
} }
namespace electron { namespace electron::gtkui {
namespace gtkui {
// Builds GtkImageMenuItems. // Builds GtkImageMenuItems.
GtkWidget* BuildMenuItemWithImage(const std::string& label, GtkWidget* image); GtkWidget* BuildMenuItemWithImage(const std::string& label, GtkWidget* image);
@ -56,8 +54,6 @@ void BuildSubmenuFromModel(ui::MenuModel* model,
// Sets the check mark, enabled/disabled state and dynamic labels on menu items. // Sets the check mark, enabled/disabled state and dynamic labels on menu items.
void SetMenuItemInfo(GtkWidget* widget, void* block_activation_ptr); void SetMenuItemInfo(GtkWidget* widget, void* block_activation_ptr);
} // namespace gtkui } // namespace electron::gtkui
} // namespace electron
#endif // ELECTRON_SHELL_BROWSER_UI_GTK_MENU_UTIL_H_ #endif // ELECTRON_SHELL_BROWSER_UI_GTK_MENU_UTIL_H_

View file

@ -16,9 +16,7 @@
#include "shell/browser/ui/gtk/app_indicator_icon.h" #include "shell/browser/ui/gtk/app_indicator_icon.h"
#include "shell/browser/ui/gtk/gtk_status_icon.h" #include "shell/browser/ui/gtk/gtk_status_icon.h"
namespace electron { namespace electron::gtkui {
namespace gtkui {
namespace { namespace {
@ -55,6 +53,4 @@ std::unique_ptr<views::StatusIconLinux> CreateLinuxStatusIcon(
#endif #endif
} }
} // namespace gtkui } // namespace electron::gtkui
} // namespace electron

View file

@ -15,9 +15,7 @@
#include "ui/gfx/image/image_skia.h" #include "ui/gfx/image/image_skia.h"
#include "ui/views/linux_ui/status_icon_linux.h" #include "ui/views/linux_ui/status_icon_linux.h"
namespace electron { namespace electron::gtkui {
namespace gtkui {
bool IsStatusIconSupported(); bool IsStatusIconSupported();
std::unique_ptr<views::StatusIconLinux> CreateLinuxStatusIcon( std::unique_ptr<views::StatusIconLinux> CreateLinuxStatusIcon(
@ -25,8 +23,6 @@ std::unique_ptr<views::StatusIconLinux> CreateLinuxStatusIcon(
const std::u16string& tool_tip, const std::u16string& tool_tip,
const char* id_prefix); const char* id_prefix);
} // namespace gtkui } // namespace electron::gtkui
} // namespace electron
#endif // ELECTRON_SHELL_BROWSER_UI_GTK_STATUS_ICON_H_ #endif // ELECTRON_SHELL_BROWSER_UI_GTK_STATUS_ICON_H_

View file

@ -40,9 +40,7 @@ HRESULT TrySetWindowTheme(HWND hWnd, bool dark) {
} // namespace } // namespace
namespace electron { namespace electron::win {
namespace win {
bool IsDarkModeSupported() { bool IsDarkModeSupported() {
auto* os_info = base::win::OSInfo::GetInstance(); auto* os_info = base::win::OSInfo::GetInstance();
@ -59,6 +57,4 @@ void SetDarkModeForWindow(HWND hWnd) {
TrySetWindowTheme(hWnd, dark); TrySetWindowTheme(hWnd, dark);
} }
} // namespace win } // namespace electron::win
} // namespace electron

View file

@ -15,15 +15,11 @@
#include "ui/native_theme/native_theme.h" #include "ui/native_theme/native_theme.h"
namespace electron { namespace electron::win {
namespace win {
bool IsDarkModeSupported(); bool IsDarkModeSupported();
void SetDarkModeForWindow(HWND hWnd); void SetDarkModeForWindow(HWND hWnd);
} // namespace win } // namespace electron::win
} // namespace electron
#endif // ELECTRON_SHELL_BROWSER_WIN_DARK_MODE_H_ #endif // ELECTRON_SHELL_BROWSER_WIN_DARK_MODE_H_

Some files were not shown because too many files have changed in this diff Show more