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 "ash/system/tray/tray_notification_view.h" | 5 #include "ash/system/tray/tray_notification_view.h" |
6 | 6 |
7 #include "ash/system/tray/system_tray_item.h" | 7 #include "ash/system/tray/system_tray_item.h" |
8 #include "ash/system/tray/tray_constants.h" | 8 #include "ash/system/tray/tray_constants.h" |
9 #include "grit/ash_strings.h" | 9 #include "grit/ash_strings.h" |
10 #include "grit/ui_resources.h" | 10 #include "grit/ui_resources.h" |
11 #include "ui/base/resource/resource_bundle.h" | 11 #include "ui/base/resource/resource_bundle.h" |
12 #include "ui/gfx/image/image_skia.h" | 12 #include "ui/gfx/image/image_skia.h" |
13 #include "ui/views/controls/button/image_button.h" | 13 #include "ui/views/controls/button/image_button.h" |
14 #include "ui/views/controls/image_view.h" | 14 #include "ui/views/controls/image_view.h" |
15 #include "ui/views/layout/grid_layout.h" | 15 #include "ui/views/layout/grid_layout.h" |
16 | 16 |
17 namespace { | 17 namespace { |
18 | 18 |
19 const int kNotificationButtonWidth = 32; | 19 const int kNotificationButtonWidth = 32; |
20 | 20 |
21 } // namespace | 21 } // namespace |
22 | 22 |
23 namespace ash { | 23 namespace ash { |
24 namespace internal { | 24 namespace internal { |
25 | 25 |
26 TrayNotificationView::TrayNotificationView(SystemTrayItem* tray, int icon_id) | 26 TrayNotificationView::TrayNotificationView(SystemTrayItem* owner, int icon_id) |
27 : tray_(tray), | 27 : owner_(owner), |
28 icon_id_(icon_id), | 28 icon_id_(icon_id), |
29 icon_(NULL) { | 29 icon_(NULL) { |
30 } | 30 } |
31 | 31 |
32 TrayNotificationView::~TrayNotificationView() { | 32 TrayNotificationView::~TrayNotificationView() { |
33 } | 33 } |
34 | 34 |
35 void TrayNotificationView::InitView(views::View* contents) { | 35 void TrayNotificationView::InitView(views::View* contents) { |
36 set_background(views::Background::CreateSolidBackground(kBackgroundColor)); | 36 set_background(views::Background::CreateSolidBackground(kBackgroundColor)); |
37 | 37 |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 return ui::ER_CONSUMED; | 133 return ui::ER_CONSUMED; |
134 } | 134 } |
135 | 135 |
136 void TrayNotificationView::OnClose() { | 136 void TrayNotificationView::OnClose() { |
137 } | 137 } |
138 | 138 |
139 void TrayNotificationView::OnClickAction() { | 139 void TrayNotificationView::OnClickAction() { |
140 } | 140 } |
141 | 141 |
142 void TrayNotificationView::OnSlideOut() { | 142 void TrayNotificationView::OnSlideOut() { |
143 tray_->HideNotificationView(); | 143 owner_->HideNotificationView(); |
144 } | 144 } |
145 | 145 |
146 void TrayNotificationView::HandleClose() { | 146 void TrayNotificationView::HandleClose() { |
147 OnClose(); | 147 OnClose(); |
148 tray_->HideNotificationView(); | 148 owner_->HideNotificationView(); |
149 } | 149 } |
150 | 150 |
151 void TrayNotificationView::HandleClickAction() { | 151 void TrayNotificationView::HandleClickAction() { |
152 HandleClose(); | 152 HandleClose(); |
153 OnClickAction(); | 153 OnClickAction(); |
154 } | 154 } |
155 | 155 |
156 } // namespace internal | 156 } // namespace internal |
157 } // namespace ash | 157 } // namespace ash |
OLD | NEW |