Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(141)

Side by Side Diff: ui/views/controls/table/native_table_win.cc

Issue 8909002: views: Convert IsEnabled() to just enabled() since it's just a simple accessor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/views/controls/resize_area.cc ('k') | ui/views/controls/table/table_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "ui/views/controls/table/native_table_win.h" 5 #include "ui/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 <algorithm> 10 #include <algorithm>
(...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after
515 if (IntersectRect(&intersection, &icon_rect, &client_rect)) { 515 if (IntersectRect(&intersection, &icon_rect, &client_rect)) {
516 gfx::CanvasSkia canvas(icon_rect.right - icon_rect.left, 516 gfx::CanvasSkia canvas(icon_rect.right - icon_rect.left,
517 icon_rect.bottom - icon_rect.top, false); 517 icon_rect.bottom - icon_rect.top, false);
518 518
519 // It seems the state in nmcd.uItemState is not correct. 519 // It seems the state in nmcd.uItemState is not correct.
520 // We'll retrieve it explicitly. 520 // We'll retrieve it explicitly.
521 int selected = ListView_GetItemState( 521 int selected = ListView_GetItemState(
522 native_view(), view_index, LVIS_SELECTED | LVIS_DROPHILITED); 522 native_view(), view_index, LVIS_SELECTED | LVIS_DROPHILITED);
523 bool drop_highlight = ((selected & LVIS_DROPHILITED) != 0); 523 bool drop_highlight = ((selected & LVIS_DROPHILITED) != 0);
524 int bg_color_index; 524 int bg_color_index;
525 if (!IsEnabled()) 525 if (!enabled())
526 bg_color_index = COLOR_3DFACE; 526 bg_color_index = COLOR_3DFACE;
527 else if (drop_highlight) 527 else if (drop_highlight)
528 bg_color_index = COLOR_HIGHLIGHT; 528 bg_color_index = COLOR_HIGHLIGHT;
529 else if (selected) 529 else if (selected)
530 bg_color_index = HasFocus() ? COLOR_HIGHLIGHT : COLOR_3DFACE; 530 bg_color_index = HasFocus() ? COLOR_HIGHLIGHT : COLOR_3DFACE;
531 else 531 else
532 bg_color_index = COLOR_WINDOW; 532 bg_color_index = COLOR_WINDOW;
533 // NOTE: This may be invoked without the ListView filling in the 533 // NOTE: This may be invoked without the ListView filling in the
534 // background (or rather windows paints background, then invokes 534 // background (or rather windows paints background, then invokes
535 // this twice). As such, we always fill in the background. 535 // this twice). As such, we always fill in the background.
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after
905 905
906 //////////////////////////////////////////////////////////////////////////////// 906 ////////////////////////////////////////////////////////////////////////////////
907 // NativeTableWrapper, public: 907 // NativeTableWrapper, public:
908 908
909 // static 909 // static
910 NativeTableWrapper* NativeTableWrapper::CreateNativeWrapper(TableView2* table) { 910 NativeTableWrapper* NativeTableWrapper::CreateNativeWrapper(TableView2* table) {
911 return new NativeTableWin(table); 911 return new NativeTableWin(table);
912 } 912 }
913 913
914 } // namespace views 914 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/resize_area.cc ('k') | ui/views/controls/table/table_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698