summaryrefslogtreecommitdiffstats
path: root/content/shell/shell_win.cc
diff options
context:
space:
mode:
authorjochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-28 09:25:25 +0000
committerjochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-28 09:25:25 +0000
commitc7e214cf0b45042f9d11790124def9aa00037aa0 (patch)
tree2adff2391d76bcd90f7e8026b09a3c9c437ddc9d /content/shell/shell_win.cc
parentebd84912ab6506a92a9cd93a24f305600a5a55d2 (diff)
downloadchromium_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_win.cc')
-rw-r--r--content/shell/shell_win.cc11
1 files changed, 9 insertions, 2 deletions
diff --git a/content/shell/shell_win.cc b/content/shell/shell_win.cc
index c1f9631..02cef79 100644
--- a/content/shell/shell_win.cc
+++ b/content/shell/shell_win.cc
@@ -7,6 +7,7 @@
#include <windows.h>
#include <commctrl.h>
+#include "base/command_line.h"
#include "base/string_piece.h"
#include "base/utf_string_conversions.h"
#include "base/win/resource_util.h"
@@ -14,6 +15,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"
#include "grit/webkit_resources.h"
#include "grit/webkit_chromium_resources.h"
@@ -169,8 +171,13 @@ void Shell::SizeTo(int width, int height) {
// Add space for the url bar.
window_height += kURLBarHeight;
- SetWindowPos(window_, NULL, 0, 0, window_width, window_height,
- SWP_NOMOVE | SWP_NOZORDER);
+ if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) {
+ SetWindowPos(window_, NULL, -window_width, -window_height,
+ window_width, window_height, SWP_NOZORDER);
+ } else {
+ SetWindowPos(window_, NULL, 0, 0, window_width, window_height,
+ SWP_NOMOVE | SWP_NOZORDER);
+ }
}
void Shell::PlatformResizeSubViews() {