summaryrefslogtreecommitdiffstats
path: root/chrome/browser/views/options/content_exceptions_table_view.cc
blob: 1b81aa15aa4b71f28639e6e44e25ee732ed4dc62 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/views/options/content_exceptions_table_view.h"

#include "gfx/font.h"

ContentExceptionsTableView::ContentExceptionsTableView(
    ContentExceptionsTableModel* model,
    const std::vector<TableColumn>& columns)
    : views::TableView(model, columns, views::TEXT_ONLY, false, true, false),
      exceptions_(model) {
  SetCustomColorsEnabled(true);
}

bool ContentExceptionsTableView::GetCellColors(int model_row,
                                               int column,
                                               ItemColor* foreground,
                                               ItemColor* background,
                                               LOGFONT* logfont) {
  if (!exceptions_->entry_is_off_the_record(model_row))
    return false;

  foreground->color_is_set = false;
  background->color_is_set = false;

  gfx::Font font;
  font = font.DeriveFont(0, gfx::Font::ITALIC);
  HFONT hf = font.GetNativeFont();
  GetObject(hf, sizeof(LOGFONT), logfont);
  return true;
}