From 828d233f2aeef5672449abc55607272da6f80ef0 Mon Sep 17 00:00:00 2001 From: Zhuo Lu Date: Sat, 18 Nov 2017 23:11:31 -0800 Subject: [PATCH] Rollback duplicated feature --- atom/browser/api/atom_api_menu.cc | 1 - atom/browser/api/atom_api_menu.h | 4 ---- atom/browser/api/atom_api_menu_mac.mm | 7 ------- docs/api/menu.md | 7 ------- lib/browser/api/menu.js | 8 -------- 5 files changed, 27 deletions(-) diff --git a/atom/browser/api/atom_api_menu.cc b/atom/browser/api/atom_api_menu.cc index 0f9264fcc65..da208b36591 100644 --- a/atom/browser/api/atom_api_menu.cc +++ b/atom/browser/api/atom_api_menu.cc @@ -200,7 +200,6 @@ void Initialize(v8::Local exports, v8::Local unused, dict.SetMethod("setApplicationMenu", &Menu::SetApplicationMenu); dict.SetMethod("sendActionToFirstResponder", &Menu::SendActionToFirstResponder); - dict.SetMethod("noteNewRecentDocumentURL", &Menu::NoteNewRecentDocumentURL); #endif } diff --git a/atom/browser/api/atom_api_menu.h b/atom/browser/api/atom_api_menu.h index d3a73fb842b..df50640b85a 100644 --- a/atom/browser/api/atom_api_menu.h +++ b/atom/browser/api/atom_api_menu.h @@ -31,10 +31,6 @@ class Menu : public mate::TrackableObject, // Fake sending an action from the application menu. static void SendActionToFirstResponder(const std::string& action); - - // Add an item corresponding to the data located by a URL to the Open Recent - // menu, or replace an existing item with the same URL. - static void NoteNewRecentDocumentURL(const std::string& url); #endif AtomMenuModel* model() const { return model_.get(); } diff --git a/atom/browser/api/atom_api_menu_mac.mm b/atom/browser/api/atom_api_menu_mac.mm index c24674ed5d6..9741202dd72 100644 --- a/atom/browser/api/atom_api_menu_mac.mm +++ b/atom/browser/api/atom_api_menu_mac.mm @@ -139,13 +139,6 @@ void Menu::SendActionToFirstResponder(const std::string& action) { [NSApp sendAction:selector to:nil from:[NSApp mainMenu]]; } -// static -void Menu::NoteNewRecentDocumentURL(const std::string& url) { - [[NSDocumentController sharedDocumentController] - noteNewRecentDocumentURL: - [NSURL fileURLWithPath:base::SysUTF8ToNSString(url)]]; -} - // static mate::WrappableBase* Menu::New(mate::Arguments* args) { return new MenuMac(args->isolate(), args->GetThis()); diff --git a/docs/api/menu.md b/docs/api/menu.md index 91d5b625dbb..3ccd118091a 100644 --- a/docs/api/menu.md +++ b/docs/api/menu.md @@ -43,13 +43,6 @@ emulating default macOS menu behaviors. Usually you would just use the See the [macOS Cocoa Event Handling Guide](https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/EventOverview/EventArchitecture/EventArchitecture.html#//apple_ref/doc/uid/10000060i-CH3-SW7) for more information on macOS' native actions. -#### `Menu.noteNewRecentDocumentURL(url)` _macOS_ - -* `url` String - -Add an item corresponding to the data located by a URL to the Open Recent menu, -or replace an existing item with the same URL. - #### `Menu.buildFromTemplate(template)` * `template` MenuItemConstructorOptions[] diff --git a/lib/browser/api/menu.js b/lib/browser/api/menu.js index a9fe7d1dbe3..33c324d4fa8 100644 --- a/lib/browser/api/menu.js +++ b/lib/browser/api/menu.js @@ -174,14 +174,6 @@ Menu.buildFromTemplate = function (template) { return menu } -Menu.noteNewRecentDocumentURL = function (url) { - if (process.platform === 'darwin') { - bindings.noteNewRecentDocumentURL(url); - } else { - throw new Error('Not supported') - } -} - /* Helper Functions */ // Search between separators to find a radio menu item and return its group id