blob: 2b09f2ceb20c7f062938a3b79526c6b181c893b8 (
plain)
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
|
// Copyright 2018 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef COMPONENTS_AUTOFILL_ASSISTANT_BROWSER_CHIP_H_
#define COMPONENTS_AUTOFILL_ASSISTANT_BROWSER_CHIP_H_
#include <string>
#include <vector>
#include "base/callback.h"
#include "components/autofill_assistant/browser/service.pb.h"
namespace autofill_assistant {
class UserAction; // For SetDefaultChipType
// A structure to represent a Chip shown in the carousel.
//
// Might be empty.
struct Chip {
explicit Chip(const ChipProto& proto);
Chip();
Chip(const Chip& other);
~Chip();
bool empty() const;
ChipType type = UNKNOWN_CHIP_TYPE;
ChipIcon icon = NO_ICON;
// Localized string to display.
std::string text;
// Whether this chip is sticky. A sticky chip will be a candidate to be
// displayed in the header if the peek mode of the sheet is HANDLE_HEADER.
bool sticky = false;
// Whether this chip should be displayed in the carousel.
bool visible = true;
// Accessibility string for chip.
std::string content_description;
// True when accessibility string for chip is set.
bool is_content_description_set;
};
// Guarantees that the Chip.type of all chips is set to a sensible value.
void SetDefaultChipType(std::vector<UserAction>* chips);
} // namespace autofill_assistant
#endif // COMPONENTS_AUTOFILL_ASSISTANT_BROWSER_CHIP_H_
|