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

@ -17,9 +17,7 @@
#include "ui/base/clipboard/scoped_clipboard_writer.h"
#include "ui/gfx/codec/png_codec.h"
namespace electron {
namespace api {
namespace electron::api {
ui::ClipboardBuffer Clipboard::GetClipboardBuffer(gin_helper::Arguments* args) {
std::string type;
@ -260,9 +258,7 @@ void Clipboard::Clear(gin_helper::Arguments* args) {
ui::Clipboard::GetForCurrentThread()->Clear(GetClipboardBuffer(args));
}
} // namespace api
} // namespace electron
} // namespace electron::api
namespace {

View file

@ -17,9 +17,7 @@ class Arguments;
class Dictionary;
} // namespace gin_helper
namespace electron {
namespace api {
namespace electron::api {
class Clipboard {
public:
@ -67,8 +65,6 @@ class Clipboard {
gin_helper::Arguments* args);
};
} // namespace api
} // namespace electron
} // namespace electron::api
#endif // ELECTRON_SHELL_COMMON_API_ELECTRON_API_CLIPBOARD_H_

View file

@ -6,9 +6,7 @@
#include "shell/common/api/electron_api_clipboard.h"
#include "ui/base/cocoa/find_pasteboard.h"
namespace electron {
namespace api {
namespace electron::api {
void Clipboard::WriteFindText(const std::u16string& text) {
NSString* text_ns = base::SysUTF16ToNSString(text);
@ -19,6 +17,4 @@ std::u16string Clipboard::ReadFindText() {
return GetFindPboardText();
}
} // namespace api
} // namespace electron
} // namespace electron::api

View file

@ -11,9 +11,7 @@
#include "shell/common/gin_helper/wrappable.h"
#include "shell/common/key_weak_map.h"
namespace electron {
namespace api {
namespace electron::api {
template <typename K>
class KeyWeakMap : public gin_helper::Wrappable<KeyWeakMap<K>> {
@ -59,8 +57,6 @@ class KeyWeakMap : public gin_helper::Wrappable<KeyWeakMap<K>> {
electron::KeyWeakMap<K> key_weak_map_;
};
} // namespace api
} // namespace electron
} // namespace electron::api
#endif // ELECTRON_SHELL_COMMON_API_ELECTRON_API_KEY_WEAK_MAP_H_

View file

@ -48,9 +48,7 @@
#include "ui/gfx/icon_util.h"
#endif
namespace electron {
namespace api {
namespace electron::api {
namespace {
@ -613,9 +611,7 @@ const char* NativeImage::GetTypeName() {
// static
gin::WrapperInfo NativeImage::kWrapperInfo = {gin::kEmbedderNativeGin};
} // namespace api
} // namespace electron
} // namespace electron::api
namespace {

View file

@ -40,9 +40,7 @@ namespace gin {
class Arguments;
}
namespace electron {
namespace api {
namespace electron::api {
class NativeImage : public gin::Wrappable<NativeImage> {
public:
@ -140,8 +138,6 @@ class NativeImage : public gin::Wrappable<NativeImage> {
int32_t memory_usage_ = 0;
};
} // namespace api
} // namespace electron
} // namespace electron::api
#endif // ELECTRON_SHELL_COMMON_API_ELECTRON_API_NATIVE_IMAGE_H_

View file

@ -23,9 +23,7 @@
#include "ui/gfx/image/image_skia.h"
#include "ui/gfx/image/image_skia_operations.h"
namespace electron {
namespace api {
namespace electron::api {
NSData* bufferFromNSImage(NSImage* image) {
CGImageRef ref = [image CGImageForProposedRect:nil context:nil hints:nil];
@ -183,6 +181,4 @@ bool NativeImage::IsTemplateImage() {
return [image_.AsNSImage() isTemplate];
}
} // namespace api
} // namespace electron
} // namespace electron::api

View file

@ -17,9 +17,7 @@
#include "ui/gfx/icon_util.h"
#include "ui/gfx/image/image_skia.h"
namespace electron {
namespace api {
namespace electron::api {
// static
v8::Local<v8::Promise> NativeImage::CreateThumbnailFromPath(
@ -102,6 +100,4 @@ v8::Local<v8::Promise> NativeImage::CreateThumbnailFromPath(
return handle;
}
} // namespace api
} // namespace electron
} // namespace electron::api