chore: clang-format (#18088)
* chore: clang-format * chore: remove obsolete native_mate_files.gypi
This commit is contained in:
parent
d2cebc62d1
commit
1abe658ef4
18 changed files with 138 additions and 187 deletions
|
@ -24,8 +24,8 @@ base::RepeatingCallback<void()> App::StartAccessingSecurityScopedResource(
|
|||
std::string data;
|
||||
args->GetNext(&data);
|
||||
NSString* base64str = base::SysUTF8ToNSString(data);
|
||||
NSData* bookmarkData =
|
||||
[[NSData alloc] initWithBase64EncodedString:base64str options:0];
|
||||
NSData* bookmarkData = [[NSData alloc] initWithBase64EncodedString:base64str
|
||||
options:0];
|
||||
|
||||
// Create bookmarkUrl from NSData.
|
||||
BOOL isStale = false;
|
||||
|
|
|
@ -60,9 +60,9 @@ void MenuMac::PopupOnUI(const base::WeakPtr<NativeWindow>& native_window,
|
|||
|
||||
auto close_callback = base::BindRepeating(
|
||||
&MenuMac::OnClosed, weak_factory_.GetWeakPtr(), window_id, callback);
|
||||
popup_controllers_[window_id] = base::scoped_nsobject<AtomMenuController>([
|
||||
[AtomMenuController alloc] initWithModel:model()
|
||||
useDefaultAccelerator:NO]);
|
||||
popup_controllers_[window_id] = base::scoped_nsobject<AtomMenuController>(
|
||||
[[AtomMenuController alloc] initWithModel:model()
|
||||
useDefaultAccelerator:NO]);
|
||||
NSMenu* menu = [popup_controllers_[window_id] menu];
|
||||
NSView* view = [nswindow contentView];
|
||||
|
||||
|
@ -136,9 +136,9 @@ void MenuMac::OnClosed(int32_t window_id, base::Closure callback) {
|
|||
// static
|
||||
void Menu::SetApplicationMenu(Menu* base_menu) {
|
||||
MenuMac* menu = static_cast<MenuMac*>(base_menu);
|
||||
base::scoped_nsobject<AtomMenuController> menu_controller([
|
||||
[AtomMenuController alloc] initWithModel:menu->model_.get()
|
||||
useDefaultAccelerator:YES]);
|
||||
base::scoped_nsobject<AtomMenuController> menu_controller(
|
||||
[[AtomMenuController alloc] initWithModel:menu->model_.get()
|
||||
useDefaultAccelerator:YES]);
|
||||
|
||||
NSRunLoop* currentRunLoop = [NSRunLoop currentRunLoop];
|
||||
[currentRunLoop cancelPerformSelector:@selector(setMainMenu:)
|
||||
|
|
|
@ -15,8 +15,9 @@ NSArray* ListValueToNSArray(const base::ListValue& value) {
|
|||
if (!base::JSONWriter::Write(value, &json))
|
||||
return nil;
|
||||
NSData* jsonData = [NSData dataWithBytes:json.c_str() length:json.length()];
|
||||
id obj =
|
||||
[NSJSONSerialization JSONObjectWithData:jsonData options:0 error:nil];
|
||||
id obj = [NSJSONSerialization JSONObjectWithData:jsonData
|
||||
options:0
|
||||
error:nil];
|
||||
if (![obj isKindOfClass:[NSArray class]])
|
||||
return nil;
|
||||
return obj;
|
||||
|
@ -67,8 +68,9 @@ NSDictionary* DictionaryValueToNSDictionary(
|
|||
if (!base::JSONWriter::Write(value, &json))
|
||||
return nil;
|
||||
NSData* jsonData = [NSData dataWithBytes:json.c_str() length:json.length()];
|
||||
id obj =
|
||||
[NSJSONSerialization JSONObjectWithData:jsonData options:0 error:nil];
|
||||
id obj = [NSJSONSerialization JSONObjectWithData:jsonData
|
||||
options:0
|
||||
error:nil];
|
||||
if (![obj isKindOfClass:[NSDictionary class]])
|
||||
return nil;
|
||||
return obj;
|
||||
|
|
|
@ -140,8 +140,8 @@
|
|||
|
||||
if (product.priceLocale != nil) {
|
||||
productStruct.formattedPrice =
|
||||
[[self formatPrice:product.price withLocal:product.priceLocale]
|
||||
UTF8String];
|
||||
[[self formatPrice:product.price
|
||||
withLocal:product.priceLocale] UTF8String];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -851,9 +851,9 @@ void NativeWindowMac::SetAlwaysOnTop(bool top,
|
|||
if (newLevel >= minWindowLevel && newLevel <= maxWindowLevel) {
|
||||
[window_ setLevel:newLevel];
|
||||
} else {
|
||||
*error = std::string([
|
||||
[NSString stringWithFormat:@"relativeLevel must be between %d and %d",
|
||||
minWindowLevel, maxWindowLevel] UTF8String]);
|
||||
*error = std::string([[NSString
|
||||
stringWithFormat:@"relativeLevel must be between %d and %d",
|
||||
minWindowLevel, maxWindowLevel] UTF8String]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1102,7 +1102,7 @@ void NativeWindowMac::RemoveBrowserView(NativeBrowserView* view) {
|
|||
}
|
||||
|
||||
[view->GetInspectableWebContentsView()->GetNativeView().GetNativeNSView()
|
||||
removeFromSuperview];
|
||||
removeFromSuperview];
|
||||
remove_browser_view(view);
|
||||
|
||||
[CATransaction commit];
|
||||
|
|
|
@ -20,8 +20,8 @@
|
|||
[NSDictionary dictionaryWithObject:paragraphStyle
|
||||
forKey:NSParagraphStyleAttributeName];
|
||||
NSAttributedString* text =
|
||||
[[[NSAttributedString alloc] initWithString:str attributes:attributes]
|
||||
autorelease];
|
||||
[[[NSAttributedString alloc] initWithString:str
|
||||
attributes:attributes] autorelease];
|
||||
NSRect frame = NSMakeRect(0, (self.frame.size.height - text.size.height) / 2,
|
||||
self.frame.size.width, text.size.height);
|
||||
[str drawInRect:frame withAttributes:attributes];
|
||||
|
|
|
@ -20,8 +20,8 @@ AtomNativeWidgetMac::~AtomNativeWidgetMac() {}
|
|||
|
||||
NativeWidgetMacNSWindow* AtomNativeWidgetMac::CreateNSWindow(
|
||||
const views_bridge_mac::mojom::CreateWindowParams* params) {
|
||||
return [[[AtomNSWindow alloc] initWithShell:shell_ styleMask:style_mask_]
|
||||
autorelease];
|
||||
return [[[AtomNSWindow alloc] initWithShell:shell_
|
||||
styleMask:style_mask_] autorelease];
|
||||
}
|
||||
|
||||
} // namespace atom
|
||||
|
|
|
@ -104,8 +104,8 @@ static NSString* const ImageScrubberItemIdentifier = @"scrubber.image.item";
|
|||
item_id = [self idFromIdentifier:identifier withPrefix:LabelIdentifier];
|
||||
return [self makeLabelForID:item_id withIdentifier:identifier];
|
||||
} else if ([identifier hasPrefix:ColorPickerIdentifier]) {
|
||||
item_id =
|
||||
[self idFromIdentifier:identifier withPrefix:ColorPickerIdentifier];
|
||||
item_id = [self idFromIdentifier:identifier
|
||||
withPrefix:ColorPickerIdentifier];
|
||||
return [self makeColorPickerForID:item_id withIdentifier:identifier];
|
||||
} else if ([identifier hasPrefix:SliderIdentifier]) {
|
||||
item_id = [self idFromIdentifier:identifier withPrefix:SliderIdentifier];
|
||||
|
@ -238,8 +238,8 @@ static NSString* const ImageScrubberItemIdentifier = @"scrubber.image.item";
|
|||
|
||||
- (void)colorPickerAction:(id)sender {
|
||||
NSString* identifier = ((NSColorPickerTouchBarItem*)sender).identifier;
|
||||
NSString* item_id =
|
||||
[self idFromIdentifier:identifier withPrefix:ColorPickerIdentifier];
|
||||
NSString* item_id = [self idFromIdentifier:identifier
|
||||
withPrefix:ColorPickerIdentifier];
|
||||
NSColor* color = ((NSColorPickerTouchBarItem*)sender).color;
|
||||
std::string hex_color = atom::ToRGBHex(skia::NSDeviceColorToSkColor(color));
|
||||
base::DictionaryValue details;
|
||||
|
@ -249,8 +249,8 @@ static NSString* const ImageScrubberItemIdentifier = @"scrubber.image.item";
|
|||
|
||||
- (void)sliderAction:(id)sender {
|
||||
NSString* identifier = ((NSSliderTouchBarItem*)sender).identifier;
|
||||
NSString* item_id =
|
||||
[self idFromIdentifier:identifier withPrefix:SliderIdentifier];
|
||||
NSString* item_id = [self idFromIdentifier:identifier
|
||||
withPrefix:SliderIdentifier];
|
||||
base::DictionaryValue details;
|
||||
details.SetInteger("value",
|
||||
[((NSSliderTouchBarItem*)sender).slider intValue]);
|
||||
|
|
|
@ -27,7 +27,8 @@ void ViewsDelegateMac::OnBeforeWidgetInit(
|
|||
return;
|
||||
}
|
||||
|
||||
// Setting null here causes Widget to create the default NativeWidget implementation.
|
||||
// Setting null here causes Widget to create the default NativeWidget
|
||||
// implementation.
|
||||
params->native_widget = nullptr;
|
||||
}
|
||||
|
||||
|
|
|
@ -326,9 +326,9 @@ const CGFloat kVerticalTitleMargin = 2;
|
|||
- (void)popUpContextMenu:(atom::AtomMenuModel*)menu_model {
|
||||
// Show a custom menu.
|
||||
if (menu_model) {
|
||||
base::scoped_nsobject<AtomMenuController> menuController([
|
||||
[AtomMenuController alloc] initWithModel:menu_model
|
||||
useDefaultAccelerator:NO]);
|
||||
base::scoped_nsobject<AtomMenuController> menuController(
|
||||
[[AtomMenuController alloc] initWithModel:menu_model
|
||||
useDefaultAccelerator:NO]);
|
||||
forceHighlight_ = YES; // Should highlight when showing menu.
|
||||
[self setNeedsDisplay:YES];
|
||||
[statusItem_ popUpStatusItemMenu:[menuController menu]];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue