return v8::Undefined();
}
+// static
+v8::Handle<v8::Value> Window::IsWebViewFocused(const v8::Arguments& args) {
+ UNWRAP_WINDOW_AND_CHECK;
+ return v8::Boolean::New(self->window_->IsWebViewFocused());
+}
+
// static
v8::Handle<v8::Value> Window::RestartHangMonitorTimeout(
const v8::Arguments &args) {
NODE_SET_PROTOTYPE_METHOD(t, "inspectElement", InspectElement);
NODE_SET_PROTOTYPE_METHOD(t, "focusOnWebView", FocusOnWebView);
NODE_SET_PROTOTYPE_METHOD(t, "blurWebView", BlurWebView);
+ NODE_SET_PROTOTYPE_METHOD(t, "isWebViewFocused", IsWebViewFocused);
NODE_SET_PROTOTYPE_METHOD(t,
"restartHangMonitorTimeout",
RestartHangMonitorTimeout);
static v8::Handle<v8::Value> InspectElement(const v8::Arguments &args);
static v8::Handle<v8::Value> FocusOnWebView(const v8::Arguments &args);
static v8::Handle<v8::Value> BlurWebView(const v8::Arguments &args);
+ static v8::Handle<v8::Value> IsWebViewFocused(const v8::Arguments& args);
static v8::Handle<v8::Value> RestartHangMonitorTimeout(
const v8::Arguments &args);
#include "content/public/browser/notification_types.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/render_view_host.h"
+#include "content/public/browser/render_widget_host_view.h"
#include "common/api/api_messages.h"
#include "common/options_switches.h"
#include "ipc/ipc_message_macros.h"
GetWebContents()->GetRenderViewHost()->Blur();
}
+bool NativeWindow::IsWebViewFocused() {
+ return GetWebContents()->GetRenderViewHost()->GetView()->HasFocus();
+}
+
void NativeWindow::RestartHangMonitorTimeout() {
GetWebContents()->GetRenderViewHost()->RestartHangMonitorTimeout();
}
virtual void InspectElement(int x, int y);
virtual void FocusOnWebView();
virtual void BlurWebView();
+ virtual bool IsWebViewFocused();
virtual void RestartHangMonitorTimeout();
// The same with closing a tab in a real browser.