]> khamidou — GitHub mirrors - electron.git/commitdiff
Small style fixes
authorCheng Zhao <zcbenz@gmail.com>
Fri, 19 Dec 2014 20:48:53 +0000 (12:48 -0800)
committerCheng Zhao <zcbenz@gmail.com>
Fri, 19 Dec 2014 20:48:53 +0000 (12:48 -0800)
atom/browser/api/atom_api_window.cc
atom/browser/native_window_mac.mm
docs/api/browser-window.md

index 9ecb445b3d71bd5a5df2399477bd2810bf2338e6..33bea26b8d1e056044276da8a3fe8ca305f07295 100644 (file)
@@ -498,8 +498,8 @@ void Window::BuildPrototype(v8::Isolate* isolate,
       .SetMethod("setMenuBarVisibility", &Window::SetMenuBarVisibility)
       .SetMethod("isMenuBarVisible", &Window::IsMenuBarVisible)
 #if defined(OS_MACOSX)
-      .SetMethod(
-        "showDefinitionForSelection", &Window::ShowDefinitionForSelection)
+      .SetMethod("showDefinitionForSelection",
+                 &Window::ShowDefinitionForSelection)
 #endif
       .SetMethod("_getWebContents", &Window::GetWebContents)
       .SetMethod("_getDevToolsWebContents", &Window::GetDevToolsWebContents);
index 5c66f3b41262b07dd739e193a974ff93f422803f..c57ceee97fb39ba1b519d92bb6ad86a22e37eb99 100644 (file)
@@ -644,6 +644,8 @@ void NativeWindowMac::SetProgressBar(double progress) {
 
 void NativeWindowMac::ShowDefinitionForSelection() {
   content::WebContents* web_contents = GetWebContents();
+  if (!web_contents)
+    return;
   content::RenderWidgetHostView* rwhv = web_contents->GetRenderWidgetHostView();
   if (!rwhv)
     return;
index 2275756571b4f65189c0dbc663104bfb61c2c424..137e8e5b92e162d2a965c070db322a5f2540bf0e 100644 (file)
@@ -426,23 +426,31 @@ Returns whether the window is in kiosk mode.
 
 * `filename` String
 
-__OS X Only:__ Sets the pathname of the file the window represents, and the icon
-of the file will show in window's title bar.
+Sets the pathname of the file the window represents, and the icon of the file
+will show in window's title bar.
+
+__Note__: This API is available only on Mac OS X.
 
 ### BrowserWindow.getRepresentedFilename()
 
-__OS X Only:__ Returns the pathname of the file the window represents.
+Returns the pathname of the file the window represents.
+
+__Note__: This API is available only on Mac OS X.
 
 ### BrowserWindow.setDocumentEdited(edited)
 
 * `edited` Boolean
 
-__OS X Only:__ Specifies whether the window’s document has been edited, and the
-icon in titlebar will become grey when set to `true`.
+Specifies whether the window’s document has been edited, and the icon in title
+bar will become grey when set to `true`.
+
+__Note__: This API is available only on Mac OS X.
 
 ### BrowserWindow.IsDocumentEdited()
 
-__OS X Only:__ Whether the window's document has been edited.
+Whether the window's document has been edited.
+
+__Note__: This API is available only on Mac OS X.
 
 ### BrowserWindow.openDevTools()
 
@@ -532,8 +540,9 @@ it will assume `app.getName().desktop`.
 
 ### BrowserWindow.showDefinitionForSelection()
 
-Show pop-up dictionary that searches the selected word on the page.
-This API is available only on Mac OS.
+Shows pop-up dictionary that searches the selected word on the page.
+
+__Note__: This API is available only on Mac OS X.
 
 ### BrowserWindow.setAutoHideMenuBar(hide)