1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15
   16
   17
   18
   19
   20
   21
   22
   23
   24
   25
   26
   27
   28
   29
   30
   31
   32
   33
   34
   35
   36
   37
   38
   39
   40
   41
   42
   43
   44
   45
   46
   47
   48
   49
   50
   51
   52
   53
   54
   55
   56
   57
   58
   59
   60
   61
   62
   63
   64
   65
   66
   67
   68
   69
   70
   71
   72
   73
   74
   75
   76
   77
   78
   79
   80
   81
   82
   83
   84
   85
   86
   87
   88
   89
   90
   91
   92
   93
   94
   95
   96
   97
   98
   99
  100
  101
  102
  103
  104
  105
  106
  107
  108
  109
  110
  111
  112
  113
  114
  115
  116
  117
  118
  119
  120
  121
  122
  123
  124
  125
  126
  127
  128
  129
  130
  131
  132
  133
  134
  135
  136
  137
  138
  139
  140
  141
  142
  143
  144
  145
  146
  147
  148
  149
  150
  151
  152
  153
  154
  155
  156
  157
  158
  159
  160
  161
  162
  163
  164
  165
  166
  167
  168
  169
  170
  171
  172
  173
  174
  175
  176
  177
  178
  179
  180
  181
  182
  183
  184
  185
  186
  187
  188
  189
  190
  191
  192
  193
  194
  195
  196
  197
  198
  199
  200
  201
  202
  203
  204
  205
  206
  207
  208
  209
  210
  211
  212
  213
  214
  215
  216
  217
  218
  219
  220
  221
  222
  223
  224
  225
  226
  227
  228
  229
  230
  231
  232
  233
  234
  235
  236
  237
  238
  239
  240
  241
  242

ash / public / cpp / system_tray_client.h [blame]

// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef ASH_PUBLIC_CPP_SYSTEM_TRAY_CLIENT_H_
#define ASH_PUBLIC_CPP_SYSTEM_TRAY_CLIENT_H_

#include <optional>
#include <string>
#include <string_view>

#include "ash/public/cpp/ash_public_export.h"
#include "components/access_code_cast/common/access_code_cast_metrics.h"
#include "components/version_info/channel.h"
#include "url/gurl.h"

namespace ash {

// Handles method calls delegated back to chrome from ash.
class ASH_PUBLIC_EXPORT SystemTrayClient {
 public:
  virtual ~SystemTrayClient() {}

  // Shows general settings UI.
  virtual void ShowSettings(int64_t display_id) = 0;

  // Shows settings related to the user account.
  virtual void ShowAccountSettings() = 0;

  // Shows settings related to Bluetooth devices (e.g. to add a device).
  virtual void ShowBluetoothSettings() = 0;

  // Shows the detailed settings for the Bluetooth device with ID |device_id|.
  virtual void ShowBluetoothSettings(const std::string& device_id) = 0;

  // Show the Bluetooth pairing dialog. When provided, |device_address| is the
  // unique device address that the dialog should attempt to pair with and
  // should be in the form "XX:XX:XX:XX:XX:XX". When |device_address| is not
  // provided the dialog will show the device list instead.
  virtual void ShowBluetoothPairingDialog(
      std::optional<std::string_view> device_address) = 0;

  // Shows the settings related to date, timezone etc.
  virtual void ShowDateSettings() = 0;

  // Shows the dialog to set system time, date, and timezone.
  virtual void ShowSetTimeDialog() = 0;

  // Shows settings related to multiple displays.
  virtual void ShowDisplaySettings() = 0;

  // Shows settings related to multiple displays.
  virtual void ShowDarkModeSettings() = 0;

  // Shows settings related to storage.
  virtual void ShowStorageSettings() = 0;

  // Shows settings related to power.
  virtual void ShowPowerSettings() = 0;

  // Shows OS settings related to privacy and security.
  virtual void ShowPrivacyAndSecuritySettings() = 0;

  // Shows OS settings page for Privacy Hub.
  virtual void ShowPrivacyHubSettings() = 0;

  // Shows OS settings page for speak-on-mute detection setting in Privacy Hub.
  virtual void ShowSpeakOnMuteDetectionSettings() = 0;

  // Show OS smart privacy settings.
  virtual void ShowSmartPrivacySettings() = 0;

  // Shows the page that lets you disable performance tracing.
  virtual void ShowChromeSlow() = 0;

  // Shows settings related to input methods.
  virtual void ShowIMESettings() = 0;

  // Shows settings related to MultiDevice features.
  virtual void ShowConnectedDevicesSettings() = 0;

  // Shows settings related to tether network.
  virtual void ShowTetherNetworkSettings() = 0;

  // Shows settings related to Wi-Fi Sync v2.
  virtual void ShowWifiSyncSettings() = 0;

  // Shows the about chrome OS page and checks for updates after the page is
  // loaded.
  virtual void ShowAboutChromeOS() = 0;

  // Shows the about chrome OS additional details page.
  virtual void ShowAboutChromeOSDetails() = 0;

  // Shows accessibility help.
  virtual void ShowAccessibilityHelp() = 0;

  // Shows the settings related to accessibility.
  virtual void ShowAccessibilitySettings() = 0;

  // Shows the settings related to color correction.
  virtual void ShowColorCorrectionSettings() = 0;

  // Shows gesture education help.
  virtual void ShowGestureEducationHelp() = 0;

  // Shows the help center article for the stylus tool palette.
  virtual void ShowPaletteHelp() = 0;

  // Shows the settings related to the stylus tool palette.
  virtual void ShowPaletteSettings() = 0;

  // Shows information about enterprise enrolled devices.
  virtual void ShowEnterpriseInfo() = 0;

  // Shows UI to configure or activate the network specified by |network_id|,
  // which may include showing payment or captive portal UI when appropriate.
  virtual void ShowNetworkConfigure(const std::string& network_id) = 0;

  // Shows UI to create a new network connection. |type| is the ONC network type
  // (see onc_spec.md). TODO(stevenjb): Use NetworkType from onc.mojo (TBD).
  virtual void ShowNetworkCreate(const std::string& type) = 0;

  // Opens the cellular setup flow in OS Settings. |show_psim_flow| indicates
  // if we should navigate to the physical SIM setup flow or to the page that
  // allows the user to select which flow they wish to enter (pSIM or eSIM).
  virtual void ShowSettingsCellularSetup(bool show_psim_flow) = 0;

  // Opens Mobile data subpage.
  virtual void ShowMobileDataSubpage() = 0;

  // Opens SIM unlock dialog in OS Settings.
  virtual void ShowSettingsSimUnlock() = 0;

  // Opens the APN subpage for network with guid |network_id|.
  virtual void ShowApnSubpage(const std::string& network_id) = 0;

  // Shows the "add network" UI to create a third-party extension-backed VPN
  // connection (e.g. Cisco AnyConnect).
  virtual void ShowThirdPartyVpnCreate(const std::string& extension_id) = 0;

  // Launches Arc VPN provider.
  virtual void ShowArcVpnCreate(const std::string& app_id) = 0;

  // Shows settings related to networking. If |network_id| is empty, shows
  // general settings. Otherwise shows settings for the individual network.
  // On devices |network_id| is a GUID, but on Linux desktop and in tests it can
  // be any string.
  virtual void ShowNetworkSettings(const std::string& network_id) = 0;

  // Shows the Hotspot subpage.
  virtual void ShowHotspotSubpage() = 0;

  // Shows the MultiDevice setup flow dialog.
  virtual void ShowMultiDeviceSetup() = 0;

  // Shows the Firmware update app.
  virtual void ShowFirmwareUpdate() = 0;

  // Sets the UI locale to |locale_iso_code| and exit the session to take
  // effect.
  virtual void SetLocaleAndExit(const std::string& locale_iso_code) = 0;

  // Shows the access code casting dialog. |open_location| is the location
  // where the dialog was opened.
  virtual void ShowAccessCodeCastingDialog(
      AccessCodeCastDialogOpenLocation open_location) = 0;

  // Shows a calendar event. If an event is present then it's opened, otherwise
  // Google Calendar is opened to `date`. Open in the calendar PWA if
  // installed (and assign true to `opened_pwa`), in a new browser tab otherwise
  // (and assign false to |opened_pwa|).
  //
  // The calendar PWA requires the event URL to have a specific prefix,
  // so the URL actually opened may not be the same as the passed-in URL.  This
  // is guaranteed to be the case if no event URL was passed in.  The URL that's
  // actually opened is assigned to `finalized_event_url`.
  virtual void ShowCalendarEvent(const std::optional<GURL>& event_url,
                                 const base::Time& date,
                                 bool& opened_pwa,
                                 GURL& finalized_event_url) = 0;

  // Launches video conference url's.
  // Opens in the Google Meet PWA if installed and `video_conference_url` is a
  // Google Meet url, otherwise opens in the browser.
  virtual void ShowVideoConference(const GURL& video_conference_url) = 0;

  // Shown when the device is on a non-stable release track and the user clicks
  // the channel/version button from quick settings.
  virtual void ShowChannelInfoAdditionalDetails() = 0;

  // Shown when the device is on a non-stable release track and the user clicks
  // the "send feedback" button.
  virtual void ShowChannelInfoGiveFeedback() = 0;

  // Shows settings related to audio devices (input/output).
  virtual void ShowAudioSettings() = 0;

  // Shows a page with more info about auto update expiration for devices that
  // reached end of life.
  virtual void ShowEolInfoPage() = 0;

  // Records a UMA metric that the end of life notice was shown.
  virtual void RecordEolNoticeShown() = 0;

  // Returns 'true' if the user preference is set to allow users to submit
  // feedback, 'false' otherwise.
  virtual bool IsUserFeedbackEnabled() = 0;

  // Shows settings related to graphics tablets.
  virtual void ShowGraphicsTabletSettings() = 0;

  // Shows settings related to mice.
  virtual void ShowMouseSettings() = 0;

  // Shows settings related to touchpads.
  virtual void ShowTouchpadSettings() = 0;

  // Shows the remap keyboard keys settings subpage for the keyboard with
  // `device_id`.
  virtual void ShowRemapKeysSubpage(int device_id) = 0;

  // Shows a page about premium plans.
  virtual void ShowYouTubeMusicPremiumPage() = 0;
  virtual void ShowChromebookPerksYouTubePage() = 0;

  // Shows settings related to keyboards.
  virtual void ShowKeyboardSettings() = 0;

  // Shows settings related to pointing sticks.
  virtual void ShowPointingStickSettings() = 0;

  // Shows settings related to Quick Share (formerly Nearby Share).
  virtual void ShowNearbyShareSettings() = 0;

 protected:
  SystemTrayClient() {}
};

}  // namespace ash

#endif  // ASH_PUBLIC_CPP_SYSTEM_TRAY_CLIENT_H_