fix: revert {Atom => Electron}Application rename (#22206)

This commit is contained in:
Jeremy Apthorp 2020-02-21 11:05:03 -08:00 коммит произвёл GitHub
Родитель e0c0875d6f
Коммит 8045152e59
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
7 изменённых файлов: 28 добавлений и 30 удалений

Просмотреть файл

@ -82,7 +82,7 @@ void ElectronMainDelegate::SetUpBundleOverrides() {
void RegisterAtomCrApp() { void RegisterAtomCrApp() {
// Force the NSApplication subclass to be used. // Force the NSApplication subclass to be used.
[ElectronApplication sharedApplication]; [AtomApplication sharedApplication];
} }
} // namespace electron } // namespace electron

Просмотреть файл

@ -29,20 +29,19 @@
namespace electron { namespace electron {
void Browser::SetShutdownHandler(base::Callback<bool()> handler) { void Browser::SetShutdownHandler(base::Callback<bool()> handler) {
[[ElectronApplication sharedApplication] [[AtomApplication sharedApplication] setShutdownHandler:std::move(handler)];
setShutdownHandler:std::move(handler)];
} }
void Browser::Focus() { void Browser::Focus() {
[[ElectronApplication sharedApplication] activateIgnoringOtherApps:NO]; [[AtomApplication sharedApplication] activateIgnoringOtherApps:NO];
} }
void Browser::Hide() { void Browser::Hide() {
[[ElectronApplication sharedApplication] hide:nil]; [[AtomApplication sharedApplication] hide:nil];
} }
void Browser::Show() { void Browser::Show() {
[[ElectronApplication sharedApplication] unhide:nil]; [[AtomApplication sharedApplication] unhide:nil];
} }
void Browser::AddRecentDocument(const base::FilePath& path) { void Browser::AddRecentDocument(const base::FilePath& path) {
@ -163,7 +162,7 @@ void Browser::SetUserActivity(const std::string& type,
std::string url_string; std::string url_string;
args->GetNext(&url_string); args->GetNext(&url_string);
[[ElectronApplication sharedApplication] [[AtomApplication sharedApplication]
setCurrentActivity:base::SysUTF8ToNSString(type) setCurrentActivity:base::SysUTF8ToNSString(type)
withUserInfo:DictionaryValueToNSDictionary(user_info) withUserInfo:DictionaryValueToNSDictionary(user_info)
withWebpageURL:net::NSURLWithGURL(GURL(url_string))]; withWebpageURL:net::NSURLWithGURL(GURL(url_string))];
@ -171,21 +170,21 @@ void Browser::SetUserActivity(const std::string& type,
std::string Browser::GetCurrentActivityType() { std::string Browser::GetCurrentActivityType() {
NSUserActivity* userActivity = NSUserActivity* userActivity =
[[ElectronApplication sharedApplication] getCurrentActivity]; [[AtomApplication sharedApplication] getCurrentActivity];
return base::SysNSStringToUTF8(userActivity.activityType); return base::SysNSStringToUTF8(userActivity.activityType);
} }
void Browser::InvalidateCurrentActivity() { void Browser::InvalidateCurrentActivity() {
[[ElectronApplication sharedApplication] invalidateCurrentActivity]; [[AtomApplication sharedApplication] invalidateCurrentActivity];
} }
void Browser::ResignCurrentActivity() { void Browser::ResignCurrentActivity() {
[[ElectronApplication sharedApplication] resignCurrentActivity]; [[AtomApplication sharedApplication] resignCurrentActivity];
} }
void Browser::UpdateCurrentActivity(const std::string& type, void Browser::UpdateCurrentActivity(const std::string& type,
base::DictionaryValue user_info) { base::DictionaryValue user_info) {
[[ElectronApplication sharedApplication] [[AtomApplication sharedApplication]
updateCurrentActivity:base::SysUTF8ToNSString(type) updateCurrentActivity:base::SysUTF8ToNSString(type)
withUserInfo:DictionaryValueToNSDictionary(user_info)]; withUserInfo:DictionaryValueToNSDictionary(user_info)];
} }
@ -291,17 +290,16 @@ std::string Browser::GetExecutableFileProductName() const {
} }
int Browser::DockBounce(BounceType type) { int Browser::DockBounce(BounceType type) {
return [[ElectronApplication sharedApplication] return [[AtomApplication sharedApplication]
requestUserAttention:static_cast<NSRequestUserAttentionType>(type)]; requestUserAttention:static_cast<NSRequestUserAttentionType>(type)];
} }
void Browser::DockCancelBounce(int request_id) { void Browser::DockCancelBounce(int request_id) {
[[ElectronApplication sharedApplication] [[AtomApplication sharedApplication] cancelUserAttentionRequest:request_id];
cancelUserAttentionRequest:request_id];
} }
void Browser::DockSetBadgeText(const std::string& label) { void Browser::DockSetBadgeText(const std::string& label) {
NSDockTile* tile = [[ElectronApplication sharedApplication] dockTile]; NSDockTile* tile = [[AtomApplication sharedApplication] dockTile];
[tile setBadgeLabel:base::SysUTF8ToNSString(label)]; [tile setBadgeLabel:base::SysUTF8ToNSString(label)];
} }
@ -312,7 +310,7 @@ void Browser::DockDownloadFinished(const std::string& filePath) {
} }
std::string Browser::DockGetBadgeText() { std::string Browser::DockGetBadgeText() {
NSDockTile* tile = [[ElectronApplication sharedApplication] dockTile]; NSDockTile* tile = [[AtomApplication sharedApplication] dockTile];
return base::SysNSStringToUTF8([tile badgeLabel]); return base::SysNSStringToUTF8([tile badgeLabel]);
} }
@ -371,7 +369,7 @@ void Browser::DockSetMenu(ElectronMenuModel* model) {
} }
void Browser::DockSetIcon(const gfx::Image& image) { void Browser::DockSetIcon(const gfx::Image& image) {
[[ElectronApplication sharedApplication] [[AtomApplication sharedApplication]
setApplicationIconImage:image.AsNSImage()]; setApplicationIconImage:image.AsNSImage()];
} }
@ -394,7 +392,7 @@ void Browser::ShowAboutPanel() {
options = [NSDictionary dictionaryWithDictionary:mutable_options]; options = [NSDictionary dictionaryWithDictionary:mutable_options];
} }
[[ElectronApplication sharedApplication] [[AtomApplication sharedApplication]
orderFrontStandardAboutPanelWithOptions:options]; orderFrontStandardAboutPanelWithOptions:options];
} }
@ -411,7 +409,7 @@ void Browser::SetAboutPanelOptions(base::DictionaryValue options) {
} }
void Browser::ShowEmojiPanel() { void Browser::ShowEmojiPanel() {
[[ElectronApplication sharedApplication] orderFrontCharacterPalette:nil]; [[AtomApplication sharedApplication] orderFrontCharacterPalette:nil];
} }
bool Browser::IsEmojiPanelSupported() { bool Browser::IsEmojiPanelSupported() {

Просмотреть файл

@ -35,7 +35,7 @@ void ElectronBrowserMainParts::FreeAppDelegate() {
} }
void ElectronBrowserMainParts::RegisterURLHandler() { void ElectronBrowserMainParts::RegisterURLHandler() {
[[ElectronApplication sharedApplication] registerURLHandler]; [[AtomApplication sharedApplication] registerURLHandler];
} }
// Replicates NSApplicationMain, but doesn't start a run loop. // Replicates NSApplicationMain, but doesn't start a run loop.

Просмотреть файл

@ -9,7 +9,7 @@
#import <AVFoundation/AVFoundation.h> #import <AVFoundation/AVFoundation.h>
#import <LocalAuthentication/LocalAuthentication.h> #import <LocalAuthentication/LocalAuthentication.h>
@interface ElectronApplication : NSApplication <CrAppProtocol, @interface AtomApplication : NSApplication <CrAppProtocol,
CrAppControlProtocol, CrAppControlProtocol,
NSUserActivityDelegate> { NSUserActivityDelegate> {
@private @private
@ -20,7 +20,7 @@
base::Callback<bool()> shouldShutdown_; base::Callback<bool()> shouldShutdown_;
} }
+ (ElectronApplication*)sharedApplication; + (AtomApplication*)sharedApplication;
- (void)setShutdownHandler:(base::Callback<bool()>)handler; - (void)setShutdownHandler:(base::Callback<bool()>)handler;
- (void)registerURLHandler; - (void)registerURLHandler;

Просмотреть файл

@ -29,16 +29,16 @@ inline void dispatch_sync_main(dispatch_block_t block) {
} // namespace } // namespace
@interface ElectronApplication () <NativeEventProcessor> { @interface AtomApplication () <NativeEventProcessor> {
base::ObserverList<content::NativeEventProcessorObserver>::Unchecked base::ObserverList<content::NativeEventProcessorObserver>::Unchecked
observers_; observers_;
} }
@end @end
@implementation ElectronApplication @implementation AtomApplication
+ (ElectronApplication*)sharedApplication { + (AtomApplication*)sharedApplication {
return (ElectronApplication*)[super sharedApplication]; return (AtomApplication*)[super sharedApplication];
} }
- (void)terminate:(id)sender { - (void)terminate:(id)sender {

Просмотреть файл

@ -27,7 +27,7 @@
<key>NSMainNibFile</key> <key>NSMainNibFile</key>
<string>MainMenu</string> <string>MainMenu</string>
<key>NSPrincipalClass</key> <key>NSPrincipalClass</key>
<string>ElectronApplication</string> <string>AtomApplication</string>
<key>NSSupportsAutomaticGraphicsSwitching</key> <key>NSSupportsAutomaticGraphicsSwitching</key>
<true/> <true/>
<key>NSHighResolutionCapable</key> <key>NSHighResolutionCapable</key>

Просмотреть файл

@ -24,7 +24,7 @@
</object> </object>
<array class="NSMutableArray" key="IBDocument.RootObjects" id="1048"> <array class="NSMutableArray" key="IBDocument.RootObjects" id="1048">
<object class="NSCustomObject" id="1021"> <object class="NSCustomObject" id="1021">
<string key="NSClassName">ElectronApplication</string> <string key="NSClassName">AtomApplication</string>
</object> </object>
<object class="NSCustomObject" id="1014"> <object class="NSCustomObject" id="1014">
<string key="NSClassName">FirstResponder</string> <string key="NSClassName">FirstResponder</string>