| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/views/tree_view.h" | 5 #include "chrome/views/tree_view.h" |
| 6 | 6 |
| 7 #include <shellapi.h> | 7 #include <shellapi.h> |
| 8 | 8 |
| 9 #include "base/win_util.h" | 9 #include "base/win_util.h" |
| 10 #include "chrome/app/theme/theme_resources.h" | 10 #include "chrome/app/theme/theme_resources.h" |
| (...skipping 581 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 592 | 592 |
| 593 LRESULT CALLBACK TreeView::TreeWndProc(HWND window, | 593 LRESULT CALLBACK TreeView::TreeWndProc(HWND window, |
| 594 UINT message, | 594 UINT message, |
| 595 WPARAM w_param, | 595 WPARAM w_param, |
| 596 LPARAM l_param) { | 596 LPARAM l_param) { |
| 597 TreeViewWrapper* wrapper = reinterpret_cast<TreeViewWrapper*>( | 597 TreeViewWrapper* wrapper = reinterpret_cast<TreeViewWrapper*>( |
| 598 GetWindowLongPtr(window, GWLP_USERDATA)); | 598 GetWindowLongPtr(window, GWLP_USERDATA)); |
| 599 DCHECK(wrapper); | 599 DCHECK(wrapper); |
| 600 TreeView* tree = wrapper->tree_view; | 600 TreeView* tree = wrapper->tree_view; |
| 601 switch (message) { | 601 switch (message) { |
| 602 case WM_ERASEBKGND: |
| 603 return 1; |
| 604 |
| 605 case WM_PAINT: { |
| 606 ChromeCanvasPaint canvas(window); |
| 607 if (canvas.isEmpty()) |
| 608 return 0; |
| 609 |
| 610 SendMessage(window, WM_PRINTCLIENT, |
| 611 reinterpret_cast<WPARAM>(canvas.beginPlatformPaint()), 0); |
| 612 canvas.endPlatformPaint(); |
| 613 return 0; |
| 614 } |
| 615 |
| 602 case WM_RBUTTONDOWN: | 616 case WM_RBUTTONDOWN: |
| 603 if (tree->select_on_right_mouse_down_) { | 617 if (tree->select_on_right_mouse_down_) { |
| 604 TVHITTESTINFO hit_info; | 618 TVHITTESTINFO hit_info; |
| 605 hit_info.pt.x = GET_X_LPARAM(l_param); | 619 hit_info.pt.x = GET_X_LPARAM(l_param); |
| 606 hit_info.pt.y = GET_Y_LPARAM(l_param); | 620 hit_info.pt.y = GET_Y_LPARAM(l_param); |
| 607 HTREEITEM hit_item = TreeView_HitTest(window, &hit_info); | 621 HTREEITEM hit_item = TreeView_HitTest(window, &hit_info); |
| 608 if (hit_item && (hit_info.flags & (TVHT_ONITEM | TVHT_ONITEMRIGHT | | 622 if (hit_item && (hit_info.flags & (TVHT_ONITEM | TVHT_ONITEMRIGHT | |
| 609 TVHT_ONITEMINDENT)) != 0) | 623 TVHT_ONITEMINDENT)) != 0) |
| 610 TreeView_SelectItem(tree->tree_view_, hit_item); | 624 TreeView_SelectItem(tree->tree_view_, hit_item); |
| 611 } | 625 } |
| 612 // Fall through and let the default handler process as well. | 626 // Fall through and let the default handler process as well. |
| 613 break; | 627 break; |
| 614 } | 628 } |
| 615 WNDPROC handler = tree->original_handler_; | 629 WNDPROC handler = tree->original_handler_; |
| 616 DCHECK(handler); | 630 DCHECK(handler); |
| 617 return CallWindowProc(handler, window, message, w_param, l_param); | 631 return CallWindowProc(handler, window, message, w_param, l_param); |
| 618 } | 632 } |
| 619 | 633 |
| 620 } // namespace views | 634 } // namespace views |
| OLD | NEW |