From 9c188cbc81fddab9866d943bb58f1518038af0bc Mon Sep 17 00:00:00 2001 From: Milan Burda Date: Sat, 20 Oct 2018 10:45:14 +0200 Subject: [PATCH] refactor: eliminate brightray --- .gitignore | 7 ----- BUILD.gn | 7 ++++- atom/app/atom_library_main.mm | 4 +-- atom/app/atom_main_delegate_mac.mm | 13 +++----- atom/browser/api/atom_api_app.cc | 14 ++++----- atom/browser/atom_browser_context.cc | 13 ++++---- atom/browser/atom_browser_main_parts.cc | 11 +++---- atom/browser/atom_browser_main_parts_mac.mm | 4 +-- .../browser/atom_paths.h | 12 ++++--- atom/browser/browser.cc | 14 ++++----- atom/browser/browser_linux.cc | 6 ++-- atom/browser/browser_mac.mm | 6 ++-- atom/browser/browser_win.cc | 8 ++--- atom/browser/media/media_device_id_salt.cc | 2 +- .../linux/libnotify_notification.cc | 4 +-- .../win/windows_toast_notification.cc | 8 ++--- .../win/windows_toast_notification.h | 4 +-- .../atom_inspectable_web_contents_view.mm | 2 +- .../ui/inspectable_web_contents_impl.cc | 6 ++-- atom/browser/ui/tray_icon_gtk.cc | 4 +-- .../browser/win/scoped_hstring.cc | 6 +++- .../browser/win/scoped_hstring.h | 10 ++++-- atom/common/api/atom_bindings.cc | 4 +-- .../common/application_info.cc | 10 ++++-- {brightray => atom}/common/application_info.h | 16 ++++++---- ...tion_info.cc => application_info_linux.cc} | 6 ++-- .../common/application_info_mac.mm | 12 ++++--- .../common/application_info_win.cc | 12 ++++--- atom/common/mac/main_application_bundle.h | 26 ++++++++++++++++ .../common/mac/main_application_bundle.mm | 6 ++-- .../atom_sandboxed_renderer_client.cc | 4 +-- brightray/BUILD.gn | 31 ------------------- brightray/CPPLINT.cfg | 1 - brightray/LICENSE | 19 ------------ brightray/LICENSE-CHROMIUM | 27 ---------------- .../common/mac/main_application_bundle.h | 21 ------------- docs/development/build-system-overview.md | 3 +- .../development/debug-instructions-windows.md | 3 +- .../debugging-instructions-macos.md | 3 +- docs/development/pull-requests.md | 2 +- .../source-code-directory-structure.md | 1 - docs/glossary.md | 8 +---- filenames.gni | 11 ++++++- package.json | 6 ++-- patches/common/chromium/.patches.yaml | 2 +- patches/common/chromium/gtk_visibility.patch | 9 +++--- script/lint.js | 2 +- 47 files changed, 177 insertions(+), 233 deletions(-) rename brightray/browser/brightray_paths.h => atom/browser/atom_paths.h (82%) rename {brightray => atom}/browser/win/scoped_hstring.cc (90%) rename {brightray => atom}/browser/win/scoped_hstring.h (82%) rename {brightray => atom}/common/application_info.cc (73%) rename {brightray => atom}/common/application_info.h (61%) rename atom/common/{linux/application_info.cc => application_info_linux.cc} (94%) rename {brightray => atom}/common/application_info_mac.mm (70%) rename {brightray => atom}/common/application_info_win.cc (92%) create mode 100644 atom/common/mac/main_application_bundle.h rename {brightray => atom}/common/mac/main_application_bundle.mm (94%) delete mode 100644 brightray/BUILD.gn delete mode 100644 brightray/CPPLINT.cfg delete mode 100644 brightray/LICENSE delete mode 100644 brightray/LICENSE-CHROMIUM delete mode 100644 brightray/common/mac/main_application_bundle.h diff --git a/.gitignore b/.gitignore index 63272ea1e3fb0..fab8743120908 100644 --- a/.gitignore +++ b/.gitignore @@ -16,13 +16,6 @@ *.vcxproj.user *.xcodeproj /.idea/ -/brightray/brightray.opensdf -/brightray/brightray.sdf -/brightray/brightray.sln -/brightray/brightray.suo -/brightray/brightray.v12.suo -/brightray/brightray.vcxproj* -/brightray/brightray.xcodeproj/ /dist/ /external_binaries/ /out/ diff --git a/BUILD.gn b/BUILD.gn index e6262e0845fb3..1e3a55b6c6a15 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -4,6 +4,7 @@ import("buildflags/buildflags.gni") import("electron_paks.gni") import("filenames.gni") import("//build/config/locales.gni") +import("//build/config/ui.gni") import("//build/config/win/manifest.gni") import("//pdf/features.gni") import("//services/service_manager/public/service_manifest.gni") @@ -200,11 +201,11 @@ static_library("electron_lib") { deps = [ ":atom_js2c", - "brightray", "buildflags", "chromium_src:chrome", "native_mate", "//base", + "//base:base_static", "//base:i18n", "//chrome/common", "//components/certificate_transparency", @@ -213,11 +214,15 @@ static_library("electron_lib") { "//components/prefs", "//components/viz/service", "//content/public/app:both", + "//content/public/browser", "//content/public/child", "//content/public/common:service_names", + "//content/shell:copy_shell_resources", "//gin", "//media/mojo/interfaces", + "//net:extras", "//net:net_resources", + "//net:net_with_v8", "//ppapi/host", "//ppapi/proxy", "//ppapi/shared_impl", diff --git a/atom/app/atom_library_main.mm b/atom/app/atom_library_main.mm index f1bf7bb97a8c8..bd241ca2f74f1 100644 --- a/atom/app/atom_library_main.mm +++ b/atom/app/atom_library_main.mm @@ -7,11 +7,11 @@ #include "atom/app/atom_main_delegate.h" #include "atom/app/node_main.h" #include "atom/common/atom_command_line.h" +#include "atom/common/mac/main_application_bundle.h" #include "base/at_exit.h" #include "base/i18n/icu_util.h" #include "base/mac/bundle_locations.h" #include "base/mac/scoped_nsautorelease_pool.h" -#include "brightray/common/mac/main_application_bundle.h" #include "content/public/app/content_main.h" int AtomMain(int argc, char* argv[]) { @@ -28,7 +28,7 @@ int AtomInitializeICUandStartNode(int argc, char* argv[]) { base::AtExitManager atexit_manager; base::mac::ScopedNSAutoreleasePool pool; base::mac::SetOverrideFrameworkBundlePath( - brightray::MainApplicationBundlePath() + atom::MainApplicationBundlePath() .Append("Contents") .Append("Frameworks") .Append(ATOM_PRODUCT_NAME " Framework.framework")); diff --git a/atom/app/atom_main_delegate_mac.mm b/atom/app/atom_main_delegate_mac.mm index 21104ae23e741..5b60ea44639ad 100644 --- a/atom/app/atom_main_delegate_mac.mm +++ b/atom/app/atom_main_delegate_mac.mm @@ -5,6 +5,8 @@ #include "atom/app/atom_main_delegate.h" #include "atom/browser/mac/atom_application.h" +#include "atom/common/application_info.h" +#include "atom/common/mac/main_application_bundle.h" #include "base/files/file_path.h" #include "base/files/file_util.h" #include "base/mac/bundle_locations.h" @@ -12,8 +14,6 @@ #include "base/mac/scoped_nsautorelease_pool.h" #include "base/path_service.h" #include "base/strings/sys_string_conversions.h" -#include "brightray/common/application_info.h" -#include "brightray/common/mac/main_application_bundle.h" #include "content/public/common/content_paths.h" namespace atom { @@ -21,9 +21,7 @@ namespace { base::FilePath GetFrameworksPath() { - return brightray::MainApplicationBundlePath() - .Append("Contents") - .Append("Frameworks"); + return MainApplicationBundlePath().Append("Contents").Append("Frameworks"); } base::FilePath GetHelperAppPath(const base::FilePath& frameworks_path, @@ -46,8 +44,7 @@ base::FilePath helper_path = GetHelperAppPath(frameworks_path, ATOM_PRODUCT_NAME); if (!base::PathExists(helper_path)) - helper_path = - GetHelperAppPath(frameworks_path, brightray::GetApplicationName()); + helper_path = GetHelperAppPath(frameworks_path, GetApplicationName()); if (!base::PathExists(helper_path)) LOG(FATAL) << "Unable to find helper app"; base::PathService::Override(content::CHILD_PROCESS_EXE, helper_path); @@ -55,7 +52,7 @@ void AtomMainDelegate::SetUpBundleOverrides() { base::mac::ScopedNSAutoreleasePool pool; - NSBundle* bundle = brightray::MainApplicationBundle(); + NSBundle* bundle = MainApplicationBundle(); std::string base_bundle_id = base::SysNSStringToUTF8([bundle bundleIdentifier]); NSString* team_id = [bundle objectForInfoDictionaryKey:@"ElectronTeamID"]; diff --git a/atom/browser/api/atom_api_app.cc b/atom/browser/api/atom_api_app.cc index 17c053dd569bb..3f0e3e02b51ef 100644 --- a/atom/browser/api/atom_api_app.cc +++ b/atom/browser/api/atom_api_app.cc @@ -13,6 +13,7 @@ #include "atom/browser/api/gpuinfo_manager.h" #include "atom/browser/atom_browser_context.h" #include "atom/browser/atom_browser_main_parts.h" +#include "atom/browser/atom_paths.h" #include "atom/browser/login_handler.h" #include "atom/browser/relauncher.h" #include "atom/common/atom_command_line.h" @@ -31,7 +32,6 @@ #include "base/path_service.h" #include "base/strings/string_util.h" #include "base/sys_info.h" -#include "brightray/browser/brightray_paths.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/icon_manager.h" #include "chrome/common/chrome_paths.h" @@ -395,15 +395,15 @@ IconLoader::IconSize GetIconSizeByString(const std::string& size) { // Return the path constant from string. int GetPathConstant(const std::string& name) { if (name == "appData") - return brightray::DIR_APP_DATA; + return DIR_APP_DATA; else if (name == "userData") - return brightray::DIR_USER_DATA; + return DIR_USER_DATA; else if (name == "cache") - return brightray::DIR_CACHE; + return DIR_CACHE; else if (name == "userCache") - return brightray::DIR_USER_CACHE; + return DIR_USER_CACHE; else if (name == "logs") - return brightray::DIR_APP_LOGS; + return DIR_APP_LOGS; else if (name == "home") return base::DIR_HOME; else if (name == "temp") @@ -898,7 +898,7 @@ bool App::RequestSingleInstanceLock() { return true; base::FilePath user_dir; - base::PathService::Get(brightray::DIR_USER_DATA, &user_dir); + base::PathService::Get(DIR_USER_DATA, &user_dir); auto cb = base::Bind(&App::OnSecondInstance, base::Unretained(this)); diff --git a/atom/browser/atom_browser_context.cc b/atom/browser/atom_browser_context.cc index af30a5c6861dc..1b6fff16919d6 100644 --- a/atom/browser/atom_browser_context.cc +++ b/atom/browser/atom_browser_context.cc @@ -9,6 +9,7 @@ #include "atom/browser/atom_blob_reader.h" #include "atom/browser/atom_browser_main_parts.h" #include "atom/browser/atom_download_manager_delegate.h" +#include "atom/browser/atom_paths.h" #include "atom/browser/atom_permission_manager.h" #include "atom/browser/browser.h" #include "atom/browser/cookie_change_notifier.h" @@ -18,6 +19,7 @@ #include "atom/browser/ui/inspectable_web_contents_impl.h" #include "atom/browser/web_view_manager.h" #include "atom/browser/zoom_level_delegate.h" +#include "atom/common/application_info.h" #include "atom/common/atom_version.h" #include "atom/common/chrome_version.h" #include "atom/common/options_switches.h" @@ -28,8 +30,6 @@ #include "base/strings/stringprintf.h" #include "base/threading/sequenced_task_runner_handle.h" #include "base/threading/thread_restrictions.h" -#include "brightray/browser/brightray_paths.h" -#include "brightray/common/application_info.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/pref_names.h" #include "components/keyed_service/content/browser_context_dependency_manager.h" @@ -100,11 +100,10 @@ AtomBrowserContext::AtomBrowserContext(const std::string& partition, base::StringToInt(command_line->GetSwitchValueASCII(switches::kDiskCacheSize), &max_cache_size_); - if (!base::PathService::Get(brightray::DIR_USER_DATA, &path_)) { - base::PathService::Get(brightray::DIR_APP_DATA, &path_); - path_ = path_.Append( - base::FilePath::FromUTF8Unsafe(brightray::GetApplicationName())); - base::PathService::Override(brightray::DIR_USER_DATA, path_); + if (!base::PathService::Get(DIR_USER_DATA, &path_)) { + base::PathService::Get(DIR_APP_DATA, &path_); + path_ = path_.Append(base::FilePath::FromUTF8Unsafe(GetApplicationName())); + base::PathService::Override(DIR_USER_DATA, path_); } if (!in_memory && !partition.empty()) diff --git a/atom/browser/atom_browser_main_parts.cc b/atom/browser/atom_browser_main_parts.cc index ab1839e8e2590..c90534450604c 100644 --- a/atom/browser/atom_browser_main_parts.cc +++ b/atom/browser/atom_browser_main_parts.cc @@ -15,6 +15,7 @@ #include "atom/browser/api/trackable_object.h" #include "atom/browser/atom_browser_client.h" #include "atom/browser/atom_browser_context.h" +#include "atom/browser/atom_paths.h" #include "atom/browser/atom_web_ui_controller_factory.h" #include "atom/browser/browser.h" #include "atom/browser/io_thread.h" @@ -23,6 +24,7 @@ #include "atom/browser/node_debugger.h" #include "atom/browser/ui/devtools_manager_delegate.h" #include "atom/common/api/atom_bindings.h" +#include "atom/common/application_info.h" #include "atom/common/asar/asar_util.h" #include "atom/common/node_bindings.h" #include "base/base_switches.h" @@ -32,8 +34,6 @@ #include "base/path_service.h" #include "base/strings/string_number_conversions.h" #include "base/strings/utf_string_conversions.h" -#include "brightray/browser/brightray_paths.h" -#include "brightray/common/application_info.h" #include "chrome/browser/browser_process_impl.h" #include "chrome/browser/icon_manager.h" #include "chrome/browser/net/chrome_net_log_helper.h" @@ -224,11 +224,10 @@ void AtomBrowserMainParts::InitializeFeatureList() { #if !defined(OS_MACOSX) void AtomBrowserMainParts::OverrideAppLogsPath() { base::FilePath path; - if (base::PathService::Get(brightray::DIR_APP_DATA, &path)) { - path = path.Append( - base::FilePath::FromUTF8Unsafe(brightray::GetApplicationName())); + if (base::PathService::Get(DIR_APP_DATA, &path)) { + path = path.Append(base::FilePath::FromUTF8Unsafe(GetApplicationName())); path = path.Append(base::FilePath::FromUTF8Unsafe("logs")); - base::PathService::Override(brightray::DIR_APP_LOGS, path); + base::PathService::Override(DIR_APP_LOGS, path); } } #endif diff --git a/atom/browser/atom_browser_main_parts_mac.mm b/atom/browser/atom_browser_main_parts_mac.mm index 1ab1bb9fa7029..073945fbecafc 100644 --- a/atom/browser/atom_browser_main_parts_mac.mm +++ b/atom/browser/atom_browser_main_parts_mac.mm @@ -4,11 +4,11 @@ #include "atom/browser/atom_browser_main_parts.h" +#include "atom/browser/atom_paths.h" #include "atom/browser/mac/atom_application_delegate.h" #include "base/mac/bundle_locations.h" #include "base/mac/foundation_util.h" #include "base/path_service.h" -#include "brightray/browser/brightray_paths.h" #include "ui/base/l10n/l10n_util_mac.h" namespace atom { @@ -41,7 +41,7 @@ NSString* libraryPath = [NSHomeDirectory() stringByAppendingPathComponent:logsPath]; - base::PathService::Override(brightray::DIR_APP_LOGS, + base::PathService::Override(DIR_APP_LOGS, base::FilePath([libraryPath UTF8String])); } diff --git a/brightray/browser/brightray_paths.h b/atom/browser/atom_paths.h similarity index 82% rename from brightray/browser/brightray_paths.h rename to atom/browser/atom_paths.h index 5c6c6d9e7adb9..c51af1447f4e0 100644 --- a/brightray/browser/brightray_paths.h +++ b/atom/browser/atom_paths.h @@ -2,8 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef BRIGHTRAY_BROWSER_BRIGHTRAY_PATHS_H_ -#define BRIGHTRAY_BROWSER_BRIGHTRAY_PATHS_H_ +#ifndef ATOM_BROWSER_ATOM_PATHS_H_ +#define ATOM_BROWSER_ATOM_PATHS_H_ + +#include "base/base_paths.h" #if defined(OS_WIN) #include "base/base_paths_win.h" @@ -15,7 +17,7 @@ #include "base/base_paths_posix.h" #endif -namespace brightray { +namespace atom { enum { PATH_START = 11000, @@ -39,6 +41,6 @@ enum { PATH_END }; -} // namespace brightray +} // namespace atom -#endif // BRIGHTRAY_BROWSER_BRIGHTRAY_PATHS_H_ +#endif // ATOM_BROWSER_ATOM_PATHS_H_ diff --git a/atom/browser/browser.cc b/atom/browser/browser.cc index f172a77e72bcb..e37de81042881 100644 --- a/atom/browser/browser.cc +++ b/atom/browser/browser.cc @@ -9,10 +9,12 @@ #include #include "atom/browser/atom_browser_main_parts.h" +#include "atom/browser/atom_paths.h" #include "atom/browser/browser_observer.h" #include "atom/browser/login_handler.h" #include "atom/browser/native_window.h" #include "atom/browser/window_list.h" +#include "atom/common/application_info.h" #include "base/files/file_util.h" #include "base/message_loop/message_loop.h" #include "base/no_destructor.h" @@ -20,8 +22,6 @@ #include "base/run_loop.h" #include "base/threading/thread_restrictions.h" #include "base/threading/thread_task_runner_handle.h" -#include "brightray/browser/brightray_paths.h" -#include "brightray/common/application_info.h" namespace atom { @@ -104,25 +104,25 @@ void Browser::Shutdown() { } std::string Browser::GetVersion() const { - std::string ret = brightray::GetOverriddenApplicationVersion(); + std::string ret = GetOverriddenApplicationVersion(); if (ret.empty()) ret = GetExecutableFileVersion(); return ret; } void Browser::SetVersion(const std::string& version) { - brightray::OverrideApplicationVersion(version); + OverrideApplicationVersion(version); } std::string Browser::GetName() const { - std::string ret = brightray::GetOverriddenApplicationName(); + std::string ret = GetOverriddenApplicationName(); if (ret.empty()) ret = GetExecutableFileProductName(); return ret; } void Browser::SetName(const std::string& name) { - brightray::OverrideApplicationName(name); + OverrideApplicationName(name); } int Browser::GetBadgeCount() { @@ -156,7 +156,7 @@ void Browser::DidFinishLaunching(const base::DictionaryValue& launch_info) { // Make sure the userData directory is created. base::ThreadRestrictions::ScopedAllowIO allow_io; base::FilePath user_data; - if (base::PathService::Get(brightray::DIR_USER_DATA, &user_data)) + if (base::PathService::Get(DIR_USER_DATA, &user_data)) base::CreateDirectoryAndGetError(user_data, nullptr); is_ready_ = true; diff --git a/atom/browser/browser_linux.cc b/atom/browser/browser_linux.cc index 0b4868f711ec2..06f8ee47105e6 100644 --- a/atom/browser/browser_linux.cc +++ b/atom/browser/browser_linux.cc @@ -9,11 +9,11 @@ #include "atom/browser/native_window.h" #include "atom/browser/window_list.h" +#include "atom/common/application_info.h" #include "atom/common/atom_version.h" #include "base/command_line.h" #include "base/environment.h" #include "base/process/launch.h" -#include "brightray/common/application_info.h" #if defined(USE_X11) #include "chrome/browser/ui/libgtkui/gtk_util.h" @@ -131,11 +131,11 @@ Browser::LoginItemSettings Browser::GetLoginItemSettings( } std::string Browser::GetExecutableFileVersion() const { - return brightray::GetApplicationVersion(); + return GetApplicationVersion(); } std::string Browser::GetExecutableFileProductName() const { - return brightray::GetApplicationName(); + return GetApplicationName(); } bool Browser::IsUnityRunning() { diff --git a/atom/browser/browser_mac.mm b/atom/browser/browser_mac.mm index 735e07b2f3be5..d4edb3f577ef8 100644 --- a/atom/browser/browser_mac.mm +++ b/atom/browser/browser_mac.mm @@ -9,13 +9,13 @@ #include "atom/browser/mac/dict_util.h" #include "atom/browser/native_window.h" #include "atom/browser/window_list.h" +#include "atom/common/application_info.h" #include "atom/common/platform_util.h" #include "base/mac/bundle_locations.h" #include "base/mac/foundation_util.h" #include "base/mac/mac_util.h" #include "base/strings/string_number_conversions.h" #include "base/strings/sys_string_conversions.h" -#include "brightray/common/application_info.h" #include "net/base/mac/url_conversions.h" #include "ui/gfx/image/image.h" #include "url/gurl.h" @@ -289,11 +289,11 @@ void RemoveFromLoginItems() { } std::string Browser::GetExecutableFileVersion() const { - return brightray::GetApplicationVersion(); + return GetApplicationVersion(); } std::string Browser::GetExecutableFileProductName() const { - return brightray::GetApplicationName(); + return GetApplicationName(); } int Browser::DockBounce(BounceType type) { diff --git a/atom/browser/browser_win.cc b/atom/browser/browser_win.cc index f5f7465e03661..18cc45741bec3 100644 --- a/atom/browser/browser_win.cc +++ b/atom/browser/browser_win.cc @@ -11,6 +11,7 @@ #include #include "atom/browser/ui/win/jump_list.h" +#include "atom/common/application_info.h" #include "atom/common/atom_version.h" #include "atom/common/native_mate_converters/string16_converter.h" #include "base/base_paths.h" @@ -24,7 +25,6 @@ #include "base/win/registry.h" #include "base/win/win_util.h" #include "base/win/windows_version.h" -#include "brightray/common/application_info.h" namespace atom { @@ -120,7 +120,7 @@ void Browser::ClearRecentDocuments() { } void Browser::SetAppUserModelID(const base::string16& name) { - brightray::SetAppUserModelID(name); + atom::SetAppUserModelID(name); } bool Browser::SetUserTasks(const std::vector& tasks) { @@ -324,7 +324,7 @@ Browser::LoginItemSettings Browser::GetLoginItemSettings( } PCWSTR Browser::GetAppUserModelID() { - return brightray::GetRawAppUserModelID(); + return GetRawAppUserModelID(); } std::string Browser::GetExecutableFileVersion() const { @@ -340,7 +340,7 @@ std::string Browser::GetExecutableFileVersion() const { } std::string Browser::GetExecutableFileProductName() const { - return brightray::GetApplicationName(); + return GetApplicationName(); } } // namespace atom diff --git a/atom/browser/media/media_device_id_salt.cc b/atom/browser/media/media_device_id_salt.cc index 466c631364b69..f7fb66d1584fd 100644 --- a/atom/browser/media/media_device_id_salt.cc +++ b/atom/browser/media/media_device_id_salt.cc @@ -15,7 +15,7 @@ namespace atom { namespace { -const char kMediaDeviceIdSalt[] = "brightray.media.device_id_salt"; +const char kMediaDeviceIdSalt[] = "electron.media.device_id_salt"; } // namespace diff --git a/atom/browser/notifications/linux/libnotify_notification.cc b/atom/browser/notifications/linux/libnotify_notification.cc index 26b65f13310e6..553057f03941e 100644 --- a/atom/browser/notifications/linux/libnotify_notification.cc +++ b/atom/browser/notifications/linux/libnotify_notification.cc @@ -9,12 +9,12 @@ #include #include "atom/browser/notifications/notification_delegate.h" +#include "atom/common/application_info.h" #include "atom/common/platform_util.h" #include "base/files/file_enumerator.h" #include "base/logging.h" #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" -#include "brightray/common/application_info.h" #include "chrome/browser/ui/libgtkui/gtk_util.h" #include "chrome/browser/ui/libgtkui/skia_utils_gtk.h" #include "third_party/skia/include/core/SkBitmap.h" @@ -66,7 +66,7 @@ bool LibnotifyNotification::Initialize() { return false; } if (!libnotify_loader_.notify_is_initted() && - !libnotify_loader_.notify_init(brightray::GetApplicationName().c_str())) { + !libnotify_loader_.notify_init(GetApplicationName().c_str())) { LOG(WARNING) << "Unable to initialize libnotify; notifications disabled"; return false; } diff --git a/atom/browser/notifications/win/windows_toast_notification.cc b/atom/browser/notifications/win/windows_toast_notification.cc index f1e210019bee9..c74326d752596 100644 --- a/atom/browser/notifications/win/windows_toast_notification.cc +++ b/atom/browser/notifications/win/windows_toast_notification.cc @@ -13,10 +13,10 @@ #include "atom/browser/notifications/notification_delegate.h" #include "atom/browser/notifications/win/notification_presenter_win.h" +#include "atom/browser/win/scoped_hstring.h" +#include "atom/common/application_info.h" #include "base/environment.h" #include "base/strings/utf_string_conversions.h" -#include "brightray/browser/win/scoped_hstring.h" -#include "brightray/common/application_info.h" #include "content/public/browser/browser_thread.h" using ABI::Windows::Data::Xml::Dom::IXmlAttribute; @@ -58,13 +58,13 @@ bool WindowsToastNotification::Initialize() { &toast_manager_))) return false; - if (brightray::IsRunningInDesktopBridge()) { + if (IsRunningInDesktopBridge()) { // Ironically, the Desktop Bridge / UWP environment // requires us to not give Windows an appUserModelId. return SUCCEEDED(toast_manager_->CreateToastNotifier(&toast_notifier_)); } else { ScopedHString app_id; - if (!brightray::GetAppUserModelID(&app_id)) + if (!GetAppUserModelID(&app_id)) return false; return SUCCEEDED( diff --git a/atom/browser/notifications/win/windows_toast_notification.h b/atom/browser/notifications/win/windows_toast_notification.h index 3d415a885abe5..7c15a60a5838b 100644 --- a/atom/browser/notifications/win/windows_toast_notification.h +++ b/atom/browser/notifications/win/windows_toast_notification.h @@ -23,10 +23,10 @@ using Microsoft::WRL::Make; using Microsoft::WRL::RuntimeClass; using Microsoft::WRL::RuntimeClassFlags; -class ScopedHString; - namespace atom { +class ScopedHString; + using DesktopToastActivatedEventHandler = ABI::Windows::Foundation::ITypedEventHandler< ABI::Windows::UI::Notifications::ToastNotification*, diff --git a/atom/browser/ui/cocoa/atom_inspectable_web_contents_view.mm b/atom/browser/ui/cocoa/atom_inspectable_web_contents_view.mm index 6d1fc8f250602..49e42fcc6e63b 100644 --- a/atom/browser/ui/cocoa/atom_inspectable_web_contents_view.mm +++ b/atom/browser/ui/cocoa/atom_inspectable_web_contents_view.mm @@ -150,7 +150,7 @@ - (void)setIsDocked:(BOOL)docked { backing:NSBackingStoreBuffered defer:YES]); [devtools_window_ setDelegate:self]; - [devtools_window_ setFrameAutosaveName:@"brightray.devtools"]; + [devtools_window_ setFrameAutosaveName:@"electron.devtools"]; [devtools_window_ setTitle:@"Developer Tools"]; [devtools_window_ setReleasedWhenClosed:NO]; [devtools_window_ setAutorecalculatesContentBorderThickness:NO diff --git a/atom/browser/ui/inspectable_web_contents_impl.cc b/atom/browser/ui/inspectable_web_contents_impl.cc index 9fc86a0b337a4..aa3e0d9cb498c 100644 --- a/atom/browser/ui/inspectable_web_contents_impl.cc +++ b/atom/browser/ui/inspectable_web_contents_impl.cc @@ -59,9 +59,9 @@ const char kChromeUIDevToolsRemoteFrontendBase[] = "https://chrome-devtools-frontend.appspot.com/"; const char kChromeUIDevToolsRemoteFrontendPath[] = "serve_file"; -const char kDevToolsBoundsPref[] = "brightray.devtools.bounds"; -const char kDevToolsZoomPref[] = "brightray.devtools.zoom"; -const char kDevToolsPreferences[] = "brightray.devtools.preferences"; +const char kDevToolsBoundsPref[] = "electron.devtools.bounds"; +const char kDevToolsZoomPref[] = "electron.devtools.zoom"; +const char kDevToolsPreferences[] = "electron.devtools.preferences"; const char kFrontendHostId[] = "id"; const char kFrontendHostMethod[] = "method"; diff --git a/atom/browser/ui/tray_icon_gtk.cc b/atom/browser/ui/tray_icon_gtk.cc index 4c780285c80a1..a1eb3b32b11cc 100644 --- a/atom/browser/ui/tray_icon_gtk.cc +++ b/atom/browser/ui/tray_icon_gtk.cc @@ -5,9 +5,9 @@ #include "atom/browser/ui/tray_icon_gtk.h" #include "atom/browser/browser.h" +#include "atom/common/application_info.h" #include "base/strings/stringprintf.h" #include "base/strings/utf_string_conversions.h" -#include "brightray/common/application_info.h" #include "chrome/browser/ui/libgtkui/app_indicator_icon.h" #include "chrome/browser/ui/libgtkui/gtk_status_icon.h" #include "ui/gfx/image/image.h" @@ -31,7 +31,7 @@ void TrayIconGtk::SetImage(const gfx::Image& image) { return; } - const auto toolTip = base::UTF8ToUTF16(brightray::GetApplicationName()); + const auto toolTip = base::UTF8ToUTF16(GetApplicationName()); if (libgtkui::AppIndicatorIcon::CouldOpen()) { ++indicators_count; diff --git a/brightray/browser/win/scoped_hstring.cc b/atom/browser/win/scoped_hstring.cc similarity index 90% rename from brightray/browser/win/scoped_hstring.cc rename to atom/browser/win/scoped_hstring.cc index 6c9e0a3ec787c..437e45f5123f5 100644 --- a/brightray/browser/win/scoped_hstring.cc +++ b/atom/browser/win/scoped_hstring.cc @@ -2,10 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE-CHROMIUM file. -#include "brightray/browser/win/scoped_hstring.h" +#include "atom/browser/win/scoped_hstring.h" #include +namespace atom { + ScopedHString::ScopedHString(const wchar_t* source) : str_(nullptr) { Reset(source); } @@ -36,3 +38,5 @@ void ScopedHString::Reset(const std::wstring& source) { Reset(); WindowsCreateString(source.c_str(), source.length(), &str_); } + +} // namespace atom diff --git a/brightray/browser/win/scoped_hstring.h b/atom/browser/win/scoped_hstring.h similarity index 82% rename from brightray/browser/win/scoped_hstring.h rename to atom/browser/win/scoped_hstring.h index 879e62cd39b89..2b4b8658ce43b 100644 --- a/brightray/browser/win/scoped_hstring.h +++ b/atom/browser/win/scoped_hstring.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE-CHROMIUM file. -#ifndef BRIGHTRAY_BROWSER_WIN_SCOPED_HSTRING_H_ -#define BRIGHTRAY_BROWSER_WIN_SCOPED_HSTRING_H_ +#ifndef ATOM_BROWSER_WIN_SCOPED_HSTRING_H_ +#define ATOM_BROWSER_WIN_SCOPED_HSTRING_H_ #include #include @@ -12,6 +12,8 @@ #include "base/macros.h" +namespace atom { + class ScopedHString { public: // Copy from |source|. @@ -38,4 +40,6 @@ class ScopedHString { DISALLOW_COPY_AND_ASSIGN(ScopedHString); }; -#endif // BRIGHTRAY_BROWSER_WIN_SCOPED_HSTRING_H_ +} // namespace atom + +#endif // ATOM_BROWSER_WIN_SCOPED_HSTRING_H_ diff --git a/atom/common/api/atom_bindings.cc b/atom/common/api/atom_bindings.cc index 51a85c1297ba6..5590797d4ea34 100644 --- a/atom/common/api/atom_bindings.cc +++ b/atom/common/api/atom_bindings.cc @@ -9,6 +9,7 @@ #include #include "atom/common/api/locker.h" +#include "atom/common/application_info.h" #include "atom/common/atom_version.h" #include "atom/common/chrome_version.h" #include "atom/common/heap_snapshot.h" @@ -20,7 +21,6 @@ #include "base/process/process_metrics_iocounters.h" #include "base/sys_info.h" #include "base/threading/thread_restrictions.h" -#include "brightray/common/application_info.h" #include "native_mate/dictionary.h" namespace atom { @@ -76,7 +76,7 @@ void AtomBindings::BindTo(v8::Isolate* isolate, v8::Local process) { #endif #if defined(OS_WIN) - if (brightray::IsRunningInDesktopBridge()) + if (IsRunningInDesktopBridge()) dict.Set("windowsStore", true); #endif diff --git a/brightray/common/application_info.cc b/atom/common/application_info.cc similarity index 73% rename from brightray/common/application_info.cc rename to atom/common/application_info.cc index 728c8dcdf6d52..53a1b0a52dcfb 100644 --- a/brightray/common/application_info.cc +++ b/atom/common/application_info.cc @@ -1,8 +1,12 @@ -#include "brightray/common/application_info.h" +// Copyright (c) 2013 GitHub, Inc. +// Use of this source code is governed by the MIT license that can be +// found in the LICENSE file. + +#include "atom/common/application_info.h" #include "base/no_destructor.h" -namespace brightray { +namespace atom { namespace { @@ -27,4 +31,4 @@ std::string GetOverriddenApplicationVersion() { return *g_overridden_application_version; } -} // namespace brightray +} // namespace atom diff --git a/brightray/common/application_info.h b/atom/common/application_info.h similarity index 61% rename from brightray/common/application_info.h rename to atom/common/application_info.h index b11893f51ccf2..6243f288682cc 100644 --- a/brightray/common/application_info.h +++ b/atom/common/application_info.h @@ -1,14 +1,18 @@ -#ifndef BRIGHTRAY_COMMON_APPLICATION_INFO_H_ -#define BRIGHTRAY_COMMON_APPLICATION_INFO_H_ +// Copyright (c) 2013 GitHub, Inc. +// Use of this source code is governed by the MIT license that can be +// found in the LICENSE file. + +#ifndef ATOM_COMMON_APPLICATION_INFO_H_ +#define ATOM_COMMON_APPLICATION_INFO_H_ #if defined(OS_WIN) +#include "atom/browser/win/scoped_hstring.h" #include "base/strings/string16.h" -#include "brightray/browser/win/scoped_hstring.h" #endif #include -namespace brightray { +namespace atom { void OverrideApplicationName(const std::string& name); std::string GetOverriddenApplicationName(); @@ -26,6 +30,6 @@ void SetAppUserModelID(const base::string16& name); bool IsRunningInDesktopBridge(); #endif -} // namespace brightray +} // namespace atom -#endif // BRIGHTRAY_COMMON_APPLICATION_INFO_H_ +#endif // ATOM_COMMON_APPLICATION_INFO_H_ diff --git a/atom/common/linux/application_info.cc b/atom/common/application_info_linux.cc similarity index 94% rename from atom/common/linux/application_info.cc rename to atom/common/application_info_linux.cc index 89a3185de46f6..ea69acad12887 100644 --- a/atom/common/linux/application_info.cc +++ b/atom/common/application_info_linux.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "brightray/common/application_info.h" +#include "atom/common/application_info.h" #include #include @@ -30,7 +30,7 @@ GDesktopAppInfo* get_desktop_app_info() { } // namespace -namespace brightray { +namespace atom { std::string GetApplicationName() { // attempt #1: the string set in app.setName() @@ -76,4 +76,4 @@ std::string GetApplicationVersion() { return ret; } -} // namespace brightray +} // namespace atom diff --git a/brightray/common/application_info_mac.mm b/atom/common/application_info_mac.mm similarity index 70% rename from brightray/common/application_info_mac.mm rename to atom/common/application_info_mac.mm index 63db8c9b4c7df..163d0e22c75e9 100644 --- a/brightray/common/application_info_mac.mm +++ b/atom/common/application_info_mac.mm @@ -1,10 +1,14 @@ -#import "brightray/common/application_info.h" +// Copyright (c) 2013 GitHub, Inc. +// Use of this source code is governed by the MIT license that can be +// found in the LICENSE file. +#import "atom/common/application_info.h" + +#import "atom/common/mac/main_application_bundle.h" #import "base/mac/foundation_util.h" #import "base/strings/sys_string_conversions.h" -#import "brightray/common/mac/main_application_bundle.h" -namespace brightray { +namespace atom { namespace { @@ -27,4 +31,4 @@ return ApplicationInfoDictionaryValue(@"CFBundleShortVersionString"); } -} // namespace brightray +} // namespace atom diff --git a/brightray/common/application_info_win.cc b/atom/common/application_info_win.cc similarity index 92% rename from brightray/common/application_info_win.cc rename to atom/common/application_info_win.cc index abd28eee4fd57..a6f4e939f49a3 100644 --- a/brightray/common/application_info_win.cc +++ b/atom/common/application_info_win.cc @@ -1,4 +1,8 @@ -#include "brightray/common/application_info.h" +// Copyright (c) 2013 GitHub, Inc. +// Use of this source code is governed by the MIT license that can be +// found in the LICENSE file. + +#include "atom/common/application_info.h" #include // windows.h must be included first @@ -8,13 +12,13 @@ #include +#include "atom/browser/win/scoped_hstring.h" #include "base/file_version_info.h" #include "base/strings/string_util.h" #include "base/strings/stringprintf.h" #include "base/strings/utf_string_conversions.h" -#include "brightray/browser/win/scoped_hstring.h" -namespace brightray { +namespace atom { namespace { @@ -106,4 +110,4 @@ bool IsRunningInDesktopBridge() { return result; } -} // namespace brightray +} // namespace atom diff --git a/atom/common/mac/main_application_bundle.h b/atom/common/mac/main_application_bundle.h new file mode 100644 index 0000000000000..ab1ea6d614daf --- /dev/null +++ b/atom/common/mac/main_application_bundle.h @@ -0,0 +1,26 @@ +// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright (c) 2013 Adam Roben . All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE-CHROMIUM file. + +#ifndef ATOM_COMMON_MAC_MAIN_APPLICATION_BUNDLE_H_ +#define ATOM_COMMON_MAC_MAIN_APPLICATION_BUNDLE_H_ + +@class NSBundle; + +namespace base { +class FilePath; +} + +namespace atom { + +// The "main" application bundle is the outermost bundle for this logical +// application. E.g., if you have MyApp.app and +// MyApp.app/Contents/Frameworks/MyApp Helper.app, the main application bundle +// is MyApp.app, no matter which executable is currently running. +NSBundle* MainApplicationBundle(); +base::FilePath MainApplicationBundlePath(); + +} // namespace atom + +#endif // ATOM_COMMON_MAC_MAIN_APPLICATION_BUNDLE_H_ diff --git a/brightray/common/mac/main_application_bundle.mm b/atom/common/mac/main_application_bundle.mm similarity index 94% rename from brightray/common/mac/main_application_bundle.mm rename to atom/common/mac/main_application_bundle.mm index 9a26b079f59ef..6971424e9cd8a 100644 --- a/brightray/common/mac/main_application_bundle.mm +++ b/atom/common/mac/main_application_bundle.mm @@ -3,7 +3,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE-CHROMIUM file. -#import "brightray/common/mac/main_application_bundle.h" +#import "atom/common/mac/main_application_bundle.h" #include "base/files/file_path.h" #include "base/mac/bundle_locations.h" @@ -11,7 +11,7 @@ #include "base/path_service.h" #include "base/strings/string_util.h" -namespace brightray { +namespace atom { namespace { @@ -53,4 +53,4 @@ bool HasMainProcessKey() { MainApplicationBundlePath())]; } -} // namespace brightray +} // namespace atom diff --git a/atom/renderer/atom_sandboxed_renderer_client.cc b/atom/renderer/atom_sandboxed_renderer_client.cc index 688f33bc165b0..db05f967188c5 100644 --- a/atom/renderer/atom_sandboxed_renderer_client.cc +++ b/atom/renderer/atom_sandboxed_renderer_client.cc @@ -6,6 +6,7 @@ #include "atom/common/api/api_messages.h" #include "atom/common/api/atom_bindings.h" +#include "atom/common/application_info.h" #include "atom/common/native_mate_converters/string16_converter.h" #include "atom/common/native_mate_converters/value_converter.h" #include "atom/common/node_bindings.h" @@ -17,7 +18,6 @@ #include "base/files/file_path.h" #include "base/path_service.h" #include "base/process/process_handle.h" -#include "brightray/common/application_info.h" #include "content/public/renderer/render_frame.h" #include "native_mate/dictionary.h" #include "third_party/blink/public/web/blink.h" @@ -168,7 +168,7 @@ void AtomSandboxedRendererClient::InitializeBindings( #endif #if defined(OS_WIN) - if (brightray::IsRunningInDesktopBridge()) + if (IsRunningInDesktopBridge()) process.Set("windowsStore", true); #endif diff --git a/brightray/BUILD.gn b/brightray/BUILD.gn deleted file mode 100644 index 53a3447b1c77a..0000000000000 --- a/brightray/BUILD.gn +++ /dev/null @@ -1,31 +0,0 @@ -import("//build/config/ui.gni") - -static_library("brightray") { - deps = [ - "//base", - "//base:base_static", - "//content/public/browser", - "//content/shell:copy_shell_resources", - "//net:extras", - "//net:net_with_v8", - "//ui/views", - ] - - include_dirs = [ ".." ] - - if (is_linux) { - deps += [ "//build/config/linux/gtk" ] - } - - sources = [ - "browser/brightray_paths.h", - "browser/win/scoped_hstring.cc", - "browser/win/scoped_hstring.h", - "common/application_info.cc", - "common/application_info.h", - "common/application_info_mac.mm", - "common/application_info_win.cc", - "common/mac/main_application_bundle.h", - "common/mac/main_application_bundle.mm", - ] -} diff --git a/brightray/CPPLINT.cfg b/brightray/CPPLINT.cfg deleted file mode 100644 index 88c6f99113d51..0000000000000 --- a/brightray/CPPLINT.cfg +++ /dev/null @@ -1 +0,0 @@ -filter=-legal/copyright diff --git a/brightray/LICENSE b/brightray/LICENSE deleted file mode 100644 index fe24a3c65fbd7..0000000000000 --- a/brightray/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2013-2014 Adam Roben - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/brightray/LICENSE-CHROMIUM b/brightray/LICENSE-CHROMIUM deleted file mode 100644 index 3d0f7d3edfd81..0000000000000 --- a/brightray/LICENSE-CHROMIUM +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) 2013 The Chromium Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/brightray/common/mac/main_application_bundle.h b/brightray/common/mac/main_application_bundle.h deleted file mode 100644 index 555738023cfd6..0000000000000 --- a/brightray/common/mac/main_application_bundle.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef BRIGHTRAY_COMMON_MAC_MAIN_APPLICATION_BUNDLE_H_ -#define BRIGHTRAY_COMMON_MAC_MAIN_APPLICATION_BUNDLE_H_ - -@class NSBundle; - -namespace base { -class FilePath; -} - -namespace brightray { - -// The "main" application bundle is the outermost bundle for this logical -// application. E.g., if you have MyApp.app and -// MyApp.app/Contents/Frameworks/MyApp Helper.app, the main application bundle -// is MyApp.app, no matter which executable is currently running. -NSBundle* MainApplicationBundle(); -base::FilePath MainApplicationBundlePath(); - -} // namespace brightray - -#endif // BRIGHTRAY_COMMON_MAC_MAIN_APPLICATION_BUNDLE_H_ diff --git a/docs/development/build-system-overview.md b/docs/development/build-system-overview.md index 1983de07ec1c9..881e4cc653fd4 100644 --- a/docs/development/build-system-overview.md +++ b/docs/development/build-system-overview.md @@ -8,8 +8,7 @@ be found in the `.gn` and `.gni` files. The following `gn` files contain the main rules for building Electron: -* `BUILD.gn` defines how Electron itself is built. -* `brightray/BUILD.gn` defines how `brightray` is built and +* `BUILD.gn` defines how Electron itself is built and includes the default configurations for linking with Chromium. * `build/args/{debug,release,all}.gn` contain the default build arguments for building Electron. diff --git a/docs/development/debug-instructions-windows.md b/docs/development/debug-instructions-windows.md index 93f0ec7e2ea32..c2d79003cec78 100644 --- a/docs/development/debug-instructions-windows.md +++ b/docs/development/debug-instructions-windows.md @@ -48,8 +48,7 @@ still set breakpoints - Visual Studio will automatically figure out that the source code matches the code running in the attached process and break accordingly. -Relevant code files can be found in `./atom/` as well as in Brightray, found in -`./brightray/browser` and `./brightray/common`. +Relevant code files can be found in `./atom/`. ### Attaching diff --git a/docs/development/debugging-instructions-macos.md b/docs/development/debugging-instructions-macos.md index cf31b7184933d..630ab12113871 100644 --- a/docs/development/debugging-instructions-macos.md +++ b/docs/development/debugging-instructions-macos.md @@ -41,8 +41,7 @@ this basic introduction, let's assume that you're calling a command from JavaScr that isn't behaving correctly - so you'd like to break on that command's C++ counterpart inside the Electron source. -Relevant code files can be found in `./atom/` as well as in Brightray, found in -`./brightray/browser` and `./brightray/common`. +Relevant code files can be found in `./atom/`. Let's assume that you want to debug `app.setName()`, which is defined in `browser.cc` as `Browser::SetName()`. Set the breakpoint using the `breakpoint` command, specifying diff --git a/docs/development/pull-requests.md b/docs/development/pull-requests.md index 4af63ababded4..19960889ff956 100644 --- a/docs/development/pull-requests.md +++ b/docs/development/pull-requests.md @@ -55,7 +55,7 @@ $ git checkout -b my-branch -t upstream/master ### Step 4: Code Most pull requests opened against the `electron/electron` repository include -changes to either the C/C++ code in the `atom/` or `brightray/` folders, +changes to either the C/C++ code in the `atom/` folder, the JavaScript code in the `lib/` folder, the documentation in `docs/api/` or tests in the `spec/` folder. diff --git a/docs/development/source-code-directory-structure.md b/docs/development/source-code-directory-structure.md index c009c53465cff..5a0369c4a32e4 100644 --- a/docs/development/source-code-directory-structure.md +++ b/docs/development/source-code-directory-structure.md @@ -31,7 +31,6 @@ Electron | | message loop into Chromium's message loop. | └── api/ - The implementation of common APIs, and foundations of | Electron's built-in modules. -├── brightray/ - Thin shim over libcc that makes it easier to use. ├── chromium_src/ - Source code copied from Chromium. See below. ├── default_app/ - The default page to show when Electron is started without | providing an app. diff --git a/docs/glossary.md b/docs/glossary.md index da1ddd28f1def..dab5b97b3fc2f 100644 --- a/docs/glossary.md +++ b/docs/glossary.md @@ -10,12 +10,6 @@ arbitrary files from it without unpacking the whole file. The ASAR format was created primarily to improve performance on Windows... TODO -### Brightray - -Brightray [was](https://github.com/electron-archive/brightray) a static library -that made [libchromiumcontent] easier to use in applications. It is now -deprecated and has been merged into Electron's codebase. - ### CRT The C Run-time Library (CRT) is the part of the C++ Standard Library that @@ -74,7 +68,7 @@ MAS, see the [Mac App Store Submission Guide]. ### Mojo -An IPC system for communicating intra- or inter-process, and that's important because Chrome is keen on being able to split its work into separate processes or not, depending on memory pressures etc. +An IPC system for communicating intra- or inter-process, and that's important because Chrome is keen on being able to split its work into separate processes or not, depending on memory pressures etc. See https://chromium.googlesource.com/chromium/src/+/master/mojo/README.md diff --git a/filenames.gni b/filenames.gni index 851f936dd40e4..4db83434a586b 100644 --- a/filenames.gni +++ b/filenames.gni @@ -223,6 +223,7 @@ filenames = { "atom/browser/atom_javascript_dialog_manager.h", "atom/browser/atom_navigation_throttle.h", "atom/browser/atom_navigation_throttle.cc", + "atom/browser/atom_paths.h", "atom/browser/atom_permission_manager.cc", "atom/browser/atom_permission_manager.h", "atom/browser/atom_quota_permission_context.cc", @@ -495,6 +496,8 @@ filenames = { "atom/browser/ui/x/x_window_utils.h", "atom/browser/unresponsive_suppressor.cc", "atom/browser/unresponsive_suppressor.h", + "atom/browser/win/scoped_hstring.cc", + "atom/browser/win/scoped_hstring.h", "atom/browser/web_contents_permission_helper.cc", "atom/browser/web_contents_permission_helper.h", "atom/browser/web_contents_preferences.cc", @@ -544,6 +547,11 @@ filenames = { "atom/common/asar/asar_util.h", "atom/common/asar/scoped_temporary_file.cc", "atom/common/asar/scoped_temporary_file.h", + "atom/common/application_info_linux.cc", + "atom/common/application_info_mac.mm", + "atom/common/application_info_win.cc", + "atom/common/application_info.cc", + "atom/common/application_info.h", "atom/common/atom_command_line.cc", "atom/common/atom_command_line.h", "atom/common/atom_constants.cc", @@ -576,7 +584,8 @@ filenames = { "atom/common/keyboard_util.h", "atom/common/mouse_util.cc", "atom/common/mouse_util.h", - "atom/common/linux/application_info.cc", + "atom/common/mac/main_application_bundle.h", + "atom/common/mac/main_application_bundle.mm", "atom/common/native_mate_converters/accelerator_converter.cc", "atom/common/native_mate_converters/accelerator_converter.h", "atom/common/native_mate_converters/blink_converter.cc", diff --git a/package.json b/package.json index d462c142b2c3a..45de787f834c6 100644 --- a/package.json +++ b/package.json @@ -43,10 +43,10 @@ "browserify": "browserify", "bump-version": "./script/bump-version.py", "check-tls": "python ./script/tls.py", - "clang-format": "find atom/ brightray/ chromium_src/ -iname *.h -o -iname *.cc -o -iname *.mm | xargs clang-format -i", + "clang-format": "find atom/ chromium_src/ -iname *.h -o -iname *.cc -o -iname *.mm | xargs clang-format -i", "lint": "node ./script/lint.js && npm run lint:clang-format && npm run lint:docs", "lint:js": "node ./script/lint.js --js", - "lint:clang-format": "python script/run-clang-format.py -r -c atom/ chromium_src/ brightray/ || (echo \"\\nCode not formatted correctly.\" && exit 1)", + "lint:clang-format": "python script/run-clang-format.py -r -c atom/ chromium_src/ || (echo \"\\nCode not formatted correctly.\" && exit 1)", "lint:cpp": "node ./script/lint.js --cc", "lint:py": "node ./script/lint.js --py", "lint:gn": "node ./script/lint.js --gn", @@ -56,7 +56,7 @@ "create-api-json": "electron-docs-linter docs --outfile=electron-api.json", "create-typescript-definitions": "npm run create-api-json && electron-typescript-definitions --in=electron-api.json --out=electron.d.ts", "preinstall": "node -e 'process.exit(0)'", - "precommit": "python script/run-clang-format.py -r -c atom/ chromium_src/ brightray/ && node ./script/lint.js -c && remark docs -qf || (echo \"Code not formatted correctly.\" && exit 1)", + "precommit": "python script/run-clang-format.py -r -c atom/ chromium_src/ && node ./script/lint.js -c && remark docs -qf || (echo \"Code not formatted correctly.\" && exit 1)", "prepack": "check-for-leaks", "prepush": "check-for-leaks", "repl": "node ./script/start.js --interactive", diff --git a/patches/common/chromium/.patches.yaml b/patches/common/chromium/.patches.yaml index e3cdf41e2ec80..2c5278e37d31f 100644 --- a/patches/common/chromium/.patches.yaml +++ b/patches/common/chromium/.patches.yaml @@ -259,7 +259,7 @@ patches: author: Jeremy Apthorp file: gtk_visibility.patch description: | - Allow electron and brightray to depend on GTK in the GN build. + Allow electron to depend on GTK in the GN build. - author: Jeremy Apthorp file: sysroot.patch diff --git a/patches/common/chromium/gtk_visibility.patch b/patches/common/chromium/gtk_visibility.patch index e9a0028887166..80cb06f871ffe 100644 --- a/patches/common/chromium/gtk_visibility.patch +++ b/patches/common/chromium/gtk_visibility.patch @@ -3,21 +3,20 @@ From: Jeremy Apthorp Date: Thu, 20 Sep 2018 17:48:38 -0700 Subject: gtk_visibility.patch -Allow electron and brightray to depend on GTK in the GN build. +Allow electron to depend on GTK in the GN build. diff --git a/build/config/linux/gtk/BUILD.gn b/build/config/linux/gtk/BUILD.gn -index deae4d3455a8..fd5d906b98b0 100644 +index deae4d3455a8..5f5db2fd6e5e 100644 --- a/build/config/linux/gtk/BUILD.gn +++ b/build/config/linux/gtk/BUILD.gn -@@ -18,6 +18,8 @@ group("gtk") { +@@ -18,6 +18,7 @@ group("gtk") { visibility = [ "//chrome/test:interactive_ui_tests", "//chrome/test:unit_tests", + "//electron:*", -+ "//electron/brightray:*", "//examples:peerconnection_client", "//gpu/gles2_conform_support:gles2_conform_test_windowless", "//remoting/host", --- +-- 2.17.0 diff --git a/script/lint.js b/script/lint.js index c8a79811bc234..a95134de115b7 100755 --- a/script/lint.js +++ b/script/lint.js @@ -40,7 +40,7 @@ function spawnAndCheckExitCode (cmd, args, opts) { const LINTERS = [ { key: 'c++', - roots: ['atom', 'brightray'], + roots: ['atom'], test: filename => filename.endsWith('.cc') || filename.endsWith('.h'), run: (opts, filenames) => { if (opts.fix) {