| 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" |
| 11 #include "ash/common/system/tray/system_tray_bubble.h" | 11 #include "ash/common/system/tray/system_tray_bubble.h" |
| 12 #include "ash/common/system/tray/tray_constants.h" | 12 #include "ash/common/system/tray/tray_constants.h" |
| 13 #include "ash/common/system/tray/tray_details_view.h" | 13 #include "ash/common/system/tray/tray_details_view.h" |
| 14 #include "ash/common/system/tray/tray_item_more.h" | 14 #include "ash/common/system/tray/tray_item_more.h" |
| 15 #include "ash/common/system/tray/tray_item_view.h" | 15 #include "ash/common/system/tray/tray_item_view.h" |
| 16 #include "ash/common/system/tray/tray_notification_view.h" | 16 #include "ash/common/system/tray/tray_notification_view.h" |
| 17 #include "ash/common/wm_shell.h" | 17 #include "ash/common/wm_shell.h" |
| 18 #include "ash/resources/vector_icons/vector_icons.h" |
| 18 #include "base/strings/string_number_conversions.h" | 19 #include "base/strings/string_number_conversions.h" |
| 19 #include "base/strings/utf_string_conversions.h" | 20 #include "base/strings/utf_string_conversions.h" |
| 20 #include "chromeos/network/network_event_log.h" | 21 #include "chromeos/network/network_event_log.h" |
| 21 #include "chromeos/network/network_handler.h" | 22 #include "chromeos/network/network_handler.h" |
| 22 #include "grit/ash_resources.h" | 23 #include "grit/ash_resources.h" |
| 23 #include "grit/ash_strings.h" | 24 #include "grit/ash_strings.h" |
| 24 #include "ui/base/l10n/l10n_util.h" | 25 #include "ui/base/l10n/l10n_util.h" |
| 25 #include "ui/base/resource/resource_bundle.h" | 26 #include "ui/base/resource/resource_bundle.h" |
| 26 #include "ui/gfx/paint_vector_icon.h" | 27 #include "ui/gfx/paint_vector_icon.h" |
| 27 #include "ui/gfx/vector_icons_public.h" | |
| 28 #include "ui/views/bubble/tray_bubble_view.h" | 28 #include "ui/views/bubble/tray_bubble_view.h" |
| 29 #include "ui/views/controls/image_view.h" | 29 #include "ui/views/controls/image_view.h" |
| 30 #include "ui/views/controls/label.h" | 30 #include "ui/views/controls/label.h" |
| 31 #include "ui/views/layout/box_layout.h" | 31 #include "ui/views/layout/box_layout.h" |
| 32 #include "ui/views/layout/fill_layout.h" | 32 #include "ui/views/layout/fill_layout.h" |
| 33 #include "ui/views/layout/grid_layout.h" | 33 #include "ui/views/layout/grid_layout.h" |
| 34 #include "ui/views/view.h" | 34 #include "ui/views/view.h" |
| 35 | 35 |
| 36 namespace { | 36 namespace { |
| 37 | 37 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 54 } | 54 } |
| 55 | 55 |
| 56 } // namespace | 56 } // namespace |
| 57 | 57 |
| 58 namespace ash { | 58 namespace ash { |
| 59 | 59 |
| 60 class TraySms::SmsDefaultView : public TrayItemMore { | 60 class TraySms::SmsDefaultView : public TrayItemMore { |
| 61 public: | 61 public: |
| 62 explicit SmsDefaultView(TraySms* owner) : TrayItemMore(owner, true) { | 62 explicit SmsDefaultView(TraySms* owner) : TrayItemMore(owner, true) { |
| 63 if (MaterialDesignController::UseMaterialDesignSystemIcons()) { | 63 if (MaterialDesignController::UseMaterialDesignSystemIcons()) { |
| 64 SetImage(gfx::CreateVectorIcon(gfx::VectorIconId::SYSTEM_MENU_SMS, | 64 SetImage(gfx::CreateVectorIcon(kSystemMenuSmsIcon, kMenuIconSize, |
| 65 kMenuIconSize, kMenuIconColor)); | 65 kMenuIconColor)); |
| 66 } else { | 66 } else { |
| 67 SetImage(*ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed( | 67 SetImage(*ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed( |
| 68 IDR_AURA_UBER_TRAY_SMS)); | 68 IDR_AURA_UBER_TRAY_SMS)); |
| 69 } | 69 } |
| 70 Update(); | 70 Update(); |
| 71 } | 71 } |
| 72 | 72 |
| 73 ~SmsDefaultView() override {} | 73 ~SmsDefaultView() override {} |
| 74 | 74 |
| 75 void Update() { | 75 void Update() { |
| (...skipping 340 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 |