-
Notifications
You must be signed in to change notification settings - Fork 128
/
Copy pathuser_education_util.h
53 lines (37 loc) · 1.56 KB
/
user_education_util.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
// Copyright 2023 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_USER_EDUCATION_USER_EDUCATION_UTIL_H_
#define ASH_USER_EDUCATION_USER_EDUCATION_UTIL_H_
#include <string>
#include "ash/ash_export.h"
class AccountId;
namespace ui {
class ElementIdentifier;
} // namespace ui
namespace views {
class View;
} // namespace views
namespace ash {
enum class TutorialId;
struct UserSession;
namespace user_education_util {
// Returns the `AccountId` for the specified `user_session`. If the specified
// `user_session` is `nullptr`, `EmptyAccountId()` is returned.
ASH_EXPORT const AccountId& GetAccountId(const UserSession* user_session);
// Returns a matching view for the specified `element_id` in the root window
// associated with the specified `display_id`, or `nullptr` if no match is
// found. Note that if multiple matches exist, this method does *not* guarantee
// which will be returned.
ASH_EXPORT views::View* GetMatchingViewInRootWindow(
int64_t display_id,
ui::ElementIdentifier element_id);
// Returns whether the primary user account is active.
ASH_EXPORT bool IsPrimaryAccountActive();
// Returns whether `account_id` is associated with the primary user account.
ASH_EXPORT bool IsPrimaryAccountId(const AccountId& account_id);
// Returns the unique string representation of the specified `tutorial_id`.
ASH_EXPORT std::string ToString(TutorialId tutorial_id);
} // namespace user_education_util
} // namespace ash
#endif // ASH_USER_EDUCATION_USER_EDUCATION_UTIL_H_