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

content / browser / contacts / contacts_provider.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 CONTENT_BROWSER_CONTACTS_CONTACTS_PROVIDER_H_
#define CONTENT_BROWSER_CONTACTS_CONTACTS_PROVIDER_H_

#include <optional>

#include "content/public/browser/contacts_picker_properties.h"
#include "third_party/blink/public/mojom/contacts/contacts_manager.mojom.h"

namespace content {

class ContactsProvider {
 public:
  using ContactsSelectedCallback = base::OnceCallback<void(
      std::optional<std::vector<blink::mojom::ContactInfoPtr>> contacts,
      int percentage_shared,
      ContactsPickerProperties properties_requested)>;

  ContactsProvider() = default;
  virtual ~ContactsProvider() = default;

  // Launches the Contacts Picker Dialog and waits for the results to come back.
  // |callback| is called with the contacts list and share statistics, once the
  // operation finishes. See above for details.
  virtual void Select(bool multiple,
                      bool include_names,
                      bool include_emails,
                      bool include_tel,
                      bool include_addresses,
                      bool include_icons,
                      ContactsSelectedCallback callback) = 0;
};

}  // namespace content

#endif  // CONTENT_BROWSER_CONTACTS_CONTACTS_PROVIDER_H_