#include "chrome/browser/ui/views/bluetooth_device_credentials_view.h"
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/ranges/algorithm.h"
#include "base/strings/string_util.h"
#include "chrome/browser/ui/bluetooth/bluetooth_dialogs.h"
#include "chrome/browser/ui/views/chrome_layout_provider.h"
#include "chrome/grit/generated_resources.h"
#include "components/constrained_window/constrained_window_views.h"
#include "components/vector_icons/vector_icons.h"
#include "device/bluetooth/strings/grit/bluetooth_strings.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/metadata/metadata_impl_macros.h"
#include "ui/base/mojom/dialog_button.mojom.h"
#include "ui/base/mojom/ui_base_types.mojom-shared.h"
#include "ui/color/color_id.h"
#include "ui/compositor/layer.h"
#include "ui/views/accessibility/view_accessibility.h"
#include "ui/views/controls/image_view.h"
#include "ui/views/controls/label.h"
#include "ui/views/layout/flex_layout.h"
BluetoothDelegate;
void ShowBluetoothDeviceCredentialsDialog(
content::WebContents* web_contents,
const std::u16string& device_identifier,
BluetoothDelegate::PairPromptCallback close_callback) { … }
namespace {
bool IsInputTextValid(const std::u16string& text) { … }
}
BluetoothDeviceCredentialsView::BluetoothDeviceCredentialsView(
const std::u16string& device_identifier,
BluetoothDelegate::PairPromptCallback close_callback)
: … { … }
BluetoothDeviceCredentialsView::~BluetoothDeviceCredentialsView() = default;
void BluetoothDeviceCredentialsView::InitControls(
const std::u16string& device_identifier) { … }
views::View* BluetoothDeviceCredentialsView::GetInitiallyFocusedView() { … }
gfx::Size BluetoothDeviceCredentialsView::CalculatePreferredSize(
const views::SizeBounds& available_size) const { … }
bool BluetoothDeviceCredentialsView::IsDialogButtonEnabled(
ui::mojom::DialogButton button) const { … }
std::u16string BluetoothDeviceCredentialsView::GetWindowTitle() const { … }
void BluetoothDeviceCredentialsView::OnDialogAccepted() { … }
void BluetoothDeviceCredentialsView::ContentsChanged(
views::Textfield* sender,
const std::u16string& new_contents) { … }
BEGIN_METADATA(…)