--- /dev/null
+// Copyright (c) 2016 GitHub, Inc.
+// Use of this source code is governed by the MIT license that can be
+// found in the LICENSE file.
+
+#include "atom/browser/api/atom_api_system_preferences.h"
+
+#include "atom/common/node_includes.h"
+#include "native_mate/dictionary.h"
+
+namespace atom {
+
+namespace api {
+
+SystemPreferences::SystemPreferences(v8::Isolate* isolate) {
+ Init(isolate);
+}
+
+SystemPreferences::~SystemPreferences() {
+}
+
+// static
+mate::Handle<SystemPreferences> SystemPreferences::Create(
+ v8::Isolate* isolate) {
+ return mate::CreateHandle(isolate, new SystemPreferences(isolate));
+}
+
+// static
+void SystemPreferences::BuildPrototype(
+ v8::Isolate* isolate, v8::Local<v8::ObjectTemplate> prototype) {
+ mate::ObjectTemplateBuilder(isolate, prototype);
+}
+
+} // namespace api
+
+} // namespace atom
+
+namespace {
+
+void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused,
+ v8::Local<v8::Context> context, void* priv) {
+ v8::Isolate* isolate = context->GetIsolate();
+ mate::Dictionary dict(isolate, exports);
+ dict.Set("systemPreferences", atom::api::SystemPreferences::Create(isolate));
+}
+
+} // namespace
+
+NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_browser_system_preferences, Initialize);
--- /dev/null
+// Copyright (c) 2016 GitHub, Inc.
+// Use of this source code is governed by the MIT license that can be
+// found in the LICENSE file.
+
+#ifndef ATOM_BROWSER_API_ATOM_API_SYSTEM_PREFERENCES_H_
+#define ATOM_BROWSER_API_ATOM_API_SYSTEM_PREFERENCES_H_
+
+#include "atom/browser/api/event_emitter.h"
+#include "native_mate/handle.h"
+
+namespace atom {
+
+namespace api {
+
+class SystemPreferences : public mate::EventEmitter<SystemPreferences> {
+ public:
+ static mate::Handle<SystemPreferences> Create(v8::Isolate* isolate);
+
+ static void BuildPrototype(v8::Isolate* isolate,
+ v8::Local<v8::ObjectTemplate> prototype);
+
+ protected:
+ explicit SystemPreferences(v8::Isolate* isolate);
+ ~SystemPreferences() override;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SystemPreferences);
+};
+
+} // namespace api
+
+} // namespace atom
+
+#endif // ATOM_BROWSER_API_ATOM_API_SYSTEM_PREFERENCES_H_
--- /dev/null
+// Copyright (c) 2016 GitHub, Inc.
+// Use of this source code is governed by the MIT license that can be
+// found in the LICENSE file.
+
+#include "atom/browser/api/atom_api_system_preferences.h"
+
+namespace atom {
+
+namespace api {
+
+
+
+} // namespace api
+
+} // namespace atom
REFERENCE_MODULE(atom_browser_protocol);
REFERENCE_MODULE(atom_browser_global_shortcut);
REFERENCE_MODULE(atom_browser_session);
+REFERENCE_MODULE(atom_browser_system_preferences);
REFERENCE_MODULE(atom_browser_tray);
REFERENCE_MODULE(atom_browser_web_contents);
REFERENCE_MODULE(atom_browser_web_view_manager);
'lib/browser/api/protocol.js',
'lib/browser/api/session.js',
'lib/browser/api/screen.js',
+ 'lib/browser/api/system-preferences.js',
'lib/browser/api/tray.js',
'lib/browser/api/web-contents.js',
'lib/browser/chrome-extension.js',
'atom/browser/api/atom_api_screen.h',
'atom/browser/api/atom_api_session.cc',
'atom/browser/api/atom_api_session.h',
+ 'atom/browser/api/atom_api_system_preferences.cc',
+ 'atom/browser/api/atom_api_system_preferences.h',
+ 'atom/browser/api/atom_api_system_preferences_mac.mm',
'atom/browser/api/atom_api_tray.cc',
'atom/browser/api/atom_api_tray.h',
'atom/browser/api/atom_api_web_contents.cc',
return require('../session')
}
},
+ systemPreferences: {
+ enumerable: true,
+ get: function () {
+ return require('../system-preferences')
+ }
+ },
Tray: {
enumerable: true,
get: function () {
--- /dev/null
+const {EventEmitter} = require('events')
+const {systemPreferences} = process.atomBinding('system_preferences')
+
+Object.setPrototypeOf(systemPreferences, EventEmitter.prototype)
+
+module.exports = systemPreferences