Merge remote-tracking branch 'refs/remotes/atom/master'
This commit is contained in:
commit
bca88c1fb9
18 changed files with 176 additions and 157 deletions
|
@ -10,6 +10,7 @@
|
|||
#include "base/at_exit.h"
|
||||
#include "base/i18n/icu_util.h"
|
||||
#include "base/mac/bundle_locations.h"
|
||||
#include "base/mac/scoped_nsautorelease_pool.h"
|
||||
#include "brightray/common/mac/main_application_bundle.h"
|
||||
#include "content/public/app/content_main.h"
|
||||
|
||||
|
@ -25,6 +26,7 @@ int AtomMain(int argc, const char* argv[]) {
|
|||
|
||||
int AtomInitializeICUandStartNode(int argc, char *argv[]) {
|
||||
base::AtExitManager atexit_manager;
|
||||
base::mac::ScopedNSAutoreleasePool pool;
|
||||
base::mac::SetOverrideFrameworkBundlePath(
|
||||
brightray::MainApplicationBundlePath()
|
||||
.Append("Contents")
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
#include "atom/app/uv_task_runner.h"
|
||||
#include "atom/browser/javascript_environment.h"
|
||||
#include "atom/browser/node_debugger.h"
|
||||
#include "atom/common/node_includes.h"
|
||||
#include "base/command_line.h"
|
||||
#include "atom/common/node_includes.h"
|
||||
#include "base/thread_task_runner_handle.h"
|
||||
#include "gin/array_buffer.h"
|
||||
#include "gin/public/isolate_holder.h"
|
||||
|
@ -19,25 +19,22 @@ namespace atom {
|
|||
int NodeMain(int argc, char *argv[]) {
|
||||
base::CommandLine::Init(argc, argv);
|
||||
|
||||
argv = uv_setup_args(argc, argv);
|
||||
int exec_argc;
|
||||
const char** exec_argv;
|
||||
node::Init(&argc, const_cast<const char**>(argv), &exec_argc, &exec_argv);
|
||||
|
||||
int exit_code = 1;
|
||||
{
|
||||
// Feed gin::PerIsolateData with a task runner.
|
||||
argv = uv_setup_args(argc, argv);
|
||||
uv_loop_t* loop = uv_default_loop();
|
||||
scoped_refptr<UvTaskRunner> uv_task_runner(new UvTaskRunner(loop));
|
||||
base::ThreadTaskRunnerHandle handle(uv_task_runner);
|
||||
|
||||
gin::V8Initializer::LoadV8Snapshot();
|
||||
gin::V8Initializer::LoadV8Natives();
|
||||
gin::IsolateHolder::Initialize(
|
||||
gin::IsolateHolder::kNonStrictMode,
|
||||
gin::ArrayBufferAllocator::SharedInstance());
|
||||
|
||||
JavascriptEnvironment gin_env;
|
||||
|
||||
int exec_argc;
|
||||
const char** exec_argv;
|
||||
node::Init(&argc, const_cast<const char**>(argv), &exec_argc, &exec_argv);
|
||||
|
||||
node::Environment* env = node::CreateEnvironment(
|
||||
gin_env.isolate(), loop, gin_env.context(), argc, argv,
|
||||
exec_argc, exec_argv);
|
||||
|
|
|
@ -48,8 +48,13 @@ void UvTaskRunner::OnTimeout(uv_timer_t* timer) {
|
|||
|
||||
self->tasks_[timer].Run();
|
||||
self->tasks_.erase(timer);
|
||||
uv_unref(reinterpret_cast<uv_handle_t*>(timer));
|
||||
delete timer;
|
||||
uv_timer_stop(timer);
|
||||
uv_close(reinterpret_cast<uv_handle_t*>(timer), UvTaskRunner::OnClose);
|
||||
}
|
||||
|
||||
// static
|
||||
void UvTaskRunner::OnClose(uv_handle_t* handle) {
|
||||
delete reinterpret_cast<uv_timer_t*>(handle);
|
||||
}
|
||||
|
||||
} // namespace atom
|
||||
|
|
|
@ -31,6 +31,7 @@ class UvTaskRunner : public base::SingleThreadTaskRunner {
|
|||
|
||||
private:
|
||||
static void OnTimeout(uv_timer_t* timer);
|
||||
static void OnClose(uv_handle_t* handle);
|
||||
|
||||
uv_loop_t* loop_;
|
||||
|
||||
|
|
|
@ -20,7 +20,6 @@ JavascriptEnvironment::JavascriptEnvironment()
|
|||
}
|
||||
|
||||
bool JavascriptEnvironment::Initialize() {
|
||||
gin::V8Initializer::LoadV8Snapshot();
|
||||
gin::IsolateHolder::Initialize(gin::IsolateHolder::kNonStrictMode,
|
||||
gin::ArrayBufferAllocator::SharedInstance());
|
||||
return true;
|
||||
|
|
|
@ -43,26 +43,6 @@ DEFINE_WEB_CONTENTS_USER_DATA_KEY(atom::NativeWindowRelay);
|
|||
|
||||
namespace atom {
|
||||
|
||||
namespace {
|
||||
|
||||
// Convert draggable regions in raw format to SkRegion format. Caller is
|
||||
// responsible for deleting the returned SkRegion instance.
|
||||
scoped_ptr<SkRegion> DraggableRegionsToSkRegion(
|
||||
const std::vector<DraggableRegion>& regions) {
|
||||
scoped_ptr<SkRegion> sk_region(new SkRegion);
|
||||
for (const DraggableRegion& region : regions) {
|
||||
sk_region->op(
|
||||
region.bounds.x(),
|
||||
region.bounds.y(),
|
||||
region.bounds.right(),
|
||||
region.bounds.bottom(),
|
||||
region.draggable ? SkRegion::kUnion_Op : SkRegion::kDifference_Op);
|
||||
}
|
||||
return sk_region.Pass();
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
NativeWindow::NativeWindow(
|
||||
brightray::InspectableWebContents* inspectable_web_contents,
|
||||
const mate::Dictionary& options)
|
||||
|
@ -480,6 +460,20 @@ void NativeWindow::NotifyWindowExecuteWindowsCommand(
|
|||
OnExecuteWindowsCommand(command));
|
||||
}
|
||||
|
||||
scoped_ptr<SkRegion> NativeWindow::DraggableRegionsToSkRegion(
|
||||
const std::vector<DraggableRegion>& regions) {
|
||||
scoped_ptr<SkRegion> sk_region(new SkRegion);
|
||||
for (const DraggableRegion& region : regions) {
|
||||
sk_region->op(
|
||||
region.bounds.x(),
|
||||
region.bounds.y(),
|
||||
region.bounds.right(),
|
||||
region.bounds.bottom(),
|
||||
region.draggable ? SkRegion::kUnion_Op : SkRegion::kDifference_Op);
|
||||
}
|
||||
return sk_region.Pass();
|
||||
}
|
||||
|
||||
void NativeWindow::RenderViewCreated(
|
||||
content::RenderViewHost* render_view_host) {
|
||||
if (!transparent_)
|
||||
|
|
|
@ -241,10 +241,19 @@ class NativeWindow : public base::SupportsUserData,
|
|||
NativeWindow(brightray::InspectableWebContents* inspectable_web_contents,
|
||||
const mate::Dictionary& options);
|
||||
|
||||
// Convert draggable regions in raw format to SkRegion format. Caller is
|
||||
// responsible for deleting the returned SkRegion instance.
|
||||
scoped_ptr<SkRegion> DraggableRegionsToSkRegion(
|
||||
const std::vector<DraggableRegion>& regions);
|
||||
|
||||
// Converts between content size to window size.
|
||||
virtual gfx::Size ContentSizeToWindowSize(const gfx::Size& size) = 0;
|
||||
virtual gfx::Size WindowSizeToContentSize(const gfx::Size& size) = 0;
|
||||
|
||||
// Called when the window needs to update its draggable region.
|
||||
virtual void UpdateDraggableRegions(
|
||||
const std::vector<DraggableRegion>& regions);
|
||||
|
||||
// content::WebContentsObserver:
|
||||
void RenderViewCreated(content::RenderViewHost* render_view_host) override;
|
||||
void BeforeUnloadDialogCancelled() override;
|
||||
|
@ -252,10 +261,6 @@ class NativeWindow : public base::SupportsUserData,
|
|||
bool OnMessageReceived(const IPC::Message& message) override;
|
||||
|
||||
private:
|
||||
// Called when the window needs to update its draggable region.
|
||||
void UpdateDraggableRegions(
|
||||
const std::vector<DraggableRegion>& regions);
|
||||
|
||||
// Schedule a notification unresponsive event.
|
||||
void ScheduleUnresponsiveEvent(int ms);
|
||||
|
||||
|
|
|
@ -71,12 +71,10 @@ class NativeWindowMac : public NativeWindow {
|
|||
void SetVisibleOnAllWorkspaces(bool visible) override;
|
||||
bool IsVisibleOnAllWorkspaces() override;
|
||||
|
||||
// Returns true if |point| in local Cocoa coordinate system falls within
|
||||
// the draggable region.
|
||||
bool IsWithinDraggableRegion(NSPoint point) const;
|
||||
|
||||
// Called to handle a mouse event.
|
||||
void HandleMouseEvent(NSEvent* event);
|
||||
// Refresh the DraggableRegion views.
|
||||
void UpdateDraggableRegionViews() {
|
||||
UpdateDraggableRegionViews(draggable_regions_);
|
||||
}
|
||||
|
||||
protected:
|
||||
// NativeWindow:
|
||||
|
@ -84,17 +82,24 @@ class NativeWindowMac : public NativeWindow {
|
|||
content::WebContents*,
|
||||
const content::NativeWebKeyboardEvent&) override;
|
||||
|
||||
// Return a vector of non-draggable regions that fill a window of size
|
||||
// |width| by |height|, but leave gaps where the window should be draggable.
|
||||
std::vector<gfx::Rect> CalculateNonDraggableRegions(
|
||||
const std::vector<DraggableRegion>& regions, int width, int height);
|
||||
|
||||
private:
|
||||
// NativeWindow:
|
||||
gfx::Size ContentSizeToWindowSize(const gfx::Size& size) override;
|
||||
gfx::Size WindowSizeToContentSize(const gfx::Size& size) override;
|
||||
void UpdateDraggableRegions(
|
||||
const std::vector<DraggableRegion>& regions) override;
|
||||
|
||||
void InstallView();
|
||||
void UninstallView();
|
||||
|
||||
// Install the drag view, which will cover the whole window and decides
|
||||
// whehter we can drag.
|
||||
void InstallDraggableRegionView();
|
||||
void UpdateDraggableRegionViews(const std::vector<DraggableRegion>& regions);
|
||||
|
||||
base::scoped_nsobject<AtomNSWindow> window_;
|
||||
base::scoped_nsobject<AtomNSWindowDelegate> window_delegate_;
|
||||
|
@ -102,6 +107,8 @@ class NativeWindowMac : public NativeWindow {
|
|||
// The view that will fill the whole frameless window.
|
||||
base::scoped_nsobject<FullSizeContentView> content_view_;
|
||||
|
||||
std::vector<DraggableRegion> draggable_regions_;
|
||||
|
||||
bool is_kiosk_;
|
||||
|
||||
NSInteger attention_request_id_; // identifier from requestUserAttention
|
||||
|
@ -109,10 +116,6 @@ class NativeWindowMac : public NativeWindow {
|
|||
// The presentation options before entering kiosk mode.
|
||||
NSApplicationPresentationOptions kiosk_options_;
|
||||
|
||||
// Mouse location since the last mouse event, in screen coordinates. This is
|
||||
// used in custom drag to compute the window movement.
|
||||
NSPoint last_mouse_offset_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(NativeWindowMac);
|
||||
};
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
#include "content/public/browser/render_view_host.h"
|
||||
#include "content/public/browser/render_widget_host_view.h"
|
||||
#include "native_mate/dictionary.h"
|
||||
#include "ui/gfx/skia_util.h"
|
||||
|
||||
namespace {
|
||||
|
||||
|
@ -146,6 +147,7 @@ bool ScopedDisableResize::disable_resize_ = false;
|
|||
}
|
||||
|
||||
- (void)windowDidResize:(NSNotification*)notification {
|
||||
shell_->UpdateDraggableRegionViews();
|
||||
shell_->NotifyWindowResize();
|
||||
}
|
||||
|
||||
|
@ -257,43 +259,23 @@ bool ScopedDisableResize::disable_resize_ = false;
|
|||
|
||||
@end
|
||||
|
||||
@interface ControlRegionView : NSView {
|
||||
@private
|
||||
atom::NativeWindowMac* shellWindow_; // Weak; owns self.
|
||||
}
|
||||
@interface ControlRegionView : NSView
|
||||
@end
|
||||
|
||||
@implementation ControlRegionView
|
||||
|
||||
- (id)initWithShellWindow:(atom::NativeWindowMac*)shellWindow {
|
||||
if ((self = [super init]))
|
||||
shellWindow_ = shellWindow;
|
||||
return self;
|
||||
}
|
||||
|
||||
- (BOOL)mouseDownCanMoveWindow {
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (NSView*)hitTest:(NSPoint)aPoint {
|
||||
if (!shellWindow_->IsWithinDraggableRegion(aPoint)) {
|
||||
return nil;
|
||||
}
|
||||
return self;
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (void)mouseDown:(NSEvent*)event {
|
||||
shellWindow_->HandleMouseEvent(event);
|
||||
}
|
||||
|
||||
- (void)mouseDragged:(NSEvent*)event {
|
||||
shellWindow_->HandleMouseEvent(event);
|
||||
}
|
||||
|
||||
- (BOOL)acceptsFirstMouse:(NSEvent*)event {
|
||||
return YES;
|
||||
}
|
||||
@end
|
||||
|
||||
@interface NSView (WebContentsView)
|
||||
- (void)setMouseDownCanMoveWindow:(BOOL)can_move;
|
||||
@end
|
||||
|
||||
@interface AtomProgressBar : NSProgressIndicator
|
||||
|
@ -439,11 +421,6 @@ NativeWindowMac::NativeWindowMac(
|
|||
[view setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
|
||||
|
||||
InstallView();
|
||||
|
||||
// Install the DraggableRegionView if it is forced to use draggable regions
|
||||
// for normal window.
|
||||
if (has_frame() && force_using_draggable_region())
|
||||
InstallDraggableRegionView();
|
||||
}
|
||||
|
||||
NativeWindowMac::~NativeWindowMac() {
|
||||
|
@ -746,36 +723,6 @@ bool NativeWindowMac::IsVisibleOnAllWorkspaces() {
|
|||
return collectionBehavior & NSWindowCollectionBehaviorCanJoinAllSpaces;
|
||||
}
|
||||
|
||||
bool NativeWindowMac::IsWithinDraggableRegion(NSPoint point) const {
|
||||
if (!draggable_region())
|
||||
return false;
|
||||
if (!web_contents())
|
||||
return false;
|
||||
NSView* webView = web_contents()->GetNativeView();
|
||||
NSInteger webViewHeight = NSHeight([webView bounds]);
|
||||
// |draggable_region_| is stored in local platform-indepdent coordiate system
|
||||
// while |point| is in local Cocoa coordinate system. Do the conversion
|
||||
// to match these two.
|
||||
return draggable_region()->contains(point.x, webViewHeight - point.y);
|
||||
}
|
||||
|
||||
void NativeWindowMac::HandleMouseEvent(NSEvent* event) {
|
||||
NSPoint eventLoc = [event locationInWindow];
|
||||
NSRect mouseRect = [window_ convertRectToScreen:NSMakeRect(eventLoc.x, eventLoc.y, 0, 0)];
|
||||
NSPoint current_mouse_location = mouseRect.origin;
|
||||
|
||||
if ([event type] == NSLeftMouseDown) {
|
||||
NSPoint frame_origin = [window_ frame].origin;
|
||||
last_mouse_offset_ = NSMakePoint(
|
||||
frame_origin.x - current_mouse_location.x,
|
||||
frame_origin.y - current_mouse_location.y);
|
||||
} else if ([event type] == NSLeftMouseDragged) {
|
||||
[window_ setFrameOrigin:NSMakePoint(
|
||||
current_mouse_location.x + last_mouse_offset_.x,
|
||||
current_mouse_location.y + last_mouse_offset_.y)];
|
||||
}
|
||||
}
|
||||
|
||||
void NativeWindowMac::HandleKeyboardEvent(
|
||||
content::WebContents*,
|
||||
const content::NativeWebKeyboardEvent& event) {
|
||||
|
@ -800,6 +747,23 @@ void NativeWindowMac::HandleKeyboardEvent(
|
|||
}
|
||||
}
|
||||
|
||||
std::vector<gfx::Rect> NativeWindowMac::CalculateNonDraggableRegions(
|
||||
const std::vector<DraggableRegion>& regions, int width, int height) {
|
||||
std::vector<gfx::Rect> result;
|
||||
if (regions.empty()) {
|
||||
result.push_back(gfx::Rect(0, 0, width, height));
|
||||
} else {
|
||||
scoped_ptr<SkRegion> draggable(DraggableRegionsToSkRegion(regions));
|
||||
scoped_ptr<SkRegion> non_draggable(new SkRegion);
|
||||
non_draggable->op(0, 0, width, height, SkRegion::kUnion_Op);
|
||||
non_draggable->op(*draggable, SkRegion::kDifference_Op);
|
||||
for (SkRegion::Iterator it(*non_draggable); !it.done(); it.next()) {
|
||||
result.push_back(gfx::SkIRectToRect(it.rect()));
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
gfx::Size NativeWindowMac::ContentSizeToWindowSize(const gfx::Size& size) {
|
||||
if (!has_frame())
|
||||
return size;
|
||||
|
@ -818,6 +782,13 @@ gfx::Size NativeWindowMac::WindowSizeToContentSize(const gfx::Size& size) {
|
|||
return gfx::Size(content.size);
|
||||
}
|
||||
|
||||
void NativeWindowMac::UpdateDraggableRegions(
|
||||
const std::vector<DraggableRegion>& regions) {
|
||||
NativeWindow::UpdateDraggableRegions(regions);
|
||||
draggable_regions_ = regions;
|
||||
UpdateDraggableRegionViews(regions);
|
||||
}
|
||||
|
||||
void NativeWindowMac::InstallView() {
|
||||
// Make sure the bottom corner is rounded: http://crbug.com/396264.
|
||||
[[window_ contentView] setWantsLayer:YES];
|
||||
|
@ -840,8 +811,6 @@ void NativeWindowMac::InstallView() {
|
|||
[view setFrame:[content_view_ bounds]];
|
||||
[content_view_ addSubview:view];
|
||||
|
||||
InstallDraggableRegionView();
|
||||
|
||||
[[window_ standardWindowButton:NSWindowZoomButton] setHidden:YES];
|
||||
[[window_ standardWindowButton:NSWindowMiniaturizeButton] setHidden:YES];
|
||||
[[window_ standardWindowButton:NSWindowCloseButton] setHidden:YES];
|
||||
|
@ -858,14 +827,55 @@ void NativeWindowMac::UninstallView() {
|
|||
[view removeFromSuperview];
|
||||
}
|
||||
|
||||
void NativeWindowMac::InstallDraggableRegionView() {
|
||||
void NativeWindowMac::UpdateDraggableRegionViews(
|
||||
const std::vector<DraggableRegion>& regions) {
|
||||
if (has_frame() && !force_using_draggable_region())
|
||||
return;
|
||||
|
||||
// All ControlRegionViews should be added as children of the WebContentsView,
|
||||
// because WebContentsView will be removed and re-added when entering and
|
||||
// leaving fullscreen mode.
|
||||
NSView* webView = web_contents()->GetNativeView();
|
||||
base::scoped_nsobject<NSView> controlRegion(
|
||||
[[ControlRegionView alloc] initWithShellWindow:this]);
|
||||
[controlRegion setFrame:NSMakeRect(0, 0,
|
||||
NSWidth([webView bounds]),
|
||||
NSHeight([webView bounds]))];
|
||||
[webView addSubview:controlRegion];
|
||||
NSInteger webViewWidth = NSWidth([webView bounds]);
|
||||
NSInteger webViewHeight = NSHeight([webView bounds]);
|
||||
|
||||
[webView setMouseDownCanMoveWindow:YES];
|
||||
|
||||
// Remove all ControlRegionViews that are added last time.
|
||||
// Note that [webView subviews] returns the view's mutable internal array and
|
||||
// it should be copied to avoid mutating the original array while enumerating
|
||||
// it.
|
||||
base::scoped_nsobject<NSArray> subviews([[webView subviews] copy]);
|
||||
for (NSView* subview in subviews.get())
|
||||
if ([subview isKindOfClass:[ControlRegionView class]])
|
||||
[subview removeFromSuperview];
|
||||
|
||||
// Draggable regions is implemented by having the whole web view draggable
|
||||
// (mouseDownCanMoveWindow) and overlaying regions that are not draggable.
|
||||
std::vector<gfx::Rect> system_drag_exclude_areas =
|
||||
CalculateNonDraggableRegions(regions, webViewWidth, webViewHeight);
|
||||
|
||||
// Create and add a ControlRegionView for each region that needs to be
|
||||
// excluded from the dragging.
|
||||
for (std::vector<gfx::Rect>::const_iterator iter =
|
||||
system_drag_exclude_areas.begin();
|
||||
iter != system_drag_exclude_areas.end();
|
||||
++iter) {
|
||||
base::scoped_nsobject<NSView> controlRegion(
|
||||
[[ControlRegionView alloc] initWithFrame:NSZeroRect]);
|
||||
[controlRegion setFrame:NSMakeRect(iter->x(),
|
||||
webViewHeight - iter->bottom(),
|
||||
iter->width(),
|
||||
iter->height())];
|
||||
[webView addSubview:controlRegion];
|
||||
}
|
||||
|
||||
// AppKit will not update its cache of mouseDownCanMoveWindow unless something
|
||||
// changes. Previously we tried adding an NSView and removing it, but for some
|
||||
// reason it required reposting the mouse-down event, and didn't always work.
|
||||
// Calling the below seems to be an effective solution.
|
||||
[window_ setMovableByWindowBackground:NO];
|
||||
[window_ setMovableByWindowBackground:YES];
|
||||
}
|
||||
|
||||
// static
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
## Guías
|
||||
|
||||
* [Platfaformas Soportadas](tutorial/supported-platforms.md)
|
||||
* [Distribución de la Aplicacion](tutorial/application-distribution.md)
|
||||
* [Empaquetamiento de la Aplicacion](tutorial/application-packaging.md)
|
||||
* [Plataformas Soportadas](tutorial/supported-platforms.md)
|
||||
* [Distribución de la Aplicación](tutorial/application-distribution.md)
|
||||
* [Empaquetamiento de la Aplicación](tutorial/application-packaging.md)
|
||||
* [Utilizando Módulos Node Nativos](tutorial/using-native-node-modules.md)
|
||||
* [Depurando el Proceso Principal](tutorial/debugging-main-process.md)
|
||||
* [Utilizando Selenium y WebDriver](tutorial/using-selenium-and-webdriver.md)
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
Esta página lista las líneas de comandos usadas por el navegador Chrome que también son
|
||||
soportadas por Electron. Puedes usar [app.commandLine.appendSwitch][append-switch] para
|
||||
anexarlas en el script principal de tu aplicación antes de que el evento [ready][ready] del
|
||||
modulo [app][app] sea emitido:
|
||||
módulo [app][app] sea emitido:
|
||||
|
||||
```javascript
|
||||
var app = require('app');
|
||||
|
@ -25,7 +25,7 @@ Ignora el límite de conexiones para la lista de `domains` separados por `,`.
|
|||
|
||||
## --disable-http-cache
|
||||
|
||||
Deshabilita la cacheé del disco para las peticiones HTTP.
|
||||
Deshabilita la caché del disco para las peticiones HTTP.
|
||||
|
||||
## --remote-debugging-port=`port`
|
||||
|
||||
|
@ -97,11 +97,11 @@ el repliegue de TLC aceptará.
|
|||
Imprime el registro de Chromium en consola.
|
||||
|
||||
Este cambio no puede ser usado en `app.commandLine.appendSwitch` ya que se analiza antes de que la
|
||||
aplicación del usuario este cargada.
|
||||
aplicación del usuario esté cargada.
|
||||
|
||||
## --v=`log_level`
|
||||
|
||||
Da el maximo nivel activo de V-logging por defecto; 0 es el predeterminado. Valores positivos
|
||||
Da el máximo nivel activo de V-logging por defecto; 0 es el predeterminado. Valores positivos
|
||||
son normalmente usados para los niveles de V-logging.
|
||||
|
||||
Este modificador sólo funciona cuando también se pasa `--enable-logging`.
|
||||
|
@ -109,10 +109,10 @@ Este modificador sólo funciona cuando también se pasa `--enable-logging`.
|
|||
## --vmodule=`pattern`
|
||||
|
||||
Da los niveles máximos de V-logging por módulo para sobreescribir el valor dado por
|
||||
`--v`. Ej. `my_module=2,foo*=3` cambiaria el nivel de registro para todo el código
|
||||
el archivos de origen `my_module.*` y `foo*.*`.
|
||||
`--v`. Ej. `my_module=2,foo*=3` cambiaría el nivel de registro para todo el código,
|
||||
los archivos de origen `my_module.*` y `foo*.*`.
|
||||
|
||||
Cualquier patron que contiene un slash o un slash invertido será probado contra toda la ruta
|
||||
Cualquier patrón que contiene un slash o un slash invertido será probado contra toda la ruta
|
||||
y no sólo con el módulo. Ej. `*/foo/bar/*=2` cambiaría el nivel de registro para todo el código
|
||||
en los archivos origen bajo un directorio `foo/bar`.
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ disponibles en Electron y módulos de terceros son támbien totalmente compatibl
|
|||
|
||||
Electron también provee algunos módulos integrados adicionales para desarrollar
|
||||
aplicaciones nativas de escritorio. Algunos módulos sólo se encuentran disponibles
|
||||
en el proceso principal, algunos sólo en el proceso renderer (pagina web), y
|
||||
en el proceso principal, algunos sólo en el proceso renderer (página web), y
|
||||
algunos pueden ser usados en ambos procesos.
|
||||
|
||||
La regla básica es: Si un módulo es
|
||||
|
|
|
@ -15,7 +15,7 @@ Estas son las maneras en las que construimos la documentación de Electron.
|
|||
- Archivos separados por guiones, mas sin embargo, es correcto.
|
||||
- No subtítulos seguidos por otros subtítulos, añadir por lo menos un enunciado
|
||||
de descripción.
|
||||
- Métodos de cabecera son delimitados con apóstrofes: `codigo`.
|
||||
- Métodos de cabecera son delimitados con apóstrofes: `código`.
|
||||
- Cabeceras de Eventos son delimitados con 'comillas' simples.
|
||||
- No generar listas de mas de dos niveles (debido al renderizador de Markdown
|
||||
desafortunadamente).
|
||||
|
@ -25,7 +25,7 @@ Estas son las maneras en las que construimos la documentación de Electron.
|
|||
- Argumentos opcionales escritos como `function (required[, optional])`.
|
||||
- Argumentos opcionales son denotados cuando se llaman en listas.
|
||||
- Delimitador de línea de 80-columnas.
|
||||
- Métodos específicos de Plataformas son denotados en italicas seguidas por la cabecera del método.
|
||||
- Métodos específicos de Plataformas son denotados en itálicas seguidas por la cabecera del método.
|
||||
- ```### `method(foo, bar)` _OS X_```
|
||||
- Preferir 'en el ___ proceso' en lugar de 'sobre el'
|
||||
|
||||
|
@ -47,7 +47,7 @@ Para agregar otro set (o un set parcial):
|
|||
|
||||
## Leyendo la Documentación de Electron
|
||||
|
||||
Estos son algunos consejos para entender la syntaxis de la documentación de
|
||||
Estos son algunos consejos para entender la sintaxis de la documentación de
|
||||
Electron.
|
||||
|
||||
### Métodos
|
||||
|
@ -67,7 +67,7 @@ El nombre del método es seguido por los argumentos que recibe. Argumentos
|
|||
opcionales son denotados por corchetes rodeados por el argumento opcional y la
|
||||
coma requerida si el argumento opcional fuera seguido por otro argumento.
|
||||
|
||||
Debajo del método se encuentra mas información detallada de cada uno de los
|
||||
Debajo del método se encuentra más información detallada de cada uno de los
|
||||
argumentos. El tipo de argumento es denotado por los tipos comúnes:
|
||||
[`String`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String),
|
||||
[`Number`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number),
|
||||
|
@ -90,7 +90,7 @@ Returns:
|
|||
---
|
||||
|
||||
El evento es una cadena que es utilizada luego de un método observador `.on`. Si
|
||||
regresa un valor, el y su tipo son denotados abajo. Si se estaba a la escucha y
|
||||
regresa un valor, él y su tipo son denotados abajo. Si se estaba a la escucha y
|
||||
respondió a este evento se debería ver así:
|
||||
|
||||
```javascript
|
||||
|
|
|
@ -169,7 +169,7 @@ The `app` object has the following methods:
|
|||
|
||||
### `app.quit()`
|
||||
|
||||
Try to close all windows. The `before-quit` event will emitted first. If all
|
||||
Try to close all windows. The `before-quit` event will be emitted first. If all
|
||||
windows are successfully closed, the `will-quit` event will be emitted and by
|
||||
default the application will terminate.
|
||||
|
||||
|
@ -213,7 +213,7 @@ created by this method. On failure an `Error` is thrown.
|
|||
|
||||
You can only override paths of a `name` defined in `app.getPath`.
|
||||
|
||||
By default, web pages's cookies and caches will be stored under the `userData`
|
||||
By default, web pages' cookies and caches will be stored under the `userData`
|
||||
directory. If you want to change this location, you have to override the
|
||||
`userData` path before the `ready` event of the `app` module is emitted.
|
||||
|
||||
|
@ -264,7 +264,7 @@ Clears the recent documents list.
|
|||
|
||||
Adds `tasks` to the [Tasks][tasks] category of the JumpList on Windows.
|
||||
|
||||
`tasks` is an array of `Task` objects in following format:
|
||||
`tasks` is an array of `Task` objects in the following format:
|
||||
|
||||
`Task` Object
|
||||
* `program` String - Path of the program to execute, usually you should
|
||||
|
@ -285,7 +285,10 @@ Adds `tasks` to the [Tasks][tasks] category of the JumpList on Windows.
|
|||
* `allow` Boolean
|
||||
|
||||
Dynamically sets whether to always send credentials for HTTP NTLM or Negotiate
|
||||
authentication.
|
||||
authentication - normally, Electron will only send NTLM/Kerberos credentials for
|
||||
URLs that fall under "Local Intranet" sites (i.e. are in the same domain as you).
|
||||
However, this detection often fails when corporate networks are badly configured,
|
||||
so this lets you co-opt this behavior and enable it for all URLs.
|
||||
|
||||
### `app.commandLine.appendSwitch(switch[, value])`
|
||||
|
||||
|
|
|
@ -107,7 +107,7 @@ app.on('ready', function() {
|
|||
mainWindow.loadUrl('file://' + __dirname + '/index.html');
|
||||
|
||||
// Open the DevTools.
|
||||
mainWindow.openDevTools();
|
||||
mainWindow.webContents.openDevTools();
|
||||
|
||||
// Emitted when the window is closed.
|
||||
mainWindow.on('closed', function() {
|
||||
|
|
2
vendor/brightray
vendored
2
vendor/brightray
vendored
|
@ -1 +1 @@
|
|||
Subproject commit f1cbfd1d457f9b40bca23a2f30948a093d6048a9
|
||||
Subproject commit 49a86c123f4cc43f4dca886ded612104a8a1fec6
|
2
vendor/node
vendored
2
vendor/node
vendored
|
@ -1 +1 @@
|
|||
Subproject commit f4243f5c84a371632d8d72a1a2210a0e994afdcc
|
||||
Subproject commit edfbc29d09425f2f387c52d77f6351b6ce101659
|
Loading…
Reference in a new issue