Skip to content

Commit 925aad2

Browse files
committed
rename OS_MACOSX to OS_MAC
1 parent bc3999f commit 925aad2

18 files changed

+43
-43
lines changed

src/api/menu/menu.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
#include <string>
2929
#include <vector>
3030

31-
#if defined(OS_MACOSX)
31+
#if defined(OS_MAC)
3232
#if __OBJC__
3333
@class NSMenu;
3434
@class NWMenuDelegate;
@@ -103,7 +103,7 @@ class Menu : public Base {
103103
const base::ListValue& arguments,
104104
content::RenderFrameHost* rvh = nullptr) override;
105105

106-
#if defined(OS_MACOSX)
106+
#if defined(OS_MAC)
107107
static Menu* GetMenuFromNative(NSMenu* menu);
108108
#endif
109109

@@ -125,7 +125,7 @@ class Menu : public Base {
125125
void Remove(MenuItem* menu_item, int pos);
126126
void Popup(int x, int y, content::RenderFrameHost*);
127127

128-
#if defined(OS_MACOSX)
128+
#if defined(OS_MAC)
129129
NSMenu* menu_;
130130
NWMenuDelegate* menu_delegate_;
131131
#elif defined(OS_LINUX) || defined(OS_WIN)

src/api/menu/menu_mac.mm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020

2121
#include "content/nw/src/api/menu/menu.h"
2222

23-
#include "base/message_loop/message_loop_current.h"
2423
#include "base/mac/scoped_sending_event.h"
24+
#include "base/task/current_thread.h"
2525
#include "base/values.h"
2626
#import <Cocoa/Cocoa.h>
2727
#include "content/public/browser/web_contents.h"
@@ -84,7 +84,7 @@
8484

8585
{
8686
// Make sure events can be pumped while the menu is up.
87-
base::MessageLoopCurrent::ScopedNestableTaskAllower allow;
87+
base::CurrentThread::ScopedNestableTaskAllower allow;
8888

8989
// One of the events that could be pumped is |window.close()|.
9090
// User-initiated event-tracking loops protect against this by

src/api/menuitem/menuitem.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ void MenuItem::Call(const std::string& method,
134134
int object_id = 0;
135135
arguments.GetInteger(0, &object_id);
136136
SetSubmenu(object_manager()->GetApiObject<Menu>(object_id));
137-
#if defined(OS_MACOSX)
137+
#if defined(OS_MAC)
138138
} else if (method == "SetKey") {
139139
std::string key;
140140
arguments.GetString(0, &key);

src/api/menuitem/menuitem.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
#include <string>
3131

32-
#if defined(OS_MACOSX)
32+
#if defined(OS_MAC)
3333
#if __OBJC__
3434
@class NSMenuItem;
3535
@class MenuItemDelegate;
@@ -42,7 +42,7 @@ class MenuItemDelegate;
4242
#include "ui/gfx/image/image.h"
4343
#include "ui/base/accelerators/accelerator.h"
4444
#include "ui/views/focus/focus_manager.h"
45-
#endif // defined(OS_MACOSX)
45+
#endif // defined(OS_MAC)
4646

4747
namespace nw {
4848

@@ -70,7 +70,7 @@ class MenuItem : public Base {
7070
const base::ListValue& arguments,
7171
base::ListValue* result) override;
7272

73-
#if defined(OS_MACOSX)
73+
#if defined(OS_MAC)
7474
static std::unique_ptr<base::DictionaryValue> CreateFromNative(NSMenuItem* menu_item, Menu* menu, int index);
7575
static MenuItem* GetMenuItemFromNative(NSMenuItem* menu_item);
7676
#endif
@@ -104,7 +104,7 @@ class MenuItem : public Base {
104104
// Template icon works only on Mac OS X
105105
void SetIconIsTemplate(bool isTemplate);
106106

107-
#if defined(OS_MACOSX)
107+
#if defined(OS_MAC)
108108
std::string type_;
109109

110110
NSMenuItem* menu_item_;

src/api/nw_menu_api.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ using nw::MenuItem;
1111

1212
namespace extensions {
1313

14-
#ifndef OS_MACOSX
14+
#ifndef OS_MAC
1515
bool NwMenuGetNSStringWithFixupFunction::RunNWSync(base::ListValue* response, std::string* error) {
1616
SetError("NwMenuGetNSStringWithFixupFunction is only for OSX");
1717
return false;

src/api/nw_window_api.cc

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
#include "content/nw/src/browser/browser_view_layout.h"
6262
#endif
6363

64-
#if defined(OS_MACOSX)
64+
#if defined(OS_MAC)
6565
#include "content/nw/src/nw_content_mac.h"
6666
#endif
6767

@@ -440,7 +440,7 @@ NwCurrentWindowInternalClearMenuFunction::Run() {
440440
}
441441
}
442442

443-
#if defined(OS_MACOSX)
443+
#if defined(OS_MAC)
444444
NWChangeAppMenu(NULL);
445445
#endif
446446

@@ -519,7 +519,7 @@ bool NwCurrentWindowInternalSetMenuFunction::RunNWSync(base::ListValue* response
519519
}
520520

521521

522-
#if defined(OS_MACOSX)
522+
#if defined(OS_MAC)
523523
response->Append(NWChangeAppMenu(menu));
524524
#endif
525525

@@ -574,7 +574,7 @@ static base::win::ScopedHICON createBadgeIcon(const HWND hWnd, const TCHAR *valu
574574
}
575575
#endif
576576

577-
#ifndef OS_MACOSX
577+
#ifndef OS_MAC
578578
ExtensionFunction::ResponseAction
579579
NwCurrentWindowInternalSetBadgeLabelFunction::Run() {
580580
EXTENSION_FUNCTION_VALIDATE(args_);
@@ -644,7 +644,7 @@ NwCurrentWindowInternalRequestAttentionInternalFunction::Run() {
644644
fwi.dwFlags = FLASHW_STOP;
645645
}
646646
FlashWindowEx(&fwi);
647-
#elif defined(OS_LINUX) || defined(OS_MACOSX)
647+
#elif defined(OS_LINUX) || defined(OS_MAC)
648648
AppWindow* window = getAppWindow(this);
649649
if (!window) {
650650
error_ = kNoAssociatedAppWindow;
@@ -773,23 +773,23 @@ NwCurrentWindowInternalEnterKioskModeInternalFunction::Run() {
773773
if (browser) {
774774
BrowserFrame* frame = BrowserView::GetBrowserViewForBrowser(browser)->frame();
775775
frame->SetFullscreen(true);
776-
#if !defined(OS_MACOSX)
776+
#if !defined(OS_MAC)
777777
browser->window()->SetZOrderLevel(ui::ZOrderLevel::kFloatingWindow);
778778
#endif
779779
}
780780
} else {
781781
AppWindow* window = getAppWindow(this);
782782
window->ForcedFullscreen();
783783
}
784-
#if defined(OS_MACOSX)
784+
#if defined(OS_MAC)
785785
NWSetNSAppKioskOptions();
786786
#endif
787787
return RespondNow(NoArguments());
788788
}
789789

790790
ExtensionFunction::ResponseAction
791791
NwCurrentWindowInternalLeaveKioskModeInternalFunction::Run() {
792-
#if defined(OS_MACOSX)
792+
#if defined(OS_MAC)
793793
NWRestoreNSAppKioskOptions();
794794
#endif
795795
if (base::FeatureList::IsEnabled(::features::kNWNewWin)) {
@@ -799,7 +799,7 @@ NwCurrentWindowInternalLeaveKioskModeInternalFunction::Run() {
799799
if (browser) {
800800
BrowserFrame* frame = BrowserView::GetBrowserViewForBrowser(browser)->frame();
801801
frame->SetFullscreen(false);
802-
#if !defined(OS_MACOSX)
802+
#if !defined(OS_MAC)
803803
browser->window()->SetZOrderLevel(ui::ZOrderLevel::kNormal);
804804
#endif
805805
return RespondNow(NoArguments());
@@ -820,14 +820,14 @@ NwCurrentWindowInternalToggleKioskModeInternalFunction::Run() {
820820
BrowserFrame* frame = BrowserView::GetBrowserViewForBrowser(browser)->frame();
821821
if (frame->IsFullscreen()) {
822822
frame->SetFullscreen(false);
823-
#if defined(OS_MACOSX)
823+
#if defined(OS_MAC)
824824
NWRestoreNSAppKioskOptions();
825825
#else
826826
browser->window()->SetZOrderLevel(ui::ZOrderLevel::kNormal);
827827
#endif
828828
} else {
829829
frame->SetFullscreen(true);
830-
#if defined(OS_MACOSX)
830+
#if defined(OS_MAC)
831831
NWSetNSAppKioskOptions();
832832
#else
833833
browser->window()->SetZOrderLevel(ui::ZOrderLevel::kFloatingWindow);
@@ -838,13 +838,13 @@ NwCurrentWindowInternalToggleKioskModeInternalFunction::Run() {
838838
}
839839
AppWindow* window = getAppWindow(this);
840840
if (window->IsFullscreen() || window->IsForcedFullscreen()) {
841-
#if defined(OS_MACOSX)
841+
#if defined(OS_MAC)
842842
NWRestoreNSAppKioskOptions();
843843
#endif
844844
window->Restore();
845845
} else {
846846
window->ForcedFullscreen();
847-
#if defined(OS_MACOSX)
847+
#if defined(OS_MAC)
848848
NWSetNSAppKioskOptions();
849849
#endif
850850
}
@@ -891,7 +891,7 @@ bool NwCurrentWindowInternalGetTitleInternalFunction::RunNWSync(base::ListValue*
891891

892892
ExtensionFunction::ResponseAction
893893
NwCurrentWindowInternalSetShadowInternalFunction::Run() {
894-
#if defined(OS_MACOSX)
894+
#if defined(OS_MAC)
895895
EXTENSION_FUNCTION_VALIDATE(args_);
896896
bool shadow;
897897
EXTENSION_FUNCTION_VALIDATE(args_->GetBoolean(0, &shadow));
@@ -1085,7 +1085,7 @@ NwCurrentWindowInternalSetShowInTaskbarInternalFunction::Run() {
10851085
LOG(ERROR) << "Failed to change the show in taskbar attribute";
10861086
return RespondNow(NoArguments());
10871087
}
1088-
#elif defined(OS_MACOSX)
1088+
#elif defined(OS_MAC)
10891089
AppWindow* app_window = getAppWindow(this);
10901090
extensions::NativeAppWindow* native_window = app_window->GetBaseWindow();
10911091
NWSetNSWindowShowInTaskbar(native_window, show);

src/api/nw_window_api.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ class NwCurrentWindowInternalSetShadowInternalFunction : public ExtensionFunctio
142142

143143
protected:
144144
~NwCurrentWindowInternalSetShadowInternalFunction() override {}
145-
#if defined(OS_MACOSX)
145+
#if defined(OS_MAC)
146146
void SetShadowOnWindow(NSWindow *window, bool shadow);
147147
#endif
148148

src/api/screen/desktop_capture_api.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ bool DesktopCaptureChooseDesktopMediaFunction::RunSync() {
123123

124124
// DesktopMediaPicker is implemented only for Windows, OSX and
125125
// Aura Linux builds.
126-
#if defined(TOOLKIT_VIEWS) || defined(OS_MACOSX)
126+
#if defined(TOOLKIT_VIEWS) || defined(OS_MAC)
127127
picker_ = DesktopMediaPicker::Create();
128128
#else
129129
error_ = "Desktop Capture API is not yet implemented for this platform.";

src/api/shortcut/shortcut.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ ui::Accelerator Parse(const std::string& shortcut) {
4545
ui::KeyboardCode key = ui::VKEY_UNKNOWN;
4646
for (size_t i = 0; i < tokens.size(); i++) {
4747
if (tokens[i] == kKeyCtrl) {
48-
#if defined(OS_MACOSX)
48+
#if defined(OS_MAC)
4949
modifiers |= ui::EF_COMMAND_DOWN;
5050
#else
5151
modifiers |= ui::EF_CONTROL_DOWN;

src/api/tray/tray.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
#include <string>
2828

29-
#if defined(OS_MACOSX)
29+
#if defined(OS_MAC)
3030
#if __OBJC__
3131
@class NSStatusItem;
3232
@class MacTrayObserver;
@@ -40,7 +40,7 @@ class MacTrayObserver;
4040
#elif defined(OS_WIN) || defined(OS_LINUX)
4141
class StatusIcon;
4242
class StatusTray;
43-
#endif // defined(OS_MACOSX)
43+
#endif // defined(OS_MAC)
4444

4545
namespace nw {
4646

@@ -74,7 +74,7 @@ class Tray : public Base {
7474
// Template icons only work with Macs
7575
void SetIconsAreTemplates(bool areTemplates);
7676

77-
#if defined(OS_MACOSX)
77+
#if defined(OS_MAC)
7878
__block NSStatusItem* status_item_;
7979
MacTrayObserver* status_observer_;
8080
bool iconsAreTemplates;

src/browser/nw_chrome_browser_hooks.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ void SetWindowHIcon(base::win::ScopedHICON icon) {
248248

249249
int MainPartsPreCreateThreadsHook() {
250250
gCheckStoragePartitionMatches = CheckStoragePartitionMatches;
251-
#if defined(OS_MACOSX)
251+
#if defined(OS_MAC)
252252
gSendEventToApp = SendEventToApp;
253253
#endif
254254
base::ThreadRestrictions::ScopedAllowIO allow_io;

src/browser/nw_content_browser_hooks.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ bool g_in_webview_apply_attr = false;
5858
bool g_in_webview_apply_attr_allow_nw = false;
5959
} //namespace
6060

61-
#if defined(OS_MACOSX)
61+
#if defined(OS_MAC)
6262
typedef void (*SendEventToAppFn)(const std::string& event_name, std::unique_ptr<base::ListValue> event_args);
6363
CONTENT_EXPORT SendEventToAppFn gSendEventToApp = nullptr;
6464

@@ -138,7 +138,7 @@ bool GetImage(Package* package, const FilePath& icon_path, gfx::Image* image) {
138138
return true;
139139
}
140140

141-
#if defined(OS_MACOSX)
141+
#if defined(OS_MAC)
142142
CONTENT_EXPORT bool ApplicationShouldHandleReopenHook(bool hasVisibleWindows) {
143143
std::unique_ptr<base::ListValue> arguments(new base::ListValue());
144144
if (gSendEventToApp)

src/browser/nw_content_browser_hooks.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ CONTENT_EXPORT void OverrideWebkitPrefsHook(content::RenderViewHost* rvh, conten
4949
// content/browser/site_instance_impl.cc
5050
CONTENT_EXPORT bool PinningRenderer();
5151

52-
#if defined(OS_MACOSX)
52+
#if defined(OS_MAC)
5353
// ref in chrome/browser/app_controller_mac.mm
5454
CONTENT_EXPORT bool ApplicationShouldHandleReopenHook(bool hasVisibleWindows);
5555
// ref in chrome/browser/app_controller_mac.mm

src/browser/nw_extensions_browser_hooks.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ void CalcNewWinParams(content::WebContents* new_contents, void* params,
377377
}
378378

379379
bool ExecuteAppCommandHook(int command_id, extensions::AppWindow* app_window) {
380-
#if defined(OS_MACOSX)
380+
#if defined(OS_MAC)
381381
return false;
382382
#else
383383
//nw::ObjectManager* obj_manager = nw::ObjectManager::Get(app_window->browser_context());

src/common/node_hooks.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ V(SetUVRunFn, "g_set_uv_run", g_set_uv_run_fn)
5555
V(VoidIntFn, "g_uv_init_nw", g_uv_init_nw_fn)
5656
V(VoidHookFn, "g_promise_reject_callback", g_promise_reject_callback_fn)
5757

58-
#if defined(OS_MACOSX)
58+
#if defined(OS_MAC)
5959
V(VoidHookFn, "g_msg_pump_dtor_osx", g_msg_pump_dtor_osx_fn)
6060
V(VoidHookFn, "g_uv_sem_post", g_uv_sem_post_fn)
6161
V(VoidHookFn, "g_uv_sem_wait", g_uv_sem_wait_fn)

src/nw_content.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ void DocumentFinishHook(blink::WebLocalFrame* frame,
8989
bool GetPackageImage(nw::Package* package,
9090
const base::FilePath& icon_path,
9191
gfx::Image* image);
92-
#if defined(OS_MACOSX)
92+
#if defined(OS_MAC)
9393
bool ApplicationShouldHandleReopenHook(bool hasVisibleWindows);
9494
void OSXOpenURLsHook(const std::vector<GURL>& startup_urls);
9595
#endif

src/nw_package.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ FilePath GetSelfPath() {
143143
path = FilePath(command_line->GetProgram());
144144
}
145145

146-
#if defined(OS_MACOSX)
146+
#if defined(OS_MAC)
147147
// Find if we have node-webkit.app/Resources/app.nw.
148148
path = path.DirName().DirName().Append("Resources").Append("app.nw");
149149
#endif
@@ -190,7 +190,7 @@ Package::Package()
190190
// Note: self_extract_ is true here, otherwise a 'Invalid Package' error
191191
// would be triggered.
192192
path = GetSelfPath().DirName();
193-
#if defined(OS_MACOSX)
193+
#if defined(OS_MAC)
194194
path = path.DirName().DirName().DirName();
195195
#endif
196196
if (InitFromPath(path))

src/renderer/nw_content_renderer_hooks.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#include "base/native_library.h"
88
#include "base/strings/utf_string_conversions.h"
99

10-
#if defined(OS_MACOSX)
10+
#if defined(OS_MAC)
1111
#include "base/mac/bundle_locations.h"
1212
#endif
1313

@@ -39,7 +39,7 @@ namespace nw {
3939
// renderer
4040
void LoadNodeSymbols() {
4141
base::NativeLibraryLoadError error;
42-
#if defined(OS_MACOSX)
42+
#if defined(OS_MAC)
4343
base::FilePath node_dll_path = base::mac::FrameworkBundlePath().Append(base::FilePath::FromUTF8Unsafe(base::GetNativeLibraryName("node")));
4444
#else
4545
base::FilePath node_dll_path = base::FilePath::FromUTF8Unsafe(base::GetNativeLibraryName("node"));

0 commit comments

Comments
 (0)