| 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/native_table_win.h" | 5 #include "views/controls/table/native_table_win.h" |
| 6 | 6 |
| 7 #include <commctrl.h> | 7 #include <commctrl.h> |
| 8 #include <windowsx.h> | 8 #include <windowsx.h> |
| 9 | 9 |
| 10 #include "app/l10n_util.h" | 10 #include "app/l10n_util.h" |
| 11 #include "app/l10n_util_win.h" | 11 #include "app/l10n_util_win.h" |
| 12 #include "app/win/hwnd_util.h" | |
| 13 #include "base/logging.h" | 12 #include "base/logging.h" |
| 14 #include "gfx/canvas_skia.h" | 13 #include "gfx/canvas_skia.h" |
| 15 #include "gfx/favicon_size.h" | 14 #include "gfx/favicon_size.h" |
| 16 #include "gfx/icon_util.h" | 15 #include "gfx/icon_util.h" |
| 17 #include "skia/ext/skia_utils_win.h" | 16 #include "skia/ext/skia_utils_win.h" |
| 18 #include "ui/base/models/table_model.h" | 17 #include "ui/base/models/table_model.h" |
| 18 #include "ui/base/win/hwnd_util.h" |
| 19 #include "views/controls/table/table_view2.h" | 19 #include "views/controls/table/table_view2.h" |
| 20 #include "views/controls/table/table_view_observer.h" | 20 #include "views/controls/table/table_view_observer.h" |
| 21 #include "views/widget/widget.h" | 21 #include "views/widget/widget.h" |
| 22 | 22 |
| 23 using ui::TableColumn; | 23 using ui::TableColumn; |
| 24 | 24 |
| 25 namespace views { | 25 namespace views { |
| 26 | 26 |
| 27 // Added to column width to prevent truncation. | 27 // Added to column width to prevent truncation. |
| 28 const int kListViewTextPadding = 15; | 28 const int kListViewTextPadding = 15; |
| (...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 403 } | 403 } |
| 404 | 404 |
| 405 if (!table_->resizable_columns()) { | 405 if (!table_->resizable_columns()) { |
| 406 // To disable the resizing of columns we'll filter the events happening on | 406 // To disable the resizing of columns we'll filter the events happening on |
| 407 // the header. We also need to intercept the HDM_LAYOUT to size the header | 407 // the header. We also need to intercept the HDM_LAYOUT to size the header |
| 408 // for the Chrome headers. | 408 // for the Chrome headers. |
| 409 HWND header = ListView_GetHeader(native_view()); | 409 HWND header = ListView_GetHeader(native_view()); |
| 410 DCHECK(header); | 410 DCHECK(header); |
| 411 SetWindowLongPtr(header, GWLP_USERDATA, reinterpret_cast<LONG_PTR>(this)); | 411 SetWindowLongPtr(header, GWLP_USERDATA, reinterpret_cast<LONG_PTR>(this)); |
| 412 header_original_handler_ = | 412 header_original_handler_ = |
| 413 app::win::SetWindowProc(header, &NativeTableWin::TableHeaderWndProc); | 413 ui::SetWindowProc(header, &NativeTableWin::TableHeaderWndProc); |
| 414 } | 414 } |
| 415 | 415 |
| 416 SetWindowLongPtr(hwnd, GWLP_USERDATA, reinterpret_cast<LONG_PTR>(this)); | 416 SetWindowLongPtr(hwnd, GWLP_USERDATA, reinterpret_cast<LONG_PTR>(this)); |
| 417 original_handler_ = | 417 original_handler_ = |
| 418 app::win::SetWindowProc(hwnd, &NativeTableWin::TableWndProc); | 418 ui::SetWindowProc(hwnd, &NativeTableWin::TableWndProc); |
| 419 | 419 |
| 420 // Bug 964884: detach the IME attached to this window. | 420 // Bug 964884: detach the IME attached to this window. |
| 421 // We should attach IMEs only when we need to input CJK strings. | 421 // We should attach IMEs only when we need to input CJK strings. |
| 422 ::ImmAssociateContextEx(hwnd, NULL, 0); | 422 ::ImmAssociateContextEx(hwnd, NULL, 0); |
| 423 | 423 |
| 424 UpdateContentOffset(); | 424 UpdateContentOffset(); |
| 425 } | 425 } |
| 426 | 426 |
| 427 //////////////////////////////////////////////////////////////////////////////// | 427 //////////////////////////////////////////////////////////////////////////////// |
| 428 // NativeTableWin, private: | 428 // NativeTableWin, private: |
| (...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 902 | 902 |
| 903 //////////////////////////////////////////////////////////////////////////////// | 903 //////////////////////////////////////////////////////////////////////////////// |
| 904 // NativeButtonWrapper, public: | 904 // NativeButtonWrapper, public: |
| 905 | 905 |
| 906 // static | 906 // static |
| 907 NativeTableWrapper* NativeTableWrapper::CreateNativeWrapper(TableView2* table) { | 907 NativeTableWrapper* NativeTableWrapper::CreateNativeWrapper(TableView2* table) { |
| 908 return new NativeTableWin(table); | 908 return new NativeTableWin(table); |
| 909 } | 909 } |
| 910 | 910 |
| 911 } // namespace views | 911 } // namespace views |
| OLD | NEW |