Merge pull request #1633 from deepak1556/window_event_patch
window: adding resize and move events
This commit is contained in:
commit
c244e83e10
10 changed files with 91 additions and 5 deletions
|
@ -176,6 +176,7 @@ NativeWindowViews::NativeWindowViews(content::WebContents* web_contents,
|
|||
options.Get(switches::kWidth, &width);
|
||||
options.Get(switches::kHeight, &height);
|
||||
gfx::Rect bounds(0, 0, width, height);
|
||||
widget_size_ = bounds.size();
|
||||
|
||||
window_->AddObserver(this);
|
||||
|
||||
|
@ -720,6 +721,17 @@ void NativeWindowViews::OnWidgetActivationChanged(
|
|||
SetMenuBarVisibility(false);
|
||||
}
|
||||
|
||||
void NativeWindowViews::OnWidgetBoundsChanged(
|
||||
views::Widget* widget, const gfx::Rect& bounds) {
|
||||
if (widget != window_.get())
|
||||
return;
|
||||
|
||||
if (widget_size_ != bounds.size()) {
|
||||
NotifyWindowResize();
|
||||
widget_size_ = bounds.size();
|
||||
}
|
||||
}
|
||||
|
||||
void NativeWindowViews::DeleteDelegate() {
|
||||
NotifyWindowClosed();
|
||||
}
|
||||
|
@ -807,6 +819,10 @@ views::NonClientFrameView* NativeWindowViews::CreateNonClientFrameView(
|
|||
#endif
|
||||
}
|
||||
|
||||
void NativeWindowViews::OnWidgetMove() {
|
||||
NotifyWindowMove();
|
||||
}
|
||||
|
||||
#if defined(OS_WIN)
|
||||
bool NativeWindowViews::ExecuteWindowsCommand(int command_id) {
|
||||
// Windows uses the 4 lower order bits of |command_id| for type-specific
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue