Permalink
Browse files
chore: add clang-format and limited linting for Objective-C sources (#…
- Loading branch information...
|
|
@@ -1,3 +1,7 @@ |
|
|
|
// Copyright (c) 2017 GitHub, Inc. |
|
|
|
// Use of this source code is governed by the MIT license that can be |
|
|
|
// found in the LICENSE file. |
|
|
|
|
|
|
|
#import <Cocoa/Cocoa.h> |
|
|
|
|
|
|
|
int main(int argc, char* argv[]) { |
|
|
|
|
|
@@ -4,6 +4,8 @@ |
|
|
|
|
|
|
|
#include "atom/app/atom_main_delegate.h" |
|
|
|
|
|
|
|
#include <string> |
|
|
|
|
|
|
|
#include "atom/browser/mac/atom_application.h" |
|
|
|
#include "atom/common/application_info.h" |
|
|
|
#include "atom/common/mac/main_application_bundle.h" |
|
|
|
|
|
@@ -33,6 +33,6 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} // namespace atom |
|
|
|
|
|
|
|
} // namespace api |
|
|
|
|
|
|
|
} // namespace atom |
|
|
@@ -4,6 +4,8 @@ |
|
|
|
|
|
|
|
#include "atom/browser/api/atom_api_app.h" |
|
|
|
|
|
|
|
#include <string> |
|
|
|
|
|
|
|
#import <Cocoa/Cocoa.h> |
|
|
|
|
|
|
|
#include "base/strings/sys_string_conversions.h" |
|
|
@@ -59,6 +61,6 @@ void OnStopAccessingSecurityScopedResource(NSURL* bookmarkUrl) { |
|
|
|
bookmarkUrl); |
|
|
|
} |
|
|
|
|
|
|
|
} // namespace atom |
|
|
|
|
|
|
|
} // namespace api |
|
|
|
|
|
|
|
} // namespace atom |
|
|
@@ -4,6 +4,9 @@ |
|
|
|
|
|
|
|
#include "atom/browser/api/atom_api_browser_window.h" |
|
|
|
|
|
|
|
#include <memory> |
|
|
|
#include <vector> |
|
|
|
|
|
|
|
#import <Cocoa/Cocoa.h> |
|
|
|
|
|
|
|
#include "atom/browser/native_browser_view.h" |
|
|
|
|
|
@@ -4,6 +4,9 @@ |
|
|
|
|
|
|
|
#import "atom/browser/api/atom_api_menu_mac.h" |
|
|
|
|
|
|
|
#include <string> |
|
|
|
#include <utility> |
|
|
|
|
|
|
|
#include "atom/browser/native_window.h" |
|
|
|
#include "atom/browser/unresponsive_suppressor.h" |
|
|
|
#include "atom/common/node_includes.h" |
|
|
|
|
|
@@ -4,7 +4,9 @@ |
|
|
|
|
|
|
|
#include "atom/browser/api/atom_api_power_monitor.h" |
|
|
|
|
|
|
|
#include <ApplicationServices/ApplicationServices.h> |
|
|
|
#include <vector> |
|
|
|
|
|
|
|
#import <ApplicationServices/ApplicationServices.h> |
|
|
|
#import <Cocoa/Cocoa.h> |
|
|
|
|
|
|
|
@interface MacLockMonitor : NSObject { |
|
|
|
|
|
@@ -5,6 +5,9 @@ |
|
|
|
#include "atom/browser/api/atom_api_system_preferences.h" |
|
|
|
|
|
|
|
#include <map> |
|
|
|
#include <memory> |
|
|
|
#include <string> |
|
|
|
#include <utility> |
|
|
|
|
|
|
|
#import <AVFoundation/AVFoundation.h> |
|
|
|
#import <Cocoa/Cocoa.h> |
|
|
|
|
|
@@ -4,6 +4,8 @@ |
|
|
|
|
|
|
|
#include "atom/browser/auto_updater.h" |
|
|
|
|
|
|
|
#include <string> |
|
|
|
|
|
|
|
#import <ReactiveCocoa/NSObject+RACPropertySubscribing.h> |
|
|
|
#import <ReactiveCocoa/RACCommand.h> |
|
|
|
#import <ReactiveCocoa/RACSignal.h> |
|
|
@@ -29,7 +31,7 @@ |
|
|
|
namespace { |
|
|
|
|
|
|
|
bool g_update_available = false; |
|
|
|
std::string update_url_ = ""; |
|
|
|
std::string update_url_ = ""; // NOLINT(runtime/string) |
|
|
|
|
|
|
|
} // namespace |
|
|
|
|
|
|
|
|
|
@@ -4,6 +4,9 @@ |
|
|
|
|
|
|
|
#include "atom/browser/browser.h" |
|
|
|
|
|
|
|
#include <string> |
|
|
|
#include <utility> |
|
|
|
|
|
|
|
#include "atom/browser/mac/atom_application.h" |
|
|
|
#include "atom/browser/mac/atom_application_delegate.h" |
|
|
|
#include "atom/browser/mac/dict_util.h" |
|
|
@@ -282,9 +285,9 @@ void RemoveFromLoginItems() { |
|
|
|
LOG(ERROR) << "Unable to set login item enabled on sandboxed app."; |
|
|
|
} |
|
|
|
#else |
|
|
|
if (settings.open_at_login) |
|
|
|
if (settings.open_at_login) { |
|
|
|
base::mac::AddToLoginItems(settings.open_as_hidden); |
|
|
|
else { |
|
|
|
} else { |
|
|
|
RemoveFromLoginItems(); |
|
|
|
} |
|
|
|
#endif |
|
|
|
|
|
@@ -4,6 +4,10 @@ |
|
|
|
|
|
|
|
#import "atom/browser/mac/atom_application.h" |
|
|
|
|
|
|
|
#include <memory> |
|
|
|
#include <string> |
|
|
|
#include <utility> |
|
|
|
|
|
|
|
#include "atom/browser/browser.h" |
|
|
|
#import "atom/browser/mac/atom_application_delegate.h" |
|
|
|
#include "atom/browser/mac/dict_util.h" |
|
|
|
|
|
@@ -4,6 +4,9 @@ |
|
|
|
|
|
|
|
#import "atom/browser/mac/atom_application_delegate.h" |
|
|
|
|
|
|
|
#include <memory> |
|
|
|
#include <string> |
|
|
|
|
|
|
|
#include "atom/browser/browser.h" |
|
|
|
#import "atom/browser/mac/atom_application.h" |
|
|
|
#include "atom/browser/mac/dict_util.h" |
|
|
@@ -24,7 +27,7 @@ @interface OOMDisabledIMKInputSession : NSObject |
|
|
|
@end |
|
|
|
@implementation OOMDisabledIMKInputSession |
|
|
|
- (void)_coreAttributesFromRange:(NSRange)range |
|
|
|
whichAttributes:(long long)attributes |
|
|
|
whichAttributes:(long long)attributes // NOLINT(runtime/int) |
|
|
|
completionHandler:(void (^)(void))block { |
|
|
|
// The allocator flag is per-process, so other threads may temporarily |
|
|
|
// not have fatal OOM occur while this method executes, but it is better |
|
|
|
|
|
@@ -4,6 +4,10 @@ |
|
|
|
|
|
|
|
#include "atom/browser/mac/dict_util.h" |
|
|
|
|
|
|
|
#include <memory> |
|
|
|
#include <string> |
|
|
|
#include <utility> |
|
|
|
|
|
|
|
#include "base/json/json_writer.h" |
|
|
|
#include "base/strings/sys_string_conversions.h" |
|
|
|
#include "base/values.h" |
|
|
|
|
|
@@ -4,6 +4,9 @@ |
|
|
|
|
|
|
|
#include "atom/browser/mac/in_app_purchase.h" |
|
|
|
|
|
|
|
#include <string> |
|
|
|
#include <utility> |
|
|
|
|
|
|
|
#include "base/bind.h" |
|
|
|
#include "base/strings/sys_string_conversions.h" |
|
|
|
#include "base/task/post_task.h" |
|
|
|
|
|
@@ -4,6 +4,8 @@ |
|
|
|
|
|
|
|
#include "atom/browser/mac/in_app_purchase_observer.h" |
|
|
|
|
|
|
|
#include <vector> |
|
|
|
|
|
|
|
#include "base/bind.h" |
|
|
|
#include "base/strings/sys_string_conversions.h" |
|
|
|
#include "base/task/post_task.h" |
|
|
|
|
|
@@ -4,6 +4,10 @@ |
|
|
|
|
|
|
|
#include "atom/browser/mac/in_app_purchase_product.h" |
|
|
|
|
|
|
|
#include <string> |
|
|
|
#include <utility> |
|
|
|
#include <vector> |
|
|
|
|
|
|
|
#include "base/bind.h" |
|
|
|
#include "base/strings/sys_string_conversions.h" |
|
|
|
#include "base/task/post_task.h" |
|
|
|
|
|
@@ -4,6 +4,8 @@ |
|
|
|
|
|
|
|
#include "atom/browser/native_browser_view_mac.h" |
|
|
|
|
|
|
|
#include <vector> |
|
|
|
|
|
|
|
#include "atom/browser/ui/inspectable_web_contents.h" |
|
|
|
#include "atom/browser/ui/inspectable_web_contents_view.h" |
|
|
|
#include "skia/ext/skia_utils_mac.h" |
|
|
|
|
|
@@ -8,6 +8,7 @@ |
|
|
|
#include <objc/objc-runtime.h> |
|
|
|
|
|
|
|
#include <string> |
|
|
|
#include <vector> |
|
|
|
|
|
|
|
#include "atom/browser/native_browser_view_mac.h" |
|
|
|
#include "atom/browser/ui/cocoa/atom_native_widget_mac.h" |
|
|
|
|
|
@@ -4,6 +4,9 @@ |
|
|
|
|
|
|
|
#include "atom/browser/notifications/mac/cocoa_notification.h" |
|
|
|
|
|
|
|
#include <string> |
|
|
|
#include <utility> |
|
|
|
|
|
|
|
#include "atom/browser/notifications/notification_delegate.h" |
|
|
|
#include "atom/browser/notifications/notification_presenter.h" |
|
|
|
#include "base/mac/mac_util.h" |
|
|
|
|
|
@@ -4,6 +4,8 @@ |
|
|
|
|
|
|
|
#include "atom/browser/notifications/mac/notification_center_delegate.h" |
|
|
|
|
|
|
|
#include <string> |
|
|
|
|
|
|
|
#include "atom/browser/notifications/mac/cocoa_notification.h" |
|
|
|
#include "atom/browser/notifications/mac/notification_presenter_mac.h" |
|
|
|
|
|
|
|
|
|
@@ -4,6 +4,10 @@ |
|
|
|
|
|
|
|
#include "atom/browser/ui/certificate_trust.h" |
|
|
|
|
|
|
|
#include <memory> |
|
|
|
#include <string> |
|
|
|
#include <utility> |
|
|
|
|
|
|
|
#import <Cocoa/Cocoa.h> |
|
|
|
#import <SecurityInterface/SFCertificateTrustPanel.h> |
|
|
|
|
|
|
|
|
|
@@ -4,6 +4,8 @@ |
|
|
|
|
|
|
|
#import "atom/browser/ui/cocoa/atom_bundle_mover.h" |
|
|
|
|
|
|
|
#include <string> |
|
|
|
|
|
|
|
#import <AppKit/AppKit.h> |
|
|
|
#import <Foundation/Foundation.h> |
|
|
|
#import <Security/Security.h> |
|
|
@@ -389,19 +391,14 @@ static OSStatus (*security_AuthorizationExecuteWithPrivileges)( |
|
|
|
// This allows us to trash the app in macOS Sierra even when the app is |
|
|
|
// running inside an app translocation image. |
|
|
|
if (!result) { |
|
|
|
auto* code = R"str( |
|
|
|
set theFile to POSIX file "%@" |
|
|
|
tell application "Finder" |
|
|
|
move theFile to trash |
|
|
|
end tell |
|
|
|
)str"; |
|
|
|
NSAppleScript* appleScript = [[[NSAppleScript alloc] |
|
|
|
initWithSource: |
|
|
|
[NSString |
|
|
|
stringWithFormat: |
|
|
|
@"\ |
|
|
|
set theFile to POSIX file \"%@\" " |
|
|
|
@"\n\ |
|
|
|
tell application \"Finder\" " |
|
|
|
@"\n\ |
|
|
|
move theFile to trash \n\ |
|
|
|
" |
|
|
|
@" end tell", |
|
|
|
path]] autorelease]; |
|
|
|
initWithSource:[NSString stringWithFormat:@(code), path]] autorelease]; |
|
|
|
NSDictionary* errorDict = nil; |
|
|
|
NSAppleEventDescriptor* scriptResult = |
|
|
|
[appleScript executeAndReturnError:&errorDict]; |
|
|
@@ -425,4 +422,4 @@ static OSStatus (*security_AuthorizationExecuteWithPrivileges)( |
|
|
|
|
|
|
|
} // namespace ui |
|
|
|
|
|
|
|
} // namespace atom
|
|
|
|
} // namespace atom |
|
|
@@ -182,8 +182,8 @@ - (void)addSeparatorToMenu:(NSMenu*)menu atIndex:(int)index { |
|
|
|
|
|
|
|
// Empties the source menu items to the destination. |
|
|
|
- (void)moveMenuItems:(NSMenu*)source to:(NSMenu*)destination { |
|
|
|
const long count = [source numberOfItems]; |
|
|
|
for (long index = 0; index < count; index++) { |
|
|
|
const NSInteger count = [source numberOfItems]; |
|
|
|
for (NSInteger index = 0; index < count; index++) { |
|
|
|
NSMenuItem* removedItem = [[[source itemAtIndex:0] retain] autorelease]; |
|
|
|
[source removeItemAtIndex:0]; |
|
|
|
[destination addItem:removedItem]; |
|
|
|
|
|
@@ -4,6 +4,8 @@ |
|
|
|
|
|
|
|
#include "atom/browser/ui/cocoa/atom_ns_window_delegate.h" |
|
|
|
|
|
|
|
#include <algorithm> |
|
|
|
|
|
|
|
#include "atom/browser/browser.h" |
|
|
|
#include "atom/browser/native_window_mac.h" |
|
|
|
#include "atom/browser/ui/cocoa/atom_preview_item.h" |
|
|
|
|
|
@@ -4,6 +4,9 @@ |
|
|
|
|
|
|
|
#import "atom/browser/ui/cocoa/atom_touch_bar.h" |
|
|
|
|
|
|
|
#include <string> |
|
|
|
#include <vector> |
|
|
|
|
|
|
|
#include "atom/common/color_util.h" |
|
|
|
#include "atom/common/native_mate_converters/image_converter.h" |
|
|
|
#include "base/strings/sys_string_conversions.h" |
|
|
|
|
|
@@ -4,6 +4,8 @@ |
|
|
|
|
|
|
|
#import <Cocoa/Cocoa.h> |
|
|
|
|
|
|
|
#include <vector> |
|
|
|
|
|
|
|
#include "atom/browser/ui/drag_util.h" |
|
|
|
#include "base/files/file_path.h" |
|
|
|
#include "base/strings/sys_string_conversions.h" |
|
|
|
|
|
@@ -4,6 +4,10 @@ |
|
|
|
|
|
|
|
#include "atom/browser/ui/file_dialog.h" |
|
|
|
|
|
|
|
#include <string> |
|
|
|
#include <utility> |
|
|
|
#include <vector> |
|
|
|
|
|
|
|
#import <Cocoa/Cocoa.h> |
|
|
|
#import <CoreServices/CoreServices.h> |
|
|
|
|
|
|
|
|
|
@@ -4,6 +4,10 @@ |
|
|
|
|
|
|
|
#include "atom/browser/ui/message_box.h" |
|
|
|
|
|
|
|
#include <string> |
|
|
|
#include <utility> |
|
|
|
#include <vector> |
|
|
|
|
|
|
|
#import <Cocoa/Cocoa.h> |
|
|
|
|
|
|
|
#include "atom/browser/native_window.h" |
|
|
|
|
|
@@ -4,6 +4,9 @@ |
|
|
|
|
|
|
|
#include "atom/browser/ui/tray_icon_cocoa.h" |
|
|
|
|
|
|
|
#include <string> |
|
|
|
#include <vector> |
|
|
|
|
|
|
|
#include "atom/browser/ui/cocoa/NSString+ANSI.h" |
|
|
|
#include "atom/browser/ui/cocoa/atom_menu_controller.h" |
|
|
|
#include "base/strings/sys_string_conversions.h" |
|
|
|
|
|
@@ -4,6 +4,9 @@ |
|
|
|
|
|
|
|
#include "atom/common/api/atom_api_native_image.h" |
|
|
|
|
|
|
|
#include <string> |
|
|
|
#include <vector> |
|
|
|
|
|
|
|
#import <Cocoa/Cocoa.h> |
|
|
|
|
|
|
|
#include "base/strings/sys_string_conversions.h" |
|
|
|
|
|
@@ -4,6 +4,8 @@ |
|
|
|
|
|
|
|
#import "atom/common/application_info.h" |
|
|
|
|
|
|
|
#include <string> |
|
|
|
|
|
|
|
#import "atom/common/mac/main_application_bundle.h" |
|
|
|
#import "base/mac/foundation_util.h" |
|
|
|
#import "base/strings/sys_string_conversions.h" |
|
|
|
|
|
@@ -4,7 +4,11 @@ |
|
|
|
|
|
|
|
#include "atom/common/crash_reporter/crash_reporter_mac.h" |
|
|
|
|
|
|
|
#include <algorithm> |
|
|
|
#include <map> |
|
|
|
#include <memory> |
|
|
|
#include <string> |
|
|
|
#include <vector> |
|
|
|
|
|
|
|
#include "base/files/file_util.h" |
|
|
|
#include "base/mac/bundle_locations.h" |
|
|
|
|
|
@@ -4,6 +4,9 @@ |
|
|
|
|
|
|
|
#include "atom/common/platform_util.h" |
|
|
|
|
|
|
|
#include <string> |
|
|
|
#include <utility> |
|
|
|
|
|
|
|
#import <Carbon/Carbon.h> |
|
|
|
#import <Cocoa/Cocoa.h> |
|
|
|
#import <ServiceManagement/ServiceManagement.h> |
|
|
|
Oops, something went wrong.
0 comments on commit
9585818