chromium/chrome/browser/ui/views/passwords/views_utils.cc

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

#include "chrome/browser/ui/views/passwords/views_utils.h"

#include <string>
#include <vector>

#include "chrome/app/vector_icons/vector_icons.h"
#include "chrome/browser/ui/browser_element_identifiers.h"
#include "chrome/browser/ui/passwords/ui_utils.h"
#include "chrome/browser/ui/views/chrome_layout_provider.h"
#include "chrome/browser/ui/views/chrome_typography.h"
#include "chrome/grit/generated_resources.h"
#include "components/password_manager/core/browser/password_form.h"
#include "components/vector_icons/vector_icons.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/models/simple_combobox_model.h"
#include "ui/gfx/range/range.h"
#include "ui/gfx/vector_icon_utils.h"
#include "ui/views/accessibility/view_accessibility.h"
#include "ui/views/bubble/bubble_frame_view.h"
#include "ui/views/controls/editable_combobox/editable_combobox.h"
#include "ui/views/controls/editable_combobox/editable_password_combobox.h"
#include "ui/views/controls/image_view.h"
#include "ui/views/controls/label.h"
#include "ui/views/controls/styled_label.h"
#include "ui/views/layout/flex_layout.h"
#include "ui/views/style/typography.h"

namespace {
// Create a vector which contains only the values in |items| and no elements.
std::vector<std::u16string> ToValues(
    const password_manager::AlternativeElementVector& items) {}

std::unique_ptr<views::View> CreateRow() {}
}  // namespace

std::unique_ptr<views::StyledLabel> CreateGooglePasswordManagerLabel(
    int text_message_id,
    int link_message_id,
    const std::u16string& email,
    base::RepeatingClosure open_link_closure,
    int context) {}

std::unique_ptr<views::Label> CreateGooglePasswordManagerLabel(
    int text_message_id,
    int password_manager_message_id,
    const std::u16string& email,
    int context) {}

std::unique_ptr<views::StyledLabel> CreateGooglePasswordManagerLabel(
    int text_message_id,
    int link_message_id,
    base::RepeatingClosure open_link_closure,
    int context) {}

std::unique_ptr<views::Label> CreateUsernameLabel(
    const password_manager::PasswordForm& form) {}

std::unique_ptr<views::Label> CreatePasswordLabel(
    const password_manager::PasswordForm& form) {}

int ComboboxIconSize() {}

// Builds a credential row, adds the given elements to the layout.
void BuildCredentialRows(views::View* parent_view,
                         std::unique_ptr<views::View> username_field,
                         std::unique_ptr<views::View> password_field) {}

// Creates an EditableCombobox from |PasswordForm.all_alternative_usernames| or
// even just |PasswordForm.username_value|.
std::unique_ptr<views::EditableCombobox> CreateUsernameEditableCombobox(
    const password_manager::PasswordForm& form) {}

// Creates an EditablePasswordCombobox from
// `PasswordForm.all_alternative_passwords` or even just
// `PasswordForm.password_value`.
std::unique_ptr<views::EditablePasswordCombobox> CreateEditablePasswordCombobox(
    const password_manager::PasswordForm& form,
    views::Button::PressedCallback reveal_password_callback) {}

std::unique_ptr<views::View> CreateTitleView(const std::u16string& title) {}

void EmphasizeTokens(views::Label* label,
                     views::style::TextStyle emphasize_style,
                     const std::vector<std::u16string>& tokens) {}