chore: rename atom -> electron (#21986)

This commit is contained in:
Jeremy Apthorp 2020-02-04 12:19:40 -08:00 committed by GitHub
parent f14fc4b041
commit d9321f4df7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
287 changed files with 1771 additions and 1708 deletions

View file

@ -1,35 +0,0 @@
// Copyright (c) 2018 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#ifndef SHELL_BROWSER_UI_COCOA_ATOM_NATIVE_WIDGET_MAC_H_
#define SHELL_BROWSER_UI_COCOA_ATOM_NATIVE_WIDGET_MAC_H_
#include "ui/views/widget/native_widget_mac.h"
namespace electron {
class NativeWindowMac;
class AtomNativeWidgetMac : public views::NativeWidgetMac {
public:
AtomNativeWidgetMac(NativeWindowMac* shell,
NSUInteger style_mask,
views::internal::NativeWidgetDelegate* delegate);
~AtomNativeWidgetMac() override;
protected:
// NativeWidgetMac:
NativeWidgetMacNSWindow* CreateNSWindow(
const remote_cocoa::mojom::CreateWindowParams* params) override;
private:
NativeWindowMac* shell_;
NSUInteger style_mask_;
DISALLOW_COPY_AND_ASSIGN(AtomNativeWidgetMac);
};
} // namespace electron
#endif // SHELL_BROWSER_UI_COCOA_ATOM_NATIVE_WIDGET_MAC_H_

View file

@ -2,8 +2,10 @@
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#ifndef SHELL_BROWSER_UI_COCOA_ATOM_BUNDLE_MOVER_H_
#define SHELL_BROWSER_UI_COCOA_ATOM_BUNDLE_MOVER_H_
#ifndef SHELL_BROWSER_UI_COCOA_ELECTRON_BUNDLE_MOVER_H_
#define SHELL_BROWSER_UI_COCOA_ELECTRON_BUNDLE_MOVER_H_
#include <string>
#include "base/mac/foundation_util.h"
#include "shell/common/gin_helper/error_thrower.h"
@ -17,7 +19,7 @@ namespace electron {
// Possible bundle movement conflicts
enum class BundlerMoverConflictType { EXISTS, EXISTS_AND_RUNNING };
class AtomBundleMover {
class ElectronBundleMover {
public:
static bool Move(gin_helper::ErrorThrower thrower, gin::Arguments* args);
static bool IsCurrentAppInApplicationsFolder();
@ -41,4 +43,4 @@ class AtomBundleMover {
} // namespace electron
#endif // SHELL_BROWSER_UI_COCOA_ATOM_BUNDLE_MOVER_H_
#endif // SHELL_BROWSER_UI_COCOA_ELECTRON_BUNDLE_MOVER_H_

View file

@ -2,7 +2,7 @@
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#import "shell/browser/ui/cocoa/atom_bundle_mover.h"
#import "shell/browser/ui/cocoa/electron_bundle_mover.h"
#import <AppKit/AppKit.h>
#import <Security/Security.h>
@ -38,9 +38,9 @@ struct Converter<electron::BundlerMoverConflictType> {
namespace electron {
bool AtomBundleMover::ShouldContinueMove(gin_helper::ErrorThrower thrower,
BundlerMoverConflictType type,
gin::Arguments* args) {
bool ElectronBundleMover::ShouldContinueMove(gin_helper::ErrorThrower thrower,
BundlerMoverConflictType type,
gin::Arguments* args) {
gin::Dictionary options(args->isolate());
bool hasOptions = args->GetNext(&options);
base::OnceCallback<v8::Local<v8::Value>(BundlerMoverConflictType)>
@ -61,8 +61,8 @@ bool AtomBundleMover::ShouldContinueMove(gin_helper::ErrorThrower thrower,
return true;
}
bool AtomBundleMover::Move(gin_helper::ErrorThrower thrower,
gin::Arguments* args) {
bool ElectronBundleMover::Move(gin_helper::ErrorThrower thrower,
gin::Arguments* args) {
// Path of the current bundle
NSString* bundlePath = [[NSBundle mainBundle] bundlePath];
@ -178,11 +178,11 @@ bool AtomBundleMover::Move(gin_helper::ErrorThrower thrower,
return true;
}
bool AtomBundleMover::IsCurrentAppInApplicationsFolder() {
bool ElectronBundleMover::IsCurrentAppInApplicationsFolder() {
return IsInApplicationsFolder([[NSBundle mainBundle] bundlePath]);
}
bool AtomBundleMover::IsInApplicationsFolder(NSString* bundlePath) {
bool ElectronBundleMover::IsInApplicationsFolder(NSString* bundlePath) {
// Check all the normal Application directories
NSArray* applicationDirs = NSSearchPathForDirectoriesInDomains(
NSApplicationDirectory, NSAllDomainsMask, true);
@ -199,7 +199,7 @@ bool AtomBundleMover::IsInApplicationsFolder(NSString* bundlePath) {
return false;
}
NSString* AtomBundleMover::ContainingDiskImageDevice(NSString* bundlePath) {
NSString* ElectronBundleMover::ContainingDiskImageDevice(NSString* bundlePath) {
NSString* containingPath = [bundlePath stringByDeletingLastPathComponent];
struct statfs fs;
@ -258,9 +258,9 @@ NSString* AtomBundleMover::ContainingDiskImageDevice(NSString* bundlePath) {
return nil;
}
bool AtomBundleMover::AuthorizedInstall(NSString* srcPath,
NSString* dstPath,
bool* canceled) {
bool ElectronBundleMover::AuthorizedInstall(NSString* srcPath,
NSString* dstPath,
bool* canceled) {
if (canceled)
*canceled = false;
@ -361,21 +361,21 @@ fail:
return false;
}
bool AtomBundleMover::CopyBundle(NSString* srcPath, NSString* dstPath) {
bool ElectronBundleMover::CopyBundle(NSString* srcPath, NSString* dstPath) {
NSFileManager* fileManager = [NSFileManager defaultManager];
NSError* error = nil;
return [fileManager copyItemAtPath:srcPath toPath:dstPath error:&error];
}
NSString* AtomBundleMover::ShellQuotedString(NSString* string) {
NSString* ElectronBundleMover::ShellQuotedString(NSString* string) {
return [NSString
stringWithFormat:@"'%@'",
[string stringByReplacingOccurrencesOfString:@"'"
withString:@"'\\''"]];
}
void AtomBundleMover::Relaunch(NSString* destinationPath) {
void ElectronBundleMover::Relaunch(NSString* destinationPath) {
// The shell script waits until the original app process terminates.
// This is done so that the relaunched app opens as the front-most app.
int pid = [[NSProcessInfo processInfo] processIdentifier];
@ -402,7 +402,7 @@ void AtomBundleMover::Relaunch(NSString* destinationPath) {
arguments:[NSArray arrayWithObjects:@"-c", script, nil]];
}
bool AtomBundleMover::IsApplicationAtPathRunning(NSString* bundlePath) {
bool ElectronBundleMover::IsApplicationAtPathRunning(NSString* bundlePath) {
bundlePath = [bundlePath stringByStandardizingPath];
for (NSRunningApplication* runningApplication in
@ -416,7 +416,7 @@ bool AtomBundleMover::IsApplicationAtPathRunning(NSString* bundlePath) {
return false;
}
bool AtomBundleMover::Trash(NSString* path) {
bool ElectronBundleMover::Trash(NSString* path) {
bool result = false;
if (floor(NSAppKitVersionNumber) >= NSAppKitVersionNumber10_8) {
@ -456,7 +456,7 @@ end tell
return result;
}
bool AtomBundleMover::DeleteOrTrash(NSString* path) {
bool ElectronBundleMover::DeleteOrTrash(NSString* path) {
NSError* error;
if ([[NSFileManager defaultManager] removeItemAtPath:path error:&error]) {

View file

@ -17,7 +17,7 @@ class InspectableWebContentsViewMac;
using electron::InspectableWebContentsViewMac;
@interface AtomInspectableWebContentsView : BaseView <NSWindowDelegate> {
@interface ElectronInspectableWebContentsView : BaseView <NSWindowDelegate> {
@private
electron::InspectableWebContentsViewMac* inspectableWebContentsView_;

View file

@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE-CHROMIUM file.
#include "shell/browser/ui/cocoa/atom_inspectable_web_contents_view.h"
#include "shell/browser/ui/cocoa/electron_inspectable_web_contents_view.h"
#include "content/public/browser/render_widget_host_view.h"
#include "shell/browser/ui/cocoa/event_dispatching_window.h"
@ -11,7 +11,7 @@
#include "shell/browser/ui/inspectable_web_contents_view_mac.h"
#include "ui/gfx/mac/scoped_cocoa_disable_screen_updates.h"
@implementation AtomInspectableWebContentsView
@implementation ElectronInspectableWebContentsView
- (instancetype)initWithInspectableWebContentsViewMac:
(InspectableWebContentsViewMac*)view {

View file

@ -3,8 +3,8 @@
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#ifndef SHELL_BROWSER_UI_COCOA_ATOM_MENU_CONTROLLER_H_
#define SHELL_BROWSER_UI_COCOA_ATOM_MENU_CONTROLLER_H_
#ifndef SHELL_BROWSER_UI_COCOA_ELECTRON_MENU_CONTROLLER_H_
#define SHELL_BROWSER_UI_COCOA_ELECTRON_MENU_CONTROLLER_H_
#import <Cocoa/Cocoa.h>
@ -13,7 +13,7 @@
#include "base/strings/string16.h"
namespace electron {
class AtomMenuModel;
class ElectronMenuModel;
}
// A controller for the cross-platform menu model. The menu that's created
@ -22,26 +22,26 @@ class AtomMenuModel;
// allow for hierarchical menus). The tag is the index into that model for
// that particular item. It is important that the model outlives this object
// as it only maintains weak references.
@interface AtomMenuController : NSObject <NSMenuDelegate> {
@interface ElectronMenuController : NSObject <NSMenuDelegate> {
@protected
electron::AtomMenuModel* model_; // weak
electron::ElectronMenuModel* model_; // weak
base::scoped_nsobject<NSMenu> menu_;
BOOL isMenuOpen_;
BOOL useDefaultAccelerator_;
base::OnceClosure closeCallback;
}
@property(nonatomic, assign) electron::AtomMenuModel* model;
@property(nonatomic, assign) electron::ElectronMenuModel* model;
// Builds a NSMenu from the pre-built model (must not be nil). Changes made
// to the contents of the model after calling this will not be noticed.
- (id)initWithModel:(electron::AtomMenuModel*)model
- (id)initWithModel:(electron::ElectronMenuModel*)model
useDefaultAccelerator:(BOOL)use;
- (void)setCloseCallback:(base::OnceClosure)callback;
// Populate current NSMenu with |model|.
- (void)populateWithModel:(electron::AtomMenuModel*)model;
- (void)populateWithModel:(electron::ElectronMenuModel*)model;
// Programmatically close the constructed menu.
- (void)cancel;
@ -60,4 +60,4 @@ class AtomMenuModel;
@end
#endif // SHELL_BROWSER_UI_COCOA_ATOM_MENU_CONTROLLER_H_
#endif // SHELL_BROWSER_UI_COCOA_ELECTRON_MENU_CONTROLLER_H_

View file

@ -3,7 +3,7 @@
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#import "shell/browser/ui/cocoa/atom_menu_controller.h"
#import "shell/browser/ui/cocoa/electron_menu_controller.h"
#include <utility>
@ -13,8 +13,8 @@
#include "base/task/post_task.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "shell/browser/mac/atom_application.h"
#include "shell/browser/ui/atom_menu_model.h"
#include "shell/browser/mac/electron_application.h"
#include "shell/browser/ui/electron_menu_model.h"
#include "ui/base/accelerators/accelerator.h"
#include "ui/base/accelerators/platform_accelerator_cocoa.h"
#include "ui/base/l10n/l10n_util_mac.h"
@ -64,7 +64,7 @@ Role kRolesMap[] = {
// Called when adding a submenu to the menu and checks if the submenu, via its
// |model|, has visible child items.
bool MenuHasVisibleItems(const electron::AtomMenuModel* model) {
bool MenuHasVisibleItems(const electron::ElectronMenuModel* model) {
int count = model->GetItemCount();
for (int index = 0; index < count; index++) {
if (model->IsVisibleAt(index))
@ -93,11 +93,11 @@ static base::scoped_nsobject<NSMenuItem> recentDocumentsMenuItem_;
// Submenu retained to be swapped back to |recentDocumentsMenuItem_|
static base::scoped_nsobject<NSMenu> recentDocumentsMenuSwap_;
@implementation AtomMenuController
@implementation ElectronMenuController
@synthesize model = model_;
- (id)initWithModel:(electron::AtomMenuModel*)model
- (id)initWithModel:(electron::ElectronMenuModel*)model
useDefaultAccelerator:(BOOL)use {
if ((self = [super init])) {
model_ = model;
@ -124,7 +124,7 @@ static base::scoped_nsobject<NSMenu> recentDocumentsMenuSwap_;
closeCallback = std::move(callback);
}
- (void)populateWithModel:(electron::AtomMenuModel*)model {
- (void)populateWithModel:(electron::ElectronMenuModel*)model {
if (!menu_)
return;
@ -142,7 +142,7 @@ static base::scoped_nsobject<NSMenu> recentDocumentsMenuSwap_;
const int count = model->GetItemCount();
for (int index = 0; index < count; index++) {
if (model->GetTypeAt(index) == electron::AtomMenuModel::TYPE_SEPARATOR)
if (model->GetTypeAt(index) == electron::ElectronMenuModel::TYPE_SEPARATOR)
[self addSeparatorToMenu:menu_ atIndex:index];
else
[self addItemToMenu:menu_ atIndex:index fromModel:model];
@ -162,12 +162,12 @@ static base::scoped_nsobject<NSMenu> recentDocumentsMenuSwap_;
// Creates a NSMenu from the given model. If the model has submenus, this can
// be invoked recursively.
- (NSMenu*)menuFromModel:(electron::AtomMenuModel*)model {
- (NSMenu*)menuFromModel:(electron::ElectronMenuModel*)model {
NSMenu* menu = [[[NSMenu alloc] initWithTitle:@""] autorelease];
const int count = model->GetItemCount();
for (int index = 0; index < count; index++) {
if (model->GetTypeAt(index) == electron::AtomMenuModel::TYPE_SEPARATOR)
if (model->GetTypeAt(index) == electron::ElectronMenuModel::TYPE_SEPARATOR)
[self addSeparatorToMenu:menu atIndex:index];
else
[self addItemToMenu:menu atIndex:index fromModel:model];
@ -226,7 +226,7 @@ static base::scoped_nsobject<NSMenu> recentDocumentsMenuSwap_;
// associated with the entry in the model identified by |modelIndex|.
- (void)addItemToMenu:(NSMenu*)menu
atIndex:(NSInteger)index
fromModel:(electron::AtomMenuModel*)model {
fromModel:(electron::ElectronMenuModel*)model {
base::string16 label16 = model->GetLabelAt(index);
NSString* label = l10n_util::FixUpWindowsStyleLabel(label16);
@ -244,7 +244,7 @@ static base::scoped_nsobject<NSMenu> recentDocumentsMenuSwap_;
[item setToolTip:base::SysUTF16ToNSString(toolTip)];
base::string16 role = model->GetRoleAt(index);
electron::AtomMenuModel::ItemType type = model->GetTypeAt(index);
electron::ElectronMenuModel::ItemType type = model->GetTypeAt(index);
if (role == base::ASCIIToUTF16("services")) {
base::string16 title = base::ASCIIToUTF16("Services");
@ -255,7 +255,7 @@ static base::scoped_nsobject<NSMenu> recentDocumentsMenuSwap_;
NSMenu* submenu = [[NSMenu alloc] initWithTitle:label];
[item setSubmenu:submenu];
[NSApp setServicesMenu:submenu];
} else if (type == electron::AtomMenuModel::TYPE_SUBMENU &&
} else if (type == electron::ElectronMenuModel::TYPE_SUBMENU &&
model->IsVisibleAt(index)) {
// We need to specifically check that the submenu top-level item has been
// enabled as it's not validated by validateUserInterfaceItem
@ -265,8 +265,9 @@ static base::scoped_nsobject<NSMenu> recentDocumentsMenuSwap_;
// Recursively build a submenu from the sub-model at this index.
[item setTarget:nil];
[item setAction:nil];
electron::AtomMenuModel* submenuModel =
static_cast<electron::AtomMenuModel*>(model->GetSubmenuModelAt(index));
electron::ElectronMenuModel* submenuModel =
static_cast<electron::ElectronMenuModel*>(
model->GetSubmenuModelAt(index));
NSMenu* submenu = MenuHasVisibleItems(submenuModel)
? [self menuFromModel:submenuModel]
: MakeEmptySubmenu();
@ -330,8 +331,9 @@ static base::scoped_nsobject<NSMenu> recentDocumentsMenuSwap_;
return NO;
NSInteger modelIndex = [item tag];
electron::AtomMenuModel* model = static_cast<electron::AtomMenuModel*>(
[[(id)item representedObject] pointerValue]);
electron::ElectronMenuModel* model =
static_cast<electron::ElectronMenuModel*>(
[[(id)item representedObject] pointerValue]);
DCHECK(model);
if (model) {
BOOL checked = model->IsItemCheckedAt(modelIndex);
@ -349,8 +351,9 @@ static base::scoped_nsobject<NSMenu> recentDocumentsMenuSwap_;
// item chosen.
- (void)itemSelected:(id)sender {
NSInteger modelIndex = [sender tag];
electron::AtomMenuModel* model = static_cast<electron::AtomMenuModel*>(
[[sender representedObject] pointerValue]);
electron::ElectronMenuModel* model =
static_cast<electron::ElectronMenuModel*>(
[[sender representedObject] pointerValue]);
DCHECK(model);
if (model) {
NSEvent* event = [NSApp currentEvent];

View file

@ -0,0 +1,35 @@
// Copyright (c) 2018 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#ifndef SHELL_BROWSER_UI_COCOA_ELECTRON_NATIVE_WIDGET_MAC_H_
#define SHELL_BROWSER_UI_COCOA_ELECTRON_NATIVE_WIDGET_MAC_H_
#include "ui/views/widget/native_widget_mac.h"
namespace electron {
class NativeWindowMac;
class ElectronNativeWidgetMac : public views::NativeWidgetMac {
public:
ElectronNativeWidgetMac(NativeWindowMac* shell,
NSUInteger style_mask,
views::internal::NativeWidgetDelegate* delegate);
~ElectronNativeWidgetMac() override;
protected:
// NativeWidgetMac:
NativeWidgetMacNSWindow* CreateNSWindow(
const remote_cocoa::mojom::CreateWindowParams* params) override;
private:
NativeWindowMac* shell_;
NSUInteger style_mask_;
DISALLOW_COPY_AND_ASSIGN(ElectronNativeWidgetMac);
};
} // namespace electron
#endif // SHELL_BROWSER_UI_COCOA_ELECTRON_NATIVE_WIDGET_MAC_H_

View file

@ -2,13 +2,13 @@
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#include "shell/browser/ui/cocoa/atom_native_widget_mac.h"
#include "shell/browser/ui/cocoa/electron_native_widget_mac.h"
#include "shell/browser/ui/cocoa/atom_ns_window.h"
#include "shell/browser/ui/cocoa/electron_ns_window.h"
namespace electron {
AtomNativeWidgetMac::AtomNativeWidgetMac(
ElectronNativeWidgetMac::ElectronNativeWidgetMac(
NativeWindowMac* shell,
NSUInteger style_mask,
views::internal::NativeWidgetDelegate* delegate)
@ -16,12 +16,12 @@ AtomNativeWidgetMac::AtomNativeWidgetMac(
shell_(shell),
style_mask_(style_mask) {}
AtomNativeWidgetMac::~AtomNativeWidgetMac() {}
ElectronNativeWidgetMac::~ElectronNativeWidgetMac() {}
NativeWidgetMacNSWindow* AtomNativeWidgetMac::CreateNSWindow(
NativeWidgetMacNSWindow* ElectronNativeWidgetMac::CreateNSWindow(
const remote_cocoa::mojom::CreateWindowParams* params) {
return [[[AtomNSWindow alloc] initWithShell:shell_
styleMask:style_mask_] autorelease];
return [[[ElectronNSWindow alloc] initWithShell:shell_
styleMask:style_mask_] autorelease];
}
} // namespace electron

View file

@ -2,8 +2,8 @@
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#ifndef SHELL_BROWSER_UI_COCOA_ATOM_NS_WINDOW_H_
#define SHELL_BROWSER_UI_COCOA_ATOM_NS_WINDOW_H_
#ifndef SHELL_BROWSER_UI_COCOA_ELECTRON_NS_WINDOW_H_
#define SHELL_BROWSER_UI_COCOA_ELECTRON_NS_WINDOW_H_
#include "components/remote_cocoa/app_shim/native_widget_mac_nswindow.h"
#include "shell/browser/ui/cocoa/event_dispatching_window.h"
@ -27,7 +27,7 @@ class ScopedDisableResize {
} // namespace electron
@interface AtomNSWindow : NativeWidgetMacNSWindow {
@interface ElectronNSWindow : NativeWidgetMacNSWindow {
@private
electron::NativeWindowMac* shell_;
}
@ -46,4 +46,4 @@ class ScopedDisableResize {
- (NSImage*)_cornerMask;
@end
#endif // SHELL_BROWSER_UI_COCOA_ATOM_NS_WINDOW_H_
#endif // SHELL_BROWSER_UI_COCOA_ELECTRON_NS_WINDOW_H_

View file

@ -2,12 +2,12 @@
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#include "shell/browser/ui/cocoa/atom_ns_window.h"
#include "shell/browser/ui/cocoa/electron_ns_window.h"
#include "base/strings/sys_string_conversions.h"
#include "shell/browser/native_window_mac.h"
#include "shell/browser/ui/cocoa/atom_preview_item.h"
#include "shell/browser/ui/cocoa/atom_touch_bar.h"
#include "shell/browser/ui/cocoa/electron_preview_item.h"
#include "shell/browser/ui/cocoa/electron_touch_bar.h"
#include "shell/browser/ui/cocoa/root_view_mac.h"
#include "ui/base/cocoa/window_size_constants.h"
@ -17,7 +17,7 @@ bool ScopedDisableResize::disable_resize_ = false;
} // namespace electron
@implementation AtomNSWindow
@implementation ElectronNSWindow
@synthesize acceptsFirstMouse;
@synthesize enableLargerThanScreen;

View file

@ -2,8 +2,8 @@
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#ifndef SHELL_BROWSER_UI_COCOA_ATOM_NS_WINDOW_DELEGATE_H_
#define SHELL_BROWSER_UI_COCOA_ATOM_NS_WINDOW_DELEGATE_H_
#ifndef SHELL_BROWSER_UI_COCOA_ELECTRON_NS_WINDOW_DELEGATE_H_
#define SHELL_BROWSER_UI_COCOA_ELECTRON_NS_WINDOW_DELEGATE_H_
#include <Quartz/Quartz.h>
@ -13,7 +13,7 @@ namespace electron {
class NativeWindowMac;
}
@interface AtomNSWindowDelegate
@interface ElectronNSWindowDelegate
: ViewsNSWindowDelegate <NSTouchBarDelegate, QLPreviewPanelDataSource> {
@private
electron::NativeWindowMac* shell_;
@ -24,4 +24,4 @@ class NativeWindowMac;
- (id)initWithShell:(electron::NativeWindowMac*)shell;
@end
#endif // SHELL_BROWSER_UI_COCOA_ATOM_NS_WINDOW_DELEGATE_H_
#endif // SHELL_BROWSER_UI_COCOA_ELECTRON_NS_WINDOW_DELEGATE_H_

View file

@ -2,7 +2,7 @@
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#include "shell/browser/ui/cocoa/atom_ns_window_delegate.h"
#include "shell/browser/ui/cocoa/electron_ns_window_delegate.h"
#include <algorithm>
@ -10,15 +10,15 @@
#include "components/remote_cocoa/app_shim/native_widget_ns_window_bridge.h"
#include "shell/browser/browser.h"
#include "shell/browser/native_window_mac.h"
#include "shell/browser/ui/cocoa/atom_preview_item.h"
#include "shell/browser/ui/cocoa/atom_touch_bar.h"
#include "shell/browser/ui/cocoa/electron_preview_item.h"
#include "shell/browser/ui/cocoa/electron_touch_bar.h"
#include "ui/gfx/mac/coordinate_conversion.h"
#include "ui/views/cocoa/native_widget_mac_ns_window_host.h"
#include "ui/views/widget/native_widget_mac.h"
using TitleBarStyle = electron::NativeWindowMac::TitleBarStyle;
@implementation AtomNSWindowDelegate
@implementation ElectronNSWindowDelegate
- (id)initWithShell:(electron::NativeWindowMac*)shell {
// The views library assumes the window delegate must be an instance of

View file

@ -2,16 +2,16 @@
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#ifndef SHELL_BROWSER_UI_COCOA_ATOM_PREVIEW_ITEM_H_
#define SHELL_BROWSER_UI_COCOA_ATOM_PREVIEW_ITEM_H_
#ifndef SHELL_BROWSER_UI_COCOA_ELECTRON_PREVIEW_ITEM_H_
#define SHELL_BROWSER_UI_COCOA_ELECTRON_PREVIEW_ITEM_H_
#import <Cocoa/Cocoa.h>
#import <Quartz/Quartz.h>
@interface AtomPreviewItem : NSObject <QLPreviewItem>
@interface ElectronPreviewItem : NSObject <QLPreviewItem>
@property(nonatomic, retain) NSURL* previewItemURL;
@property(nonatomic, retain) NSString* previewItemTitle;
- (id)initWithURL:(NSURL*)url title:(NSString*)title;
@end
#endif // SHELL_BROWSER_UI_COCOA_ATOM_PREVIEW_ITEM_H_
#endif // SHELL_BROWSER_UI_COCOA_ELECTRON_PREVIEW_ITEM_H_

View file

@ -2,9 +2,9 @@
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#include "shell/browser/ui/cocoa/atom_preview_item.h"
#include "shell/browser/ui/cocoa/electron_preview_item.h"
@implementation AtomPreviewItem
@implementation ElectronPreviewItem
@synthesize previewItemURL;
@synthesize previewItemTitle;

View file

@ -2,8 +2,8 @@
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#ifndef SHELL_BROWSER_UI_COCOA_ATOM_TOUCH_BAR_H_
#define SHELL_BROWSER_UI_COCOA_ATOM_TOUCH_BAR_H_
#ifndef SHELL_BROWSER_UI_COCOA_ELECTRON_TOUCH_BAR_H_
#define SHELL_BROWSER_UI_COCOA_ELECTRON_TOUCH_BAR_H_
#import <Cocoa/Cocoa.h>
@ -15,9 +15,9 @@
#include "shell/browser/native_window.h"
#include "shell/common/gin_helper/persistent_dictionary.h"
@interface AtomTouchBar : NSObject <NSScrubberDelegate,
NSScrubberDataSource,
NSScrubberFlowLayoutDelegate> {
@interface ElectronTouchBar : NSObject <NSScrubberDelegate,
NSScrubberDataSource,
NSScrubberFlowLayoutDelegate> {
@protected
std::vector<gin_helper::PersistentDictionary> ordered_settings_;
std::map<std::string, gin_helper::PersistentDictionary> settings_;
@ -96,4 +96,4 @@
@end
#endif // SHELL_BROWSER_UI_COCOA_ATOM_TOUCH_BAR_H_
#endif // SHELL_BROWSER_UI_COCOA_ELECTRON_TOUCH_BAR_H_

View file

@ -2,7 +2,7 @@
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#import "shell/browser/ui/cocoa/atom_touch_bar.h"
#import "shell/browser/ui/cocoa/electron_touch_bar.h"
#include <string>
#include <utility>
@ -14,7 +14,7 @@
#include "skia/ext/skia_utils_mac.h"
#include "ui/gfx/image/image.h"
@implementation AtomTouchBar
@implementation ElectronTouchBar
static NSTouchBarItemIdentifier ButtonIdentifier =
@"com.electron.touchbar.button.";