<commit_before>// Copyright (c) 2012 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 "ui/message_center/base_format_view.h"

#include "base/i18n/time_formatting.h"
#include "grit/ui_resources.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/views/controls/button/image_button.h"
#include "ui/views/controls/button/label_button.h"
#include "ui/views/controls/image_view.h"
#include "ui/views/controls/label.h"
#include "ui/views/layout/grid_layout.h"

namespace message_center {

const SkColor kNotificationColor = SkColorSetRGB(0xfe, 0xfe, 0xfe);
const SkColor kNotificationReadColor = SkColorSetRGB(0xfa, 0xfa, 0xfa);

const int kBaseFormatPrimaryIconWidth = 64;
const int kBaseFormatSecondaryIconWidth = 16;
const int kBaseFormatTimestampWidth = 60;
const int kBaseFormatButtonWidth = 60;
const int kBaseFormatPaddingBetweenItems = 10;
const int kBaseFormatOuterHorizontalPadding = 18;

BaseFormatView::BaseFormatView(
    NotificationList::Delegate* list_delegate,
    const NotificationList::Notification& notification)
    : MessageView(list_delegate, notification) {
}

BaseFormatView::BaseFormatView() {
}

BaseFormatView::~BaseFormatView() {
}

void BaseFormatView::SetUpView() {
  DCHECK(close_button_);

  SkColor bg_color = notification_.is_read ?
      kNotificationReadColor : kNotificationColor;
  set_background(views::Background::CreateSolidBackground(bg_color));

  views::ImageView* icon = new views::ImageView;
  icon->SetImageSize(
      gfx::Size(kBaseFormatPrimaryIconWidth, kBaseFormatPrimaryIconWidth));
  icon->SetImage(notification_.image);

  views::ImageView* second_icon = new views::ImageView;<commit_msg>Set NULL to button_one_ and _two_ at ctor of BaseMessageView.<commit_after>// Copyright (c) 2012 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 "ui/message_center/base_format_view.h"

#include "base/i18n/time_formatting.h"
#include "grit/ui_resources.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/views/controls/button/image_button.h"
#include "ui/views/controls/button/label_button.h"
#include "ui/views/controls/image_view.h"
#include "ui/views/controls/label.h"
#include "ui/views/layout/grid_layout.h"

namespace message_center {

const SkColor kNotificationColor = SkColorSetRGB(0xfe, 0xfe, 0xfe);
const SkColor kNotificationReadColor = SkColorSetRGB(0xfa, 0xfa, 0xfa);

const int kBaseFormatPrimaryIconWidth = 64;
const int kBaseFormatSecondaryIconWidth = 16;
const int kBaseFormatTimestampWidth = 60;
const int kBaseFormatButtonWidth = 60;
const int kBaseFormatPaddingBetweenItems = 10;
const int kBaseFormatOuterHorizontalPadding = 18;

BaseFormatView::BaseFormatView(
    NotificationList::Delegate* list_delegate,
    const NotificationList::Notification& notification)
    : MessageView(list_delegate, notification),
      button_one_(NULL),
      button_two_(NULL) {
}

BaseFormatView::~BaseFormatView() {
}

void BaseFormatView::SetUpView() {
  DCHECK(close_button_);

  SkColor bg_color = notification_.is_read ?
      kNotificationReadColor : kNotificationColor;
  set_background(views::Background::CreateSolidBackground(bg_color));

  views::ImageView* icon = new views::ImageView;
  icon->SetImageSize(
      gfx::Size(kBaseFormatPrimaryIconWidth, kBaseFormatPrimaryIconWidth));
  icon->SetImage(notification_.image);

  views::ImageView* second_icon = new views::ImageView;
{'fraction_non_alphanumeric': 0.10268606603245663, 'fraction_numerical': 0.013430330162283156, 'mean_word_length': 6.222222222222222, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1869757', 'n_tokens_mistral': 1145, 'n_tokens_neox': 1085, 'n_words': 241}