chore: run clang-format
- atom/ - brightray/ - chromium_src/
This commit is contained in:
parent
ec125b761c
commit
7fc3bcaa02
35 changed files with 98 additions and 98 deletions
|
@ -65,7 +65,7 @@ void StartHandlingTask(bool capture_window,
|
|||
atom::api::DesktopCapturer* cap) {
|
||||
#if defined(OS_WIN)
|
||||
if (content::desktop_capture::CreateDesktopCaptureOptions()
|
||||
.allow_directx_capturer()) {
|
||||
.allow_directx_capturer()) {
|
||||
// DxgiDuplicatorController should be alive in this scope according to
|
||||
// screen_capturer_win.cc.
|
||||
auto duplicator = webrtc::DxgiDuplicatorController::Instance();
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
@interface MacLockMonitor : NSObject {
|
||||
@private
|
||||
@private
|
||||
std::vector<atom::api::PowerMonitor*> emitters;
|
||||
}
|
||||
|
||||
|
@ -21,15 +21,15 @@
|
|||
- (id)init {
|
||||
if ((self = [super init])) {
|
||||
NSDistributedNotificationCenter* distCenter =
|
||||
[NSDistributedNotificationCenter defaultCenter];
|
||||
[NSDistributedNotificationCenter defaultCenter];
|
||||
[distCenter addObserver:self
|
||||
selector:@selector(onScreenLocked:)
|
||||
name:@"com.apple.screenIsLocked"
|
||||
object:nil];
|
||||
selector:@selector(onScreenLocked:)
|
||||
name:@"com.apple.screenIsLocked"
|
||||
object:nil];
|
||||
[distCenter addObserver:self
|
||||
selector:@selector(onScreenUnlocked:)
|
||||
name:@"com.apple.screenIsUnlocked"
|
||||
object:nil];
|
||||
selector:@selector(onScreenUnlocked:)
|
||||
name:@"com.apple.screenIsUnlocked"
|
||||
object:nil];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
|
|
@ -4,17 +4,18 @@
|
|||
|
||||
#include "atom/browser/api/atom_api_power_monitor.h"
|
||||
|
||||
#include <windows.h>
|
||||
#include <wtsapi32.h>
|
||||
|
||||
#include "base/win/wrapped_window_proc.h"
|
||||
#include "ui/base/win/shell.h"
|
||||
#include "ui/gfx/win/hwnd_util.h"
|
||||
#include "Wtsapi32.h"
|
||||
|
||||
namespace atom {
|
||||
|
||||
namespace {
|
||||
|
||||
const wchar_t kPowerMonitorWindowClass[] =
|
||||
L"Electron_PowerMonitorHostWindow";
|
||||
const wchar_t kPowerMonitorWindowClass[] = L"Electron_PowerMonitorHostWindow";
|
||||
|
||||
} // namespace
|
||||
|
||||
|
@ -24,8 +25,8 @@ void PowerMonitor::InitPlatformSpecificMonitors() {
|
|||
WNDCLASSEX window_class;
|
||||
base::win::InitializeWindowClass(
|
||||
kPowerMonitorWindowClass,
|
||||
&base::win::WrappedWindowProc<PowerMonitor::WndProcStatic>, 0, 0, 0,
|
||||
NULL, NULL, NULL, NULL, NULL, &window_class);
|
||||
&base::win::WrappedWindowProc<PowerMonitor::WndProcStatic>, 0, 0, 0, NULL,
|
||||
NULL, NULL, NULL, NULL, &window_class);
|
||||
instance_ = window_class.hInstance;
|
||||
atom_ = RegisterClassEx(&window_class);
|
||||
|
||||
|
@ -41,11 +42,11 @@ void PowerMonitor::InitPlatformSpecificMonitors() {
|
|||
}
|
||||
|
||||
LRESULT CALLBACK PowerMonitor::WndProcStatic(HWND hwnd,
|
||||
UINT message,
|
||||
WPARAM wparam,
|
||||
LPARAM lparam) {
|
||||
PowerMonitor* msg_wnd = reinterpret_cast<PowerMonitor*>(
|
||||
GetWindowLongPtr(hwnd, GWLP_USERDATA));
|
||||
UINT message,
|
||||
WPARAM wparam,
|
||||
LPARAM lparam) {
|
||||
PowerMonitor* msg_wnd =
|
||||
reinterpret_cast<PowerMonitor*>(GetWindowLongPtr(hwnd, GWLP_USERDATA));
|
||||
if (msg_wnd)
|
||||
return msg_wnd->WndProc(hwnd, message, wparam, lparam);
|
||||
else
|
||||
|
@ -53,9 +54,9 @@ LRESULT CALLBACK PowerMonitor::WndProcStatic(HWND hwnd,
|
|||
}
|
||||
|
||||
LRESULT CALLBACK PowerMonitor::WndProc(HWND hwnd,
|
||||
UINT message,
|
||||
WPARAM wparam,
|
||||
LPARAM lparam) {
|
||||
UINT message,
|
||||
WPARAM wparam,
|
||||
LPARAM lparam) {
|
||||
if (message == WM_WTSSESSION_CHANGE) {
|
||||
if (wparam == WTS_SESSION_LOCK) {
|
||||
Emit("lock-screen");
|
||||
|
|
|
@ -61,10 +61,8 @@ void PowerSaveBlocker::UpdatePowerSaveBlocker() {
|
|||
device::mojom::WakeLockType new_blocker_type =
|
||||
device::mojom::WakeLockType::kPreventAppSuspension;
|
||||
for (const auto& element : power_save_blocker_types_) {
|
||||
if (element.second ==
|
||||
device::mojom::WakeLockType::kPreventDisplaySleep) {
|
||||
new_blocker_type =
|
||||
device::mojom::WakeLockType::kPreventDisplaySleep;
|
||||
if (element.second == device::mojom::WakeLockType::kPreventDisplaySleep) {
|
||||
new_blocker_type = device::mojom::WakeLockType::kPreventDisplaySleep;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -223,7 +223,7 @@ class TopLevelWindow : public mate::TrackableObject<TopLevelWindow>,
|
|||
// Remove this window from parent window's |child_windows_|.
|
||||
void RemoveFromParentChildWindows();
|
||||
|
||||
template<typename... Args>
|
||||
template <typename... Args>
|
||||
void EmitEventSoon(base::StringPiece eventName) {
|
||||
content::BrowserThread::PostTask(
|
||||
content::BrowserThread::UI, FROM_HERE,
|
||||
|
|
|
@ -150,8 +150,8 @@ bool AtomDownloadManagerDelegate::DetermineDownloadTarget(
|
|||
if (!save_path.empty()) {
|
||||
callback.Run(save_path,
|
||||
download::DownloadItem::TARGET_DISPOSITION_OVERWRITE,
|
||||
download::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS,
|
||||
save_path, download::DOWNLOAD_INTERRUPT_REASON_NONE);
|
||||
download::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS, save_path,
|
||||
download::DOWNLOAD_INTERRUPT_REASON_NONE);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -11,7 +11,8 @@
|
|||
NSUserActivityDelegate> {
|
||||
@private
|
||||
BOOL handlingSendEvent_;
|
||||
base::scoped_nsobject<NSUserActivity> currentActivity_ API_AVAILABLE(macosx(10.10));
|
||||
base::scoped_nsobject<NSUserActivity> currentActivity_
|
||||
API_AVAILABLE(macosx(10.10));
|
||||
NSCondition* handoffLock_;
|
||||
BOOL updateReceived_;
|
||||
base::Callback<bool()> shouldShutdown_;
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
|
||||
#include "atom/browser/net/atom_url_request.h"
|
||||
|
||||
#include <string>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
#include "atom/browser/api/atom_api_url_request.h"
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
#ifndef ATOM_BROWSER_NET_ATOM_URL_REQUEST_H_
|
||||
#define ATOM_BROWSER_NET_ATOM_URL_REQUEST_H_
|
||||
|
||||
#include <string>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "atom/browser/api/atom_api_url_request.h"
|
||||
|
|
|
@ -8,10 +8,10 @@
|
|||
|
||||
namespace atom {
|
||||
|
||||
bool AtomMenuModel::Delegate::GetAcceleratorForCommandId(int command_id,
|
||||
bool AtomMenuModel::Delegate::GetAcceleratorForCommandId(
|
||||
int command_id,
|
||||
ui::Accelerator* accelerator) const {
|
||||
return GetAcceleratorForCommandIdWithParams(
|
||||
command_id, false, accelerator);
|
||||
return GetAcceleratorForCommandIdWithParams(command_id, false, accelerator);
|
||||
}
|
||||
|
||||
AtomMenuModel::AtomMenuModel(Delegate* delegate)
|
||||
|
|
|
@ -224,17 +224,21 @@ bool ScopedDisableResize::disable_resize_ = false;
|
|||
|
||||
// Custom window button methods
|
||||
|
||||
- (BOOL)windowShouldClose:(id)sender { return YES; }
|
||||
- (BOOL)windowShouldClose:(id)sender {
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (void)performClose:(id)sender {
|
||||
if (shell_->title_bar_style() ==
|
||||
atom::NativeWindowMac::CUSTOM_BUTTONS_ON_HOVER) {
|
||||
[[self delegate] windowShouldClose:self];
|
||||
} else if (shell_->IsSimpleFullScreen()) {
|
||||
if([[self delegate] respondsToSelector:@selector(windowShouldClose:)]) {
|
||||
if(![[self delegate] windowShouldClose:self]) return;
|
||||
} else if([self respondsToSelector:@selector(windowShouldClose:)]) {
|
||||
if(![self windowShouldClose:self]) return;
|
||||
if ([[self delegate] respondsToSelector:@selector(windowShouldClose:)]) {
|
||||
if (![[self delegate] windowShouldClose:self])
|
||||
return;
|
||||
} else if ([self respondsToSelector:@selector(windowShouldClose:)]) {
|
||||
if (![self windowShouldClose:self])
|
||||
return;
|
||||
}
|
||||
[self close];
|
||||
} else {
|
||||
|
|
|
@ -13,9 +13,8 @@ namespace atom {
|
|||
class NativeWindowMac;
|
||||
}
|
||||
|
||||
@interface AtomNSWindowDelegate :
|
||||
ViewsNSWindowDelegate<NSTouchBarDelegate,
|
||||
QLPreviewPanelDataSource> {
|
||||
@interface AtomNSWindowDelegate
|
||||
: ViewsNSWindowDelegate <NSTouchBarDelegate, QLPreviewPanelDataSource> {
|
||||
@private
|
||||
atom::NativeWindowMac* shell_;
|
||||
bool is_zooming_;
|
||||
|
|
|
@ -8,9 +8,9 @@
|
|||
#import <Cocoa/Cocoa.h>
|
||||
#import <Quartz/Quartz.h>
|
||||
|
||||
@interface AtomPreviewItem : NSObject<QLPreviewItem>
|
||||
@property (nonatomic, retain) NSURL* previewItemURL;
|
||||
@property (nonatomic, retain) NSString* previewItemTitle;
|
||||
@interface AtomPreviewItem : NSObject <QLPreviewItem>
|
||||
@property(nonatomic, retain) NSURL* previewItemURL;
|
||||
@property(nonatomic, retain) NSString* previewItemTitle;
|
||||
- (id)initWithURL:(NSURL*)url title:(NSString*)title;
|
||||
@end
|
||||
|
||||
|
|
|
@ -150,8 +150,7 @@ static HRESULT ShowFileDialog(IFileDialog* dialog,
|
|||
return dialog->Show(parent_window);
|
||||
}
|
||||
|
||||
static void ApplySettings(IFileDialog* dialog,
|
||||
const DialogSettings& settings) {
|
||||
static void ApplySettings(IFileDialog* dialog, const DialogSettings& settings) {
|
||||
std::wstring file_part;
|
||||
|
||||
if (!IsDirectory(settings.default_path))
|
||||
|
@ -271,7 +270,7 @@ bool ShowSaveDialog(const DialogSettings& settings, base::FilePath* path) {
|
|||
return false;
|
||||
|
||||
file_save_dialog->SetOptions(FOS_FORCEFILESYSTEM | FOS_PATHMUSTEXIST |
|
||||
FOS_OVERWRITEPROMPT);
|
||||
FOS_OVERWRITEPROMPT);
|
||||
ApplySettings(file_save_dialog, settings);
|
||||
hr = ShowFileDialog(file_save_dialog, settings);
|
||||
|
||||
|
|
|
@ -105,20 +105,20 @@ void WebContentsPermissionHelper::RequestMediaAccessPermission(
|
|||
|
||||
base::DictionaryValue details;
|
||||
std::unique_ptr<base::ListValue> media_types(new base::ListValue);
|
||||
if (request.audio_type
|
||||
== content::MediaStreamType::MEDIA_DEVICE_AUDIO_CAPTURE) {
|
||||
if (request.audio_type ==
|
||||
content::MediaStreamType::MEDIA_DEVICE_AUDIO_CAPTURE) {
|
||||
media_types->AppendString("audio");
|
||||
}
|
||||
if (request.video_type
|
||||
== content::MediaStreamType::MEDIA_DEVICE_VIDEO_CAPTURE) {
|
||||
if (request.video_type ==
|
||||
content::MediaStreamType::MEDIA_DEVICE_VIDEO_CAPTURE) {
|
||||
media_types->AppendString("video");
|
||||
}
|
||||
details.SetList("mediaTypes", std::move(media_types));
|
||||
|
||||
// The permission type doesn't matter here, AUDIO_CAPTURE/VIDEO_CAPTURE
|
||||
// are presented as same type in content_converter.h.
|
||||
RequestPermission(content::PermissionType::AUDIO_CAPTURE, callback,
|
||||
false, &details);
|
||||
RequestPermission(content::PermissionType::AUDIO_CAPTURE, callback, false,
|
||||
&details);
|
||||
}
|
||||
|
||||
void WebContentsPermissionHelper::RequestWebNotificationPermission(
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
|
||||
#include "atom/common/native_mate_converters/net_converter.h"
|
||||
|
||||
#include <string>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
|
|
|
@ -20,8 +20,8 @@
|
|||
#include "chrome/renderer/printing/print_web_view_helper.h"
|
||||
#include "content/public/renderer/render_frame.h"
|
||||
#include "native_mate/dictionary.h"
|
||||
#include "third_party/blink/public/web/web_document.h"
|
||||
#include "third_party/blink/public/web/blink.h"
|
||||
#include "third_party/blink/public/web/web_document.h"
|
||||
|
||||
#include "atom/common/node_includes.h"
|
||||
#include "atom_natives.h" // NOLINT: This file is generated with js2c
|
||||
|
|
|
@ -26,13 +26,13 @@
|
|||
#include "content/public/renderer/render_frame.h"
|
||||
#include "content/public/renderer/render_view.h"
|
||||
#include "native_mate/dictionary.h"
|
||||
#include "third_party/blink/renderer/platform/weborigin/scheme_registry.h"
|
||||
#include "third_party/blink/public/web/blink.h"
|
||||
#include "third_party/blink/public/web/web_custom_element.h" // NOLINT(build/include_alpha)
|
||||
#include "third_party/blink/public/web/web_frame_widget.h"
|
||||
#include "third_party/blink/public/web/web_plugin_params.h"
|
||||
#include "third_party/blink/public/web/web_script_source.h"
|
||||
#include "third_party/blink/public/web/web_security_policy.h"
|
||||
#include "third_party/blink/renderer/platform/weborigin/scheme_registry.h"
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
#include "base/strings/sys_string_conversions.h"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue