camera_roll_menu_model.cc 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. // Copyright 2021 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #include "ash/system/phonehub/camera_roll_menu_model.h"
  5. #include "ash/resources/vector_icons/vector_icons.h"
  6. #include "ash/strings/grit/ash_strings.h"
  7. #include "ui/base/l10n/l10n_util.h"
  8. namespace ash {
  9. namespace {
  10. // Appearance in dip.
  11. constexpr int kCameraRollMenuIconSize = 20;
  12. } // namespace
  13. CameraRollMenuModel::CameraRollMenuModel(
  14. const base::RepeatingClosure download_callback)
  15. : ui::SimpleMenuModel(this),
  16. download_callback_(std::move(download_callback)) {
  17. AddItemWithIcon(COMMAND_DOWNLOAD,
  18. l10n_util::GetStringUTF16(
  19. IDS_ASH_PHONE_HUB_CAMERA_ROLL_MENU_DOWNLOAD_LABEL),
  20. ui::ImageModel::FromVectorIcon(
  21. kPhoneHubCameraRollMenuDownloadIcon,
  22. ui::kColorAshSystemUIMenuIcon, kCameraRollMenuIconSize));
  23. }
  24. CameraRollMenuModel::~CameraRollMenuModel() {}
  25. void CameraRollMenuModel::ExecuteCommand(int command_id, int event_flags) {
  26. switch (command_id) {
  27. case COMMAND_DOWNLOAD: {
  28. download_callback_.Run();
  29. break;
  30. }
  31. }
  32. }
  33. } // namespace ash