| 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/material_design/material_design_controller.h" | 7 #include "ash/common/material_design/material_design_controller.h" |
| 8 #include "ash/common/metrics/user_metrics_action.h" | 8 #include "ash/common/metrics/user_metrics_action.h" |
| 9 #include "ash/common/system/tray/fixed_sized_scroll_view.h" | 9 #include "ash/common/system/tray/fixed_sized_scroll_view.h" |
| 10 #include "ash/common/system/tray/system_tray.h" | 10 #include "ash/common/system/tray/system_tray.h" |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 | 287 |
| 288 private: | 288 private: |
| 289 TraySms* tray_sms() { return static_cast<TraySms*>(owner()); } | 289 TraySms* tray_sms() { return static_cast<TraySms*>(owner()); } |
| 290 | 290 |
| 291 size_t message_index_; | 291 size_t message_index_; |
| 292 | 292 |
| 293 DISALLOW_COPY_AND_ASSIGN(SmsNotificationView); | 293 DISALLOW_COPY_AND_ASSIGN(SmsNotificationView); |
| 294 }; | 294 }; |
| 295 | 295 |
| 296 TraySms::TraySms(SystemTray* system_tray) | 296 TraySms::TraySms(SystemTray* system_tray) |
| 297 : SystemTrayItem(system_tray), | 297 : SystemTrayItem(system_tray, UMA_SMS), |
| 298 default_(nullptr), | 298 default_(nullptr), |
| 299 detailed_(nullptr), | 299 detailed_(nullptr), |
| 300 notification_(nullptr) { | 300 notification_(nullptr) { |
| 301 // TODO(armansito): SMS could be a special case for cellular that requires a | 301 // TODO(armansito): SMS could be a special case for cellular that requires a |
| 302 // user (perhaps the owner) to be logged in. If that is the case, then an | 302 // user (perhaps the owner) to be logged in. If that is the case, then an |
| 303 // additional check should be done before subscribing for SMS notifications. | 303 // additional check should be done before subscribing for SMS notifications. |
| 304 if (chromeos::NetworkHandler::IsInitialized()) | 304 if (chromeos::NetworkHandler::IsInitialized()) |
| 305 chromeos::NetworkHandler::Get()->network_sms_handler()->AddObserver(this); | 305 chromeos::NetworkHandler::Get()->network_sms_handler()->AddObserver(this); |
| 306 } | 306 } |
| 307 | 307 |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 425 std::string number, text; | 425 std::string number, text; |
| 426 if (GetLatestMessage(&index, &number, &text)) | 426 if (GetLatestMessage(&index, &number, &text)) |
| 427 notification_->Update(index, number, text); | 427 notification_->Update(index, number, text); |
| 428 } else if (notify) { | 428 } else if (notify) { |
| 429 ShowNotificationView(); | 429 ShowNotificationView(); |
| 430 } | 430 } |
| 431 } | 431 } |
| 432 } | 432 } |
| 433 | 433 |
| 434 } // namespace ash | 434 } // namespace ash |
| OLD | NEW |