]> khamidou — GitHub mirrors - electron.git/commitdiff
Add isDevToolsFocused to webview
authorCheng Zhao <zcbenz@gmail.com>
Mon, 4 Jan 2016 02:46:30 +0000 (10:46 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Mon, 4 Jan 2016 02:46:30 +0000 (10:46 +0800)
atom/browser/api/atom_api_window.cc
atom/browser/api/atom_api_window.h
atom/browser/native_window.cc
atom/browser/native_window.h
atom/renderer/lib/web-view/web-view.coffee
docs/api/web-contents.md
docs/api/web-view-tag.md

index 08b5bc4f7b7a4b40320dbf04e082756863512b9b..222f2cae03f1267c8eceeb772ffbbc662562f45b 100644 (file)
@@ -468,10 +468,6 @@ bool Window::IsWebViewFocused() {
   return window_->IsWebViewFocused();
 }
 
-bool Window::IsDevToolsFocused() {
-  return window_->IsDevToolsFocused();
-}
-
 void Window::SetRepresentedFilename(const std::string& filename) {
   window_->SetRepresentedFilename(filename);
 }
@@ -670,7 +666,6 @@ void Window::BuildPrototype(v8::Isolate* isolate,
       .SetMethod("focusOnWebView", &Window::FocusOnWebView)
       .SetMethod("blurWebView", &Window::BlurWebView)
       .SetMethod("isWebViewFocused", &Window::IsWebViewFocused)
-      .SetMethod("isDevToolsFocused", &Window::IsDevToolsFocused)
       .SetMethod("capturePage", &Window::CapturePage)
       .SetMethod("setProgressBar", &Window::SetProgressBar)
       .SetMethod("setOverlayIcon", &Window::SetOverlayIcon)
index 3611c6e33fbc1a126310a06c300a76b306a77738..9297b2fe756288e878b0ce3fcb3578a6c7de0421 100644 (file)
@@ -121,7 +121,6 @@ class Window : public mate::TrackableObject<Window>,
   void FocusOnWebView();
   void BlurWebView();
   bool IsWebViewFocused();
-  bool IsDevToolsFocused();
   void SetRepresentedFilename(const std::string& filename);
   std::string GetRepresentedFilename();
   void SetDocumentEdited(bool edited);
index 3013923ecd8f985229b0fea0b25f84ffe15dd9db..d946704b9f7307c701224436423c192a553612b2 100644 (file)
@@ -268,10 +268,6 @@ bool NativeWindow::IsWebViewFocused() {
   return host_view && host_view->HasFocus();
 }
 
-bool NativeWindow::IsDevToolsFocused() {
-  return inspectable_web_contents_->GetView()->IsDevToolsViewFocused();
-}
-
 void NativeWindow::CapturePage(const gfx::Rect& rect,
                                const CapturePageCallback& callback) {
   const auto view = web_contents()->GetRenderWidgetHostView();
index 3eb235b03c661062d9647a99d206f017d7a97d65..c60c0dd5f1d68b92d09e2013e019778a3c3fceb8 100644 (file)
@@ -157,7 +157,6 @@ class NativeWindow : public base::SupportsUserData,
   virtual void FocusOnWebView();
   virtual void BlurWebView();
   virtual bool IsWebViewFocused();
-  virtual bool IsDevToolsFocused();
 
   // Captures the page with |rect|, |callback| would be called when capturing is
   // done.
index 2d81bd6aa6e9ac0499324ead7c50a1e1933d4b1e..fc01725746effdd74064f5f9f873ffc7e44c83fe 100644 (file)
@@ -273,6 +273,7 @@ registerWebViewElement = ->
     'openDevTools'
     'closeDevTools'
     'isDevToolsOpened'
+    'isDevToolsFocused'
     'inspectElement'
     'setAudioMuted'
     'isAudioMuted'
index 2057b515c025f8b7cfeaa3d6c7abfe63dcf68023..7fd19103930c6708ebfa2323db0b0f4c966cb931 100644 (file)
@@ -596,15 +596,19 @@ Removes the specified path from DevTools workspace.
 * `options` Object (optional). Properties:
   * `detach` Boolean - opens DevTools in a new window
 
-Opens the developer tools.
+Opens the devtools.
 
 ### `webContents.closeDevTools()`
 
-Closes the developer tools.
+Closes the devtools.
 
 ### `webContents.isDevToolsOpened()`
 
-Returns whether the developer tools are opened.
+Returns whether the devtools is opened.
+
+### `webContents.isDevToolsFocused()`
+
+Returns whether the devtools view is focused .
 
 ### `webContents.toggleDevTools()`
 
index 79e759c8cb81829142e9dc24747c6181270bae0f..a4c1be0e20da3b3c17c944fe28687776b5ab1407 100644 (file)
@@ -279,6 +279,10 @@ Closes the DevTools window of guest page.
 
 Returns a boolean whether guest page has a DevTools window attached.
 
+### `<webview>.isDevToolsFocused()`
+
+Returns a boolean whether DevTools window of guest page is focused.
+
 ### `<webview>.inspectElement(x, y)`
 
 * `x` Integer