summaryrefslogtreecommitdiffstats
path: root/chrome/views/table_view.cc
diff options
context:
space:
mode:
authorsky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-24 17:18:26 +0000
committersky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-24 17:18:26 +0000
commit9052745343f2a8a231150977cfad3afec687daf1 (patch)
tree976b3b816ee908c68f65eb39ca883151abdba79e /chrome/views/table_view.cc
parent2d507dc02c5b70fe241ac353de7cd57635e28bc5 (diff)
downloadchromium_src-9052745343f2a8a231150977cfad3afec687daf1.zip
chromium_src-9052745343f2a8a231150977cfad3afec687daf1.tar.gz
chromium_src-9052745343f2a8a231150977cfad3afec687daf1.tar.bz2
Makes our tables (task manager, keywords ...) not flicker when
resizing by doing nothing when we get erase background. BUG=804753 TEST=make sure you don't get any painting artifacts in the task manager and keyword editor. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1292 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/views/table_view.cc')
-rw-r--r--chrome/views/table_view.cc29
1 files changed, 28 insertions, 1 deletions
diff --git a/chrome/views/table_view.cc b/chrome/views/table_view.cc
index d70576e..a0d9fba 100644
--- a/chrome/views/table_view.cc
+++ b/chrome/views/table_view.cc
@@ -49,8 +49,8 @@ TableView::TableView(TableModel* model,
autosize_columns_(autosize_columns),
resizable_columns_(resizable_columns),
list_view_(NULL),
- list_view_original_handler_(NULL),
header_original_handler_(NULL),
+ original_handler_(NULL),
table_view_wrapper_(this),
custom_cell_font_(NULL),
content_offset_(0) {
@@ -393,6 +393,28 @@ bool TableView::GetCellColors(int row,
return false;
}
+LRESULT CALLBACK TableView::TableWndProc(HWND window,
+ UINT message,
+ WPARAM w_param,
+ LPARAM l_param) {
+ TableView* table_view = reinterpret_cast<TableViewWrapper*>(
+ GetWindowLongPtr(window, GWLP_USERDATA))->table_view;
+
+ switch (message) {
+ case WM_ERASEBKGND:
+ // We make WM_ERASEBKGND do nothing (returning 1 indicates we handled
+ // the request). We do this so that the table view doesn't flicker during
+ // resizing.
+ return 1;
+
+ default:
+ break;
+ }
+ DCHECK(table_view->original_handler_);
+ return CallWindowProc(table_view->original_handler_, window, message, w_param,
+ l_param);
+}
+
LRESULT CALLBACK TableView::TableHeaderWndProc(HWND window, UINT message,
WPARAM w_param, LPARAM l_param) {
TableView* table_view = reinterpret_cast<TableViewWrapper*>(
@@ -512,6 +534,11 @@ HWND TableView::CreateNativeControl(HWND parent_container) {
&TableView::TableHeaderWndProc);
}
+ SetWindowLongPtr(list_view_, GWLP_USERDATA,
+ reinterpret_cast<LONG_PTR>(&table_view_wrapper_));
+ original_handler_ =
+ win_util::SetWindowProc(list_view_, &TableView::TableWndProc);
+
// Bug 964884: detach the IME attached to this window.
// We should attach IMEs only when we need to input CJK strings.
::ImmAssociateContextEx(list_view_, NULL, 0);