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/base_format_view.h" | 5 #include "ui/message_center/base_format_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 23 matching lines...) Expand all Loading... |
34 set_background(views::Background::CreateSolidBackground(bg_color)); | 34 set_background(views::Background::CreateSolidBackground(bg_color)); |
35 SetPaintToLayer(true); | 35 SetPaintToLayer(true); |
36 SetFillsBoundsOpaquely(false); | 36 SetFillsBoundsOpaquely(false); |
37 | 37 |
38 icon_ = new views::ImageView; | 38 icon_ = new views::ImageView; |
39 icon_->SetImageSize( | 39 icon_->SetImageSize( |
40 gfx::Size(kWebNotificationIconSize, kWebNotificationIconSize)); | 40 gfx::Size(kWebNotificationIconSize, kWebNotificationIconSize)); |
41 icon_->SetImage(notification_.image); | 41 icon_->SetImage(notification_.image); |
42 | 42 |
43 views::Label* title = new views::Label(notification_.title); | 43 views::Label* title = new views::Label(notification_.title); |
44 title->SetHorizontalAlignment(views::Label::ALIGN_LEFT); | 44 title->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
45 title->SetFont(title->font().DeriveFont(0, gfx::Font::BOLD)); | 45 title->SetFont(title->font().DeriveFont(0, gfx::Font::BOLD)); |
46 | 46 |
47 views::Label* extra_field = new views::Label(notification_.extra_field); | 47 views::Label* extra_field = new views::Label(notification_.extra_field); |
48 extra_field->SetHorizontalAlignment(views::Label::ALIGN_LEFT); | 48 extra_field->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
49 views::Label* second_extra_field = | 49 views::Label* second_extra_field = |
50 new views::Label(notification_.second_extra_field); | 50 new views::Label(notification_.second_extra_field); |
51 second_extra_field->SetHorizontalAlignment(views::Label::ALIGN_LEFT); | 51 second_extra_field->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
52 | 52 |
53 views::Label* message = new views::Label(notification_.message); | 53 views::Label* message = new views::Label(notification_.message); |
54 message->SetHorizontalAlignment(views::Label::ALIGN_LEFT); | 54 message->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
55 message->SetMultiLine(true); | 55 message->SetMultiLine(true); |
56 | 56 |
57 close_button_ = new views::ImageButton(this); | 57 close_button_ = new views::ImageButton(this); |
58 close_button_->SetImage( | 58 close_button_->SetImage( |
59 views::CustomButton::BS_NORMAL, | 59 views::CustomButton::BS_NORMAL, |
60 ResourceBundle::GetSharedInstance().GetImageSkiaNamed( | 60 ResourceBundle::GetSharedInstance().GetImageSkiaNamed( |
61 IDR_MESSAGE_CLOSE)); | 61 IDR_MESSAGE_CLOSE)); |
62 close_button_->SetImageAlignment(views::ImageButton::ALIGN_CENTER, | 62 close_button_->SetImageAlignment(views::ImageButton::ALIGN_CENTER, |
63 views::ImageButton::ALIGN_MIDDLE); | 63 views::ImageButton::ALIGN_MIDDLE); |
64 | 64 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 layout->AddView(extra_field, 1, 1); | 112 layout->AddView(extra_field, 1, 1); |
113 | 113 |
114 layout->StartRow(0,0); | 114 layout->StartRow(0,0); |
115 layout->SkipColumns(1); | 115 layout->SkipColumns(1); |
116 layout->AddView(second_extra_field, 1, 1); | 116 layout->AddView(second_extra_field, 1, 1); |
117 | 117 |
118 layout->AddPaddingRow(0, kPaddingBetweenItems); | 118 layout->AddPaddingRow(0, kPaddingBetweenItems); |
119 } | 119 } |
120 | 120 |
121 } // namespace message_center | 121 } // namespace message_center |
OLD | NEW |