Merge pull request #14688 from electron/run-clang-format

chore: run clang-format
This commit is contained in:
John Kleinschmidt 2018-09-19 14:27:21 -04:00 committed by GitHub
commit b48ea70eeb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
35 changed files with 98 additions and 98 deletions

View file

@ -65,7 +65,7 @@ void StartHandlingTask(bool capture_window,
atom::api::DesktopCapturer* cap) { atom::api::DesktopCapturer* cap) {
#if defined(OS_WIN) #if defined(OS_WIN)
if (content::desktop_capture::CreateDesktopCaptureOptions() if (content::desktop_capture::CreateDesktopCaptureOptions()
.allow_directx_capturer()) { .allow_directx_capturer()) {
// DxgiDuplicatorController should be alive in this scope according to // DxgiDuplicatorController should be alive in this scope according to
// screen_capturer_win.cc. // screen_capturer_win.cc.
auto duplicator = webrtc::DxgiDuplicatorController::Instance(); auto duplicator = webrtc::DxgiDuplicatorController::Instance();

View file

@ -8,7 +8,7 @@
#import <Cocoa/Cocoa.h> #import <Cocoa/Cocoa.h>
@interface MacLockMonitor : NSObject { @interface MacLockMonitor : NSObject {
@private @private
std::vector<atom::api::PowerMonitor*> emitters; std::vector<atom::api::PowerMonitor*> emitters;
} }
@ -21,15 +21,15 @@
- (id)init { - (id)init {
if ((self = [super init])) { if ((self = [super init])) {
NSDistributedNotificationCenter* distCenter = NSDistributedNotificationCenter* distCenter =
[NSDistributedNotificationCenter defaultCenter]; [NSDistributedNotificationCenter defaultCenter];
[distCenter addObserver:self [distCenter addObserver:self
selector:@selector(onScreenLocked:) selector:@selector(onScreenLocked:)
name:@"com.apple.screenIsLocked" name:@"com.apple.screenIsLocked"
object:nil]; object:nil];
[distCenter addObserver:self [distCenter addObserver:self
selector:@selector(onScreenUnlocked:) selector:@selector(onScreenUnlocked:)
name:@"com.apple.screenIsUnlocked" name:@"com.apple.screenIsUnlocked"
object:nil]; object:nil];
} }
return self; return self;
} }

View file

@ -4,17 +4,18 @@
#include "atom/browser/api/atom_api_power_monitor.h" #include "atom/browser/api/atom_api_power_monitor.h"
#include <windows.h>
#include <wtsapi32.h>
#include "base/win/wrapped_window_proc.h" #include "base/win/wrapped_window_proc.h"
#include "ui/base/win/shell.h" #include "ui/base/win/shell.h"
#include "ui/gfx/win/hwnd_util.h" #include "ui/gfx/win/hwnd_util.h"
#include "Wtsapi32.h"
namespace atom { namespace atom {
namespace { namespace {
const wchar_t kPowerMonitorWindowClass[] = const wchar_t kPowerMonitorWindowClass[] = L"Electron_PowerMonitorHostWindow";
L"Electron_PowerMonitorHostWindow";
} // namespace } // namespace
@ -24,8 +25,8 @@ void PowerMonitor::InitPlatformSpecificMonitors() {
WNDCLASSEX window_class; WNDCLASSEX window_class;
base::win::InitializeWindowClass( base::win::InitializeWindowClass(
kPowerMonitorWindowClass, kPowerMonitorWindowClass,
&base::win::WrappedWindowProc<PowerMonitor::WndProcStatic>, 0, 0, 0, &base::win::WrappedWindowProc<PowerMonitor::WndProcStatic>, 0, 0, 0, NULL,
NULL, NULL, NULL, NULL, NULL, &window_class); NULL, NULL, NULL, NULL, &window_class);
instance_ = window_class.hInstance; instance_ = window_class.hInstance;
atom_ = RegisterClassEx(&window_class); atom_ = RegisterClassEx(&window_class);
@ -41,11 +42,11 @@ void PowerMonitor::InitPlatformSpecificMonitors() {
} }
LRESULT CALLBACK PowerMonitor::WndProcStatic(HWND hwnd, LRESULT CALLBACK PowerMonitor::WndProcStatic(HWND hwnd,
UINT message, UINT message,
WPARAM wparam, WPARAM wparam,
LPARAM lparam) { LPARAM lparam) {
PowerMonitor* msg_wnd = reinterpret_cast<PowerMonitor*>( PowerMonitor* msg_wnd =
GetWindowLongPtr(hwnd, GWLP_USERDATA)); reinterpret_cast<PowerMonitor*>(GetWindowLongPtr(hwnd, GWLP_USERDATA));
if (msg_wnd) if (msg_wnd)
return msg_wnd->WndProc(hwnd, message, wparam, lparam); return msg_wnd->WndProc(hwnd, message, wparam, lparam);
else else
@ -53,9 +54,9 @@ LRESULT CALLBACK PowerMonitor::WndProcStatic(HWND hwnd,
} }
LRESULT CALLBACK PowerMonitor::WndProc(HWND hwnd, LRESULT CALLBACK PowerMonitor::WndProc(HWND hwnd,
UINT message, UINT message,
WPARAM wparam, WPARAM wparam,
LPARAM lparam) { LPARAM lparam) {
if (message == WM_WTSSESSION_CHANGE) { if (message == WM_WTSSESSION_CHANGE) {
if (wparam == WTS_SESSION_LOCK) { if (wparam == WTS_SESSION_LOCK) {
Emit("lock-screen"); Emit("lock-screen");

View file

@ -61,10 +61,8 @@ void PowerSaveBlocker::UpdatePowerSaveBlocker() {
device::mojom::WakeLockType new_blocker_type = device::mojom::WakeLockType new_blocker_type =
device::mojom::WakeLockType::kPreventAppSuspension; device::mojom::WakeLockType::kPreventAppSuspension;
for (const auto& element : power_save_blocker_types_) { for (const auto& element : power_save_blocker_types_) {
if (element.second == if (element.second == device::mojom::WakeLockType::kPreventDisplaySleep) {
device::mojom::WakeLockType::kPreventDisplaySleep) { new_blocker_type = device::mojom::WakeLockType::kPreventDisplaySleep;
new_blocker_type =
device::mojom::WakeLockType::kPreventDisplaySleep;
break; break;
} }
} }

View file

@ -223,7 +223,7 @@ class TopLevelWindow : public mate::TrackableObject<TopLevelWindow>,
// Remove this window from parent window's |child_windows_|. // Remove this window from parent window's |child_windows_|.
void RemoveFromParentChildWindows(); void RemoveFromParentChildWindows();
template<typename... Args> template <typename... Args>
void EmitEventSoon(base::StringPiece eventName) { void EmitEventSoon(base::StringPiece eventName) {
content::BrowserThread::PostTask( content::BrowserThread::PostTask(
content::BrowserThread::UI, FROM_HERE, content::BrowserThread::UI, FROM_HERE,

View file

@ -150,8 +150,8 @@ bool AtomDownloadManagerDelegate::DetermineDownloadTarget(
if (!save_path.empty()) { if (!save_path.empty()) {
callback.Run(save_path, callback.Run(save_path,
download::DownloadItem::TARGET_DISPOSITION_OVERWRITE, download::DownloadItem::TARGET_DISPOSITION_OVERWRITE,
download::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS, download::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS, save_path,
save_path, download::DOWNLOAD_INTERRUPT_REASON_NONE); download::DOWNLOAD_INTERRUPT_REASON_NONE);
return true; return true;
} }

View file

@ -11,7 +11,8 @@
NSUserActivityDelegate> { NSUserActivityDelegate> {
@private @private
BOOL handlingSendEvent_; BOOL handlingSendEvent_;
base::scoped_nsobject<NSUserActivity> currentActivity_ API_AVAILABLE(macosx(10.10)); base::scoped_nsobject<NSUserActivity> currentActivity_
API_AVAILABLE(macosx(10.10));
NSCondition* handoffLock_; NSCondition* handoffLock_;
BOOL updateReceived_; BOOL updateReceived_;
base::Callback<bool()> shouldShutdown_; base::Callback<bool()> shouldShutdown_;

View file

@ -5,8 +5,8 @@
#include "atom/browser/net/atom_url_request.h" #include "atom/browser/net/atom_url_request.h"
#include <string>
#include <memory> #include <memory>
#include <string>
#include <utility> #include <utility>
#include "atom/browser/api/atom_api_url_request.h" #include "atom/browser/api/atom_api_url_request.h"

View file

@ -6,8 +6,8 @@
#ifndef ATOM_BROWSER_NET_ATOM_URL_REQUEST_H_ #ifndef ATOM_BROWSER_NET_ATOM_URL_REQUEST_H_
#define ATOM_BROWSER_NET_ATOM_URL_REQUEST_H_ #define ATOM_BROWSER_NET_ATOM_URL_REQUEST_H_
#include <string>
#include <memory> #include <memory>
#include <string>
#include <vector> #include <vector>
#include "atom/browser/api/atom_api_url_request.h" #include "atom/browser/api/atom_api_url_request.h"

View file

@ -8,10 +8,10 @@
namespace atom { namespace atom {
bool AtomMenuModel::Delegate::GetAcceleratorForCommandId(int command_id, bool AtomMenuModel::Delegate::GetAcceleratorForCommandId(
int command_id,
ui::Accelerator* accelerator) const { ui::Accelerator* accelerator) const {
return GetAcceleratorForCommandIdWithParams( return GetAcceleratorForCommandIdWithParams(command_id, false, accelerator);
command_id, false, accelerator);
} }
AtomMenuModel::AtomMenuModel(Delegate* delegate) AtomMenuModel::AtomMenuModel(Delegate* delegate)

View file

@ -224,17 +224,21 @@ bool ScopedDisableResize::disable_resize_ = false;
// Custom window button methods // Custom window button methods
- (BOOL)windowShouldClose:(id)sender { return YES; } - (BOOL)windowShouldClose:(id)sender {
return YES;
}
- (void)performClose:(id)sender { - (void)performClose:(id)sender {
if (shell_->title_bar_style() == if (shell_->title_bar_style() ==
atom::NativeWindowMac::CUSTOM_BUTTONS_ON_HOVER) { atom::NativeWindowMac::CUSTOM_BUTTONS_ON_HOVER) {
[[self delegate] windowShouldClose:self]; [[self delegate] windowShouldClose:self];
} else if (shell_->IsSimpleFullScreen()) { } else if (shell_->IsSimpleFullScreen()) {
if([[self delegate] respondsToSelector:@selector(windowShouldClose:)]) { if ([[self delegate] respondsToSelector:@selector(windowShouldClose:)]) {
if(![[self delegate] windowShouldClose:self]) return; if (![[self delegate] windowShouldClose:self])
} else if([self respondsToSelector:@selector(windowShouldClose:)]) { return;
if(![self windowShouldClose:self]) return; } else if ([self respondsToSelector:@selector(windowShouldClose:)]) {
if (![self windowShouldClose:self])
return;
} }
[self close]; [self close];
} else { } else {

View file

@ -13,9 +13,8 @@ namespace atom {
class NativeWindowMac; class NativeWindowMac;
} }
@interface AtomNSWindowDelegate : @interface AtomNSWindowDelegate
ViewsNSWindowDelegate<NSTouchBarDelegate, : ViewsNSWindowDelegate <NSTouchBarDelegate, QLPreviewPanelDataSource> {
QLPreviewPanelDataSource> {
@private @private
atom::NativeWindowMac* shell_; atom::NativeWindowMac* shell_;
bool is_zooming_; bool is_zooming_;

View file

@ -8,9 +8,9 @@
#import <Cocoa/Cocoa.h> #import <Cocoa/Cocoa.h>
#import <Quartz/Quartz.h> #import <Quartz/Quartz.h>
@interface AtomPreviewItem : NSObject<QLPreviewItem> @interface AtomPreviewItem : NSObject <QLPreviewItem>
@property (nonatomic, retain) NSURL* previewItemURL; @property(nonatomic, retain) NSURL* previewItemURL;
@property (nonatomic, retain) NSString* previewItemTitle; @property(nonatomic, retain) NSString* previewItemTitle;
- (id)initWithURL:(NSURL*)url title:(NSString*)title; - (id)initWithURL:(NSURL*)url title:(NSString*)title;
@end @end

View file

@ -150,8 +150,7 @@ static HRESULT ShowFileDialog(IFileDialog* dialog,
return dialog->Show(parent_window); return dialog->Show(parent_window);
} }
static void ApplySettings(IFileDialog* dialog, static void ApplySettings(IFileDialog* dialog, const DialogSettings& settings) {
const DialogSettings& settings) {
std::wstring file_part; std::wstring file_part;
if (!IsDirectory(settings.default_path)) if (!IsDirectory(settings.default_path))
@ -271,7 +270,7 @@ bool ShowSaveDialog(const DialogSettings& settings, base::FilePath* path) {
return false; return false;
file_save_dialog->SetOptions(FOS_FORCEFILESYSTEM | FOS_PATHMUSTEXIST | file_save_dialog->SetOptions(FOS_FORCEFILESYSTEM | FOS_PATHMUSTEXIST |
FOS_OVERWRITEPROMPT); FOS_OVERWRITEPROMPT);
ApplySettings(file_save_dialog, settings); ApplySettings(file_save_dialog, settings);
hr = ShowFileDialog(file_save_dialog, settings); hr = ShowFileDialog(file_save_dialog, settings);

View file

@ -105,20 +105,20 @@ void WebContentsPermissionHelper::RequestMediaAccessPermission(
base::DictionaryValue details; base::DictionaryValue details;
std::unique_ptr<base::ListValue> media_types(new base::ListValue); std::unique_ptr<base::ListValue> media_types(new base::ListValue);
if (request.audio_type if (request.audio_type ==
== content::MediaStreamType::MEDIA_DEVICE_AUDIO_CAPTURE) { content::MediaStreamType::MEDIA_DEVICE_AUDIO_CAPTURE) {
media_types->AppendString("audio"); media_types->AppendString("audio");
} }
if (request.video_type if (request.video_type ==
== content::MediaStreamType::MEDIA_DEVICE_VIDEO_CAPTURE) { content::MediaStreamType::MEDIA_DEVICE_VIDEO_CAPTURE) {
media_types->AppendString("video"); media_types->AppendString("video");
} }
details.SetList("mediaTypes", std::move(media_types)); details.SetList("mediaTypes", std::move(media_types));
// The permission type doesn't matter here, AUDIO_CAPTURE/VIDEO_CAPTURE // The permission type doesn't matter here, AUDIO_CAPTURE/VIDEO_CAPTURE
// are presented as same type in content_converter.h. // are presented as same type in content_converter.h.
RequestPermission(content::PermissionType::AUDIO_CAPTURE, callback, RequestPermission(content::PermissionType::AUDIO_CAPTURE, callback, false,
false, &details); &details);
} }
void WebContentsPermissionHelper::RequestWebNotificationPermission( void WebContentsPermissionHelper::RequestWebNotificationPermission(

View file

@ -4,8 +4,8 @@
#include "atom/common/native_mate_converters/net_converter.h" #include "atom/common/native_mate_converters/net_converter.h"
#include <string>
#include <memory> #include <memory>
#include <string>
#include <utility> #include <utility>
#include <vector> #include <vector>

View file

@ -20,8 +20,8 @@
#include "chrome/renderer/printing/print_web_view_helper.h" #include "chrome/renderer/printing/print_web_view_helper.h"
#include "content/public/renderer/render_frame.h" #include "content/public/renderer/render_frame.h"
#include "native_mate/dictionary.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/blink.h"
#include "third_party/blink/public/web/web_document.h"
#include "atom/common/node_includes.h" #include "atom/common/node_includes.h"
#include "atom_natives.h" // NOLINT: This file is generated with js2c #include "atom_natives.h" // NOLINT: This file is generated with js2c

View file

@ -26,13 +26,13 @@
#include "content/public/renderer/render_frame.h" #include "content/public/renderer/render_frame.h"
#include "content/public/renderer/render_view.h" #include "content/public/renderer/render_view.h"
#include "native_mate/dictionary.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/blink.h"
#include "third_party/blink/public/web/web_custom_element.h" // NOLINT(build/include_alpha) #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_frame_widget.h"
#include "third_party/blink/public/web/web_plugin_params.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_script_source.h"
#include "third_party/blink/public/web/web_security_policy.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) #if defined(OS_MACOSX)
#include "base/strings/sys_string_conversions.h" #include "base/strings/sys_string_conversions.h"

View file

@ -29,7 +29,6 @@ base::LazyInstance<std::string>::DestructorAtExit
base::NoDestructor<std::string> g_application_locale; base::NoDestructor<std::string> g_application_locale;
void SetApplicationLocaleOnIOThread(const std::string& locale) { void SetApplicationLocaleOnIOThread(const std::string& locale) {
DCHECK_CURRENTLY_ON(BrowserThread::IO); DCHECK_CURRENTLY_ON(BrowserThread::IO);
g_io_thread_application_locale.Get() = locale; g_io_thread_application_locale.Get() = locale;

View file

@ -56,8 +56,7 @@ scoped_refptr<BrowserContext> BrowserContext::Get(const std::string& partition,
} }
BrowserContext::BrowserContext(const std::string& partition, bool in_memory) BrowserContext::BrowserContext(const std::string& partition, bool in_memory)
: in_memory_(in_memory), : in_memory_(in_memory), weak_factory_(this) {
weak_factory_(this) {
if (!PathService::Get(DIR_USER_DATA, &path_)) { if (!PathService::Get(DIR_USER_DATA, &path_)) {
PathService::Get(DIR_APP_DATA, &path_); PathService::Get(DIR_APP_DATA, &path_);
path_ = path_.Append(base::FilePath::FromUTF8Unsafe(GetApplicationName())); path_ = path_.Append(base::FilePath::FromUTF8Unsafe(GetApplicationName()));

View file

@ -30,7 +30,7 @@ class CocoaNotification : public Notification {
void NotificationReplied(const std::string& reply); void NotificationReplied(const std::string& reply);
void NotificationActivated(); void NotificationActivated();
void NotificationActivated(NSUserNotificationAction* action) void NotificationActivated(NSUserNotificationAction* action)
API_AVAILABLE(macosx(10.10)); API_AVAILABLE(macosx(10.10));
void NotificationDismissed(); void NotificationDismissed();
NSUserNotification* notification() const { return notification_; } NSUserNotification* notification() const { return notification_; }

View file

@ -40,7 +40,7 @@ HBITMAP CopyBitmap(HBITMAP bitmap) {
} }
const TCHAR DesktopNotificationController::class_name_[] = const TCHAR DesktopNotificationController::class_name_[] =
TEXT("DesktopNotificationController"); TEXT("DesktopNotificationController");
HINSTANCE DesktopNotificationController::RegisterWndClasses() { HINSTANCE DesktopNotificationController::RegisterWndClasses() {
// We keep a static `module` variable which serves a dual purpose: // We keep a static `module` variable which serves a dual purpose:
@ -365,7 +365,7 @@ void DesktopNotificationController::DestroyToast(ToastInstance& inst) {
DesktopNotificationController::Notification::Notification() = default; DesktopNotificationController::Notification::Notification() = default;
DesktopNotificationController::Notification::Notification( DesktopNotificationController::Notification::Notification(
const DesktopNotificationController::Notification&) = default; const DesktopNotificationController::Notification&) = default;
DesktopNotificationController::Notification::Notification( DesktopNotificationController::Notification::Notification(
const shared_ptr<NotificationData>& data) const shared_ptr<NotificationData>& data)

View file

@ -61,15 +61,14 @@ bool WindowsToastNotification::Initialize() {
if (IsRunningInDesktopBridge()) { if (IsRunningInDesktopBridge()) {
// Ironically, the Desktop Bridge / UWP environment // Ironically, the Desktop Bridge / UWP environment
// requires us to not give Windows an appUserModelId. // requires us to not give Windows an appUserModelId.
return SUCCEEDED( return SUCCEEDED(toast_manager_->CreateToastNotifier(&toast_notifier_));
toast_manager_->CreateToastNotifier(&toast_notifier_));
} else { } else {
ScopedHString app_id; ScopedHString app_id;
if (!GetAppUserModelID(&app_id)) if (!GetAppUserModelID(&app_id))
return false; return false;
return SUCCEEDED( return SUCCEEDED(
toast_manager_->CreateToastNotifierWithId(app_id, &toast_notifier_)); toast_manager_->CreateToastNotifierWithId(app_id, &toast_notifier_));
} }
} }

View file

@ -1,6 +1,7 @@
#include "base/no_destructor.h"
#include "brightray/common/application_info.h" #include "brightray/common/application_info.h"
#include "base/no_destructor.h"
namespace brightray { namespace brightray {
namespace { namespace {

View file

@ -2,9 +2,9 @@
#include <windows.h> // windows.h must be included first #include <windows.h> // windows.h must be included first
#include <VersionHelpers.h>
#include <appmodel.h> #include <appmodel.h>
#include <shlobj.h> #include <shlobj.h>
#include <VersionHelpers.h>
#include <memory> #include <memory>
@ -93,7 +93,7 @@ bool IsRunningInDesktopBridgeImpl() {
wchar_t packageFamilyName[PACKAGE_FAMILY_NAME_MAX_LENGTH + 1]; wchar_t packageFamilyName[PACKAGE_FAMILY_NAME_MAX_LENGTH + 1];
HANDLE proc = GetCurrentProcess(); HANDLE proc = GetCurrentProcess();
LONG result = LONG result =
(*get_package_family_namePtr)(proc, &length, packageFamilyName); (*get_package_family_namePtr)(proc, &length, packageFamilyName);
return result == ERROR_SUCCESS; return result == ERROR_SUCCESS;
} else { } else {

View file

@ -28,8 +28,8 @@ bool SubprocessNeedsResourceBundle(const std::string& process_type) {
process_type == switches::kZygoteProcess || process_type == switches::kZygoteProcess ||
#endif #endif
#if defined(OS_MACOSX) #if defined(OS_MACOSX)
// Mac needs them too for scrollbar related images and for sandbox // Mac needs them too for scrollbar related images and for sandbox
// profiles. // profiles.
process_type == switches::kPpapiPluginProcess || process_type == switches::kPpapiPluginProcess ||
process_type == switches::kPpapiBrokerProcess || process_type == switches::kPpapiBrokerProcess ||
process_type == switches::kGpuProcess || process_type == switches::kGpuProcess ||
@ -61,9 +61,10 @@ void LoadResourceBundle(const std::string& locale) {
bundle.AddDataPackFromPath(pak_dir.Append(FILE_PATH_LITERAL("resources.pak")), bundle.AddDataPackFromPath(pak_dir.Append(FILE_PATH_LITERAL("resources.pak")),
ui::SCALE_FACTOR_NONE); ui::SCALE_FACTOR_NONE);
#if defined(ENABLE_PDF_VIEWER) #if defined(ENABLE_PDF_VIEWER)
NOTIMPLEMENTED() << "Hi, whoever's fixing PDF support! Thanks! The pdf " NOTIMPLEMENTED()
"viewer resources haven't been ported over to the GN build yet, so " << "Hi, whoever's fixing PDF support! Thanks! The pdf "
"you'll probably need to change this bit of code."; "viewer resources haven't been ported over to the GN build yet, so "
"you'll probably need to change this bit of code.";
bundle.AddDataPackFromPath( bundle.AddDataPackFromPath(
pak_dir.Append(FILE_PATH_LITERAL("pdf_viewer_resources.pak")), pak_dir.Append(FILE_PATH_LITERAL("pdf_viewer_resources.pak")),
ui::GetSupportedScaleFactors()[0]); ui::GetSupportedScaleFactors()[0]);

View file

@ -44,10 +44,8 @@ class GlobalShortcutListenerMac : public GlobalShortcutListener {
// GlobalShortcutListener implementation. // GlobalShortcutListener implementation.
void StartListening() override; void StartListening() override;
void StopListening() override; void StopListening() override;
bool RegisterAcceleratorImpl( bool RegisterAcceleratorImpl(const ui::Accelerator& accelerator) override;
const ui::Accelerator& accelerator) override; void UnregisterAcceleratorImpl(const ui::Accelerator& accelerator) override;
void UnregisterAcceleratorImpl(
const ui::Accelerator& accelerator) override;
// Mac-specific functions for registering hot keys with modifiers. // Mac-specific functions for registering hot keys with modifiers.
bool RegisterHotKey(const ui::Accelerator& accelerator, KeyId hot_key_id); bool RegisterHotKey(const ui::Accelerator& accelerator, KeyId hot_key_id);

View file

@ -5,6 +5,7 @@
#include "chrome/browser/icon_loader.h" #include "chrome/browser/icon_loader.h"
#include <windows.h> #include <windows.h>
#include <shellapi.h> #include <shellapi.h>
#include "base/bind.h" #include "base/bind.h"

View file

@ -24,10 +24,10 @@
#include "base/threading/thread_restrictions.h" #include "base/threading/thread_restrictions.h"
#include "base/threading/thread_task_runner_handle.h" #include "base/threading/thread_task_runner_handle.h"
#include "chrome/common/chrome_utility_printing_messages.h" #include "chrome/common/chrome_utility_printing_messages.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/child_process_data.h"
#include "content/browser/utility_process_host.h" #include "content/browser/utility_process_host.h"
#include "content/browser/utility_process_host_client.h" #include "content/browser/utility_process_host_client.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/child_process_data.h"
#include "printing/emf_win.h" #include "printing/emf_win.h"
#include "printing/pdf_render_settings.h" #include "printing/pdf_render_settings.h"
#include "ui/base/l10n/l10n_util.h" #include "ui/base/l10n/l10n_util.h"
@ -39,8 +39,8 @@ namespace printing {
namespace { namespace {
void CloseFileOnBlockingTaskRunner(base::File temp_file) { void CloseFileOnBlockingTaskRunner(base::File temp_file) {
base::AssertBlockingAllowed(); base::AssertBlockingAllowed();
temp_file.Close(); temp_file.Close();
} }
class PdfConverterImpl; class PdfConverterImpl;

View file

@ -24,8 +24,8 @@
#if defined(OS_WIN) #if defined(OS_WIN)
#include "chrome/browser/printing/pdf_to_emf_converter.h" #include "chrome/browser/printing/pdf_to_emf_converter.h"
#include "printing/pdf_render_settings.h"
#include "printing/metafile.h" #include "printing/metafile.h"
#include "printing/pdf_render_settings.h"
#endif #endif
using base::TimeDelta; using base::TimeDelta;
@ -264,8 +264,8 @@ void PrintJob::StartPdfToEmfConversion(
std::make_unique<PdfConversionState>(page_size, content_area); std::make_unique<PdfConversionState>(page_size, content_area);
const int kPrinterDpi = settings().dpi(); const int kPrinterDpi = settings().dpi();
PdfRenderSettings settings( PdfRenderSettings settings(
content_area, gfx::Point(0, 0), gfx::Size(kPrinterDpi, kPrinterDpi), /*autorotate=*/true, content_area, gfx::Point(0, 0), gfx::Size(kPrinterDpi, kPrinterDpi),
settings_.color() == COLOR, /*autorotate=*/true, settings_.color() == COLOR,
print_text_with_gdi ? PdfRenderSettings::Mode::GDI_TEXT print_text_with_gdi ? PdfRenderSettings::Mode::GDI_TEXT
: PdfRenderSettings::Mode::NORMAL); : PdfRenderSettings::Mode::NORMAL);
pdf_conversion_state_->Start( pdf_conversion_state_->Start(
@ -313,8 +313,8 @@ void PrintJob::StartPdfToPostScriptConversion(
std::make_unique<PdfConversionState>(gfx::Size(), gfx::Rect()); std::make_unique<PdfConversionState>(gfx::Size(), gfx::Rect());
const int kPrinterDpi = settings().dpi(); const int kPrinterDpi = settings().dpi();
PdfRenderSettings settings( PdfRenderSettings settings(
content_area, physical_offsets, gfx::Size(kPrinterDpi, kPrinterDpi), true /* autorotate? */, content_area, physical_offsets, gfx::Size(kPrinterDpi, kPrinterDpi),
settings_.color() == COLOR, true /* autorotate? */, settings_.color() == COLOR,
ps_level2 ? PdfRenderSettings::Mode::POSTSCRIPT_LEVEL2 ps_level2 ? PdfRenderSettings::Mode::POSTSCRIPT_LEVEL2
: PdfRenderSettings::Mode::POSTSCRIPT_LEVEL3); : PdfRenderSettings::Mode::POSTSCRIPT_LEVEL3);
pdf_conversion_state_->Start( pdf_conversion_state_->Start(
@ -466,6 +466,8 @@ PrintedDocument* JobEventDetails::document() const {
} }
#if defined(OS_WIN) #if defined(OS_WIN)
PrintedPage* JobEventDetails::page() const { return page_.get(); } PrintedPage* JobEventDetails::page() const {
return page_.get();
}
#endif #endif
} // namespace printing } // namespace printing

View file

@ -41,10 +41,8 @@ class TtsControllerImpl : public TtsController {
void GetVoices(content::BrowserContext* browser_context, void GetVoices(content::BrowserContext* browser_context,
std::vector<VoiceData>* out_voices) override; std::vector<VoiceData>* out_voices) override;
void VoicesChanged() override; void VoicesChanged() override;
void AddVoicesChangedDelegate( void AddVoicesChangedDelegate(VoicesChangedDelegate* delegate) override;
VoicesChangedDelegate* delegate) override; void RemoveVoicesChangedDelegate(VoicesChangedDelegate* delegate) override;
void RemoveVoicesChangedDelegate(
VoicesChangedDelegate* delegate) override;
void SetTtsEngineDelegate(TtsEngineDelegate* delegate) override; void SetTtsEngineDelegate(TtsEngineDelegate* delegate) override;
TtsEngineDelegate* GetTtsEngineDelegate() override; TtsEngineDelegate* GetTtsEngineDelegate() override;
void SetPlatformImpl(TtsPlatformImpl* platform_impl) override; void SetPlatformImpl(TtsPlatformImpl* platform_impl) override;

View file

@ -5,8 +5,8 @@
#include <math.h> #include <math.h>
#include <objbase.h> #include <objbase.h>
#include <sapi.h> #include <sapi.h>
#include <wrl/client.h>
#include <sphelper.h> #include <sphelper.h>
#include <wrl/client.h>
#include "base/memory/singleton.h" #include "base/memory/singleton.h"
#include "base/strings/string_number_conversions.h" #include "base/strings/string_number_conversions.h"

View file

@ -416,7 +416,7 @@ bool PathProvider(int key, base::FilePath* result) {
return false; return false;
cur = cur =
cur.Append(GetWidevinePath()) cur.Append(GetWidevinePath())
.AppendASCII(base::GetNativeLibraryName(kWidevineCdmLibraryName)); .AppendASCII(base::GetNativeLibraryName(kWidevineCdmLibraryName));
break; break;
#endif // defined(WIDEVINE_CDM_AVAILABLE) && BUILDFLAG(ENABLE_LIBRARY_CDMS) #endif // defined(WIDEVINE_CDM_AVAILABLE) && BUILDFLAG(ENABLE_LIBRARY_CDMS)
case chrome::FILE_RESOURCES_PACK: case chrome::FILE_RESOURCES_PACK:

View file

@ -37,8 +37,7 @@ class TtsDispatcher : public blink::WebSpeechSynthesizer,
// blink::WebSpeechSynthesizer implementation. // blink::WebSpeechSynthesizer implementation.
void UpdateVoiceList() override; void UpdateVoiceList() override;
void Speak(const blink::WebSpeechSynthesisUtterance& utterance) void Speak(const blink::WebSpeechSynthesisUtterance& utterance) override;
override;
void Pause() override; void Pause() override;
void Resume() override; void Resume() override;
void Cancel() override; void Cancel() override;

View file

@ -156,7 +156,8 @@ bool PrintingHandlerWin::RenderPdfPageToMetafile(int page_number,
if (!chrome_pdf::RenderPDFPageToDC( if (!chrome_pdf::RenderPDFPageToDC(
&pdf_data_.front(), pdf_data_.size(), page_number, metafile.context(), &pdf_data_.front(), pdf_data_.size(), page_number, metafile.context(),
pdf_rendering_settings_.dpi.width(), pdf_rendering_settings_.dpi.height(), pdf_rendering_settings_.dpi.width(),
pdf_rendering_settings_.dpi.height(),
pdf_rendering_settings_.area.x() - offset_x, pdf_rendering_settings_.area.x() - offset_x,
pdf_rendering_settings_.area.y() - offset_y, pdf_rendering_settings_.area.y() - offset_y,
pdf_rendering_settings_.area.width(), pdf_rendering_settings_.area.width(),