chore: use nested namespaces (#37855)

This commit is contained in:
David Sanders 2023-04-10 23:30:25 -07:00 committed by GitHub
parent e929b2140d
commit adb1172066
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 12 additions and 36 deletions

View file

@ -10,9 +10,7 @@
#include "shell/common/gin_helper/dictionary.h" #include "shell/common/gin_helper/dictionary.h"
#include "shell/common/node_includes.h" #include "shell/common/node_includes.h"
namespace electron { namespace electron::api {
namespace api {
PushNotifications* g_push_notifications = nullptr; PushNotifications* g_push_notifications = nullptr;
@ -55,9 +53,7 @@ const char* PushNotifications::GetTypeName() {
return "PushNotifications"; return "PushNotifications";
} }
} // namespace api } // namespace electron::api
} // namespace electron
namespace { namespace {

View file

@ -15,9 +15,7 @@
#include "shell/browser/event_emitter_mixin.h" #include "shell/browser/event_emitter_mixin.h"
#include "shell/common/gin_helper/promise.h" #include "shell/common/gin_helper/promise.h"
namespace electron { namespace electron::api {
namespace api {
class PushNotifications class PushNotifications
: public ElectronBrowserClient::Delegate, : public ElectronBrowserClient::Delegate,
@ -57,8 +55,6 @@ class PushNotifications
#endif #endif
}; };
} // namespace api } // namespace electron::api
} // namespace electron
#endif // ELECTRON_SHELL_BROWSER_API_ELECTRON_API_PUSH_NOTIFICATIONS_H_ #endif // ELECTRON_SHELL_BROWSER_API_ELECTRON_API_PUSH_NOTIFICATIONS_H_

View file

@ -12,9 +12,7 @@
#include "shell/common/gin_converters/value_converter.h" #include "shell/common/gin_converters/value_converter.h"
#include "shell/common/gin_helper/promise.h" #include "shell/common/gin_helper/promise.h"
namespace electron { namespace electron::api {
namespace api {
v8::Local<v8::Promise> PushNotifications::RegisterForAPNSNotifications( v8::Local<v8::Promise> PushNotifications::RegisterForAPNSNotifications(
v8::Isolate* isolate) { v8::Isolate* isolate) {
@ -57,6 +55,4 @@ void PushNotifications::OnDidReceiveAPNSNotification(
Emit("received-apns-notification", user_info); Emit("received-apns-notification", user_info);
} }
} // namespace api } // namespace electron::api
} // namespace electron

View file

@ -33,9 +33,7 @@ namespace base {
class Process; class Process;
} // namespace base } // namespace base
namespace electron { namespace electron::api {
namespace api {
class UtilityProcessWrapper class UtilityProcessWrapper
: public gin::Wrappable<UtilityProcessWrapper>, : public gin::Wrappable<UtilityProcessWrapper>,
@ -93,8 +91,6 @@ class UtilityProcessWrapper
base::WeakPtrFactory<UtilityProcessWrapper> weak_factory_{this}; base::WeakPtrFactory<UtilityProcessWrapper> weak_factory_{this};
}; };
} // namespace api } // namespace electron::api
} // namespace electron
#endif // ELECTRON_SHELL_BROWSER_API_ELECTRON_API_UTILITY_PROCESS_H_ #endif // ELECTRON_SHELL_BROWSER_API_ELECTRON_API_UTILITY_PROCESS_H_

View file

@ -9,9 +9,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 {
MenuGtk::MenuGtk(ui::MenuModel* model) MenuGtk::MenuGtk(ui::MenuModel* model)
: menu_model_(model), gtk_menu_(TakeGObject(gtk_menu_new())) { : menu_model_(model), gtk_menu_(TakeGObject(gtk_menu_new())) {
@ -65,6 +63,4 @@ void MenuGtk::OnMenuItemActivated(GtkWidget* menu_item) {
ExecuteCommand(model, id); ExecuteCommand(model, id);
} }
} // namespace gtkui } // namespace electron::gtkui
} // namespace electron

View file

@ -17,9 +17,7 @@ namespace ui {
class MenuModel; class MenuModel;
} }
namespace electron { namespace electron::gtkui {
namespace gtkui {
class MenuGtk { class MenuGtk {
public: public:
@ -41,8 +39,6 @@ class MenuGtk {
bool block_activation_ = false; bool block_activation_ = false;
}; };
} // namespace gtkui } // namespace electron::gtkui
} // namespace electron
#endif // ELECTRON_SHELL_BROWSER_UI_GTK_MENU_GTK_H_ #endif // ELECTRON_SHELL_BROWSER_UI_GTK_MENU_GTK_H_