forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathkiosk_app_menu.h
62 lines (47 loc) · 1.83 KB
/
kiosk_app_menu.h
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
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef ASH_PUBLIC_CPP_KIOSK_APP_MENU_H_
#define ASH_PUBLIC_CPP_KIOSK_APP_MENU_H_
#include <string>
#include <vector>
#include "ash/public/cpp/ash_public_export.h"
#include "base/callback_forward.h"
#include "components/account_id/account_id.h"
#include "ui/gfx/image/image_skia.h"
namespace ash {
// Metadata about a kiosk app. Used for display in the kiosk app menu in the
// login screen shelf.
struct ASH_PUBLIC_EXPORT KioskAppMenuEntry {
KioskAppMenuEntry();
KioskAppMenuEntry(const KioskAppMenuEntry& other);
KioskAppMenuEntry(KioskAppMenuEntry&& other);
~KioskAppMenuEntry();
KioskAppMenuEntry& operator=(KioskAppMenuEntry&& other);
KioskAppMenuEntry& operator=(const KioskAppMenuEntry& other);
// For Chrome kiosk apps only, the extension app id.
std::string app_id;
// For ARC kiosk apps only, the account id for the app.
AccountId account_id;
std::u16string name;
gfx::ImageSkia icon;
};
// An interface implemented by Ash to allow Chrome to control the kiosk app
// menu, which appears in the login shelf.
class ASH_PUBLIC_EXPORT KioskAppMenu {
public:
// Returns the singleton instance.
static KioskAppMenu* Get();
// Update the kiosk app data. |launch_app| will be called if the user selects
// an item (app) from the menu. |on_show_menu| will be called when the menu
// will be displayed.
virtual void SetKioskApps(
const std::vector<KioskAppMenuEntry>& kiosk_apps,
const base::RepeatingCallback<void(const KioskAppMenuEntry&)>& launch_app,
const base::RepeatingCallback<void()>& on_show_menu) = 0;
protected:
KioskAppMenu();
virtual ~KioskAppMenu();
};
} // namespace ash
#endif // ASH_PUBLIC_CPP_KIOSK_APP_MENU_H_