#include "chrome/browser/sharing/click_to_call/click_to_call_utils.h"
#include <optional>
#include "base/ranges/algorithm.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/sharing/click_to_call/phone_number_regex.h"
#include "chrome/browser/sharing/sharing_service_factory.h"
#include "components/prefs/pref_service.h"
#include "components/sharing_message/features.h"
#include "components/sharing_message/pref_names.h"
#include "components/sharing_message/sharing_service.h"
#include "content/public/browser/browser_context.h"
#include "third_party/abseil-cpp/absl/strings/ascii.h"
#include "third_party/re2/src/re2/re2.h"
#include "url/url_constants.h"
#include "url/url_util.h"
namespace {
constexpr int kSelectionTextMaxLength = …;
constexpr int kSelectionTextMaxDigits = …;
bool IsClickToCallEnabled(content::BrowserContext* browser_context) { … }
std::optional<std::string> ExtractPhoneNumber(
const std::string& selection_text) { … }
std::string GetUnescapedURLContent(const GURL& url) { … }
}
bool ShouldOfferClickToCallForURL(content::BrowserContext* browser_context,
const GURL& url) { … }
std::optional<std::string> ExtractPhoneNumberForClickToCall(
content::BrowserContext* browser_context,
const std::string& selection_text) { … }
bool IsUrlSafeForClickToCall(const GURL& url) { … }