chore: used nested namespaces (#34737)
This commit is contained in:
parent
0d4e417594
commit
5d120359f6
122 changed files with 246 additions and 738 deletions
|
@ -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 {
|
||||
|
||||
|
|
|
@ -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_
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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_
|
||||
|
|
|
@ -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 {
|
||||
|
||||
|
|
|
@ -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_
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -23,9 +23,7 @@
|
|||
#include "shell/common/process_util.h"
|
||||
#include "third_party/crashpad/crashpad/client/annotation.h"
|
||||
|
||||
namespace electron {
|
||||
|
||||
namespace crash_keys {
|
||||
namespace electron::crash_keys {
|
||||
|
||||
namespace {
|
||||
|
||||
|
@ -167,6 +165,4 @@ void SetPlatformCrashKey() {
|
|||
#endif
|
||||
}
|
||||
|
||||
} // namespace crash_keys
|
||||
|
||||
} // namespace electron
|
||||
} // namespace electron::crash_keys
|
||||
|
|
|
@ -12,9 +12,7 @@ namespace base {
|
|||
class CommandLine;
|
||||
}
|
||||
|
||||
namespace electron {
|
||||
|
||||
namespace crash_keys {
|
||||
namespace electron::crash_keys {
|
||||
|
||||
void SetCrashKey(const std::string& key, const std::string& value);
|
||||
void ClearCrashKey(const std::string& key);
|
||||
|
@ -23,8 +21,6 @@ void GetCrashKeys(std::map<std::string, std::string>* keys);
|
|||
void SetCrashKeysFromCommandLine(const base::CommandLine& command_line);
|
||||
void SetPlatformCrashKey();
|
||||
|
||||
} // namespace crash_keys
|
||||
|
||||
} // namespace electron
|
||||
} // namespace electron::crash_keys
|
||||
|
||||
#endif // ELECTRON_SHELL_COMMON_CRASH_KEYS_H_
|
||||
|
|
|
@ -10,9 +10,7 @@
|
|||
#include "shell/common/gin_helper/dictionary.h"
|
||||
#include "shell/common/gin_helper/object_template_builder.h"
|
||||
|
||||
namespace gin_helper {
|
||||
|
||||
namespace internal {
|
||||
namespace gin_helper::internal {
|
||||
|
||||
namespace {
|
||||
|
||||
|
@ -75,6 +73,4 @@ v8::Local<v8::Object> CreateNativeEvent(
|
|||
return event;
|
||||
}
|
||||
|
||||
} // namespace internal
|
||||
|
||||
} // namespace gin_helper
|
||||
} // namespace gin_helper::internal
|
||||
|
|
|
@ -8,9 +8,7 @@
|
|||
#include "shell/common/gin_helper/microtasks_scope.h"
|
||||
#include "shell/common/node_includes.h"
|
||||
|
||||
namespace gin_helper {
|
||||
|
||||
namespace internal {
|
||||
namespace gin_helper::internal {
|
||||
|
||||
v8::Local<v8::Value> CallMethodWithArgs(v8::Isolate* isolate,
|
||||
v8::Local<v8::Object> obj,
|
||||
|
@ -33,6 +31,4 @@ v8::Local<v8::Value> CallMethodWithArgs(v8::Isolate* isolate,
|
|||
return v8::Boolean::New(isolate, false);
|
||||
}
|
||||
|
||||
} // namespace internal
|
||||
|
||||
} // namespace gin_helper
|
||||
} // namespace gin_helper::internal
|
||||
|
|
|
@ -7,9 +7,7 @@
|
|||
#include "base/logging.h"
|
||||
#include "shell/common/node_includes.h"
|
||||
|
||||
namespace electron {
|
||||
|
||||
namespace util {
|
||||
namespace electron::util {
|
||||
|
||||
v8::MaybeLocal<v8::Value> CompileAndCall(
|
||||
v8::Local<v8::Context> context,
|
||||
|
@ -36,6 +34,4 @@ v8::MaybeLocal<v8::Value> CompileAndCall(
|
|||
return ret;
|
||||
}
|
||||
|
||||
} // namespace util
|
||||
|
||||
} // namespace electron
|
||||
} // namespace electron::util
|
||||
|
|
|
@ -13,9 +13,7 @@ namespace node {
|
|||
class Environment;
|
||||
}
|
||||
|
||||
namespace electron {
|
||||
|
||||
namespace util {
|
||||
namespace electron::util {
|
||||
|
||||
// Run a script with JS source bundled inside the binary as if it's wrapped
|
||||
// in a function called with a null receiver and arguments specified in C++.
|
||||
|
@ -29,8 +27,6 @@ v8::MaybeLocal<v8::Value> CompileAndCall(
|
|||
std::vector<v8::Local<v8::Value>>* arguments,
|
||||
node::Environment* optional_env);
|
||||
|
||||
} // namespace util
|
||||
|
||||
} // namespace electron
|
||||
} // namespace electron::util
|
||||
|
||||
#endif // ELECTRON_SHELL_COMMON_NODE_UTIL_H_
|
||||
|
|
|
@ -13,14 +13,12 @@ namespace base {
|
|||
class FilePath;
|
||||
}
|
||||
|
||||
namespace platform_util {
|
||||
namespace internal {
|
||||
namespace platform_util::internal {
|
||||
|
||||
// Called by platform_util.cc on to invoke platform specific logic to move
|
||||
// |path| to trash using a suitable handler.
|
||||
bool PlatformTrashItem(const base::FilePath& path, std::string* error);
|
||||
|
||||
} // namespace internal
|
||||
} // namespace platform_util
|
||||
} // namespace platform_util::internal
|
||||
|
||||
#endif // ELECTRON_SHELL_COMMON_PLATFORM_UTIL_INTERNAL_H_
|
||||
|
|
|
@ -28,9 +28,7 @@
|
|||
#include "ui/gfx/icon_util.h"
|
||||
#endif
|
||||
|
||||
namespace electron {
|
||||
|
||||
namespace util {
|
||||
namespace electron::util {
|
||||
|
||||
struct ScaleFactorPair {
|
||||
const char* name;
|
||||
|
@ -164,6 +162,4 @@ bool ReadImageSkiaFromICO(gfx::ImageSkia* image, HICON icon) {
|
|||
}
|
||||
#endif
|
||||
|
||||
} // namespace util
|
||||
|
||||
} // namespace electron
|
||||
} // namespace electron::util
|
||||
|
|
|
@ -13,9 +13,7 @@ namespace gfx {
|
|||
class ImageSkia;
|
||||
}
|
||||
|
||||
namespace electron {
|
||||
|
||||
namespace util {
|
||||
namespace electron::util {
|
||||
|
||||
bool PopulateImageSkiaRepsFromPath(gfx::ImageSkia* image,
|
||||
const base::FilePath& path);
|
||||
|
@ -41,8 +39,6 @@ bool AddImageSkiaRepFromPNG(gfx::ImageSkia* image,
|
|||
bool ReadImageSkiaFromICO(gfx::ImageSkia* image, HICON icon);
|
||||
#endif
|
||||
|
||||
} // namespace util
|
||||
|
||||
} // namespace electron
|
||||
} // namespace electron::util
|
||||
|
||||
#endif // ELECTRON_SHELL_COMMON_SKIA_UTIL_H_
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue