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/chromeos/network/tray_sms.h" | 5 #include "ash/system/chromeos/network/tray_sms.h" |
6 | 6 |
7 #include "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
9 #include "ash/system/tray/system_tray.h" | 9 #include "ash/system/tray/system_tray.h" |
10 #include "ash/system/tray/tray_constants.h" | 10 #include "ash/system/tray/tray_constants.h" |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 SmsMessageView(TraySms* tray, | 87 SmsMessageView(TraySms* tray, |
88 ViewType view_type, | 88 ViewType view_type, |
89 size_t index, | 89 size_t index, |
90 const std::string& number, | 90 const std::string& number, |
91 const std::string& message) | 91 const std::string& message) |
92 : tray_(tray), | 92 : tray_(tray), |
93 index_(index) { | 93 index_(index) { |
94 number_label_ = new views::Label( | 94 number_label_ = new views::Label( |
95 l10n_util::GetStringFUTF16(IDS_ASH_STATUS_TRAY_SMS_NUMBER, | 95 l10n_util::GetStringFUTF16(IDS_ASH_STATUS_TRAY_SMS_NUMBER, |
96 UTF8ToUTF16(number))); | 96 UTF8ToUTF16(number))); |
97 number_label_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); | 97 number_label_->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
98 number_label_->SetFont( | 98 number_label_->SetFont( |
99 number_label_->font().DeriveFont(0, gfx::Font::BOLD)); | 99 number_label_->font().DeriveFont(0, gfx::Font::BOLD)); |
100 | 100 |
101 message_label_ = new views::Label(UTF8ToUTF16(message)); | 101 message_label_ = new views::Label(UTF8ToUTF16(message)); |
102 message_label_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); | 102 message_label_->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
103 message_label_->SetMultiLine(true); | 103 message_label_->SetMultiLine(true); |
104 | 104 |
105 if (view_type == VIEW_DETAILED) | 105 if (view_type == VIEW_DETAILED) |
106 LayoutDetailedView(); | 106 LayoutDetailedView(); |
107 else | 107 else |
108 LayoutNotificationView(); | 108 LayoutNotificationView(); |
109 } | 109 } |
110 | 110 |
111 virtual ~SmsMessageView() { | 111 virtual ~SmsMessageView() { |
112 } | 112 } |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 if (GetLatestMessage(&index, &number, &text)) | 369 if (GetLatestMessage(&index, &number, &text)) |
370 notification_->Update(index, number, text); | 370 notification_->Update(index, number, text); |
371 } else if (notify) { | 371 } else if (notify) { |
372 ShowNotificationView(); | 372 ShowNotificationView(); |
373 } | 373 } |
374 } | 374 } |
375 } | 375 } |
376 | 376 |
377 } // namespace internal | 377 } // namespace internal |
378 } // namespace ash | 378 } // namespace ash |
OLD | NEW |