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/table/table_view.h" | 5 #include "views/controls/table/table_view.h" |
6 | 6 |
7 #include <commctrl.h> | 7 #include <commctrl.h> |
8 #include <windowsx.h> | 8 #include <windowsx.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
11 | 11 |
12 #include "app/l10n_util.h" | 12 #include "app/l10n_util.h" |
13 #include "app/l10n_util_win.h" | 13 #include "app/l10n_util_win.h" |
14 #include "app/resource_bundle.h" | 14 #include "app/resource_bundle.h" |
15 #include "app/table_model.h" | 15 #include "app/table_model.h" |
| 16 #include "app/win/hwnd_util.h" |
16 #include "base/i18n/rtl.h" | 17 #include "base/i18n/rtl.h" |
17 #include "base/string_util.h" | 18 #include "base/string_util.h" |
18 #include "base/win_util.h" | |
19 #include "gfx/canvas_skia.h" | 19 #include "gfx/canvas_skia.h" |
20 #include "gfx/favicon_size.h" | 20 #include "gfx/favicon_size.h" |
21 #include "gfx/font.h" | 21 #include "gfx/font.h" |
22 #include "gfx/icon_util.h" | 22 #include "gfx/icon_util.h" |
23 #include "skia/ext/skia_utils_win.h" | 23 #include "skia/ext/skia_utils_win.h" |
24 #include "third_party/skia/include/core/SkBitmap.h" | 24 #include "third_party/skia/include/core/SkBitmap.h" |
25 #include "third_party/skia/include/core/SkColorFilter.h" | 25 #include "third_party/skia/include/core/SkColorFilter.h" |
26 #include "views/controls/native/native_view_host.h" | 26 #include "views/controls/native/native_view_host.h" |
27 #include "views/controls/table/table_view_observer.h" | 27 #include "views/controls/table/table_view_observer.h" |
28 | 28 |
(...skipping 799 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
828 } | 828 } |
829 | 829 |
830 if (!resizable_columns_) { | 830 if (!resizable_columns_) { |
831 // To disable the resizing of columns we'll filter the events happening on | 831 // To disable the resizing of columns we'll filter the events happening on |
832 // the header. We also need to intercept the HDM_LAYOUT to size the header | 832 // the header. We also need to intercept the HDM_LAYOUT to size the header |
833 // for the Chrome headers. | 833 // for the Chrome headers. |
834 HWND header = ListView_GetHeader(list_view_); | 834 HWND header = ListView_GetHeader(list_view_); |
835 DCHECK(header); | 835 DCHECK(header); |
836 SetWindowLongPtr(header, GWLP_USERDATA, | 836 SetWindowLongPtr(header, GWLP_USERDATA, |
837 reinterpret_cast<LONG_PTR>(&table_view_wrapper_)); | 837 reinterpret_cast<LONG_PTR>(&table_view_wrapper_)); |
838 header_original_handler_ = win_util::SetWindowProc(header, | 838 header_original_handler_ = app::win::SetWindowProc(header, |
839 &TableView::TableHeaderWndProc); | 839 &TableView::TableHeaderWndProc); |
840 } | 840 } |
841 | 841 |
842 SetWindowLongPtr(list_view_, GWLP_USERDATA, | 842 SetWindowLongPtr(list_view_, GWLP_USERDATA, |
843 reinterpret_cast<LONG_PTR>(&table_view_wrapper_)); | 843 reinterpret_cast<LONG_PTR>(&table_view_wrapper_)); |
844 original_handler_ = | 844 original_handler_ = |
845 win_util::SetWindowProc(list_view_, &TableView::TableWndProc); | 845 app::win::SetWindowProc(list_view_, &TableView::TableWndProc); |
846 | 846 |
847 // Bug 964884: detach the IME attached to this window. | 847 // Bug 964884: detach the IME attached to this window. |
848 // We should attach IMEs only when we need to input CJK strings. | 848 // We should attach IMEs only when we need to input CJK strings. |
849 ::ImmAssociateContextEx(list_view_, NULL, 0); | 849 ::ImmAssociateContextEx(list_view_, NULL, 0); |
850 | 850 |
851 UpdateContentOffset(); | 851 UpdateContentOffset(); |
852 column_sizes_valid_ = false; | 852 column_sizes_valid_ = false; |
853 | 853 |
854 return list_view_; | 854 return list_view_; |
855 } | 855 } |
(...skipping 778 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1634 } | 1634 } |
1635 | 1635 |
1636 void TableSelectionIterator::UpdateModelIndexFromViewIndex() { | 1636 void TableSelectionIterator::UpdateModelIndexFromViewIndex() { |
1637 if (view_index_ == -1) | 1637 if (view_index_ == -1) |
1638 model_index_ = -1; | 1638 model_index_ = -1; |
1639 else | 1639 else |
1640 model_index_ = table_view_->ViewToModel(view_index_); | 1640 model_index_ = table_view_->ViewToModel(view_index_); |
1641 } | 1641 } |
1642 | 1642 |
1643 } // namespace views | 1643 } // namespace views |
OLD | NEW |