diff options
author | sky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-28 00:15:54 +0000 |
---|---|---|
committer | sky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-28 00:15:54 +0000 |
commit | d7483fd119690067a7f31df60b612e1606567d0b (patch) | |
tree | 1f60ed7238ca61694f22c9ed467e1ef64879ed74 /chrome/browser/views | |
parent | 26158d31f92b72f71888f2af3f256eedb4661f34 (diff) | |
download | chromium_src-d7483fd119690067a7f31df60b612e1606567d0b.zip chromium_src-d7483fd119690067a7f31df60b612e1606567d0b.tar.gz chromium_src-d7483fd119690067a7f31df60b612e1606567d0b.tar.bz2 |
Adds the ability to have browser windows shown with a specific
state. I need this for in process ui tests. I can move this to be
private and make the test a friend if you prefer.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/19404
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8773 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views')
-rw-r--r-- | chrome/browser/views/frame/browser_view.cc | 11 | ||||
-rw-r--r-- | chrome/browser/views/frame/browser_view.h | 5 |
2 files changed, 16 insertions, 0 deletions
diff --git a/chrome/browser/views/frame/browser_view.cc b/chrome/browser/views/frame/browser_view.cc index 1e5ad23..0d20e835e 100644 --- a/chrome/browser/views/frame/browser_view.cc +++ b/chrome/browser/views/frame/browser_view.cc @@ -84,6 +84,9 @@ static const int kDefaultPluginMessageResponseTimeout = 30000; // The number of milliseconds between loading animation frames. static const int kLoadingAnimationFrameTimeMs = 30; +// If not -1, windows are shown with this state. +static int explicit_show_state = -1; + static const struct { bool separator; int command; int label; } kMenuLayout[] = { { true, 0, 0 }, { false, IDC_TASK_MANAGER, IDS_TASK_MANAGER }, @@ -111,6 +114,11 @@ static const struct { bool separator; int command; int label; } kMenuLayout[] = /////////////////////////////////////////////////////////////////////////////// // BrowserView, public: +// static +void BrowserView::SetShowState(int state) { + explicit_show_state = state; +} + BrowserView::BrowserView(Browser* browser) : ClientView(NULL, NULL), frame_(NULL), @@ -154,6 +162,9 @@ BrowserView* BrowserView::GetBrowserViewForHWND(HWND window) { } int BrowserView::GetShowState() const { + if (explicit_show_state != -1) + return explicit_show_state; + STARTUPINFO si = {0}; si.cb = sizeof(si); si.dwFlags = STARTF_USESHOWWINDOW; diff --git a/chrome/browser/views/frame/browser_view.h b/chrome/browser/views/frame/browser_view.h index 1a6ff36..0b5768f 100644 --- a/chrome/browser/views/frame/browser_view.h +++ b/chrome/browser/views/frame/browser_view.h @@ -44,6 +44,11 @@ class BrowserView : public BrowserWindow, // frame border. static const int kClientEdgeThickness; + // Explicitly sets how windows are shown. Use a value of -1 to give the + // default behavior. This is used during testing and not generally useful + // otherwise. + static void SetShowState(int state); + explicit BrowserView(Browser* browser); virtual ~BrowserView(); |