OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/message_center/message_simple_view.h" | 5 #include "ui/message_center/message_simple_view.h" |
6 | 6 |
7 #include "grit/ui_resources.h" | 7 #include "grit/ui_resources.h" |
8 #include "ui/base/resource/resource_bundle.h" | 8 #include "ui/base/resource/resource_bundle.h" |
9 #include "ui/views/controls/button/image_button.h" | 9 #include "ui/views/controls/button/image_button.h" |
10 #include "ui/views/controls/image_view.h" | 10 #include "ui/views/controls/image_view.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 set_background(views::Background::CreateSolidBackground(bg_color)); | 32 set_background(views::Background::CreateSolidBackground(bg_color)); |
33 SetPaintToLayer(true); | 33 SetPaintToLayer(true); |
34 SetFillsBoundsOpaquely(false); | 34 SetFillsBoundsOpaquely(false); |
35 | 35 |
36 icon_ = new views::ImageView; | 36 icon_ = new views::ImageView; |
37 icon_->SetImageSize( | 37 icon_->SetImageSize( |
38 gfx::Size(kWebNotificationIconSize, kWebNotificationIconSize)); | 38 gfx::Size(kWebNotificationIconSize, kWebNotificationIconSize)); |
39 icon_->SetImage(notification_.image); | 39 icon_->SetImage(notification_.image); |
40 | 40 |
41 views::Label* title = new views::Label(notification_.title); | 41 views::Label* title = new views::Label(notification_.title); |
42 title->SetHorizontalAlignment(views::Label::ALIGN_LEFT); | 42 title->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
43 title->SetFont(title->font().DeriveFont(0, gfx::Font::BOLD)); | 43 title->SetFont(title->font().DeriveFont(0, gfx::Font::BOLD)); |
44 views::Label* message = new views::Label(notification_.message); | 44 views::Label* message = new views::Label(notification_.message); |
45 message->SetHorizontalAlignment(views::Label::ALIGN_LEFT); | 45 message->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
46 message->SetMultiLine(true); | 46 message->SetMultiLine(true); |
47 | 47 |
48 close_button_ = new views::ImageButton(this); | 48 close_button_ = new views::ImageButton(this); |
49 close_button_->SetImage( | 49 close_button_->SetImage( |
50 views::CustomButton::BS_NORMAL, | 50 views::CustomButton::BS_NORMAL, |
51 ResourceBundle::GetSharedInstance().GetImageSkiaNamed(IDR_MESSAGE_CLOSE)); | 51 ResourceBundle::GetSharedInstance().GetImageSkiaNamed(IDR_MESSAGE_CLOSE)); |
52 close_button_->SetImageAlignment(views::ImageButton::ALIGN_CENTER, | 52 close_button_->SetImageAlignment(views::ImageButton::ALIGN_CENTER, |
53 views::ImageButton::ALIGN_MIDDLE); | 53 views::ImageButton::ALIGN_MIDDLE); |
54 | 54 |
55 views::GridLayout* layout = new views::GridLayout(this); | 55 views::GridLayout* layout = new views::GridLayout(this); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 layout->AddView(title, 1, 1); | 94 layout->AddView(title, 1, 1); |
95 layout->AddView(close_button_, 1, 1); | 95 layout->AddView(close_button_, 1, 1); |
96 | 96 |
97 layout->StartRow(0, 0); | 97 layout->StartRow(0, 0); |
98 layout->SkipColumns(2); | 98 layout->SkipColumns(2); |
99 layout->AddView(message, 1, 1); | 99 layout->AddView(message, 1, 1); |
100 layout->AddPaddingRow(0, kPaddingBetweenItems); | 100 layout->AddPaddingRow(0, kPaddingBetweenItems); |
101 } | 101 } |
102 | 102 |
103 } // namespace message_center | 103 } // namespace message_center |
OLD | NEW |