| 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 "chrome/browser/views/options/content_exceptions_table_view.h" | 5 #include "chrome/browser/views/options/content_exceptions_table_view.h" |
| 6 | 6 |
| 7 #include "gfx/font.h" | 7 #include "gfx/font.h" |
| 8 | 8 |
| 9 ContentExceptionsTableView::ContentExceptionsTableView( | 9 ContentExceptionsTableView::ContentExceptionsTableView( |
| 10 ContentExceptionsTableModel* model, | 10 ContentExceptionsTableModel* model, |
| 11 const std::vector<TableColumn>& columns) | 11 const std::vector<TableColumn>& columns) |
| 12 : views::TableView(model, columns, views::TEXT_ONLY, false, true, false), | 12 : views::TableView(model, columns, views::TEXT_ONLY, false, true, false), |
| 13 exceptions_(model) { | 13 exceptions_(model) { |
| 14 SetCustomColorsEnabled(true); | 14 SetCustomColorsEnabled(true); |
| 15 } | 15 } |
| 16 | 16 |
| 17 bool ContentExceptionsTableView::GetCellColors(int model_row, | 17 bool ContentExceptionsTableView::GetCellColors(int model_row, |
| 18 int column, | 18 int column, |
| 19 ItemColor* foreground, | 19 ItemColor* foreground, |
| 20 ItemColor* background, | 20 ItemColor* background, |
| 21 LOGFONT* logfont) { | 21 LOGFONT* logfont) { |
| 22 if (!exceptions_->entry_is_off_the_record(model_row)) | 22 if (!exceptions_->entry_is_off_the_record(model_row)) |
| 23 return false; | 23 return false; |
| 24 | 24 |
| 25 foreground->color_is_set = false; | 25 foreground->color_is_set = false; |
| 26 background->color_is_set = false; | 26 background->color_is_set = false; |
| 27 | 27 |
| 28 gfx::Font font; | 28 gfx::Font font; |
| 29 font = font.DeriveFont(0, gfx::Font::ITALIC); | 29 font = font.DeriveFont(0, gfx::Font::ITALIC); |
| 30 HFONT hf = font.hfont(); | 30 HFONT hf = font.GetNativeFont(); |
| 31 GetObject(hf, sizeof(LOGFONT), logfont); | 31 GetObject(hf, sizeof(LOGFONT), logfont); |
| 32 return true; | 32 return true; |
| 33 } | 33 } |
| OLD | NEW |