summaryrefslogtreecommitdiffstats
path: root/chrome/views
diff options
context:
space:
mode:
authorbeng@google.com <beng@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-13 07:05:22 +0000
committerbeng@google.com <beng@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-13 07:05:22 +0000
commit1ad29e21b21982e80b666535d2329ca8baa20278 (patch)
tree9652cb974b6a203d95d4c277ebf08db7a83fb727 /chrome/views
parent402cb88c926994d0fb35a9dbf71808117d8d0118 (diff)
downloadchromium_src-1ad29e21b21982e80b666535d2329ca8baa20278.zip
chromium_src-1ad29e21b21982e80b666535d2329ca8baa20278.tar.gz
chromium_src-1ad29e21b21982e80b666535d2329ca8baa20278.tar.bz2
Some speculative fixes for UI test flakiness.
- make the window update locking use window visibility instead of WM_SETREDRAW. I believe WM_SETREDRAW is causing the window to become visible during tests. - potential crashes caused by NULL TabcontentsDelegates. TBR=sky Review URL: http://codereview.chromium.org/10674 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5335 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/views')
-rw-r--r--chrome/views/custom_frame_window.cc10
-rw-r--r--chrome/views/custom_frame_window.h3
2 files changed, 8 insertions, 5 deletions
diff --git a/chrome/views/custom_frame_window.cc b/chrome/views/custom_frame_window.cc
index 3221e76..33df287 100644
--- a/chrome/views/custom_frame_window.cc
+++ b/chrome/views/custom_frame_window.cc
@@ -886,7 +886,8 @@ class NonClientViewLayout : public LayoutManager {
CustomFrameWindow::CustomFrameWindow(WindowDelegate* window_delegate)
: Window(window_delegate),
is_active_(false),
- lock_updates_(false) {
+ lock_updates_(false),
+ saved_window_style_(0) {
InitClass();
non_client_view_ = new DefaultNonClientView(this);
}
@@ -1339,13 +1340,12 @@ void CustomFrameWindow::InitClass() {
void CustomFrameWindow::LockUpdates() {
lock_updates_ = true;
- // This message causes invalidations to be discarded until it is called again
- // with WPARAM TRUE (see UnlockUpdates).
- SendMessage(GetHWND(), WM_SETREDRAW, FALSE, 0);
+ saved_window_style_ = GetWindowLong(GetHWND(), GWL_STYLE);
+ SetWindowLong(GetHWND(), GWL_STYLE, saved_window_style_ & ~WS_VISIBLE);
}
void CustomFrameWindow::UnlockUpdates() {
- SendMessage(GetHWND(), WM_SETREDRAW, TRUE, 0);
+ SetWindowLong(GetHWND(), GWL_STYLE, saved_window_style_);
lock_updates_ = false;
}
diff --git a/chrome/views/custom_frame_window.h b/chrome/views/custom_frame_window.h
index 0c2b7f9..85c6b2d 100644
--- a/chrome/views/custom_frame_window.h
+++ b/chrome/views/custom_frame_window.h
@@ -89,6 +89,9 @@ class CustomFrameWindow : public Window {
// True if updates to this window are currently locked.
bool lock_updates_;
+ // The window styles of the window before updates were locked.
+ DWORD saved_window_style_;
+
// Static resource initialization.
static void InitClass();
enum ResizeCursor {