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/common/system/chromeos/network/tray_sms.h" | 5 #include "ash/common/system/chromeos/network/tray_sms.h" |
6 | 6 |
7 #include "ash/common/metrics/user_metrics_action.h" | 7 #include "ash/common/metrics/user_metrics_action.h" |
8 #include "ash/common/system/tray/fixed_sized_scroll_view.h" | 8 #include "ash/common/system/tray/fixed_sized_scroll_view.h" |
9 #include "ash/common/system/tray/system_tray_bubble.h" | 9 #include "ash/common/system/tray/system_tray_bubble.h" |
10 #include "ash/common/system/tray/tray_constants.h" | 10 #include "ash/common/system/tray/tray_constants.h" |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 | 278 |
279 private: | 279 private: |
280 TraySms* tray_sms() { return static_cast<TraySms*>(owner()); } | 280 TraySms* tray_sms() { return static_cast<TraySms*>(owner()); } |
281 | 281 |
282 size_t message_index_; | 282 size_t message_index_; |
283 | 283 |
284 DISALLOW_COPY_AND_ASSIGN(SmsNotificationView); | 284 DISALLOW_COPY_AND_ASSIGN(SmsNotificationView); |
285 }; | 285 }; |
286 | 286 |
287 TraySms::TraySms(SystemTray* system_tray) | 287 TraySms::TraySms(SystemTray* system_tray) |
288 : SystemTrayItem(system_tray), | 288 : SystemTrayItem(system_tray, UMA_SMS), |
289 default_(nullptr), | 289 default_(nullptr), |
290 detailed_(nullptr), | 290 detailed_(nullptr), |
291 notification_(nullptr) { | 291 notification_(nullptr) { |
292 // TODO(armansito): SMS could be a special case for cellular that requires a | 292 // TODO(armansito): SMS could be a special case for cellular that requires a |
293 // user (perhaps the owner) to be logged in. If that is the case, then an | 293 // user (perhaps the owner) to be logged in. If that is the case, then an |
294 // additional check should be done before subscribing for SMS notifications. | 294 // additional check should be done before subscribing for SMS notifications. |
295 if (chromeos::NetworkHandler::IsInitialized()) | 295 if (chromeos::NetworkHandler::IsInitialized()) |
296 chromeos::NetworkHandler::Get()->network_sms_handler()->AddObserver(this); | 296 chromeos::NetworkHandler::Get()->network_sms_handler()->AddObserver(this); |
297 } | 297 } |
298 | 298 |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
416 std::string number, text; | 416 std::string number, text; |
417 if (GetLatestMessage(&index, &number, &text)) | 417 if (GetLatestMessage(&index, &number, &text)) |
418 notification_->Update(index, number, text); | 418 notification_->Update(index, number, text); |
419 } else if (notify) { | 419 } else if (notify) { |
420 ShowNotificationView(); | 420 ShowNotificationView(); |
421 } | 421 } |
422 } | 422 } |
423 } | 423 } |
424 | 424 |
425 } // namespace ash | 425 } // namespace ash |
OLD | NEW |