Add "enable-larger-than-screen" option for BrowserWindow.
From now on BrowserWindow can only be resized larger than screen or moved out of screen when this option is set to "true". Fixes #582.
This commit is contained in:
parent
78afa29ade
commit
2a9f5a5fb8
8 changed files with 51 additions and 17 deletions
|
@ -114,16 +114,18 @@ NativeWindowViews::NativeWindowViews(content::WebContents* web_contents,
|
|||
menu_bar_alt_pressed_(false),
|
||||
keyboard_event_handler_(new views::UnhandledKeyboardEventHandler),
|
||||
use_content_size_(false),
|
||||
resizable_(true),
|
||||
// We need to set a default maximum window size here otherwise Windows
|
||||
// will not allow us to resize the window larger than scree.
|
||||
// Setting directly to INT_MAX somehow doesn't work, so we just devide
|
||||
// by 10, which should still be large enough.
|
||||
maximum_size_(INT_MAX / 10, INT_MAX / 10) {
|
||||
resizable_(true) {
|
||||
options.Get(switches::kResizable, &resizable_);
|
||||
options.Get(switches::kTitle, &title_);
|
||||
options.Get(switches::kAutoHideMenuBar, &menu_bar_autohide_);
|
||||
|
||||
if (enable_larger_than_screen_)
|
||||
// We need to set a default maximum window size here otherwise Windows
|
||||
// will not allow us to resize the window larger than scree.
|
||||
// Setting directly to INT_MAX somehow doesn't work, so we just devide
|
||||
// by 10, which should still be large enough.
|
||||
maximum_size_.set(INT_MAX / 10, INT_MAX / 10);
|
||||
|
||||
int width = 800, height = 600;
|
||||
options.Get(switches::kWidth, &width);
|
||||
options.Get(switches::kHeight, &height);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue