From: Cheng Zhao Date: Tue, 17 Dec 2013 14:08:45 +0000 (+0800) Subject: Discard the require('atom-delegate') API. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5b12f80d013370d58c6a8f4f187281d1eb36c673;p=platform%2Fframework%2Fweb%2Fcrosswalk-tizen.git Discard the require('atom-delegate') API. --- diff --git a/atom.gyp b/atom.gyp index 63562cf..5b87367 100644 --- a/atom.gyp +++ b/atom.gyp @@ -12,7 +12,6 @@ ], 'coffee_sources': [ 'browser/api/lib/app.coffee', - 'browser/api/lib/atom-delegate.coffee', 'browser/api/lib/auto-updater.coffee', 'browser/api/lib/browser-window.coffee', 'browser/api/lib/dialog.coffee', diff --git a/browser/api/atom_browser_bindings.h b/browser/api/atom_browser_bindings.h index d110fad..004518c 100644 --- a/browser/api/atom_browser_bindings.h +++ b/browser/api/atom_browser_bindings.h @@ -40,14 +40,7 @@ class AtomBrowserBindings : public AtomBindings { NativeWindow* sender, IPC::Message* message); - // The require('atom').browserMainParts object. - v8::Handle browser_main_parts() { - return browser_main_parts_.NewHandle(); - } - private: - ScopedPersistent browser_main_parts_; - DISALLOW_COPY_AND_ASSIGN(AtomBrowserBindings); }; diff --git a/browser/api/lib/atom-delegate.coffee b/browser/api/lib/atom-delegate.coffee deleted file mode 100644 index f38491e..0000000 --- a/browser/api/lib/atom-delegate.coffee +++ /dev/null @@ -1 +0,0 @@ -module.exports = global.__atom diff --git a/browser/default_app/default_app.js b/browser/default_app/default_app.js index dd43d82..092a193 100644 --- a/browser/default_app/default_app.js +++ b/browser/default_app/default_app.js @@ -1,6 +1,5 @@ var app = require('app'); var dialog = require('dialog'); -var delegate = require('atom-delegate'); var ipc = require('ipc'); var Menu = require('menu'); var MenuItem = require('menu-item'); diff --git a/browser/lib/init.coffee b/browser/lib/init.coffee index a9393f1..551efff 100644 --- a/browser/lib/init.coffee +++ b/browser/lib/init.coffee @@ -21,18 +21,6 @@ if process.platform is 'win32' stdin.push null process.__defineGetter__ 'stdin', -> stdin -# Provide default Content API implementations. -atom = {} - -atom.browserMainParts = - preMainMessageLoopRun: -> - # This is the start of the whole application, usually we should initialize - # the main window here. - -# Store atom object in global scope, apps can just override methods of it to -# implement various logics. -global.__atom = atom - # Add browser/api/lib to require's search paths, # which contains javascript part of Atom's built-in libraries. globalPaths = require('module').globalPaths diff --git a/docs/README.md b/docs/README.md index 77b2eb4..6433da3 100644 --- a/docs/README.md +++ b/docs/README.md @@ -22,7 +22,6 @@ Renderer side modules: Browser side modules: * [app](api/browser/app.md) -* [atom-delegate](api/browser/atom-delegate.md) * [auto-updater](api/browser/auto-updater.md) * [browser-window](api/browser/browser-window.md) * [dialog](api/browser/dialog.md) diff --git a/docs/api/browser/atom-delegate.md b/docs/api/browser/atom-delegate.md deleted file mode 100644 index b172a77..0000000 --- a/docs/api/browser/atom-delegate.md +++ /dev/null @@ -1,31 +0,0 @@ -# atom-delegate - -The `atom-delegate` returns the delegate object for Chrome Content API. The -atom-shell would call methods of the delegate object when the corresponding -C++ code is called. Developers can override methods of it to control the -underlying behaviour of the browser. - -An example of creating a new window when the browser is initialized: - -```javascript -var delegate = require('atom-delegate'); // Delegate of Content API. -var BrowserWindow = require('browser-window'); // Module to create native browser window. - -// Keep a global reference of the window object, if you don't, the window will -// be closed automatically when the javascript object is GCed. -var mainWindow = null; - -// This method will be called when atom-shell has done everything -// initialization and ready for creating browser windows. -delegate.browserMainParts.preMainMessageLoopRun = function() { - // Create the browser window, - mainWindow = new BrowserWindow({ width: 800, height: 600 }); - // and load the index.html of the app. - mainWindow.loadUrl('file://' + __dirname + '/index.html'); -} -``` - -## atom-delegate.browserMainParts.preMainMessageLoopRun() - -Called when atom-shell has done everything initialization and ready for -creating browser windows. diff --git a/docs/quick-start.md b/docs/quick-start.md index 5ba8e85..eb0b3cb 100644 --- a/docs/quick-start.md +++ b/docs/quick-start.md @@ -53,7 +53,6 @@ every piece of the app. An example of `main.js` is: ```javascript var app = require('app'); // Module to control application life. -var delegate = require('atom_delegate'); // Delegate of Content API. var Window = require('window'); // Module to create native browser window. // Keep a global reference of the window object, if you don't, the window will @@ -67,7 +66,7 @@ app.on('window-all-closed', function() { // This method will be called when atom-shell has done everything // initialization and ready for creating browser windows. -delegate.browserMainParts.preMainMessageLoopRun = function() { +app.on('finish-launching', function() { // Create the browser window, mainWindow = new Window({ width: 800, height: 600 }); // and load the index.html of the app. @@ -89,7 +88,7 @@ delegate.browserMainParts.preMainMessageLoopRun = function() { // when you should delete the corresponding element. mainWindow = null; }); -} +}); ``` Finally the `index.html` is the web page you want to show, in fact you