Add BrowserWindow.focusOnWebView and blurWebView.
This commit is contained in:
parent
f3a8a0741c
commit
edf2e84895
7 changed files with 50 additions and 3 deletions
|
@ -132,6 +132,14 @@ void NativeWindow::CloseDevTools() {
|
|||
inspectable_web_contents()->GetView()->CloseDevTools();
|
||||
}
|
||||
|
||||
void NativeWindow::FocusOnWebView() {
|
||||
GetWebContents()->GetRenderViewHost()->Focus();
|
||||
}
|
||||
|
||||
void NativeWindow::BlurWebView() {
|
||||
GetWebContents()->GetRenderViewHost()->Blur();
|
||||
}
|
||||
|
||||
void NativeWindow::CloseWebContents() {
|
||||
bool prevent_default = false;
|
||||
FOR_EACH_OBSERVER(NativeWindowObserver,
|
||||
|
@ -162,6 +170,10 @@ void NativeWindow::NotifyWindowClosed() {
|
|||
WindowList::RemoveWindow(this);
|
||||
}
|
||||
|
||||
void NativeWindow::NotifyWindowBlur() {
|
||||
FOR_EACH_OBSERVER(NativeWindowObserver, observers_, OnWindowBlur());
|
||||
}
|
||||
|
||||
// Window opened by window.open.
|
||||
void NativeWindow::WebContentsCreated(
|
||||
content::WebContents* source_contents,
|
||||
|
@ -207,11 +219,11 @@ bool NativeWindow::CanOverscrollContent() const {
|
|||
}
|
||||
|
||||
void NativeWindow::ActivateContents(content::WebContents* contents) {
|
||||
GetWebContents()->GetRenderViewHost()->Focus();
|
||||
FocusOnWebView();
|
||||
}
|
||||
|
||||
void NativeWindow::DeactivateContents(content::WebContents* contents) {
|
||||
GetWebContents()->GetRenderViewHost()->Blur();
|
||||
BlurWebView();
|
||||
}
|
||||
|
||||
void NativeWindow::MoveContents(content::WebContents* source,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue