| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "views/controls/tree/tree_view.h" | 5 #include "views/controls/tree/tree_view.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "app/l10n_util_win.h" | 9 #include "app/l10n_util_win.h" |
| 10 #include "app/resource_bundle.h" | 10 #include "app/resource_bundle.h" |
| 11 #include "app/win/hwnd_util.h" | |
| 12 #include "base/i18n/rtl.h" | 11 #include "base/i18n/rtl.h" |
| 13 #include "base/logging.h" | 12 #include "base/logging.h" |
| 14 #include "base/stl_util-inl.h" | 13 #include "base/stl_util-inl.h" |
| 15 #include "base/win/win_util.h" | 14 #include "base/win/win_util.h" |
| 16 #include "gfx/canvas_skia.h" | 15 #include "gfx/canvas_skia.h" |
| 17 #include "gfx/canvas_skia_paint.h" | 16 #include "gfx/canvas_skia_paint.h" |
| 18 #include "gfx/favicon_size.h" | 17 #include "gfx/favicon_size.h" |
| 19 #include "gfx/icon_util.h" | 18 #include "gfx/icon_util.h" |
| 20 #include "gfx/point.h" | 19 #include "gfx/point.h" |
| 21 #include "grit/app_resources.h" | 20 #include "grit/app_resources.h" |
| 22 #include "ui/base/keycodes/keyboard_codes.h" | 21 #include "ui/base/keycodes/keyboard_codes.h" |
| 23 #include "ui/base/keycodes/keyboard_code_conversion_win.h" | 22 #include "ui/base/keycodes/keyboard_code_conversion_win.h" |
| 23 #include "ui/base/win/hwnd_util.h" |
| 24 #include "views/focus/focus_manager.h" | 24 #include "views/focus/focus_manager.h" |
| 25 #include "views/widget/widget.h" | 25 #include "views/widget/widget.h" |
| 26 | 26 |
| 27 using ui::TreeModel; | 27 using ui::TreeModel; |
| 28 using ui::TreeModelNode; | 28 using ui::TreeModelNode; |
| 29 | 29 |
| 30 namespace views { | 30 namespace views { |
| 31 | 31 |
| 32 TreeView::TreeView() | 32 TreeView::TreeView() |
| 33 : tree_view_(NULL), | 33 : tree_view_(NULL), |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 if (lines_at_root_) | 333 if (lines_at_root_) |
| 334 style |= TVS_LINESATROOT; | 334 style |= TVS_LINESATROOT; |
| 335 tree_view_ = ::CreateWindowEx(WS_EX_CLIENTEDGE | GetAdditionalExStyle(), | 335 tree_view_ = ::CreateWindowEx(WS_EX_CLIENTEDGE | GetAdditionalExStyle(), |
| 336 WC_TREEVIEW, | 336 WC_TREEVIEW, |
| 337 L"", | 337 L"", |
| 338 style, | 338 style, |
| 339 0, 0, width(), height(), | 339 0, 0, width(), height(), |
| 340 parent_container, NULL, NULL, NULL); | 340 parent_container, NULL, NULL, NULL); |
| 341 SetWindowLongPtr(tree_view_, GWLP_USERDATA, | 341 SetWindowLongPtr(tree_view_, GWLP_USERDATA, |
| 342 reinterpret_cast<LONG_PTR>(&wrapper_)); | 342 reinterpret_cast<LONG_PTR>(&wrapper_)); |
| 343 original_handler_ = app::win::SetWindowProc(tree_view_, &TreeWndProc); | 343 original_handler_ = ui::SetWindowProc(tree_view_, &TreeWndProc); |
| 344 l10n_util::AdjustUIFontForWindow(tree_view_); | 344 l10n_util::AdjustUIFontForWindow(tree_view_); |
| 345 | 345 |
| 346 if (model_) { | 346 if (model_) { |
| 347 CreateRootItems(); | 347 CreateRootItems(); |
| 348 model_->AddObserver(this); | 348 model_->AddObserver(this); |
| 349 image_list_ = CreateImageList(); | 349 image_list_ = CreateImageList(); |
| 350 TreeView_SetImageList(tree_view_, image_list_, TVSIL_NORMAL); | 350 TreeView_SetImageList(tree_view_, image_list_, TVSIL_NORMAL); |
| 351 } | 351 } |
| 352 | 352 |
| 353 // Bug 964884: detach the IME attached to this window. | 353 // Bug 964884: detach the IME attached to this window. |
| (...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 762 } | 762 } |
| 763 // Fall through and let the default handler process as well. | 763 // Fall through and let the default handler process as well. |
| 764 break; | 764 break; |
| 765 } | 765 } |
| 766 WNDPROC handler = tree->original_handler_; | 766 WNDPROC handler = tree->original_handler_; |
| 767 DCHECK(handler); | 767 DCHECK(handler); |
| 768 return CallWindowProc(handler, window, message, w_param, l_param); | 768 return CallWindowProc(handler, window, message, w_param, l_param); |
| 769 } | 769 } |
| 770 | 770 |
| 771 } // namespace views | 771 } // namespace views |
| OLD | NEW |