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

Unified Diff: ui/message_center/message_simple_view.cc

Issue 11926032: Updated the look of web and basic notifications to match latest mockups. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 months 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 side-by-side diff with in-line comments
Download patch
Index: ui/message_center/message_simple_view.cc
diff --git a/ui/message_center/message_simple_view.cc b/ui/message_center/message_simple_view.cc
deleted file mode 100644
index af0cc8451e7b14c9d76fe8b62931132ab0830252..0000000000000000000000000000000000000000
--- a/ui/message_center/message_simple_view.cc
+++ /dev/null
@@ -1,95 +0,0 @@
-// 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/message_simple_view.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/image_view.h"
-#include "ui/views/controls/label.h"
-#include "ui/views/controls/scroll_view.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);
-
-MessageSimpleView::MessageSimpleView(
- NotificationList::Delegate* list_delegate,
- const NotificationList::Notification& notification)
- : MessageView(list_delegate, notification) {
-}
-
-MessageSimpleView::~MessageSimpleView() {
-}
-
-void MessageSimpleView::SetUpView() {
- 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(kWebNotificationIconSize, kWebNotificationIconSize));
- icon->SetImage(notification().primary_icon);
-
- views::Label* title = new views::Label(notification().title);
- title->SetHorizontalAlignment(gfx::ALIGN_LEFT);
- title->SetFont(title->font().DeriveFont(0, gfx::Font::BOLD));
- views::Label* message = new views::Label(notification().message);
- message->SetHorizontalAlignment(gfx::ALIGN_LEFT);
- message->SetMultiLine(true);
-
- views::GridLayout* layout = new views::GridLayout(this);
- SetLayoutManager(layout);
-
- views::ColumnSet* columns = layout->AddColumnSet(0);
-
- const int padding_width = kPaddingHorizontal / 2;
- columns->AddPaddingColumn(0, padding_width);
-
- // Notification Icon.
- columns->AddColumn(views::GridLayout::CENTER, views::GridLayout::LEADING,
- 0, /* resize percent */
- views::GridLayout::FIXED,
- kWebNotificationIconSize, kWebNotificationIconSize);
-
- columns->AddPaddingColumn(0, padding_width);
-
- // Notification message text.
- const int message_width = kWebNotificationWidth - kWebNotificationIconSize -
- kWebNotificationButtonWidth - (padding_width * 3) -
- (scroller() ? scroller()->GetScrollBarWidth() : 0);
- columns->AddColumn(views::GridLayout::FILL, views::GridLayout::FILL,
- 100, /* resize percent */
- views::GridLayout::FIXED,
- message_width, message_width);
-
- columns->AddPaddingColumn(0, padding_width);
- message->SizeToFit(message_width);
-
- // Close button.
- columns->AddColumn(views::GridLayout::CENTER, views::GridLayout::LEADING,
- 0, /* resize percent */
- views::GridLayout::FIXED,
- kWebNotificationButtonWidth,
- kWebNotificationButtonWidth);
-
- // Layout rows
- layout->AddPaddingRow(0, kPaddingBetweenItems);
-
- layout->StartRow(0, 0);
- layout->AddView(icon, 1, 2);
- layout->AddView(title, 1, 1);
- layout->AddView(close_button(), 1, 1);
-
- layout->StartRow(0, 0);
- layout->SkipColumns(2);
- layout->AddView(message, 1, 1);
- layout->AddPaddingRow(0, kPaddingBetweenItems);
-}
-
-} // namespace message_center
dharcourt 2013/01/19 03:06:13 MessageSimpleView replaced by NotificationView.

Powered by Google App Engine
This is Rietveld 408576698