| 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/controls/tree/tree_view.h" | 5 #include "chrome/views/controls/tree/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/common/gfx/chrome_canvas.h" | 10 #include "chrome/common/gfx/chrome_canvas.h" |
| 11 #include "chrome/common/gfx/icon_util.h" | 11 #include "chrome/common/gfx/icon_util.h" |
| 12 #include "chrome/common/l10n_util.h" | 12 #include "chrome/common/l10n_util.h" |
| 13 #include "chrome/common/l10n_util_win.h" |
| 13 #include "chrome/common/resource_bundle.h" | 14 #include "chrome/common/resource_bundle.h" |
| 14 #include "chrome/common/stl_util-inl.h" | 15 #include "chrome/common/stl_util-inl.h" |
| 15 #include "chrome/views/focus/focus_manager.h" | 16 #include "chrome/views/focus/focus_manager.h" |
| 16 #include "chrome/views/widget/widget.h" | 17 #include "chrome/views/widget/widget.h" |
| 17 #include "grit/theme_resources.h" | 18 #include "grit/theme_resources.h" |
| 18 | 19 |
| 19 namespace views { | 20 namespace views { |
| 20 | 21 |
| 21 TreeView::TreeView() | 22 TreeView::TreeView() |
| 22 : tree_view_(NULL), | 23 : tree_view_(NULL), |
| (...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 tree_view_ = ::CreateWindowEx(WS_EX_CLIENTEDGE | GetAdditionalExStyle(), | 340 tree_view_ = ::CreateWindowEx(WS_EX_CLIENTEDGE | GetAdditionalExStyle(), |
| 340 WC_TREEVIEW, | 341 WC_TREEVIEW, |
| 341 L"", | 342 L"", |
| 342 style, | 343 style, |
| 343 0, 0, width(), height(), | 344 0, 0, width(), height(), |
| 344 parent_container, NULL, NULL, NULL); | 345 parent_container, NULL, NULL, NULL); |
| 345 SetWindowLongPtr(tree_view_, GWLP_USERDATA, | 346 SetWindowLongPtr(tree_view_, GWLP_USERDATA, |
| 346 reinterpret_cast<LONG_PTR>(&wrapper_)); | 347 reinterpret_cast<LONG_PTR>(&wrapper_)); |
| 347 original_handler_ = win_util::SetWindowProc(tree_view_, | 348 original_handler_ = win_util::SetWindowProc(tree_view_, |
| 348 &TreeWndProc); | 349 &TreeWndProc); |
| 350 l10n_util::AdjustUIFontForWindow(tree_view_); |
| 351 |
| 349 if (model_) { | 352 if (model_) { |
| 350 CreateRootItems(); | 353 CreateRootItems(); |
| 351 model_->SetObserver(this); | 354 model_->SetObserver(this); |
| 352 image_list_ = CreateImageList(); | 355 image_list_ = CreateImageList(); |
| 353 TreeView_SetImageList(tree_view_, image_list_, TVSIL_NORMAL); | 356 TreeView_SetImageList(tree_view_, image_list_, TVSIL_NORMAL); |
| 354 } | 357 } |
| 355 | 358 |
| 356 // Bug 964884: detach the IME attached to this window. | 359 // Bug 964884: detach the IME attached to this window. |
| 357 // We should attach IMEs only when we need to input CJK strings. | 360 // We should attach IMEs only when we need to input CJK strings. |
| 358 ::ImmAssociateContextEx(tree_view_, NULL, 0); | 361 ::ImmAssociateContextEx(tree_view_, NULL, 0); |
| (...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 733 } | 736 } |
| 734 // Fall through and let the default handler process as well. | 737 // Fall through and let the default handler process as well. |
| 735 break; | 738 break; |
| 736 } | 739 } |
| 737 WNDPROC handler = tree->original_handler_; | 740 WNDPROC handler = tree->original_handler_; |
| 738 DCHECK(handler); | 741 DCHECK(handler); |
| 739 return CallWindowProc(handler, window, message, w_param, l_param); | 742 return CallWindowProc(handler, window, message, w_param, l_param); |
| 740 } | 743 } |
| 741 | 744 |
| 742 } // namespace views | 745 } // namespace views |
| OLD | NEW |