#include "chrome/browser/sharing/click_to_call/click_to_call_ui_controller.h"
#include <utility>
#include "base/functional/callback.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/app/vector_icons/vector_icons.h"
#include "chrome/browser/external_protocol/external_protocol_handler.h"
#include "chrome/browser/sharing/click_to_call/click_to_call_utils.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/grit/branded_strings.h"
#include "components/sharing_message/sharing_constants.h"
#include "components/sharing_message/sharing_dialog.h"
#include "components/sharing_message/sharing_target_device_info.h"
#include "components/vector_icons/vector_icons.h"
#include "content/public/browser/weak_document_ptr.h"
#include "content/public/browser/web_contents.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/gfx/paint_vector_icon.h"
#include "ui/strings/grit/ui_strings.h"
SharingMessage;
ClickToCallUiController* ClickToCallUiController::GetOrCreateFromWebContents(
content::WebContents* web_contents) { … }
void ClickToCallUiController::ShowDialog(
content::WebContents* web_contents,
const std::optional<url::Origin>& initiating_origin,
content::WeakDocumentPtr initiator_document,
const GURL& url,
bool hide_default_handler,
const std::u16string& program_name) { … }
ClickToCallUiController::ClickToCallUiController(
content::WebContents* web_contents)
: … { … }
ClickToCallUiController::~ClickToCallUiController() = default;
void ClickToCallUiController::OnDeviceSelected(
const std::string& phone_number,
const SharingTargetDeviceInfo& device,
SharingClickToCallEntryPoint entry_point) { … }
#if BUILDFLAG(IS_CHROMEOS)
void ClickToCallUiController::OnIntentPickerShown(bool has_devices,
bool has_apps) {
UpdateIcon();
OnDialogShown(has_devices, has_apps);
}
void ClickToCallUiController::OnIntentPickerClosed() {
UpdateIcon();
}
#endif
void ClickToCallUiController::OnDialogClosed(SharingDialog* dialog) { … }
std::u16string ClickToCallUiController::GetTitle(
SharingDialogType dialog_type) { … }
PageActionIconType ClickToCallUiController::GetIconType() { … }
sync_pb::SharingSpecificFields::EnabledFeatures
ClickToCallUiController::GetRequiredFeature() const { … }
void ClickToCallUiController::DoUpdateApps(UpdateAppsCallback callback) { … }
void ClickToCallUiController::OnDeviceChosen(
const SharingTargetDeviceInfo& device) { … }
void ClickToCallUiController::SendNumberToDevice(
const SharingTargetDeviceInfo& device,
const std::string& phone_number,
SharingClickToCallEntryPoint entry_point) { … }
void ClickToCallUiController::OnAppChosen(const SharingApp& app) { … }
void ClickToCallUiController::OnDialogShown(bool has_devices, bool has_apps) { … }
std::u16string ClickToCallUiController::GetContentType() const { … }
const gfx::VectorIcon& ClickToCallUiController::GetVectorIcon() const { … }
std::u16string ClickToCallUiController::GetTextForTooltipAndAccessibleName()
const { … }
SharingFeatureName ClickToCallUiController::GetFeatureMetricsPrefix() const { … }
SharingDialogData ClickToCallUiController::CreateDialogData(
SharingDialogType dialog_type) { … }
WEB_CONTENTS_USER_DATA_KEY_IMPL(ClickToCallUiController);