diff options
author | jochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-28 09:25:25 +0000 |
---|---|---|
committer | jochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-28 09:25:25 +0000 |
commit | c7e214cf0b45042f9d11790124def9aa00037aa0 (patch) | |
tree | 2adff2391d76bcd90f7e8026b09a3c9c437ddc9d /content/shell/shell_mac.mm | |
parent | ebd84912ab6506a92a9cd93a24f305600a5a55d2 (diff) | |
download | chromium_src-c7e214cf0b45042f9d11790124def9aa00037aa0.zip chromium_src-c7e214cf0b45042f9d11790124def9aa00037aa0.tar.gz chromium_src-c7e214cf0b45042f9d11790124def9aa00037aa0.tar.bz2 |
When running in DRT mode, move the content shell window off-screen
BUG=111316
TEST=run content_shell --dump-render-tree, enter a URL, there should be no window
Review URL: https://chromiumcodereview.appspot.com/10694004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@144693 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/shell/shell_mac.mm')
-rw-r--r-- | content/shell/shell_mac.mm | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/content/shell/shell_mac.mm b/content/shell/shell_mac.mm index e6fcd40..d24991e 100644 --- a/content/shell/shell_mac.mm +++ b/content/shell/shell_mac.mm @@ -6,6 +6,7 @@ #include <algorithm> +#include "base/command_line.h" #include "base/logging.h" #import "base/mac/cocoa_protocols.h" #import "base/memory/scoped_nsobject.h" @@ -15,6 +16,7 @@ #include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents_view.h" #include "content/shell/resource.h" +#include "content/shell/shell_switches.h" #include "googleurl/src/gurl.h" #import "ui/base/cocoa/underlay_opengl_hosting_window.h" @@ -152,13 +154,20 @@ void Shell::PlatformSetIsLoading(bool loading) { } void Shell::PlatformCreateWindow(int width, int height) { - NSRect initial_window_bounds = NSMakeRect(0, 0, width, height); + NSRect initial_window_bounds = + NSMakeRect(0, 0, width, height + kURLBarHeight); + NSRect content_rect = initial_window_bounds; + NSUInteger style_mask = NSTitledWindowMask | + NSClosableWindowMask | + NSMiniaturizableWindowMask | + NSResizableWindowMask; + if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) { + content_rect = NSOffsetRect(initial_window_bounds, -10000, -10000); + style_mask = NSBorderlessWindowMask; + } window_ = [[UnderlayOpenGLHostingWindow alloc] - initWithContentRect:initial_window_bounds - styleMask:(NSTitledWindowMask | - NSClosableWindowMask | - NSMiniaturizableWindowMask | - NSResizableWindowMask ) + initWithContentRect:content_rect + styleMask:style_mask backing:NSBackingStoreBuffered defer:NO]; [window_ setTitle:kWindowTitle]; |