Implement some common web contents overrides.
This commit is contained in:
parent
349ed4fd73
commit
f477ec09c0
2 changed files with 24 additions and 0 deletions
|
@ -196,6 +196,24 @@ void NativeWindow::BeforeUnloadFired(content::WebContents* tab,
|
||||||
WindowList::WindowCloseCancelled(this);
|
WindowList::WindowCloseCancelled(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void NativeWindow::RequestToLockMouse(content::WebContents* web_contents,
|
||||||
|
bool user_gesture,
|
||||||
|
bool last_unlocked_by_target) {
|
||||||
|
GetWebContents()->GotResponseToLockMouseRequest(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NativeWindow::CanOverscrollContent() const {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void NativeWindow::ActivateContents(content::WebContents* contents) {
|
||||||
|
GetWebContents()->GetRenderViewHost()->Focus();
|
||||||
|
}
|
||||||
|
|
||||||
|
void NativeWindow::DeactivateContents(content::WebContents* contents) {
|
||||||
|
GetWebContents()->GetRenderViewHost()->Blur();
|
||||||
|
}
|
||||||
|
|
||||||
void NativeWindow::MoveContents(content::WebContents* source,
|
void NativeWindow::MoveContents(content::WebContents* source,
|
||||||
const gfx::Rect& pos) {
|
const gfx::Rect& pos) {
|
||||||
SetPosition(pos.origin());
|
SetPosition(pos.origin());
|
||||||
|
|
|
@ -131,6 +131,12 @@ class NativeWindow : public content::WebContentsDelegate,
|
||||||
virtual void BeforeUnloadFired(content::WebContents* tab,
|
virtual void BeforeUnloadFired(content::WebContents* tab,
|
||||||
bool proceed,
|
bool proceed,
|
||||||
bool* proceed_to_fire_unload) OVERRIDE;
|
bool* proceed_to_fire_unload) OVERRIDE;
|
||||||
|
virtual void RequestToLockMouse(content::WebContents* web_contents,
|
||||||
|
bool user_gesture,
|
||||||
|
bool last_unlocked_by_target) OVERRIDE;
|
||||||
|
virtual bool CanOverscrollContent() const OVERRIDE;
|
||||||
|
virtual void ActivateContents(content::WebContents* contents) OVERRIDE;
|
||||||
|
virtual void DeactivateContents(content::WebContents* contents) OVERRIDE;
|
||||||
virtual void MoveContents(content::WebContents* source,
|
virtual void MoveContents(content::WebContents* source,
|
||||||
const gfx::Rect& pos) OVERRIDE;
|
const gfx::Rect& pos) OVERRIDE;
|
||||||
virtual void CloseContents(content::WebContents* source) OVERRIDE;
|
virtual void CloseContents(content::WebContents* source) OVERRIDE;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue