[LSC] Replace base::string16 with std::u16string in //{chrome*,content}
This change replaces base::string16 with std::u16string in //chrome,
//chromecast, //chromeos and //content.
Reproduction steps:
$ git grep -lw 'base::string16' chrome* content | \
xargs sed -i 's/\bbase::string16\b/std::u16string/g'
$ git cl format
Bug: 1184339
Change-Id: I8fae0ab25b5d9bf1cb416ae5f47d7f680fb8f3ea
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2752229
Commit-Queue: Jan Wilken Dörrie <jdoerrie@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Owners-Override: Daniel Cheng <dcheng@chromium.org>
Auto-Submit: Jan Wilken Dörrie <jdoerrie@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#862152}
diff --git a/chrome/app/resources/resources_unittest.cc b/chrome/app/resources/resources_unittest.cc
index 7d28c2d6..4e7fa32 100644
--- a/chrome/app/resources/resources_unittest.cc
+++ b/chrome/app/resources/resources_unittest.cc
@@ -48,7 +48,7 @@
ui::ResourceBundle::GetSharedInstance().ReloadLocaleResources("");
for (int message : messages_to_check) {
- base::string16 message_str = l10n_util::GetStringUTF16(message);
+ std::u16string message_str = l10n_util::GetStringUTF16(message);
EXPECT_EQ(message_str, base::TrimWhitespace(message_str, base::TRIM_ALL));
}
}
diff --git a/chrome/app_shim/app_shim_controller.h b/chrome/app_shim/app_shim_controller.h
index ce51d08..5d3589f 100644
--- a/chrome/app_shim/app_shim_controller.h
+++ b/chrome/app_shim/app_shim_controller.h
@@ -41,7 +41,7 @@
// The relative path of the profile.
base::FilePath profile_dir;
std::string app_id;
- base::string16 app_name;
+ std::u16string app_name;
GURL app_url;
};
diff --git a/chrome/common/chrome_content_client.cc b/chrome/common/chrome_content_client.cc
index 69e0d538..058bdc6 100644
--- a/chrome/common/chrome_content_client.cc
+++ b/chrome/common/chrome_content_client.cc
@@ -566,13 +566,13 @@
#endif
}
-base::string16 ChromeContentClient::GetLocalizedString(int message_id) {
+std::u16string ChromeContentClient::GetLocalizedString(int message_id) {
return l10n_util::GetStringUTF16(message_id);
}
-base::string16 ChromeContentClient::GetLocalizedString(
+std::u16string ChromeContentClient::GetLocalizedString(
int message_id,
- const base::string16& replacement) {
+ const std::u16string& replacement) {
return l10n_util::GetStringFUTF16(message_id, replacement);
}
diff --git a/chrome/common/chrome_content_client.h b/chrome/common/chrome_content_client.h
index f8d7c66..09ae324 100644
--- a/chrome/common/chrome_content_client.h
+++ b/chrome/common/chrome_content_client.h
@@ -85,9 +85,9 @@
std::vector<content::CdmInfo>* cdms,
std::vector<media::CdmHostFilePath>* cdm_host_file_paths) override;
void AddAdditionalSchemes(Schemes* schemes) override;
- base::string16 GetLocalizedString(int message_id) override;
- base::string16 GetLocalizedString(int message_id,
- const base::string16& replacement) override;
+ std::u16string GetLocalizedString(int message_id) override;
+ std::u16string GetLocalizedString(int message_id,
+ const std::u16string& replacement) override;
base::StringPiece GetDataResource(int resource_id,
ui::ScaleFactor scale_factor) override;
base::RefCountedMemory* GetDataResourceBytes(int resource_id) override;
diff --git a/chrome/common/custom_handlers/protocol_handler.cc b/chrome/common/custom_handlers/protocol_handler.cc
index 256313c..997dd928 100644
--- a/chrome/common/custom_handlers/protocol_handler.cc
+++ b/chrome/common/custom_handlers/protocol_handler.cc
@@ -150,7 +150,7 @@
return d;
}
-base::string16 ProtocolHandler::GetProtocolDisplayName(
+std::u16string ProtocolHandler::GetProtocolDisplayName(
const std::string& protocol) {
if (protocol == "mailto")
return l10n_util::GetStringUTF16(IDS_REGISTER_PROTOCOL_HANDLER_MAILTO_NAME);
@@ -159,7 +159,7 @@
return base::UTF8ToUTF16(protocol);
}
-base::string16 ProtocolHandler::GetProtocolDisplayName() const {
+std::u16string ProtocolHandler::GetProtocolDisplayName() const {
return GetProtocolDisplayName(protocol_);
}
diff --git a/chrome/common/custom_handlers/protocol_handler.h b/chrome/common/custom_handlers/protocol_handler.h
index 5a74373..6ab8a9b 100644
--- a/chrome/common/custom_handlers/protocol_handler.h
+++ b/chrome/common/custom_handlers/protocol_handler.h
@@ -75,11 +75,11 @@
// Returns a friendly name for |protocol| if one is available, otherwise
// this function returns |protocol|.
- static base::string16 GetProtocolDisplayName(const std::string& protocol);
+ static std::u16string GetProtocolDisplayName(const std::string& protocol);
// Returns a friendly name for |this.protocol_| if one is available, otherwise
// this function returns |this.protocol_|.
- base::string16 GetProtocolDisplayName() const;
+ std::u16string GetProtocolDisplayName() const;
const std::string& protocol() const { return protocol_; }
const GURL& url() const { return url_;}
diff --git a/chrome/common/extensions/api/commands/commands_handler.cc b/chrome/common/extensions/api/commands/commands_handler.cc
index 6532e1e0..8bd93d2d 100644
--- a/chrome/common/extensions/api/commands/commands_handler.cc
+++ b/chrome/common/extensions/api/commands/commands_handler.cc
@@ -67,7 +67,7 @@
CommandsHandler::~CommandsHandler() {
}
-bool CommandsHandler::Parse(Extension* extension, base::string16* error) {
+bool CommandsHandler::Parse(Extension* extension, std::u16string* error) {
if (!extension->manifest()->HasKey(keys::kCommands)) {
std::unique_ptr<CommandsInfo> commands_info(new CommandsInfo);
MaybeSetBrowserActionDefault(extension, commands_info.get());
@@ -151,9 +151,7 @@
!info->browser_action_command.get()) {
info->browser_action_command.reset(
new Command(manifest_values::kBrowserActionCommandEvent,
- base::string16(),
- std::string(),
- false));
+ std::u16string(), std::string(), false));
}
}
diff --git a/chrome/common/extensions/api/commands/commands_handler.h b/chrome/common/extensions/api/commands/commands_handler.h
index 3528be6..04f9269 100644
--- a/chrome/common/extensions/api/commands/commands_handler.h
+++ b/chrome/common/extensions/api/commands/commands_handler.h
@@ -41,7 +41,7 @@
CommandsHandler();
~CommandsHandler() override;
- bool Parse(Extension* extension, base::string16* error) override;
+ bool Parse(Extension* extension, std::u16string* error) override;
bool AlwaysParseForType(Manifest::Type type) const override;
private:
diff --git a/chrome/common/extensions/api/extension_action/browser_action_manifest_unittest.cc b/chrome/common/extensions/api/extension_action/browser_action_manifest_unittest.cc
index 10aa00e6..18e1a4d 100644
--- a/chrome/common/extensions/api/extension_action/browser_action_manifest_unittest.cc
+++ b/chrome/common/extensions/api/extension_action/browser_action_manifest_unittest.cc
@@ -127,8 +127,8 @@
}
}
})");
- base::string16 error = ErrorUtils::FormatErrorMessageUTF16(
- errors::kInvalidIconPath, "19");
+ std::u16string error =
+ ErrorUtils::FormatErrorMessageUTF16(errors::kInvalidIconPath, "19");
LoadAndExpectError(
ManifestData(std::move(manifest_value), "Invalid default icon"),
errors::kInvalidIconPath);
diff --git a/chrome/common/extensions/api/file_browser_handlers/file_browser_handler.cc b/chrome/common/extensions/api/file_browser_handlers/file_browser_handler.cc
index b8d2624..f24cd01b 100644
--- a/chrome/common/extensions/api/file_browser_handlers/file_browser_handler.cc
+++ b/chrome/common/extensions/api/file_browser_handlers/file_browser_handler.cc
@@ -141,7 +141,7 @@
std::unique_ptr<FileBrowserHandler> LoadFileBrowserHandler(
const std::string& extension_id,
const base::DictionaryValue* file_browser_handler,
- base::string16* error) {
+ std::u16string* error) {
std::unique_ptr<FileBrowserHandler> result(new FileBrowserHandler());
result->set_extension_id(extension_id);
@@ -249,11 +249,10 @@
}
// Loads FileBrowserHandlers from |extension_actions| into a list in |result|.
-bool LoadFileBrowserHandlers(
- const std::string& extension_id,
- const base::ListValue* extension_actions,
- FileBrowserHandler::List* result,
- base::string16* error) {
+bool LoadFileBrowserHandlers(const std::string& extension_id,
+ const base::ListValue* extension_actions,
+ FileBrowserHandler::List* result,
+ std::u16string* error) {
for (const auto& entry : *extension_actions) {
const base::DictionaryValue* dict;
if (!entry.GetAsDictionary(&dict)) {
@@ -272,7 +271,7 @@
} // namespace
bool FileBrowserHandlerParser::Parse(extensions::Extension* extension,
- base::string16* error) {
+ std::u16string* error) {
const base::Value* file_browser_handlers_value = nullptr;
if (!extension->manifest()->Get(keys::kFileBrowserHandlers,
&file_browser_handlers_value)) {
diff --git a/chrome/common/extensions/api/file_browser_handlers/file_browser_handler.h b/chrome/common/extensions/api/file_browser_handlers/file_browser_handler.h
index d69e618..ef450d9 100644
--- a/chrome/common/extensions/api/file_browser_handlers/file_browser_handler.h
+++ b/chrome/common/extensions/api/file_browser_handlers/file_browser_handler.h
@@ -92,7 +92,7 @@
FileBrowserHandlerParser();
~FileBrowserHandlerParser() override;
- bool Parse(extensions::Extension* extension, base::string16* error) override;
+ bool Parse(extensions::Extension* extension, std::u16string* error) override;
private:
base::span<const char* const> Keys() const override;
diff --git a/chrome/common/extensions/api/file_system_provider_capabilities/file_system_provider_capabilities_handler.cc b/chrome/common/extensions/api/file_system_provider_capabilities/file_system_provider_capabilities_handler.cc
index ac16cf0..3ae616f 100644
--- a/chrome/common/extensions/api/file_system_provider_capabilities/file_system_provider_capabilities_handler.cc
+++ b/chrome/common/extensions/api/file_system_provider_capabilities/file_system_provider_capabilities_handler.cc
@@ -53,7 +53,7 @@
}
bool FileSystemProviderCapabilitiesHandler::Parse(Extension* extension,
- base::string16* error) {
+ std::u16string* error) {
const bool has_permission = extensions::PermissionsParser::HasAPIPermission(
extension, extensions::APIPermission::ID::kFileSystemProvider);
const base::DictionaryValue* section = nullptr;
diff --git a/chrome/common/extensions/api/file_system_provider_capabilities/file_system_provider_capabilities_handler.h b/chrome/common/extensions/api/file_system_provider_capabilities/file_system_provider_capabilities_handler.h
index f179e006..241e466a 100644
--- a/chrome/common/extensions/api/file_system_provider_capabilities/file_system_provider_capabilities_handler.h
+++ b/chrome/common/extensions/api/file_system_provider_capabilities/file_system_provider_capabilities_handler.h
@@ -51,7 +51,7 @@
~FileSystemProviderCapabilitiesHandler() override;
// ManifestHandler overrides.
- bool Parse(Extension* extension, base::string16* error) override;
+ bool Parse(Extension* extension, std::u16string* error) override;
bool AlwaysParseForType(Manifest::Type type) const override;
private:
diff --git a/chrome/common/extensions/api/input_ime/input_components_handler.cc b/chrome/common/extensions/api/input_ime/input_components_handler.cc
index 50b33154..a4c4ff25 100644
--- a/chrome/common/extensions/api/input_ime/input_components_handler.cc
+++ b/chrome/common/extensions/api/input_ime/input_components_handler.cc
@@ -48,7 +48,7 @@
}
bool InputComponentsHandler::Parse(Extension* extension,
- base::string16* error) {
+ std::u16string* error) {
std::unique_ptr<InputComponents> info(new InputComponents);
const base::ListValue* list_value = NULL;
if (!extension->manifest()->GetList(keys::kInputComponents, &list_value)) {
diff --git a/chrome/common/extensions/api/input_ime/input_components_handler.h b/chrome/common/extensions/api/input_ime/input_components_handler.h
index 79c64b5..5794c0e 100644
--- a/chrome/common/extensions/api/input_ime/input_components_handler.h
+++ b/chrome/common/extensions/api/input_ime/input_components_handler.h
@@ -50,7 +50,7 @@
InputComponentsHandler();
~InputComponentsHandler() override;
- bool Parse(Extension* extension, base::string16* error) override;
+ bool Parse(Extension* extension, std::u16string* error) override;
// Requires kOptionsPage is already parsed.
const std::vector<std::string> PrerequisiteKeys() const override;
diff --git a/chrome/common/extensions/api/omnibox/omnibox_handler.cc b/chrome/common/extensions/api/omnibox/omnibox_handler.cc
index 4110b00..56834cd 100644
--- a/chrome/common/extensions/api/omnibox/omnibox_handler.cc
+++ b/chrome/common/extensions/api/omnibox/omnibox_handler.cc
@@ -35,7 +35,7 @@
OmniboxHandler::~OmniboxHandler() {
}
-bool OmniboxHandler::Parse(Extension* extension, base::string16* error) {
+bool OmniboxHandler::Parse(Extension* extension, std::u16string* error) {
ManifestKeys manifest_keys;
if (!ManifestKeys::ParseFromDictionary(
extension->manifest()->available_values(), &manifest_keys, error)) {
diff --git a/chrome/common/extensions/api/omnibox/omnibox_handler.h b/chrome/common/extensions/api/omnibox/omnibox_handler.h
index d52c3f4..8dfbabd4 100644
--- a/chrome/common/extensions/api/omnibox/omnibox_handler.h
+++ b/chrome/common/extensions/api/omnibox/omnibox_handler.h
@@ -28,7 +28,7 @@
OmniboxHandler();
~OmniboxHandler() override;
- bool Parse(Extension* extension, base::string16* error) override;
+ bool Parse(Extension* extension, std::u16string* error) override;
private:
base::span<const char* const> Keys() const override;
diff --git a/chrome/common/extensions/api/speech/tts_engine_manifest_handler.cc b/chrome/common/extensions/api/speech/tts_engine_manifest_handler.cc
index f947c4c8..0efd7e50 100644
--- a/chrome/common/extensions/api/speech/tts_engine_manifest_handler.cc
+++ b/chrome/common/extensions/api/speech/tts_engine_manifest_handler.cc
@@ -34,7 +34,7 @@
// static
bool TtsVoices::Parse(const base::ListValue* tts_voices,
TtsVoices* out_voices,
- base::string16* error,
+ std::u16string* error,
Extension* extension) {
bool added_gender_warning = false;
for (size_t i = 0; i < tts_voices->GetSize(); i++) {
@@ -126,7 +126,7 @@
TtsEngineManifestHandler::~TtsEngineManifestHandler() {}
bool TtsEngineManifestHandler::Parse(Extension* extension,
- base::string16* error) {
+ std::u16string* error) {
auto info = std::make_unique<TtsVoices>();
const base::DictionaryValue* tts_dict = nullptr;
if (!extension->manifest()->GetDictionary(keys::kTtsEngine, &tts_dict)) {
diff --git a/chrome/common/extensions/api/speech/tts_engine_manifest_handler.h b/chrome/common/extensions/api/speech/tts_engine_manifest_handler.h
index a8dc1842..7b3950c 100644
--- a/chrome/common/extensions/api/speech/tts_engine_manifest_handler.h
+++ b/chrome/common/extensions/api/speech/tts_engine_manifest_handler.h
@@ -32,7 +32,7 @@
~TtsVoices() override;
static bool Parse(const base::ListValue* tts_voices,
TtsVoices* out_voices,
- base::string16* error,
+ std::u16string* error,
Extension* extension);
std::vector<extensions::TtsVoice> voices;
@@ -46,7 +46,7 @@
TtsEngineManifestHandler();
~TtsEngineManifestHandler() override;
- bool Parse(Extension* extension, base::string16* error) override;
+ bool Parse(Extension* extension, std::u16string* error) override;
private:
base::span<const char* const> Keys() const override;
diff --git a/chrome/common/extensions/api/storage/storage_schema_manifest_handler.cc b/chrome/common/extensions/api/storage/storage_schema_manifest_handler.cc
index d8bac56..c9caa4b3 100644
--- a/chrome/common/extensions/api/storage/storage_schema_manifest_handler.cc
+++ b/chrome/common/extensions/api/storage/storage_schema_manifest_handler.cc
@@ -59,7 +59,7 @@
}
bool StorageSchemaManifestHandler::Parse(Extension* extension,
- base::string16* error) {
+ std::u16string* error) {
std::string path;
if (!extension->manifest()->GetString(kStorageManagedSchema, &path)) {
*error = base::ASCIIToUTF16(
diff --git a/chrome/common/extensions/api/storage/storage_schema_manifest_handler.h b/chrome/common/extensions/api/storage/storage_schema_manifest_handler.h
index 7a9bf6b7..fdb3170d 100644
--- a/chrome/common/extensions/api/storage/storage_schema_manifest_handler.h
+++ b/chrome/common/extensions/api/storage/storage_schema_manifest_handler.h
@@ -29,7 +29,7 @@
private:
// ManifestHandler implementation:
- bool Parse(Extension* extension, base::string16* error) override;
+ bool Parse(Extension* extension, std::u16string* error) override;
bool Validate(const Extension* extension,
std::string* error,
std::vector<InstallWarning>* warnings) const override;
diff --git a/chrome/common/extensions/api/system_indicator/system_indicator_handler.cc b/chrome/common/extensions/api/system_indicator/system_indicator_handler.cc
index 9269b42..dbf34a1 100644
--- a/chrome/common/extensions/api/system_indicator/system_indicator_handler.cc
+++ b/chrome/common/extensions/api/system_indicator/system_indicator_handler.cc
@@ -46,7 +46,7 @@
}
bool SystemIndicatorHandler::Parse(Extension* extension,
- base::string16* error) {
+ std::u16string* error) {
const base::DictionaryValue* system_indicator_value = nullptr;
if (!extension->manifest()->GetDictionary(
manifest_keys::kSystemIndicator, &system_indicator_value)) {
diff --git a/chrome/common/extensions/api/system_indicator/system_indicator_handler.h b/chrome/common/extensions/api/system_indicator/system_indicator_handler.h
index cd96161..e356021 100644
--- a/chrome/common/extensions/api/system_indicator/system_indicator_handler.h
+++ b/chrome/common/extensions/api/system_indicator/system_indicator_handler.h
@@ -30,7 +30,7 @@
const Extension& extension);
// ManifestHandler:
- bool Parse(Extension* extension, base::string16* error) override;
+ bool Parse(Extension* extension, std::u16string* error) override;
private:
base::span<const char* const> Keys() const override;
diff --git a/chrome/common/extensions/api/url_handlers/url_handlers_parser.cc b/chrome/common/extensions/api/url_handlers/url_handlers_parser.cc
index a3bbd54..e92c5586 100644
--- a/chrome/common/extensions/api/url_handlers/url_handlers_parser.cc
+++ b/chrome/common/extensions/api/url_handlers/url_handlers_parser.cc
@@ -111,7 +111,7 @@
bool ParseUrlHandler(const std::string& handler_id,
const base::DictionaryValue& handler_info,
std::vector<UrlHandlerInfo>* url_handlers,
- base::string16* error,
+ std::u16string* error,
Extension* extension) {
DCHECK(error);
@@ -158,7 +158,7 @@
return true;
}
-bool UrlHandlersParser::Parse(Extension* extension, base::string16* error) {
+bool UrlHandlersParser::Parse(Extension* extension, std::u16string* error) {
if (extension->GetType() == Manifest::TYPE_HOSTED_APP &&
!extension->from_bookmark()) {
*error = base::ASCIIToUTF16(merrors::kUrlHandlersInHostedApps);
diff --git a/chrome/common/extensions/api/url_handlers/url_handlers_parser.h b/chrome/common/extensions/api/url_handlers/url_handlers_parser.h
index 82dda11..097132d3 100644
--- a/chrome/common/extensions/api/url_handlers/url_handlers_parser.h
+++ b/chrome/common/extensions/api/url_handlers/url_handlers_parser.h
@@ -63,7 +63,7 @@
~UrlHandlersParser() override;
// ManifestHandler API
- bool Parse(Extension* extension, base::string16* error) override;
+ bool Parse(Extension* extension, std::u16string* error) override;
private:
base::span<const char* const> Keys() const override;
diff --git a/chrome/common/extensions/chrome_manifest_url_handlers.cc b/chrome/common/extensions/chrome_manifest_url_handlers.cc
index 6b82a35..3583bec4 100644
--- a/chrome/common/extensions/chrome_manifest_url_handlers.cc
+++ b/chrome/common/extensions/chrome_manifest_url_handlers.cc
@@ -71,7 +71,7 @@
DevToolsPageHandler::~DevToolsPageHandler() {
}
-bool DevToolsPageHandler::Parse(Extension* extension, base::string16* error) {
+bool DevToolsPageHandler::Parse(Extension* extension, std::u16string* error) {
std::unique_ptr<ManifestURL> manifest_url(new ManifestURL);
std::string devtools_str;
if (!extension->manifest()->GetString(keys::kDevToolsPage, &devtools_str)) {
@@ -103,7 +103,7 @@
URLOverridesHandler::~URLOverridesHandler() {
}
-bool URLOverridesHandler::Parse(Extension* extension, base::string16* error) {
+bool URLOverridesHandler::Parse(Extension* extension, std::u16string* error) {
const base::DictionaryValue* overrides = NULL;
if (!extension->manifest()->GetDictionary(keys::kChromeURLOverrides,
&overrides)) {
diff --git a/chrome/common/extensions/chrome_manifest_url_handlers.h b/chrome/common/extensions/chrome_manifest_url_handlers.h
index 5ba3f9c..2701eab 100644
--- a/chrome/common/extensions/chrome_manifest_url_handlers.h
+++ b/chrome/common/extensions/chrome_manifest_url_handlers.h
@@ -40,7 +40,7 @@
DevToolsPageHandler();
~DevToolsPageHandler() override;
- bool Parse(Extension* extension, base::string16* error) override;
+ bool Parse(Extension* extension, std::u16string* error) override;
private:
base::span<const char* const> Keys() const override;
@@ -54,7 +54,7 @@
URLOverridesHandler();
~URLOverridesHandler() override;
- bool Parse(Extension* extension, base::string16* error) override;
+ bool Parse(Extension* extension, std::u16string* error) override;
bool Validate(const Extension* extension,
std::string* error,
std::vector<InstallWarning>* warnings) const override;
diff --git a/chrome/common/extensions/command.cc b/chrome/common/extensions/command.cc
index fc803ac..991b480 100644
--- a/chrome/common/extensions/command.cc
+++ b/chrome/common/extensions/command.cc
@@ -67,7 +67,7 @@
const std::string& platform_key,
int index,
bool should_parse_media_keys,
- base::string16* error) {
+ std::u16string* error) {
error->clear();
if (platform_key != values::kKeybindingPlatformWin &&
platform_key != values::kKeybindingPlatformMac &&
@@ -273,11 +273,11 @@
Command::Command() : global_(false) {}
Command::Command(const std::string& command_name,
- const base::string16& description,
+ const std::u16string& description,
const std::string& accelerator,
bool global)
: command_name_(command_name), description_(description), global_(global) {
- base::string16 error;
+ std::u16string error;
accelerator_ = ParseImpl(accelerator, CommandPlatform(), 0,
IsNamedCommand(command_name), &error);
}
@@ -304,7 +304,7 @@
// static
ui::Accelerator Command::StringToAccelerator(const std::string& accelerator,
const std::string& command_name) {
- base::string16 error;
+ std::u16string error;
ui::Accelerator parsed =
ParseImpl(accelerator, Command::CommandPlatform(), 0,
IsNamedCommand(command_name), &error);
@@ -418,10 +418,10 @@
bool Command::Parse(const base::DictionaryValue* command,
const std::string& command_name,
int index,
- base::string16* error) {
+ std::u16string* error) {
DCHECK(!command_name.empty());
- base::string16 description;
+ std::u16string description;
if (IsNamedCommand(command_name)) {
if (!command->GetString(keys::kDescription, &description) ||
description.empty()) {
diff --git a/chrome/common/extensions/command.h b/chrome/common/extensions/command.h
index a4b9a57..10b1f91 100644
--- a/chrome/common/extensions/command.h
+++ b/chrome/common/extensions/command.h
@@ -21,7 +21,7 @@
public:
Command();
Command(const std::string& command_name,
- const base::string16& description,
+ const std::u16string& description,
const std::string& accelerator,
bool global);
Command(const Command& other);
@@ -48,12 +48,12 @@
bool Parse(const base::DictionaryValue* command,
const std::string& command_name,
int index,
- base::string16* error);
+ std::u16string* error);
// Accessors:
const std::string& command_name() const { return command_name_; }
const ui::Accelerator& accelerator() const { return accelerator_; }
- const base::string16& description() const { return description_; }
+ const std::u16string& description() const { return description_; }
bool global() const { return global_; }
// Setter:
@@ -67,7 +67,7 @@
private:
std::string command_name_;
ui::Accelerator accelerator_;
- base::string16 description_;
+ std::u16string description_;
bool global_;
};
diff --git a/chrome/common/extensions/command_unittest.cc b/chrome/common/extensions/command_unittest.cc
index 7885d94..9a7ff45 100644
--- a/chrome/common/extensions/command_unittest.cc
+++ b/chrome/common/extensions/command_unittest.cc
@@ -45,7 +45,7 @@
extensions::Command command;
std::unique_ptr<base::DictionaryValue> input(new base::DictionaryValue);
- base::string16 error;
+ std::u16string error;
// First, test the parse of a string suggested_key value.
input->SetString("suggested_key", data.key);
@@ -219,7 +219,7 @@
key_dict->SetString("chromeos", "Ctrl+Shift+C");
extensions::Command command;
- base::string16 error;
+ std::u16string error;
EXPECT_TRUE(command.Parse(input.get(), command_name, 0, &error));
EXPECT_STREQ(description.c_str(),
base::UTF16ToASCII(command.description()).c_str());
diff --git a/chrome/common/extensions/extension_unittest.cc b/chrome/common/extensions/extension_unittest.cc
index 40de6d38..b97aff7 100644
--- a/chrome/common/extensions/extension_unittest.cc
+++ b/chrome/common/extensions/extension_unittest.cc
@@ -171,7 +171,7 @@
ExtensionBuilder().SetManifest(manifest.Build()).Build();
ASSERT_TRUE(extension);
const int kResourceId = IDS_EXTENSION_PERMISSIONS_PROMPT_TITLE;
- const base::string16 expected_utf16 = base::WideToUTF16(expected);
+ const std::u16string expected_utf16 = base::WideToUTF16(expected);
EXPECT_EQ(l10n_util::GetStringFUTF16(kResourceId, expected_utf16),
l10n_util::GetStringFUTF16(kResourceId,
base::UTF8ToUTF16(extension->name())));
diff --git a/chrome/common/extensions/manifest_handlers/app_display_mode_info.cc b/chrome/common/extensions/manifest_handlers/app_display_mode_info.cc
index 45920c3..c0997ef 100644
--- a/chrome/common/extensions/manifest_handlers/app_display_mode_info.cc
+++ b/chrome/common/extensions/manifest_handlers/app_display_mode_info.cc
@@ -32,7 +32,7 @@
AppDisplayModeHandler::~AppDisplayModeHandler() = default;
-bool AppDisplayModeHandler::Parse(Extension* extension, base::string16* error) {
+bool AppDisplayModeHandler::Parse(Extension* extension, std::u16string* error) {
std::string display_mode_string;
blink::mojom::DisplayMode display_mode =
blink::mojom::DisplayMode::kUndefined;
diff --git a/chrome/common/extensions/manifest_handlers/app_display_mode_info.h b/chrome/common/extensions/manifest_handlers/app_display_mode_info.h
index b148988..bc0572ba 100644
--- a/chrome/common/extensions/manifest_handlers/app_display_mode_info.h
+++ b/chrome/common/extensions/manifest_handlers/app_display_mode_info.h
@@ -30,7 +30,7 @@
AppDisplayModeHandler();
~AppDisplayModeHandler() override;
- bool Parse(Extension* extension, base::string16* error) override;
+ bool Parse(Extension* extension, std::u16string* error) override;
private:
base::span<const char* const> Keys() const override;
diff --git a/chrome/common/extensions/manifest_handlers/app_icon_color_info.cc b/chrome/common/extensions/manifest_handlers/app_icon_color_info.cc
index 12b55c1..296f5ae8 100644
--- a/chrome/common/extensions/manifest_handlers/app_icon_color_info.cc
+++ b/chrome/common/extensions/manifest_handlers/app_icon_color_info.cc
@@ -53,7 +53,7 @@
AppIconColorHandler::~AppIconColorHandler() {
}
-bool AppIconColorHandler::Parse(Extension* extension, base::string16* error) {
+bool AppIconColorHandler::Parse(Extension* extension, std::u16string* error) {
std::unique_ptr<AppIconColorInfo> app_icon_color_info(new AppIconColorInfo);
const base::Value* temp = NULL;
diff --git a/chrome/common/extensions/manifest_handlers/app_icon_color_info.h b/chrome/common/extensions/manifest_handlers/app_icon_color_info.h
index 41348e9..0a89564 100644
--- a/chrome/common/extensions/manifest_handlers/app_icon_color_info.h
+++ b/chrome/common/extensions/manifest_handlers/app_icon_color_info.h
@@ -33,7 +33,7 @@
AppIconColorHandler();
~AppIconColorHandler() override;
- bool Parse(Extension* extension, base::string16* error) override;
+ bool Parse(Extension* extension, std::u16string* error) override;
private:
base::span<const char* const> Keys() const override;
diff --git a/chrome/common/extensions/manifest_handlers/app_launch_info.cc b/chrome/common/extensions/manifest_handlers/app_launch_info.cc
index 7d9ee32..138fd3a6 100644
--- a/chrome/common/extensions/manifest_handlers/app_launch_info.cc
+++ b/chrome/common/extensions/manifest_handlers/app_launch_info.cc
@@ -31,7 +31,7 @@
const char* key,
int* target,
bool is_valid_container,
- base::string16* error) {
+ std::u16string* error) {
const base::Value* temp = NULL;
if (manifest->Get(key, &temp)) {
if (!is_valid_container) {
@@ -125,14 +125,14 @@
return extension->url().Resolve(info.launch_local_path_);
}
-bool AppLaunchInfo::Parse(Extension* extension, base::string16* error) {
+bool AppLaunchInfo::Parse(Extension* extension, std::u16string* error) {
if (!LoadLaunchURL(extension, error) ||
!LoadLaunchContainer(extension, error))
return false;
return true;
}
-bool AppLaunchInfo::LoadLaunchURL(Extension* extension, base::string16* error) {
+bool AppLaunchInfo::LoadLaunchURL(Extension* extension, std::u16string* error) {
const base::Value* temp = NULL;
// Launch URL can be either local (to chrome-extension:// root) or an absolute
@@ -264,7 +264,7 @@
}
bool AppLaunchInfo::LoadLaunchContainer(Extension* extension,
- base::string16* error) {
+ std::u16string* error) {
const base::Value* tmp_launcher_container = NULL;
if (!extension->manifest()->Get(keys::kLaunchContainer,
&tmp_launcher_container))
@@ -342,7 +342,7 @@
}
bool AppLaunchManifestHandler::Parse(Extension* extension,
- base::string16* error) {
+ std::u16string* error) {
std::unique_ptr<AppLaunchInfo> info(new AppLaunchInfo);
if (!info->Parse(extension, error))
return false;
diff --git a/chrome/common/extensions/manifest_handlers/app_launch_info.h b/chrome/common/extensions/manifest_handlers/app_launch_info.h
index 6bfd10e..6d40ed2 100644
--- a/chrome/common/extensions/manifest_handlers/app_launch_info.h
+++ b/chrome/common/extensions/manifest_handlers/app_launch_info.h
@@ -46,11 +46,11 @@
// Get the fully resolved absolute launch URL.
static GURL GetFullLaunchURL(const Extension* extension);
- bool Parse(Extension* extension, base::string16* error);
+ bool Parse(Extension* extension, std::u16string* error);
private:
- bool LoadLaunchURL(Extension* extension, base::string16* error);
- bool LoadLaunchContainer(Extension* extension, base::string16* error);
+ bool LoadLaunchURL(Extension* extension, std::u16string* error);
+ bool LoadLaunchContainer(Extension* extension, std::u16string* error);
void OverrideLaunchURL(Extension* extension, GURL override_url);
std::string launch_local_path_;
@@ -71,7 +71,7 @@
AppLaunchManifestHandler();
~AppLaunchManifestHandler() override;
- bool Parse(Extension* extension, base::string16* error) override;
+ bool Parse(Extension* extension, std::u16string* error) override;
bool AlwaysParseForType(Manifest::Type type) const override;
private:
diff --git a/chrome/common/extensions/manifest_handlers/app_theme_color_info.cc b/chrome/common/extensions/manifest_handlers/app_theme_color_info.cc
index aaf0eca..dfad20c 100644
--- a/chrome/common/extensions/manifest_handlers/app_theme_color_info.cc
+++ b/chrome/common/extensions/manifest_handlers/app_theme_color_info.cc
@@ -34,7 +34,7 @@
AppThemeColorHandler::~AppThemeColorHandler() {}
-bool AppThemeColorHandler::Parse(Extension* extension, base::string16* error) {
+bool AppThemeColorHandler::Parse(Extension* extension, std::u16string* error) {
std::string theme_color_string;
SkColor theme_color = SK_ColorTRANSPARENT;
if (!extension->manifest()->GetString(keys::kAppThemeColor,
diff --git a/chrome/common/extensions/manifest_handlers/app_theme_color_info.h b/chrome/common/extensions/manifest_handlers/app_theme_color_info.h
index b898482..12eafad 100644
--- a/chrome/common/extensions/manifest_handlers/app_theme_color_info.h
+++ b/chrome/common/extensions/manifest_handlers/app_theme_color_info.h
@@ -30,7 +30,7 @@
AppThemeColorHandler();
~AppThemeColorHandler() override;
- bool Parse(Extension* extension, base::string16* error) override;
+ bool Parse(Extension* extension, std::u16string* error) override;
private:
base::span<const char* const> Keys() const override;
diff --git a/chrome/common/extensions/manifest_handlers/linked_app_icons.cc b/chrome/common/extensions/manifest_handlers/linked_app_icons.cc
index effeaec..818e3f8 100644
--- a/chrome/common/extensions/manifest_handlers/linked_app_icons.cc
+++ b/chrome/common/extensions/manifest_handlers/linked_app_icons.cc
@@ -50,7 +50,7 @@
LinkedAppIconsHandler::~LinkedAppIconsHandler() {
}
-bool LinkedAppIconsHandler::Parse(Extension* extension, base::string16* error) {
+bool LinkedAppIconsHandler::Parse(Extension* extension, std::u16string* error) {
std::unique_ptr<LinkedAppIcons> linked_app_icons(new LinkedAppIcons);
const base::Value* icons_value = nullptr;
diff --git a/chrome/common/extensions/manifest_handlers/linked_app_icons.h b/chrome/common/extensions/manifest_handlers/linked_app_icons.h
index 82f0697..0f26a5a 100644
--- a/chrome/common/extensions/manifest_handlers/linked_app_icons.h
+++ b/chrome/common/extensions/manifest_handlers/linked_app_icons.h
@@ -40,7 +40,7 @@
LinkedAppIconsHandler();
~LinkedAppIconsHandler() override;
- bool Parse(Extension* extension, base::string16* error) override;
+ bool Parse(Extension* extension, std::u16string* error) override;
private:
base::span<const char* const> Keys() const override;
diff --git a/chrome/common/extensions/manifest_handlers/minimum_chrome_version_checker.cc b/chrome/common/extensions/manifest_handlers/minimum_chrome_version_checker.cc
index 079292e..5d1f3a3 100644
--- a/chrome/common/extensions/manifest_handlers/minimum_chrome_version_checker.cc
+++ b/chrome/common/extensions/manifest_handlers/minimum_chrome_version_checker.cc
@@ -26,7 +26,7 @@
}
bool MinimumChromeVersionChecker::Parse(Extension* extension,
- base::string16* error) {
+ std::u16string* error) {
std::string minimum_version_string;
if (!extension->manifest()->GetString(keys::kMinimumChromeVersion,
&minimum_version_string)) {
diff --git a/chrome/common/extensions/manifest_handlers/minimum_chrome_version_checker.h b/chrome/common/extensions/manifest_handlers/minimum_chrome_version_checker.h
index 4ca6430..c02af55 100644
--- a/chrome/common/extensions/manifest_handlers/minimum_chrome_version_checker.h
+++ b/chrome/common/extensions/manifest_handlers/minimum_chrome_version_checker.h
@@ -18,7 +18,7 @@
// Validate minimum Chrome version. We don't need to store this, since the
// extension is not valid if it is incorrect.
- bool Parse(Extension* extension, base::string16* error) override;
+ bool Parse(Extension* extension, std::u16string* error) override;
private:
base::span<const char* const> Keys() const override;
diff --git a/chrome/common/extensions/manifest_handlers/natively_connectable_handler.cc b/chrome/common/extensions/manifest_handlers/natively_connectable_handler.cc
index 397c3f7..6ef976d 100644
--- a/chrome/common/extensions/manifest_handlers/natively_connectable_handler.cc
+++ b/chrome/common/extensions/manifest_handlers/natively_connectable_handler.cc
@@ -41,7 +41,7 @@
NativelyConnectableHandler::~NativelyConnectableHandler() = default;
bool NativelyConnectableHandler::Parse(Extension* extension,
- base::string16* error) {
+ std::u16string* error) {
const base::Value* natively_connectable_hosts = nullptr;
if (!extension->manifest()->GetList(manifest_keys::kNativelyConnectable,
&natively_connectable_hosts)) {
diff --git a/chrome/common/extensions/manifest_handlers/natively_connectable_handler.h b/chrome/common/extensions/manifest_handlers/natively_connectable_handler.h
index 8a32c3a..4f8af84 100644
--- a/chrome/common/extensions/manifest_handlers/natively_connectable_handler.h
+++ b/chrome/common/extensions/manifest_handlers/natively_connectable_handler.h
@@ -35,7 +35,7 @@
NativelyConnectableHandler();
~NativelyConnectableHandler() override;
- bool Parse(Extension* extension, base::string16* error) override;
+ bool Parse(Extension* extension, std::u16string* error) override;
private:
base::span<const char* const> Keys() const override;
diff --git a/chrome/common/extensions/manifest_handlers/settings_overrides_handler.cc b/chrome/common/extensions/manifest_handlers/settings_overrides_handler.cc
index 5feee98..9e80ff7 100644
--- a/chrome/common/extensions/manifest_handlers/settings_overrides_handler.cc
+++ b/chrome/common/extensions/manifest_handlers/settings_overrides_handler.cc
@@ -38,7 +38,7 @@
}
std::unique_ptr<GURL> ParseHomepage(const ChromeSettingsOverrides& overrides,
- base::string16* error) {
+ std::u16string* error) {
if (!overrides.homepage)
return std::unique_ptr<GURL>();
std::unique_ptr<GURL> manifest_url = CreateManifestURL(*overrides.homepage);
@@ -50,7 +50,7 @@
}
std::vector<GURL> ParseStartupPage(const ChromeSettingsOverrides& overrides,
- base::string16* error) {
+ std::u16string* error) {
std::vector<GURL> urls;
if (!overrides.startup_pages)
return urls;
@@ -72,7 +72,7 @@
std::unique_ptr<ChromeSettingsOverrides::SearchProvider> ParseSearchEngine(
ChromeSettingsOverrides* overrides,
- base::string16* error) {
+ std::u16string* error) {
if (!overrides->search_provider)
return std::unique_ptr<ChromeSettingsOverrides::SearchProvider>();
if (!CreateManifestURL(overrides->search_provider->search_url)) {
@@ -138,7 +138,7 @@
SettingsOverridesHandler::~SettingsOverridesHandler() {}
bool SettingsOverridesHandler::Parse(Extension* extension,
- base::string16* error) {
+ std::u16string* error) {
const base::Value* dict = NULL;
CHECK(extension->manifest()->Get(manifest_keys::kSettingsOverride, &dict));
std::unique_ptr<ChromeSettingsOverrides> settings(
@@ -150,11 +150,11 @@
// parse failure should result in hard error. Currently, Parse fails only when
// all of these fail to parse.
auto info = std::make_unique<SettingsOverrides>();
- base::string16 homepage_error;
+ std::u16string homepage_error;
info->homepage = ParseHomepage(*settings, &homepage_error);
- base::string16 search_engine_error;
+ std::u16string search_engine_error;
info->search_engine = ParseSearchEngine(settings.get(), &search_engine_error);
- base::string16 startup_pages_error;
+ std::u16string startup_pages_error;
info->startup_pages = ParseStartupPage(*settings, &startup_pages_error);
if (!info->homepage && !info->search_engine && info->startup_pages.empty()) {
if (!homepage_error.empty()) {
diff --git a/chrome/common/extensions/manifest_handlers/settings_overrides_handler.h b/chrome/common/extensions/manifest_handlers/settings_overrides_handler.h
index ea898947..d3ae287 100644
--- a/chrome/common/extensions/manifest_handlers/settings_overrides_handler.h
+++ b/chrome/common/extensions/manifest_handlers/settings_overrides_handler.h
@@ -43,7 +43,7 @@
SettingsOverridesHandler();
~SettingsOverridesHandler() override;
- bool Parse(Extension* extension, base::string16* error) override;
+ bool Parse(Extension* extension, std::u16string* error) override;
private:
base::span<const char* const> Keys() const override;
diff --git a/chrome/common/extensions/manifest_handlers/theme_handler.cc b/chrome/common/extensions/manifest_handlers/theme_handler.cc
index 327b035e..9d323fb 100644
--- a/chrome/common/extensions/manifest_handlers/theme_handler.cc
+++ b/chrome/common/extensions/manifest_handlers/theme_handler.cc
@@ -22,7 +22,7 @@
namespace {
bool LoadImages(const base::DictionaryValue* theme_value,
- base::string16* error,
+ std::u16string* error,
ThemeInfo* theme_info) {
const base::DictionaryValue* images_value = NULL;
if (theme_value->GetDictionary(keys::kThemeImages, &images_value)) {
@@ -57,7 +57,7 @@
}
bool LoadColors(const base::DictionaryValue* theme_value,
- base::string16* error,
+ std::u16string* error,
ThemeInfo* theme_info) {
const base::DictionaryValue* colors_value = NULL;
if (theme_value->GetDictionary(keys::kThemeColors, &colors_value)) {
@@ -89,7 +89,7 @@
}
bool LoadTints(const base::DictionaryValue* theme_value,
- base::string16* error,
+ std::u16string* error,
ThemeInfo* theme_info) {
const base::DictionaryValue* tints_value = NULL;
if (!theme_value->GetDictionary(keys::kThemeTints, &tints_value))
@@ -114,7 +114,7 @@
}
bool LoadDisplayProperties(const base::DictionaryValue* theme_value,
- base::string16* error,
+ std::u16string* error,
ThemeInfo* theme_info) {
const base::DictionaryValue* display_properties_value = NULL;
if (theme_value->GetDictionary(keys::kThemeDisplayProperties,
@@ -168,7 +168,7 @@
ThemeHandler::~ThemeHandler() {
}
-bool ThemeHandler::Parse(Extension* extension, base::string16* error) {
+bool ThemeHandler::Parse(Extension* extension, std::u16string* error) {
const base::DictionaryValue* theme_value = NULL;
if (!extension->manifest()->GetDictionary(keys::kTheme, &theme_value)) {
*error = base::ASCIIToUTF16(errors::kInvalidTheme);
diff --git a/chrome/common/extensions/manifest_handlers/theme_handler.h b/chrome/common/extensions/manifest_handlers/theme_handler.h
index 7f1b3f3..3d471ce 100644
--- a/chrome/common/extensions/manifest_handlers/theme_handler.h
+++ b/chrome/common/extensions/manifest_handlers/theme_handler.h
@@ -48,7 +48,7 @@
ThemeHandler();
~ThemeHandler() override;
- bool Parse(Extension* extension, base::string16* error) override;
+ bool Parse(Extension* extension, std::u16string* error) override;
bool Validate(const Extension* extension,
std::string* error,
std::vector<InstallWarning>* warnings) const override;
diff --git a/chrome/common/extensions/manifest_tests/extension_manifests_initvalue_unittest.cc b/chrome/common/extensions/manifest_tests/extension_manifests_initvalue_unittest.cc
index b1fca91..53c8b97 100644
--- a/chrome/common/extensions/manifest_tests/extension_manifests_initvalue_unittest.cc
+++ b/chrome/common/extensions/manifest_tests/extension_manifests_initvalue_unittest.cc
@@ -178,7 +178,7 @@
scoped_refptr<Extension> extension(LoadAndExpectSuccess(
"init_valid_name_no_rtl.json"));
- base::string16 localized_name(base::ASCIIToUTF16("Dictionary (by Google)"));
+ std::u16string localized_name(base::ASCIIToUTF16("Dictionary (by Google)"));
base::i18n::AdjustStringForLocaleDirection(&localized_name);
EXPECT_EQ(localized_name, base::UTF8ToUTF16(extension->name()));
diff --git a/chrome/common/extensions/permissions/chrome_permission_message_rules.cc b/chrome/common/extensions/permissions/chrome_permission_message_rules.cc
index 452dd8be..5021bb88 100644
--- a/chrome/common/extensions/permissions/chrome_permission_message_rules.cc
+++ b/chrome/common/extensions/permissions/chrome_permission_message_rules.cc
@@ -51,7 +51,7 @@
PermissionMessage GetPermissionMessage(
const PermissionIDSet& permissions) const override {
DCHECK(permissions.size() > 0);
- std::vector<base::string16> parameters =
+ std::vector<std::u16string> parameters =
permissions.GetAllPermissionParameters();
DCHECK_EQ(1U, parameters.size())
<< "Only one message with each ID can be parameterized.";
@@ -103,9 +103,9 @@
PermissionMessage GetPermissionMessage(
const PermissionIDSet& permissions) const override {
DCHECK(permissions.size() > 0);
- std::vector<base::string16> hostnames =
+ std::vector<std::u16string> hostnames =
permissions.GetAllPermissionParameters();
- base::string16 hosts_string =
+ std::u16string hosts_string =
base::JoinString(hostnames, base::ASCIIToUTF16(" "));
return PermissionMessage(
l10n_util::GetStringFUTF16(hostnames.size() == 1
@@ -140,7 +140,7 @@
PermissionMessage GetPermissionMessage(
const PermissionIDSet& permissions) const override {
DCHECK(!permissions.empty());
- std::vector<base::string16> hostnames =
+ std::vector<std::u16string> hostnames =
GetHostMessages(permissions.GetAllPermissionParameters());
int message_id = message_id_for_hosts(hostnames.size());
if (hostnames.size() <= kMaxHostsInMainMessage) {
@@ -166,13 +166,13 @@
}
}
- std::vector<base::string16> GetHostMessages(
- const std::vector<base::string16>& hosts) const {
+ std::vector<std::u16string> GetHostMessages(
+ const std::vector<std::u16string>& hosts) const {
int msg_id = hosts.size() <= kMaxHostsInMainMessage
? IDS_EXTENSION_PROMPT_WARNING_HOST_AND_SUBDOMAIN
: IDS_EXTENSION_PROMPT_WARNING_HOST_AND_SUBDOMAIN_LIST;
- std::vector<base::string16> messages;
- for (const base::string16& host : hosts) {
+ std::vector<std::u16string> messages;
+ for (const std::u16string& host : hosts) {
messages.push_back(
host[0] == '*' && host[1] == '.'
? l10n_util::GetStringFUTF16(msg_id, host.substr(2))
@@ -207,7 +207,7 @@
PermissionMessage GetItemMessage(const PermissionIDSet& permissions) const {
DCHECK(permissions.size() == 1);
const PermissionID& permission = *permissions.begin();
- base::string16 msg;
+ std::u16string msg;
switch (permission.id()) {
case APIPermission::kUsbDevice:
msg = l10n_util::GetStringFUTF16(
@@ -232,14 +232,14 @@
const PermissionIDSet& permissions) const {
DCHECK(permissions.size() > 1);
// Put all the individual items into submessages.
- std::vector<base::string16> submessages =
+ std::vector<std::u16string> submessages =
permissions.GetAllPermissionsWithID(APIPermission::kUsbDevice)
.GetAllPermissionParameters();
- std::vector<base::string16> vendors =
- permissions.GetAllPermissionsWithID(
- APIPermission::kUsbDeviceUnknownProduct)
+ std::vector<std::u16string> vendors =
+ permissions
+ .GetAllPermissionsWithID(APIPermission::kUsbDeviceUnknownProduct)
.GetAllPermissionParameters();
- for (const base::string16& vendor : vendors) {
+ for (const std::u16string& vendor : vendors) {
submessages.push_back(l10n_util::GetStringFUTF16(
IDS_EXTENSION_PROMPT_WARNING_USB_DEVICE_LIST_ITEM_UNKNOWN_PRODUCT,
vendor));
diff --git a/chrome/common/extensions/permissions/permission_set_unittest.cc b/chrome/common/extensions/permissions/permission_set_unittest.cc
index 676fb0e80..0d025a0 100644
--- a/chrome/common/extensions/permissions/permission_set_unittest.cc
+++ b/chrome/common/extensions/permissions/permission_set_unittest.cc
@@ -47,7 +47,7 @@
}
size_t IndexOf(const PermissionMessages& warnings, const std::string& warning) {
- base::string16 warning16 = base::ASCIIToUTF16(warning);
+ std::u16string warning16 = base::ASCIIToUTF16(warning);
size_t i = 0;
for (const PermissionMessage& msg : warnings) {
if (msg.message() == warning16)
diff --git a/chrome/common/importer/firefox_importer_utils.cc b/chrome/common/importer/firefox_importer_utils.cc
index dd5ec4ab..ed7d7c9 100644
--- a/chrome/common/importer/firefox_importer_utils.cc
+++ b/chrome/common/importer/firefox_importer_utils.cc
@@ -29,7 +29,7 @@
// Retrieves the file system path of the profile name.
base::FilePath GetProfilePath(const base::DictionaryValue& root,
const std::string& profile_name) {
- base::string16 path16;
+ std::u16string path16;
std::string is_relative;
if (!root.GetStringASCII(profile_name + ".IsRelative", &is_relative) ||
!root.GetString(profile_name + ".Path", &path16))
@@ -75,13 +75,13 @@
break;
}
- base::string16 path;
+ std::u16string path;
if (!root.GetString(current_profile + ".Path", &path))
continue;
FirefoxDetail details;
details.path = GetProfilePath(root, current_profile);
- base::string16 name;
+ std::u16string name;
root.GetString(current_profile + ".Name", &name);
// Make the profile name more presentable by replacing dashes with spaces.
base::ReplaceChars(name, base::ASCIIToUTF16("-"), base::ASCIIToUTF16(" "),
@@ -94,7 +94,7 @@
// The name is only used to disambiguate profiles in the profile selection UI,
// which is only useful when there are multiple profiles.
if (profile_details.size() == 1) {
- profile_details[0].name = base::string16();
+ profile_details[0].name = std::u16string();
}
return profile_details;
@@ -300,7 +300,7 @@
// ID={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
// .........................................
// In this example the function returns "Iceweasel" (or a localized equivalent).
-base::string16 GetFirefoxImporterName(const base::FilePath& app_path) {
+std::u16string GetFirefoxImporterName(const base::FilePath& app_path) {
const base::FilePath app_ini_file = app_path.AppendASCII("application.ini");
std::string branding_name;
if (base::PathExists(app_ini_file)) {
diff --git a/chrome/common/importer/firefox_importer_utils.h b/chrome/common/importer/firefox_importer_utils.h
index 4f8d83e..6daac24 100644
--- a/chrome/common/importer/firefox_importer_utils.h
+++ b/chrome/common/importer/firefox_importer_utils.h
@@ -37,7 +37,7 @@
// in stored.
base::FilePath path;
// The user specified name of the profile.
- base::string16 name;
+ std::u16string name;
};
inline bool operator==(const FirefoxDetail& a1, const FirefoxDetail& a2) {
@@ -101,6 +101,6 @@
// This is useful to differentiate between Firefox and Iceweasel.
// If anything goes wrong while trying to obtain the branding name,
// the function assumes it's Firefox.
-base::string16 GetFirefoxImporterName(const base::FilePath& app_path);
+std::u16string GetFirefoxImporterName(const base::FilePath& app_path);
#endif // CHROME_COMMON_IMPORTER_FIREFOX_IMPORTER_UTILS_H_
diff --git a/chrome/common/importer/firefox_importer_utils_unittest.cc b/chrome/common/importer/firefox_importer_utils_unittest.cc
index 3ea9669..fdb4df7fc 100644
--- a/chrome/common/importer/firefox_importer_utils_unittest.cc
+++ b/chrome/common/importer/firefox_importer_utils_unittest.cc
@@ -145,7 +145,7 @@
GetFirefoxDetailsFromDictionary(single_profile, std::string());
EXPECT_THAT(details, UnorderedElementsAre(FirefoxDetail{
base::FilePath(FILE_PATH_LITERAL("first")),
- base::string16()}));
+ std::u16string()}));
base::DictionaryValue no_default;
no_default.SetString("Profile0.Path", "first");
@@ -222,9 +222,9 @@
EXPECT_THAT(default_single_install_unknown_profile_details,
UnorderedElementsAre(
FirefoxDetail{base::FilePath(FILE_PATH_LITERAL("first")),
- base::string16()},
+ std::u16string()},
FirefoxDetail{base::FilePath(FILE_PATH_LITERAL("second")),
- base::string16()}));
+ std::u16string()}));
default_single_install_unknown_profile.SetString("Install01.Default",
"first");
@@ -241,9 +241,9 @@
EXPECT_THAT(default_multiple_install_details,
UnorderedElementsAre(
FirefoxDetail{base::FilePath(FILE_PATH_LITERAL("first")),
- base::string16()},
+ std::u16string()},
FirefoxDetail{base::FilePath(FILE_PATH_LITERAL("second")),
- base::string16()}));
+ std::u16string()}));
base::DictionaryValue one_of_profiles_is_not_ascii_named;
one_of_profiles_is_not_ascii_named.SetString("Profile0.Path", "first");
diff --git a/chrome/common/importer/imported_bookmark_entry.h b/chrome/common/importer/imported_bookmark_entry.h
index 4e14df1..7496a1cd 100644
--- a/chrome/common/importer/imported_bookmark_entry.h
+++ b/chrome/common/importer/imported_bookmark_entry.h
@@ -22,8 +22,8 @@
bool in_toolbar;
bool is_folder;
GURL url;
- std::vector<base::string16> path;
- base::string16 title;
+ std::vector<std::u16string> path;
+ std::u16string title;
base::Time creation_time;
};
diff --git a/chrome/common/importer/importer_autofill_form_data_entry.h b/chrome/common/importer/importer_autofill_form_data_entry.h
index 005b72b..4e28e6d 100644
--- a/chrome/common/importer/importer_autofill_form_data_entry.h
+++ b/chrome/common/importer/importer_autofill_form_data_entry.h
@@ -17,10 +17,10 @@
~ImporterAutofillFormDataEntry();
// Name of input element.
- base::string16 name;
+ std::u16string name;
// Value of input element.
- base::string16 value;
+ std::u16string value;
// Number of times this name-value pair has been used.
int times_used;
diff --git a/chrome/common/importer/importer_bridge.h b/chrome/common/importer/importer_bridge.h
index ff90cb13d..13e2a84 100644
--- a/chrome/common/importer/importer_bridge.h
+++ b/chrome/common/importer/importer_bridge.h
@@ -28,9 +28,8 @@
public:
ImporterBridge();
- virtual void AddBookmarks(
- const std::vector<ImportedBookmarkEntry>& bookmarks,
- const base::string16& first_folder_name) = 0;
+ virtual void AddBookmarks(const std::vector<ImportedBookmarkEntry>& bookmarks,
+ const std::u16string& first_folder_name) = 0;
virtual void AddHomePage(const GURL& home_page) = 0;
@@ -67,7 +66,7 @@
// this calls the set of strings we've ported over to the external process.
// It's good to avoid having to create a separate ResourceBundle for the
// external import process, since the importer only needs a few strings.
- virtual base::string16 GetLocalizedString(int message_id) = 0;
+ virtual std::u16string GetLocalizedString(int message_id) = 0;
protected:
friend class base::RefCountedThreadSafe<ImporterBridge>;
diff --git a/chrome/common/importer/importer_data_types.h b/chrome/common/importer/importer_data_types.h
index ee901d4..f3963862 100644
--- a/chrome/common/importer/importer_data_types.h
+++ b/chrome/common/importer/importer_data_types.h
@@ -40,7 +40,7 @@
SourceProfile(const SourceProfile& other);
~SourceProfile();
- base::string16 importer_name;
+ std::u16string importer_name;
ImporterType importer_type;
base::FilePath source_path;
base::FilePath app_path;
@@ -48,16 +48,16 @@
// The application locale. Stored because we can only access it from the UI
// thread on the browser process. This is only used by the Firefox importer.
std::string locale;
- base::string16 profile;
+ std::u16string profile;
};
// Contains information needed for importing search engine urls.
struct SearchEngineInfo {
// |url| is a string instead of a GURL since it may not actually be a valid
// GURL directly (e.g. for "http://%s.com").
- base::string16 url;
- base::string16 keyword;
- base::string16 display_name;
+ std::u16string url;
+ std::u16string keyword;
+ std::u16string display_name;
};
// Contains the information read from the IE7/IE8 Storage2 key in the registry.
@@ -68,7 +68,7 @@
ImporterIE7PasswordInfo& operator=(const ImporterIE7PasswordInfo& other);
// Hash of the url.
- base::string16 url_hash;
+ std::u16string url_hash;
// Encrypted data containing the username, password and some more
// undocumented fields.
@@ -98,10 +98,10 @@
std::string signon_realm;
GURL url;
GURL action;
- base::string16 username_element;
- base::string16 username_value;
- base::string16 password_element;
- base::string16 password_value;
+ std::u16string username_element;
+ std::u16string username_value;
+ std::u16string password_element;
+ std::u16string password_value;
bool blocked_by_user = false;
};
diff --git a/chrome/common/importer/importer_url_row.h b/chrome/common/importer/importer_url_row.h
index de92b7a..62847d8 100644
--- a/chrome/common/importer/importer_url_row.h
+++ b/chrome/common/importer/importer_url_row.h
@@ -21,7 +21,7 @@
ImporterURLRow(const ImporterURLRow& other);
GURL url;
- base::string16 title;
+ std::u16string title;
// Total number of times this URL has been visited.
int visit_count;
diff --git a/chrome/common/importer/mock_importer_bridge.h b/chrome/common/importer/mock_importer_bridge.h
index 389b984..c1a976c 100644
--- a/chrome/common/importer/mock_importer_bridge.h
+++ b/chrome/common/importer/mock_importer_bridge.h
@@ -19,7 +19,7 @@
MOCK_METHOD2(AddBookmarks,
void(const std::vector<ImportedBookmarkEntry>&,
- const base::string16&));
+ const std::u16string&));
MOCK_METHOD1(AddHomePage, void(const GURL&));
MOCK_METHOD1(SetFavicons, void(const favicon_base::FaviconUsageDataList&));
MOCK_METHOD2(SetHistoryItems,
@@ -33,7 +33,7 @@
MOCK_METHOD1(NotifyItemStarted, void(importer::ImportItem));
MOCK_METHOD1(NotifyItemEnded, void(importer::ImportItem));
MOCK_METHOD0(NotifyEnded, void());
- MOCK_METHOD1(GetLocalizedString, base::string16(int));
+ MOCK_METHOD1(GetLocalizedString, std::u16string(int));
private:
~MockImporterBridge() override;
diff --git a/chrome/common/importer/profile_import_process_param_traits.h b/chrome/common/importer/profile_import_process_param_traits.h
index 3c0b8f41..6b4e93c 100644
--- a/chrome/common/importer/profile_import_process_param_traits.h
+++ b/chrome/common/importer/profile_import_process_param_traits.h
@@ -69,22 +69,22 @@
return r.action;
}
- static const base::string16& username_element(
+ static const std::u16string& username_element(
const importer::ImportedPasswordForm& r) {
return r.username_element;
}
- static const base::string16& username_value(
+ static const std::u16string& username_value(
const importer::ImportedPasswordForm& r) {
return r.username_value;
}
- static const base::string16& password_element(
+ static const std::u16string& password_element(
const importer::ImportedPasswordForm& r) {
return r.password_element;
}
- static const base::string16& password_value(
+ static const std::u16string& password_value(
const importer::ImportedPasswordForm& r) {
return r.password_value;
}
diff --git a/chrome/common/media/media_resource_provider.cc b/chrome/common/media/media_resource_provider.cc
index 0f9258c..cb6ec96 100644
--- a/chrome/common/media/media_resource_provider.cc
+++ b/chrome/common/media/media_resource_provider.cc
@@ -26,6 +26,6 @@
} // namespace
-base::string16 ChromeMediaLocalizedStringProvider(media::MessageId message_id) {
+std::u16string ChromeMediaLocalizedStringProvider(media::MessageId message_id) {
return l10n_util::GetStringUTF16(MediaMessageIdToGrdId(message_id));
}
diff --git a/chrome/common/media/media_resource_provider.h b/chrome/common/media/media_resource_provider.h
index 2140fcf..a62b261 100644
--- a/chrome/common/media/media_resource_provider.h
+++ b/chrome/common/media/media_resource_provider.h
@@ -11,7 +11,7 @@
#include "media/base/localized_strings.h"
// This is called indirectly by the media layer to access resources.
-base::string16 ChromeMediaLocalizedStringProvider(
+std::u16string ChromeMediaLocalizedStringProvider(
media::MessageId media_message_id);
#endif // CHROME_COMMON_MEDIA_MEDIA_RESOURCE_PROVIDER_H_
diff --git a/chrome/common/net/x509_certificate_model_nss.cc b/chrome/common/net/x509_certificate_model_nss.cc
index 165d6eed..c47c08e 100644
--- a/chrome/common/net/x509_certificate_model_nss.cc
+++ b/chrome/common/net/x509_certificate_model_nss.cc
@@ -320,11 +320,11 @@
std::string ProcessIDN(const std::string& input) {
// Convert the ASCII input to a string16 for ICU.
- base::string16 input16;
+ std::u16string input16;
input16.reserve(input.length());
input16.insert(input16.end(), input.begin(), input.end());
- base::string16 output16 = url_formatter::IDNToUnicode(input);
+ std::u16string output16 = url_formatter::IDNToUnicode(input);
if (input16 == output16)
return input; // Input did not contain any encoded data.
diff --git a/chrome/common/search/instant_types.h b/chrome/common/search/instant_types.h
index 7c5d595..ca0017de 100644
--- a/chrome/common/search/instant_types.h
+++ b/chrome/common/search/instant_types.h
@@ -173,7 +173,7 @@
// The title of the Most Visited page. May be empty, in which case the |url|
// is used as the title.
- base::string16 title;
+ std::u16string title;
// The external URL of the favicon associated with this page.
GURL favicon;
diff --git a/chrome/common/service_process_util_win.cc b/chrome/common/service_process_util_win.cc
index 9442019..1835eae 100644
--- a/chrome/common/service_process_util_win.cc
+++ b/chrome/common/service_process_util_win.cc
@@ -110,7 +110,7 @@
if (size > static_cast<size_t>(std::numeric_limits<int>::max()))
return {};
- base::string16 name = base::ASCIIToUTF16(GetServiceProcessSharedMemName());
+ std::u16string name = base::ASCIIToUTF16(GetServiceProcessSharedMemName());
SECURITY_ATTRIBUTES sa = {sizeof(sa), nullptr, FALSE};
HANDLE raw_handle =
@@ -140,7 +140,7 @@
base::ReadOnlySharedMemoryMapping
ServiceProcessState::OpenServiceProcessDataMapping(size_t size) {
DWORD access = FILE_MAP_READ | SECTION_QUERY;
- base::string16 name = base::ASCIIToUTF16(GetServiceProcessSharedMemName());
+ std::u16string name = base::ASCIIToUTF16(GetServiceProcessSharedMemName());
HANDLE raw_handle = OpenFileMapping(access, false, base::as_wcstr(name));
if (!raw_handle) {
auto err = GetLastError();
diff --git a/chrome/common/time_format_browsertest.cc b/chrome/common/time_format_browsertest.cc
index 899d5c8..02b1692 100644
--- a/chrome/common/time_format_browsertest.cc
+++ b/chrome/common/time_format_browsertest.cc
@@ -37,9 +37,8 @@
// This showed up on the browser on estimated download time, for example.
// http://crbug.com/60476
- base::string16 one_min =
- ui::TimeFormat::Simple(ui::TimeFormat::FORMAT_DURATION,
- ui::TimeFormat::LENGTH_SHORT,
- TimeDelta::FromMinutes(1));
+ std::u16string one_min = ui::TimeFormat::Simple(
+ ui::TimeFormat::FORMAT_DURATION, ui::TimeFormat::LENGTH_SHORT,
+ TimeDelta::FromMinutes(1));
EXPECT_EQ(base::ASCIIToUTF16("1 min"), one_min);
}
diff --git a/chrome/credential_provider/gaiacp/credential_provider_broker_win.cc b/chrome/credential_provider/gaiacp/credential_provider_broker_win.cc
index 3645f32..f8526125 100644
--- a/chrome/credential_provider/gaiacp/credential_provider_broker_win.cc
+++ b/chrome/credential_provider/gaiacp/credential_provider_broker_win.cc
@@ -101,7 +101,7 @@
CredentialProviderBrokerWin::~CredentialProviderBrokerWin() = default;
void CredentialProviderBrokerWin::OpenDevice(
- const base::string16& input_device_path,
+ const std::u16string& input_device_path,
OpenDeviceCallback callback) {
base::win::ScopedDevInfo device_info_set(
SetupDiGetClassDevs(&GUID_DEVINTERFACE_HID, nullptr, nullptr,
diff --git a/chrome/credential_provider/gaiacp/credential_provider_broker_win.h b/chrome/credential_provider/gaiacp/credential_provider_broker_win.h
index ce9f89dc..2673405 100644
--- a/chrome/credential_provider/gaiacp/credential_provider_broker_win.h
+++ b/chrome/credential_provider/gaiacp/credential_provider_broker_win.h
@@ -22,7 +22,7 @@
protected:
// GcpwHidBroker impl:
- void OpenDevice(const base::string16& device_path,
+ void OpenDevice(const std::u16string& device_path,
OpenDeviceCallback callback) override;
};
} // namespace credential_provider
diff --git a/chrome/elevation_service/service_main.h b/chrome/elevation_service/service_main.h
index ea01e138..d762feb 100644
--- a/chrome/elevation_service/service_main.h
+++ b/chrome/elevation_service/service_main.h
@@ -89,7 +89,7 @@
void SignalExit();
// Registers |factory| as the factory for the elevator identified by |id|.
- void RegisterElevatorFactory(const base::string16& id,
+ void RegisterElevatorFactory(const std::u16string& id,
IClassFactory* factory);
// The action routine to be executed.
diff --git a/chrome/renderer/autofill/autofill_renderer_browsertest.cc b/chrome/renderer/autofill/autofill_renderer_browsertest.cc
index 1f85383..a97baca0 100644
--- a/chrome/renderer/autofill/autofill_renderer_browsertest.cc
+++ b/chrome/renderer/autofill/autofill_renderer_browsertest.cc
@@ -190,21 +190,21 @@
expected.id_attribute = ASCIIToUTF16("firstname");
expected.name = expected.id_attribute;
- expected.value = base::string16();
+ expected.value = std::u16string();
expected.form_control_type = "text";
expected.max_length = WebInputElement::DefaultMaxLength();
EXPECT_FORM_FIELD_DATA_EQUALS(expected, forms[0].fields[0]);
expected.id_attribute = ASCIIToUTF16("middlename");
expected.name = expected.id_attribute;
- expected.value = base::string16();
+ expected.value = std::u16string();
expected.form_control_type = "text";
expected.max_length = WebInputElement::DefaultMaxLength();
EXPECT_FORM_FIELD_DATA_EQUALS(expected, forms[0].fields[1]);
expected.id_attribute = ASCIIToUTF16("lastname");
expected.name = expected.id_attribute;
- expected.value = base::string16();
+ expected.value = std::u16string();
expected.form_control_type = "text";
expected.autocomplete_attribute = "off";
expected.max_length = WebInputElement::DefaultMaxLength();
diff --git a/chrome/renderer/autofill/fake_mojo_password_manager_driver.cc b/chrome/renderer/autofill/fake_mojo_password_manager_driver.cc
index 710e810..6521ca32 100644
--- a/chrome/renderer/autofill/fake_mojo_password_manager_driver.cc
+++ b/chrome/renderer/autofill/fake_mojo_password_manager_driver.cc
@@ -59,7 +59,7 @@
void FakeMojoPasswordManagerDriver::UserModifiedNonPasswordField(
autofill::FieldRendererId renderer_id,
- const base::string16& value) {}
+ const std::u16string& value) {}
void FakeMojoPasswordManagerDriver::CheckSafeBrowsingReputation(
const GURL& form_action,
diff --git a/chrome/renderer/autofill/fake_mojo_password_manager_driver.h b/chrome/renderer/autofill/fake_mojo_password_manager_driver.h
index 1da46a1..a27c2f64b 100644
--- a/chrome/renderer/autofill/fake_mojo_password_manager_driver.h
+++ b/chrome/renderer/autofill/fake_mojo_password_manager_driver.h
@@ -38,7 +38,7 @@
MOCK_METHOD4(ShowPasswordSuggestions,
void(base::i18n::TextDirection,
- const base::string16&,
+ const std::u16string&,
int,
const gfx::RectF&));
@@ -99,7 +99,7 @@
return called_save_generation_field_;
}
- const base::Optional<base::string16>& save_generation_field() const {
+ const base::Optional<std::u16string>& save_generation_field() const {
return save_generation_field_;
}
@@ -139,7 +139,7 @@
void UserModifiedPasswordField() override;
void UserModifiedNonPasswordField(autofill::FieldRendererId renderer_id,
- const base::string16& value) override;
+ const std::u16string& value) override;
void CheckSafeBrowsingReputation(const GURL& form_action,
const GURL& frame_url) override;
@@ -176,7 +176,7 @@
// Records whether SaveGenerationFieldDetectedByClassifier() gets called.
bool called_save_generation_field_ = false;
// Records data received via SaveGenerationFieldDetectedByClassifier() call.
- base::Optional<base::string16> save_generation_field_;
+ base::Optional<std::u16string> save_generation_field_;
// Records number of times CheckSafeBrowsingReputation() gets called.
int called_check_safe_browsing_reputation_cnt_ = 0;
diff --git a/chrome/renderer/autofill/fake_password_generation_driver.h b/chrome/renderer/autofill/fake_password_generation_driver.h
index a48e709..a741ff2 100644
--- a/chrome/renderer/autofill/fake_password_generation_driver.h
+++ b/chrome/renderer/autofill/fake_password_generation_driver.h
@@ -38,11 +38,11 @@
void(const gfx::RectF&,
const autofill::FormData&,
autofill::FieldRendererId,
- const base::string16&));
+ const std::u16string&));
MOCK_METHOD0(PasswordGenerationRejectedByTyping, void());
MOCK_METHOD2(PresaveGeneratedPassword,
void(const autofill::FormData& form_data,
- const base::string16& generated_password));
+ const std::u16string& generated_password));
MOCK_METHOD1(PasswordNoLongerGenerated,
void(const autofill::FormData& form_data));
MOCK_METHOD0(FrameWasScrolled, void());
diff --git a/chrome/renderer/autofill/form_autocomplete_browsertest.cc b/chrome/renderer/autofill/form_autocomplete_browsertest.cc
index b389623..684c780f6 100644
--- a/chrome/renderer/autofill/form_autocomplete_browsertest.cc
+++ b/chrome/renderer/autofill/form_autocomplete_browsertest.cc
@@ -767,7 +767,7 @@
WebDocument document = GetMainFrame()->GetDocument();
// Each case tests a different field value with the same suggestion.
- const base::string16 kSuggestion =
+ const std::u16string kSuggestion =
base::ASCIIToUTF16("suggestion@example.com");
struct TestCase {
std::string id;
diff --git a/chrome/renderer/autofill/form_autofill_browsertest.cc b/chrome/renderer/autofill/form_autofill_browsertest.cc
index 5a01f0d60..e4e5abd8c9 100644
--- a/chrome/renderer/autofill/form_autofill_browsertest.cc
+++ b/chrome/renderer/autofill/form_autofill_browsertest.cc
@@ -293,11 +293,11 @@
#endif
void ExpectLabels(const char* html,
- const std::vector<base::string16>& id_attributes,
- const std::vector<base::string16>& name_attributes,
- const std::vector<base::string16>& labels,
- const std::vector<base::string16>& names,
- const std::vector<base::string16>& values) {
+ const std::vector<std::u16string>& id_attributes,
+ const std::vector<std::u16string>& name_attributes,
+ const std::vector<std::u16string>& labels,
+ const std::vector<std::u16string>& names,
+ const std::vector<std::u16string>& values) {
ASSERT_EQ(labels.size(), id_attributes.size());
ASSERT_EQ(labels.size(), name_attributes.size());
ASSERT_EQ(labels.size(), names.size());
@@ -346,23 +346,23 @@
// the name attribute to identify the input fields. Otherwise, this is the
// same text structure as ExpectJohnSmithLabelsAndNameAttributes().
void ExpectJohnSmithLabelsAndIdAttributes(const char* html) {
- std::vector<base::string16> id_attributes, name_attributes, labels, names,
+ std::vector<std::u16string> id_attributes, name_attributes, labels, names,
values;
id_attributes.push_back(ASCIIToUTF16("firstname"));
- name_attributes.push_back(base::string16());
+ name_attributes.push_back(std::u16string());
labels.push_back(ASCIIToUTF16("First name:"));
names.push_back(id_attributes.back());
values.push_back(ASCIIToUTF16("John"));
id_attributes.push_back(ASCIIToUTF16("lastname"));
- name_attributes.push_back(base::string16());
+ name_attributes.push_back(std::u16string());
labels.push_back(ASCIIToUTF16("Last name:"));
names.push_back(id_attributes.back());
values.push_back(ASCIIToUTF16("Smith"));
id_attributes.push_back(ASCIIToUTF16("email"));
- name_attributes.push_back(base::string16());
+ name_attributes.push_back(std::u16string());
labels.push_back(ASCIIToUTF16("Email:"));
names.push_back(id_attributes.back());
values.push_back(ASCIIToUTF16("john@example.com"));
@@ -374,21 +374,21 @@
// the id attribute to identify the input fields. Otherwise, this is the same
// text structure as ExpectJohnSmithLabelsAndIdAttributes().
void ExpectJohnSmithLabelsAndNameAttributes(const char* html) {
- std::vector<base::string16> id_attributes, name_attributes, labels, names,
+ std::vector<std::u16string> id_attributes, name_attributes, labels, names,
values;
- id_attributes.push_back(base::string16());
+ id_attributes.push_back(std::u16string());
name_attributes.push_back(ASCIIToUTF16("firstname"));
labels.push_back(ASCIIToUTF16("First name:"));
names.push_back(name_attributes.back());
values.push_back(ASCIIToUTF16("John"));
- id_attributes.push_back(base::string16());
+ id_attributes.push_back(std::u16string());
name_attributes.push_back(ASCIIToUTF16("lastname"));
labels.push_back(ASCIIToUTF16("Last name:"));
names.push_back(name_attributes.back());
values.push_back(ASCIIToUTF16("Smith"));
- id_attributes.push_back(base::string16());
+ id_attributes.push_back(std::u16string());
name_attributes.push_back(ASCIIToUTF16("email"));
labels.push_back(ASCIIToUTF16("Email:"));
names.push_back(name_attributes.back());
@@ -3155,7 +3155,7 @@
EXPECT_EQ(3U, form.fields.size());
EXPECT_EQ(ASCIIToUTF16("firstname_field"), form.fields[0].css_classes);
EXPECT_EQ(ASCIIToUTF16("lastname_field"), form.fields[1].css_classes);
- EXPECT_EQ(base::string16(), form.fields[2].css_classes);
+ EXPECT_EQ(std::u16string(), form.fields[2].css_classes);
}
// Tests id attributes are set.
@@ -3582,7 +3582,7 @@
// however, current label parsing code will extract the text from the previous
// label element and apply it to the following input field.
TEST_F(FormAutofillTest, InvalidLabels) {
- std::vector<base::string16> id_attributes, name_attributes, labels, names,
+ std::vector<std::u16string> id_attributes, name_attributes, labels, names,
values;
id_attributes.push_back(ASCIIToUTF16(""));
@@ -3738,7 +3738,7 @@
}
TEST_F(FormAutofillTest, LabelsInferredFromTableCellNested) {
- std::vector<base::string16> id_attributes, name_attributes, labels, names,
+ std::vector<std::u16string> id_attributes, name_attributes, labels, names,
values;
id_attributes.push_back(ASCIIToUTF16("firstname"));
@@ -3813,7 +3813,7 @@
}
TEST_F(FormAutofillTest, LabelsInferredFromTableEmptyTDs) {
- std::vector<base::string16> id_attributes, name_attributes, labels, names,
+ std::vector<std::u16string> id_attributes, name_attributes, labels, names,
values;
id_attributes.push_back(ASCIIToUTF16("firstname"));
@@ -3879,7 +3879,7 @@
}
TEST_F(FormAutofillTest, LabelsInferredFromPreviousTD) {
- std::vector<base::string16> id_attributes, name_attributes, labels, names,
+ std::vector<std::u16string> id_attributes, name_attributes, labels, names,
values;
id_attributes.push_back(ASCIIToUTF16("firstname"));
@@ -4115,7 +4115,7 @@
// Verify that we correctly infer labels when the label text spans multiple
// adjacent HTML elements, not separated by whitespace.
TEST_F(FormAutofillTest, LabelsInferredFromTableAdjacentElements) {
- std::vector<base::string16> id_attributes, name_attributes, labels, names,
+ std::vector<std::u16string> id_attributes, name_attributes, labels, names,
values;
id_attributes.push_back(ASCIIToUTF16("firstname"));
@@ -4176,7 +4176,7 @@
// Verify that we correctly infer labels when the label text resides in the
// previous row.
TEST_F(FormAutofillTest, LabelsInferredFromTableRow) {
- std::vector<base::string16> id_attributes, name_attributes, labels, names,
+ std::vector<std::u16string> id_attributes, name_attributes, labels, names,
values;
id_attributes.push_back(ASCIIToUTF16("firstname"));
@@ -4300,7 +4300,7 @@
// Verify that we correctly infer labels when enclosed within a list item.
TEST_F(FormAutofillTest, LabelsInferredFromListItem) {
- std::vector<base::string16> id_attributes, name_attributes, labels, names,
+ std::vector<std::u16string> id_attributes, name_attributes, labels, names,
values;
id_attributes.push_back(ASCIIToUTF16("areacode"));
@@ -4342,7 +4342,7 @@
}
TEST_F(FormAutofillTest, LabelsInferredFromDefinitionList) {
- std::vector<base::string16> id_attributes, name_attributes, labels, names,
+ std::vector<std::u16string> id_attributes, name_attributes, labels, names,
values;
id_attributes.push_back(ASCIIToUTF16("firstname"));
@@ -4412,26 +4412,26 @@
}
TEST_F(FormAutofillTest, LabelsInferredWithSameName) {
- std::vector<base::string16> id_attributes, name_attributes, labels, names,
+ std::vector<std::u16string> id_attributes, name_attributes, labels, names,
values;
id_attributes.push_back(ASCIIToUTF16(""));
name_attributes.push_back(ASCIIToUTF16("Address"));
labels.push_back(ASCIIToUTF16("Address Line 1:"));
names.push_back(name_attributes.back());
- values.push_back(base::string16());
+ values.push_back(std::u16string());
id_attributes.push_back(ASCIIToUTF16(""));
name_attributes.push_back(ASCIIToUTF16("Address"));
labels.push_back(ASCIIToUTF16("Address Line 2:"));
names.push_back(name_attributes.back());
- values.push_back(base::string16());
+ values.push_back(std::u16string());
id_attributes.push_back(ASCIIToUTF16(""));
name_attributes.push_back(ASCIIToUTF16("Address"));
labels.push_back(ASCIIToUTF16("Address Line 3:"));
names.push_back(name_attributes.back());
- values.push_back(base::string16());
+ values.push_back(std::u16string());
ExpectLabels(
"<FORM name='TestForm' action='http://cnn.com' method='post'>"
@@ -4447,38 +4447,38 @@
}
TEST_F(FormAutofillTest, LabelsInferredWithImageTags) {
- std::vector<base::string16> id_attributes, name_attributes, labels, names,
+ std::vector<std::u16string> id_attributes, name_attributes, labels, names,
values;
id_attributes.push_back(ASCIIToUTF16(""));
name_attributes.push_back(ASCIIToUTF16("dayphone1"));
labels.push_back(ASCIIToUTF16("Phone:"));
names.push_back(name_attributes.back());
- values.push_back(base::string16());
+ values.push_back(std::u16string());
id_attributes.push_back(ASCIIToUTF16(""));
name_attributes.push_back(ASCIIToUTF16("dayphone2"));
labels.push_back(ASCIIToUTF16(""));
names.push_back(name_attributes.back());
- values.push_back(base::string16());
+ values.push_back(std::u16string());
id_attributes.push_back(ASCIIToUTF16(""));
name_attributes.push_back(ASCIIToUTF16("dayphone3"));
labels.push_back(ASCIIToUTF16(""));
names.push_back(name_attributes.back());
- values.push_back(base::string16());
+ values.push_back(std::u16string());
id_attributes.push_back(ASCIIToUTF16(""));
name_attributes.push_back(ASCIIToUTF16("dayphone4"));
labels.push_back(ASCIIToUTF16("ext.:"));
names.push_back(name_attributes.back());
- values.push_back(base::string16());
+ values.push_back(std::u16string());
id_attributes.push_back(ASCIIToUTF16(""));
name_attributes.push_back(ASCIIToUTF16("dummy"));
- labels.push_back(base::string16());
+ labels.push_back(std::u16string());
names.push_back(name_attributes.back());
- values.push_back(base::string16());
+ values.push_back(std::u16string());
ExpectLabels(
"<FORM name='TestForm' action='http://cnn.com' method='post'>"
@@ -5131,23 +5131,23 @@
// If we have multiple labels per id, the labels concatenated into label string.
TEST_F(FormAutofillTest, MultipleLabelsPerElement) {
- std::vector<base::string16> id_attributes, name_attributes, labels, names,
+ std::vector<std::u16string> id_attributes, name_attributes, labels, names,
values;
id_attributes.push_back(ASCIIToUTF16("firstname"));
- name_attributes.push_back(base::string16());
+ name_attributes.push_back(std::u16string());
labels.push_back(ASCIIToUTF16("First Name:"));
names.push_back(id_attributes.back());
values.push_back(ASCIIToUTF16("John"));
id_attributes.push_back(ASCIIToUTF16("lastname"));
- name_attributes.push_back(base::string16());
+ name_attributes.push_back(std::u16string());
labels.push_back(ASCIIToUTF16("Last Name:"));
names.push_back(id_attributes.back());
values.push_back(ASCIIToUTF16("Smith"));
id_attributes.push_back(ASCIIToUTF16("email"));
- name_attributes.push_back(base::string16());
+ name_attributes.push_back(std::u16string());
labels.push_back(ASCIIToUTF16("Email: xxx@yyy.com"));
names.push_back(id_attributes.back());
values.push_back(ASCIIToUTF16("john@example.com"));
diff --git a/chrome/renderer/autofill/password_autofill_agent_browsertest.cc b/chrome/renderer/autofill/password_autofill_agent_browsertest.cc
index e27ad01..ab2ee49 100644
--- a/chrome/renderer/autofill/password_autofill_agent_browsertest.cc
+++ b/chrome/renderer/autofill/password_autofill_agent_browsertest.cc
@@ -279,7 +279,7 @@
bool FormHasFieldWithValue(const autofill::FormData& form,
const std::string& value) {
- base::string16 value_16 = ASCIIToUTF16(value);
+ std::u16string value_16 = ASCIIToUTF16(value);
for (const auto& field : form.fields) {
if (field.value == value_16)
return true;
@@ -501,16 +501,16 @@
}
void SimulateSuggestionChoice(WebInputElement& username_input) {
- base::string16 username(ASCIIToUTF16(kAliceUsername));
- base::string16 password(ASCIIToUTF16(kAlicePassword));
+ std::u16string username(ASCIIToUTF16(kAliceUsername));
+ std::u16string password(ASCIIToUTF16(kAlicePassword));
SimulateSuggestionChoiceOfUsernameAndPassword(username_input, username,
password);
}
void SimulateSuggestionChoiceOfUsernameAndPassword(
WebInputElement& input,
- const base::string16& username,
- const base::string16& password) {
+ const std::u16string& username,
+ const std::u16string& password) {
// This call is necessary to setup the autofill agent appropriate for the
// user selection; simulates the menu actually popping up.
SimulatePointClick(gfx::Point(1, 1));
@@ -640,7 +640,7 @@
void ExpectFieldPropertiesMasks(
PasswordFormSourceType expected_type,
- const std::map<base::string16, FieldPropertiesMask>&
+ const std::map<std::u16string, FieldPropertiesMask>&
expected_properties_masks,
autofill::mojom::SubmissionIndicatorEvent expected_submission_event) {
base::RunLoop().RunUntilIdle();
@@ -721,9 +721,9 @@
username_value, password_value, new_password_value, event);
}
- void CheckIfEventsAreCalled(const std::vector<base::string16>& checkers,
+ void CheckIfEventsAreCalled(const std::vector<std::u16string>& checkers,
bool expected) {
- for (const base::string16& variable : checkers) {
+ for (const std::u16string& variable : checkers) {
int value;
EXPECT_TRUE(ExecuteJavaScriptAndReturnIntValue(variable, &value))
<< variable;
@@ -783,15 +783,15 @@
FakeMojoPasswordManagerDriver fake_driver_;
testing::NiceMock<FakePasswordGenerationDriver> fake_pw_client_;
- base::string16 username1_;
- base::string16 username2_;
- base::string16 username3_;
- base::string16 username4_;
- base::string16 password1_;
- base::string16 password2_;
- base::string16 password3_;
- base::string16 alternate_username3_;
- base::string16 password4_;
+ std::u16string username1_;
+ std::u16string username2_;
+ std::u16string username3_;
+ std::u16string username4_;
+ std::u16string password1_;
+ std::u16string password2_;
+ std::u16string password3_;
+ std::u16string alternate_username3_;
+ std::u16string password4_;
PasswordFormFillData fill_data_;
WebInputElement username_element_;
@@ -925,7 +925,7 @@
// read-only field.
TEST_F(PasswordAutofillAgentTest,
AutocompletePasswordForReadonlyUsernamePrefixMatched) {
- base::string16 username_at = username3_ + base::UTF8ToUTF16("@example.com");
+ std::u16string username_at = username3_ + base::UTF8ToUTF16("@example.com");
username_element_.SetValue(WebString::FromUTF16(username_at));
SetElementReadOnly(username_element_, true);
@@ -966,7 +966,7 @@
// of username in read-only field.
TEST_F(PasswordAutofillAgentTest,
DontAutocompletePasswordForReadonlyUsernamePrefixMatched) {
- base::string16 prefilled_username =
+ std::u16string prefilled_username =
username3_ + base::UTF8ToUTF16("example.com");
username_element_.SetValue(WebString::FromUTF16(prefilled_username));
SetElementReadOnly(username_element_, true);
@@ -986,7 +986,7 @@
TEST_F(
PasswordAutofillAgentTest,
DontAutocompletePasswordForNotReadonlyUsernameFieldEvenWhenPrefixMatched) {
- base::string16 prefilled_username =
+ std::u16string prefilled_username =
username3_ + base::UTF8ToUTF16("@example.com");
username_element_.SetValue(WebString::FromUTF16(prefilled_username));
@@ -1321,8 +1321,8 @@
// are filled on page load.
TEST_F(PasswordAutofillAgentTest,
PasswordAutofillTriggersOnChangeEventsOnLoad) {
- std::vector<base::string16> username_event_checkers;
- std::vector<base::string16> password_event_checkers;
+ std::vector<std::u16string> username_event_checkers;
+ std::vector<std::u16string> password_event_checkers;
std::string events_registration_script =
CreateScriptToRegisterListeners(kUsernameName, &username_event_checkers) +
CreateScriptToRegisterListeners(kPasswordName, &password_event_checkers);
@@ -1359,7 +1359,7 @@
// are filled after page load.
TEST_F(PasswordAutofillAgentTest,
PasswordAutofillTriggersOnChangeEventsWaitForUsername) {
- std::vector<base::string16> event_checkers;
+ std::vector<std::u16string> event_checkers;
std::string events_registration_script =
CreateScriptToRegisterListeners(kUsernameName, &event_checkers) +
CreateScriptToRegisterListeners(kPasswordName, &event_checkers);
@@ -2245,7 +2245,7 @@
SaveAndSubmitForm();
- std::map<base::string16, FieldPropertiesMask> expected_properties_masks;
+ std::map<std::u16string, FieldPropertiesMask> expected_properties_masks;
expected_properties_masks[ASCIIToUTF16("random_field")] =
FieldPropertiesFlags::kHadFocus;
expected_properties_masks[ASCIIToUTF16("username")] =
@@ -2289,7 +2289,7 @@
.To<WebFormElement>();
SaveAndSubmitForm(form_element);
- std::map<base::string16, FieldPropertiesMask> expected_properties_masks;
+ std::map<std::u16string, FieldPropertiesMask> expected_properties_masks;
expected_properties_masks[ASCIIToUTF16("new_username")] =
FieldPropertiesFlags::kAutofilledOnPageLoad;
expected_properties_masks[ASCIIToUTF16("new_password")] =
@@ -2316,7 +2316,7 @@
FireAjaxSucceeded();
- std::map<base::string16, FieldPropertiesMask> expected_properties_masks;
+ std::map<std::u16string, FieldPropertiesMask> expected_properties_masks;
expected_properties_masks[ASCIIToUTF16("username")] =
FieldPropertiesFlags::kUserTyped | FieldPropertiesFlags::kHadFocus;
expected_properties_masks[ASCIIToUTF16("password")] =
@@ -2346,7 +2346,7 @@
base::RunLoop().RunUntilIdle();
- std::map<base::string16, FieldPropertiesMask> expected_properties_masks;
+ std::map<std::u16string, FieldPropertiesMask> expected_properties_masks;
expected_properties_masks[ASCIIToUTF16("username")] =
FieldPropertiesFlags::kUserTyped | FieldPropertiesFlags::kHadFocus;
expected_properties_masks[ASCIIToUTF16("password")] =
@@ -2477,7 +2477,7 @@
password_element_.SetAutofillState(WebAutofillState::kNotFilled);
SimulateSuggestionChoiceOfUsernameAndPassword(
- password_element_, base::string16(), ASCIIToUTF16(kAlicePassword));
+ password_element_, std::u16string(), ASCIIToUTF16(kAlicePassword));
CheckSuggestions(std::string(), true);
EXPECT_EQ(ASCIIToUTF16(kAlicePassword), password_element_.Value().Utf16());
EXPECT_TRUE(password_element_.IsAutofilled());
@@ -2502,7 +2502,7 @@
password_element_.SetAutofillState(WebAutofillState::kAutofilled);
SimulateSuggestionChoiceOfUsernameAndPassword(
- password_element_, base::string16(), ASCIIToUTF16(kAlicePassword));
+ password_element_, std::u16string(), ASCIIToUTF16(kAlicePassword));
CheckSuggestions(std::string(), true);
EXPECT_EQ(ASCIIToUTF16(kAlicePassword), password_element_.Value().Utf16());
EXPECT_TRUE(password_element_.IsAutofilled());
@@ -2528,7 +2528,7 @@
password_element_.SetAutofillState(WebAutofillState::kNotFilled);
SimulateSuggestionChoiceOfUsernameAndPassword(
- password_element_, base::string16(), ASCIIToUTF16(kAlicePassword));
+ password_element_, std::u16string(), ASCIIToUTF16(kAlicePassword));
EXPECT_CALL(fake_driver_, ShowPasswordSuggestions).Times(0);
base::RunLoop().RunUntilIdle();
}
@@ -2601,7 +2601,7 @@
// generaiton pop-up. GeneratedPasswordAccepted can't be called without it.
SimulateElementClick(kPasswordName);
- base::string16 password = ASCIIToUTF16("NewPass22");
+ std::u16string password = ASCIIToUTF16("NewPass22");
EXPECT_CALL(fake_pw_client_, PresaveGeneratedPassword(_, Eq(password)));
password_generation_->GeneratedPasswordAccepted(password);
@@ -2621,7 +2621,7 @@
// Simulate the user clicks on a password field, that leads to showing
// generaiton pop-up. GeneratedPasswordAccepted can't be called without it.
SimulateElementClick(kPasswordName);
- base::string16 password = ASCIIToUTF16("NewPass22");
+ std::u16string password = ASCIIToUTF16("NewPass22");
EXPECT_CALL(fake_pw_client_, PresaveGeneratedPassword(_, Eq(password)));
password_generation_->GeneratedPasswordAccepted(password);
diff --git a/chrome/renderer/autofill/password_generation_agent_browsertest.cc b/chrome/renderer/autofill/password_generation_agent_browsertest.cc
index 8856f93..c7f8bbb 100644
--- a/chrome/renderer/autofill/password_generation_agent_browsertest.cc
+++ b/chrome/renderer/autofill/password_generation_agent_browsertest.cc
@@ -182,7 +182,7 @@
void ExpectGenerationElementLostFocus(const char* new_element_id);
void ExpectFormClassifierVoteReceived(
bool received,
- const base::string16& expected_generation_element);
+ const std::u16string& expected_generation_element);
void SelectGenerationFallbackAndExpect(bool available);
void BindPasswordManagerDriver(mojo::ScopedInterfaceEndpointHandle handle);
@@ -303,7 +303,7 @@
void PasswordGenerationAgentTest::ExpectFormClassifierVoteReceived(
bool received,
- const base::string16& expected_generation_element) {
+ const std::u16string& expected_generation_element) {
base::RunLoop().RunUntilIdle();
if (received) {
ASSERT_TRUE(fake_driver_.called_save_generation_field());
@@ -441,7 +441,7 @@
TEST_F(PasswordGenerationAgentTest, FillTest) {
// Add event listeners for password fields.
- std::vector<base::string16> variables_to_check;
+ std::vector<std::u16string> variables_to_check;
std::string events_registration_script =
CreateScriptToRegisterListeners("first_password", &variables_to_check) +
CreateScriptToRegisterListeners("second_password", &variables_to_check);
@@ -470,7 +470,7 @@
EXPECT_TRUE(first_password_element.Value().IsNull());
EXPECT_TRUE(second_password_element.Value().IsNull());
- base::string16 password = base::ASCIIToUTF16("random_password");
+ std::u16string password = base::ASCIIToUTF16("random_password");
EXPECT_CALL(fake_pw_client_, PresaveGeneratedPassword(_, Eq(password)));
password_generation_->GeneratedPasswordAccepted(password);
@@ -482,7 +482,7 @@
EXPECT_TRUE(second_password_element.IsAutofilled());
// Make sure all events are called.
- for (const base::string16& variable : variables_to_check) {
+ for (const std::u16string& variable : variables_to_check) {
int value;
EXPECT_TRUE(ExecuteJavaScriptAndReturnIntValue(variable, &value));
EXPECT_EQ(1, value) << variable;
@@ -511,7 +511,7 @@
ASSERT_FALSE(element.IsNull());
WebInputElement second_password_element = element.To<WebInputElement>();
- base::string16 password = base::ASCIIToUTF16("random_password");
+ std::u16string password = base::ASCIIToUTF16("random_password");
EXPECT_CALL(fake_pw_client_, PresaveGeneratedPassword(_, Eq(password)));
password_generation_->GeneratedPasswordAccepted(password);
@@ -522,7 +522,7 @@
// After editing the first field they are still the same.
std::string edited_password_ascii = "edited_password";
- base::string16 edited_password = base::ASCIIToUTF16(edited_password_ascii);
+ std::u16string edited_password = base::ASCIIToUTF16(edited_password_ascii);
EXPECT_CALL(fake_pw_client_,
PresaveGeneratedPassword(_, Eq(edited_password)));
EXPECT_CALL(fake_pw_client_, ShowPasswordEditingPopup(_, _, _, _));
@@ -545,17 +545,17 @@
EXPECT_CALL(fake_pw_client_, PasswordNoLongerGenerated(_));
EXPECT_CALL(fake_pw_client_, AutomaticGenerationAvailable(_));
SimulateUserInputChangeForElement(&first_password_element, std::string());
- EXPECT_EQ(base::string16(), first_password_element.Value().Utf16());
- EXPECT_EQ(base::string16(), second_password_element.Value().Utf16());
+ EXPECT_EQ(std::u16string(), first_password_element.Value().Utf16());
+ EXPECT_EQ(std::u16string(), second_password_element.Value().Utf16());
EXPECT_FALSE(first_password_element.IsAutofilled());
EXPECT_FALSE(second_password_element.IsAutofilled());
ASSERT_TRUE(fake_driver_.form_data_maybe_submitted().has_value());
EXPECT_THAT(FindFieldById(*fake_driver_.form_data_maybe_submitted(),
"first_password"),
- testing::Field(&FormFieldData::value, base::string16()));
+ testing::Field(&FormFieldData::value, std::u16string()));
EXPECT_THAT(FindFieldById(*fake_driver_.form_data_maybe_submitted(),
"second_password"),
- testing::Field(&FormFieldData::value, base::string16()));
+ testing::Field(&FormFieldData::value, std::u16string()));
}
TEST_F(PasswordGenerationAgentTest, EditingEventsTest) {
@@ -566,7 +566,7 @@
// Generate password.
ExpectAutomaticGenerationAvailable("first_password", kAvailable);
- base::string16 password = base::ASCIIToUTF16("random_password");
+ std::u16string password = base::ASCIIToUTF16("random_password");
EXPECT_CALL(fake_pw_client_, PresaveGeneratedPassword(_, Eq(password)));
password_generation_->GeneratedPasswordAccepted(password);
fake_pw_client_.Flush();
@@ -698,7 +698,7 @@
ExpectAutomaticGenerationAvailable("first_password", kAvailable);
// Generate a new password.
- base::string16 password = base::ASCIIToUTF16("random_password");
+ std::u16string password = base::ASCIIToUTF16("random_password");
EXPECT_CALL(fake_pw_client_, PresaveGeneratedPassword(_, Eq(password)));
password_generation_->GeneratedPasswordAccepted(password);
@@ -736,8 +736,8 @@
element = document.GetElementById(WebString::FromUTF8("second_password"));
ASSERT_FALSE(element.IsNull());
WebInputElement second_password_element = element.To<WebInputElement>();
- EXPECT_NE(base::string16(), first_password_element.Value().Utf16());
- EXPECT_EQ(base::string16(), second_password_element.Value().Utf16());
+ EXPECT_NE(std::u16string(), first_password_element.Value().Utf16());
+ EXPECT_EQ(std::u16string(), second_password_element.Value().Utf16());
}
TEST_F(PasswordGenerationAgentTest, DynamicFormTest) {
@@ -853,7 +853,7 @@
SelectGenerationFallbackAndExpect(true);
// Simulate that the user accepts a generated password.
- base::string16 password = ASCIIToUTF16("random_password");
+ std::u16string password = ASCIIToUTF16("random_password");
EXPECT_CALL(fake_pw_client_, PresaveGeneratedPassword(_, Eq(password)));
password_generation_->GeneratedPasswordAccepted(password);
@@ -888,7 +888,7 @@
SimulateElementRightClick(test_case.generation_element);
SelectGenerationFallbackAndExpect(true);
- base::string16 password = base::ASCIIToUTF16("random_password");
+ std::u16string password = base::ASCIIToUTF16("random_password");
EXPECT_CALL(fake_pw_client_, PresaveGeneratedPassword(_, Eq(password)));
password_generation_->GeneratedPasswordAccepted(password);
base::RunLoop().RunUntilIdle();
@@ -928,7 +928,7 @@
SimulateElementRightClick("first_password");
SelectGenerationFallbackAndExpect(true);
EXPECT_EQ(0, fake_driver_.called_inform_about_user_input_count());
- base::string16 password = base::ASCIIToUTF16("random_password");
+ std::u16string password = base::ASCIIToUTF16("random_password");
EXPECT_CALL(fake_pw_client_, PresaveGeneratedPassword(_, Eq(password)))
.WillOnce(testing::InvokeWithoutArgs([this]() {
// Make sure that generation event was propagated to the browser before
@@ -946,7 +946,7 @@
TEST_F(PasswordGenerationAgentTest, FormClassifierDisabled) {
LoadHTMLWithUserGesture(kSigninFormHTML);
ExpectFormClassifierVoteReceived(false /* vote is not expected */,
- base::string16());
+ std::u16string());
}
TEST_F(PasswordGenerationAgentTest, RevealPassword) {
@@ -961,7 +961,7 @@
const char* kTextFieldId = "username";
ExpectAutomaticGenerationAvailable(kGenerationElementId, kAvailable);
- base::string16 password = base::ASCIIToUTF16("long_pwd");
+ std::u16string password = base::ASCIIToUTF16("long_pwd");
EXPECT_CALL(fake_pw_client_, PresaveGeneratedPassword(_, Eq(password)));
password_generation_->GeneratedPasswordAccepted(password);
@@ -998,7 +998,7 @@
const char kGenerationElementId[] = "first_password";
ExpectAutomaticGenerationAvailable(kGenerationElementId, kAvailable);
- base::string16 password = base::ASCIIToUTF16("long_pwd");
+ std::u16string password = base::ASCIIToUTF16("long_pwd");
EXPECT_CALL(fake_pw_client_, PresaveGeneratedPassword(_, Eq(password)));
password_generation_->GeneratedPasswordAccepted(password);
@@ -1066,7 +1066,7 @@
// Generate a new password.
ExpectAutomaticGenerationAvailable(kGenerationElementId, kAvailable);
- base::string16 password = base::ASCIIToUTF16("random_password");
+ std::u16string password = base::ASCIIToUTF16("random_password");
EXPECT_CALL(fake_pw_client_, PresaveGeneratedPassword(_, Eq(password)));
password_generation_->GeneratedPasswordAccepted(password);
fake_pw_client_.Flush();
@@ -1118,7 +1118,7 @@
// Generate a new password.
ExpectAutomaticGenerationAvailable(kGenerationElementId, kAvailable);
- base::string16 password = base::ASCIIToUTF16("random_password");
+ std::u16string password = base::ASCIIToUTF16("random_password");
EXPECT_CALL(fake_pw_client_, PresaveGeneratedPassword(_, Eq(password)));
password_generation_->GeneratedPasswordAccepted(password);
fake_pw_client_.Flush();
diff --git a/chrome/renderer/autofill/password_generation_test_utils.cc b/chrome/renderer/autofill/password_generation_test_utils.cc
index a79de6bf..9b1bf96c 100644
--- a/chrome/renderer/autofill/password_generation_test_utils.cc
+++ b/chrome/renderer/autofill/password_generation_test_utils.cc
@@ -62,7 +62,7 @@
// |variables_to_check| are set to 1.
std::string CreateScriptToRegisterListeners(
const char* const element_name,
- std::vector<base::string16>* variables_to_check) {
+ std::vector<std::u16string>* variables_to_check) {
DCHECK(variables_to_check);
std::string element = element_name;
diff --git a/chrome/renderer/autofill/password_generation_test_utils.h b/chrome/renderer/autofill/password_generation_test_utils.h
index 06907a5..9f2a687 100644
--- a/chrome/renderer/autofill/password_generation_test_utils.h
+++ b/chrome/renderer/autofill/password_generation_test_utils.h
@@ -28,7 +28,7 @@
std::string CreateScriptToRegisterListeners(
const char* const element_name,
- std::vector<base::string16>* variables_to_check);
+ std::vector<std::u16string>* variables_to_check);
} // namespace autofill
diff --git a/chrome/renderer/cart/commerce_hint_agent_browsertest.cc b/chrome/renderer/cart/commerce_hint_agent_browsertest.cc
index 808ed43..10e7222 100644
--- a/chrome/renderer/cart/commerce_hint_agent_browsertest.cc
+++ b/chrome/renderer/cart/commerce_hint_agent_browsertest.cc
@@ -440,7 +440,7 @@
base::RunLoop run_loop;
profile_manager->CreateProfileAsync(
profile_path2, base::BindRepeating(&UnblockOnProfileCreation, &run_loop),
- base::string16(), std::string());
+ std::u16string(), std::string());
run_loop.Run();
ASSERT_EQ(profile_manager->GetNumberOfProfiles(), 2U);
diff --git a/chrome/renderer/chrome_content_renderer_client.cc b/chrome/renderer/chrome_content_renderer_client.cc
index b7308d6..9c69377 100644
--- a/chrome/renderer/chrome_content_renderer_client.cc
+++ b/chrome/renderer/chrome_content_renderer_client.cc
@@ -800,7 +800,7 @@
const chrome::mojom::PluginInfo& plugin_info) {
const WebPluginInfo& info = plugin_info.plugin;
const std::string& actual_mime_type = plugin_info.actual_mime_type;
- const base::string16& group_name = plugin_info.group_name;
+ const std::u16string& group_name = plugin_info.group_name;
const std::string& identifier = plugin_info.group_identifier;
chrome::mojom::PluginStatus status = plugin_info.status;
GURL url(original_params.url);
@@ -870,7 +870,7 @@
auto create_blocked_plugin = [&render_frame, ¶ms, &info, &identifier,
&group_name](int template_id,
- const base::string16& message) {
+ const std::u16string& message) {
return ChromePluginPlaceholder::CreateBlockedPlugin(
render_frame, params, info, identifier, group_name, template_id,
message);
@@ -1113,7 +1113,7 @@
const content::WebPluginInfo& plugin) {
// Look for the manifest URL among the MIME type's additonal parameters.
const char kNaClPluginManifestAttribute[] = "nacl";
- base::string16 nacl_attr = ASCIIToUTF16(kNaClPluginManifestAttribute);
+ std::u16string nacl_attr = ASCIIToUTF16(kNaClPluginManifestAttribute);
for (size_t i = 0; i < plugin.mime_types.size(); ++i) {
if (plugin.mime_types[i].mime_type == actual_mime_type) {
for (const auto& p : plugin.mime_types[i].additional_params) {
@@ -1423,7 +1423,7 @@
}
bool ChromeContentRendererClient::ShouldReportDetailedMessageForSource(
- const base::string16& source) {
+ const std::u16string& source) {
#if BUILDFLAG(ENABLE_EXTENSIONS)
return extensions::IsSourceFromAnExtension(source);
#else
diff --git a/chrome/renderer/chrome_content_renderer_client.h b/chrome/renderer/chrome_content_renderer_client.h
index 2654e58..0340221d 100644
--- a/chrome/renderer/chrome_content_renderer_client.h
+++ b/chrome/renderer/chrome_content_renderer_client.h
@@ -140,7 +140,7 @@
std::unique_ptr<blink::WebSocketHandshakeThrottleProvider>
CreateWebSocketHandshakeThrottleProvider() override;
bool ShouldReportDetailedMessageForSource(
- const base::string16& source) override;
+ const std::u16string& source) override;
std::unique_ptr<blink::WebContentSettingsClient>
CreateWorkerContentSettingsClient(
content::RenderFrame* render_frame) override;
diff --git a/chrome/renderer/chrome_render_frame_observer.cc b/chrome/renderer/chrome_render_frame_observer.cc
index 77d02bc..0e9fdfd 100644
--- a/chrome/renderer/chrome_render_frame_observer.cc
+++ b/chrome/renderer/chrome_render_frame_observer.cc
@@ -284,7 +284,7 @@
}
void ChromeRenderFrameObserver::ExecuteWebUIJavaScript(
- const base::string16& javascript) {
+ const std::u16string& javascript) {
#if !defined(OS_ANDROID)
webui_javascript_.push_back(javascript);
#endif
@@ -493,7 +493,7 @@
}
DCHECK_GT(capture_max_size, 0U);
- base::string16 contents;
+ std::u16string contents;
{
SCOPED_UMA_HISTOGRAM_TIMER(kTranslateCaptureText);
TRACE_EVENT0("renderer", "ChromeRenderFrameObserver::CapturePageText");
diff --git a/chrome/renderer/chrome_render_frame_observer.h b/chrome/renderer/chrome_render_frame_observer.h
index c049797..9a8910d 100644
--- a/chrome/renderer/chrome_render_frame_observer.h
+++ b/chrome/renderer/chrome_render_frame_observer.h
@@ -81,7 +81,7 @@
// chrome::mojom::ChromeRenderFrame:
void SetWindowFeatures(
blink::mojom::WindowFeaturesPtr window_features) override;
- void ExecuteWebUIJavaScript(const base::string16& javascript) override;
+ void ExecuteWebUIJavaScript(const std::u16string& javascript) override;
void RequestImageForContextNode(
int32_t thumbnail_min_area_pixels,
const gfx::Size& thumbnail_max_size_pixels,
@@ -140,7 +140,7 @@
#if !defined(OS_ANDROID)
// Save the JavaScript to preload if ExecuteWebUIJavaScript is invoked.
- std::vector<base::string16> webui_javascript_;
+ std::vector<std::u16string> webui_javascript_;
#endif
mojo::AssociatedReceiverSet<chrome::mojom::ChromeRenderFrame> receivers_;
diff --git a/chrome/renderer/chrome_render_frame_observer_browsertest.cc b/chrome/renderer/chrome_render_frame_observer_browsertest.cc
index 9c81ead..3a6f7c05 100644
--- a/chrome/renderer/chrome_render_frame_observer_browsertest.cc
+++ b/chrome/renderer/chrome_render_frame_observer_browsertest.cc
@@ -75,7 +75,7 @@
TestOptGuideConsumer() = default;
~TestOptGuideConsumer() override = default;
- base::string16 text() const { return base::StrCat(chunks_); }
+ std::u16string text() const { return base::StrCat(chunks_); }
bool on_chunks_end_called() const { return on_chunks_end_called_; }
size_t num_chunks() const { return chunks_.size(); }
@@ -85,7 +85,7 @@
}
// optimization_guide::mojom::PageTextConsumer:
- void OnTextDumpChunk(const base::string16& chunk) override {
+ void OnTextDumpChunk(const std::u16string& chunk) override {
ASSERT_FALSE(on_chunks_end_called_);
chunks_.push_back(chunk);
}
@@ -94,7 +94,7 @@
private:
mojo::Receiver<optimization_guide::mojom::PageTextConsumer> receiver_{this};
- std::vector<base::string16> chunks_;
+ std::vector<std::u16string> chunks_;
bool on_chunks_end_called_ = false;
};
diff --git a/chrome/renderer/net/available_offline_content_helper.cc b/chrome/renderer/net/available_offline_content_helper.cc
index da091a3..68c724ea 100644
--- a/chrome/renderer/net/available_offline_content_helper.cc
+++ b/chrome/renderer/net/available_offline_content_helper.cc
@@ -34,7 +34,7 @@
// characters. Additionally, javascript needs UTF16 strings. So we instead
// encode to UTF16, and then store that data as base64.
std::string ConvertToUTF16Base64(const std::string& text) {
- base::string16 text_utf16 = base::UTF8ToUTF16(text);
+ std::u16string text_utf16 = base::UTF8ToUTF16(text);
std::string utf16_bytes;
for (char16_t c : text_utf16) {
utf16_bytes.push_back(static_cast<char>(c >> 8));
diff --git a/chrome/renderer/net/net_error_helper.cc b/chrome/renderer/net/net_error_helper.cc
index 24110a6..2441627 100644
--- a/chrome/renderer/net/net_error_helper.cc
+++ b/chrome/renderer/net/net_error_helper.cc
@@ -283,7 +283,7 @@
std::string js = "if (window.updateForDnsProbe) "
"updateForDnsProbe(" + json + ");";
- base::string16 js16;
+ std::u16string js16;
if (base::UTF8ToUTF16(js.c_str(), js.length(), &js16)) {
render_frame()->ExecuteJavaScript(js16);
} else {
@@ -297,7 +297,7 @@
"if (window.initializeEasterEggHighScore) "
"initializeEasterEggHighScore(%i);",
high_score);
- base::string16 js16;
+ std::u16string js16;
if (!base::UTF8ToUTF16(js.c_str(), js.length(), &js16)) {
NOTREACHED();
return;
diff --git a/chrome/renderer/plugins/chrome_plugin_placeholder.cc b/chrome/renderer/plugins/chrome_plugin_placeholder.cc
index 9145b24..0d88823 100644
--- a/chrome/renderer/plugins/chrome_plugin_placeholder.cc
+++ b/chrome/renderer/plugins/chrome_plugin_placeholder.cc
@@ -95,7 +95,7 @@
content::RenderFrame* render_frame,
const blink::WebPluginParams& params,
const std::string& html_data,
- const base::string16& title)
+ const std::u16string& title)
: plugins::LoadablePluginPlaceholder(render_frame, params, html_data),
status_(chrome::mojom::PluginStatus::kAllowed),
title_(title) {
@@ -152,9 +152,9 @@
const blink::WebPluginParams& params,
const content::WebPluginInfo& info,
const std::string& identifier,
- const base::string16& name,
+ const std::u16string& name,
int template_id,
- const base::string16& message) {
+ const std::u16string& message) {
base::DictionaryValue values;
values.SetString("message", message);
values.SetString("name", name);
diff --git a/chrome/renderer/plugins/chrome_plugin_placeholder.h b/chrome/renderer/plugins/chrome_plugin_placeholder.h
index 5db2f5f6..5d60621 100644
--- a/chrome/renderer/plugins/chrome_plugin_placeholder.h
+++ b/chrome/renderer/plugins/chrome_plugin_placeholder.h
@@ -33,9 +33,9 @@
const blink::WebPluginParams& params,
const content::WebPluginInfo& info,
const std::string& identifier,
- const base::string16& name,
+ const std::u16string& name,
int resource_id,
- const base::string16& message);
+ const std::u16string& message);
// Creates a new WebViewPlugin with a MissingPlugin as a delegate.
static ChromePluginPlaceholder* CreateLoadableMissingPlugin(
@@ -55,7 +55,7 @@
ChromePluginPlaceholder(content::RenderFrame* render_frame,
const blink::WebPluginParams& params,
const std::string& html_data,
- const base::string16& title);
+ const std::u16string& title);
~ChromePluginPlaceholder() override;
// content::LoadablePluginPlaceholder overrides.
@@ -92,9 +92,9 @@
chrome::mojom::PluginStatus status_;
- base::string16 title_;
+ std::u16string title_;
- base::string16 plugin_name_;
+ std::u16string plugin_name_;
mojo::Receiver<chrome::mojom::PluginRenderer> plugin_renderer_receiver_{this};
diff --git a/chrome/renderer/safe_browsing/phishing_classifier_browsertest.cc b/chrome/renderer/safe_browsing/phishing_classifier_browsertest.cc
index 7176b58..70cbb50 100644
--- a/chrome/renderer/safe_browsing/phishing_classifier_browsertest.cc
+++ b/chrome/renderer/safe_browsing/phishing_classifier_browsertest.cc
@@ -121,7 +121,7 @@
}
// Helper method to start phishing classification.
- void RunPhishingClassifier(const base::string16* page_text) {
+ void RunPhishingClassifier(const std::u16string* page_text) {
feature_map_.Clear();
classifier_->BeginClassification(
@@ -166,7 +166,7 @@
const std::string url_tld_token_net_;
const std::string page_link_domain_phishing_;
const std::string page_term_login_;
- base::string16 page_text_;
+ std::u16string page_text_;
// Outputs of phishing classifier.
FeatureMap feature_map_;
diff --git a/chrome/renderer/safe_browsing/phishing_classifier_delegate_browsertest.cc b/chrome/renderer/safe_browsing/phishing_classifier_delegate_browsertest.cc
index 9cbce05..c4d0217 100644
--- a/chrome/renderer/safe_browsing/phishing_classifier_delegate_browsertest.cc
+++ b/chrome/renderer/safe_browsing/phishing_classifier_delegate_browsertest.cc
@@ -41,7 +41,7 @@
~MockPhishingClassifier() override {}
- MOCK_METHOD2(BeginClassification, void(const base::string16*, DoneCallback));
+ MOCK_METHOD2(BeginClassification, void(const std::u16string*, DoneCallback));
MOCK_METHOD0(CancelPendingClassification, void());
private:
@@ -120,7 +120,7 @@
Mock::VerifyAndClearExpectations(classifier_);
OnStartPhishingDetection(url);
- base::string16 page_text = ASCIIToUTF16("dummy");
+ std::u16string page_text = ASCIIToUTF16("dummy");
{
InSequence s;
EXPECT_CALL(*classifier_, CancelPendingClassification());
@@ -254,7 +254,7 @@
// Queue up a pending classification, cancel it, then queue up another one.
GURL url("http://host.test");
- base::string16 page_text = ASCIIToUTF16("dummy");
+ std::u16string page_text = ASCIIToUTF16("dummy");
LoadHTMLWithUrlOverride("dummy", url.spec().c_str());
OnStartPhishingDetection(url);
delegate_->PageCaptured(&page_text, false);
@@ -293,7 +293,7 @@
// Queue up a pending classification, cancel it, then queue up another one.
GURL url("http://host.test");
- base::string16 page_text = ASCIIToUTF16("dummy");
+ std::u16string page_text = ASCIIToUTF16("dummy");
LoadHTMLWithUrlOverride("dummy", url.spec().c_str());
OnStartPhishingDetection(url);
delegate_->PageCaptured(&page_text, false);
@@ -335,7 +335,7 @@
LoadHTMLWithUrlOverride("<html><body>phish</body></html>",
url.spec().c_str());
Mock::VerifyAndClearExpectations(classifier_);
- base::string16 page_text = ASCIIToUTF16("phish");
+ std::u16string page_text = ASCIIToUTF16("phish");
EXPECT_CALL(*classifier_, CancelPendingClassification());
delegate_->PageCaptured(&page_text, false);
Mock::VerifyAndClearExpectations(classifier_);
@@ -410,7 +410,7 @@
url.spec().c_str());
Mock::VerifyAndClearExpectations(classifier_);
OnStartPhishingDetection(url);
- base::string16 page_text = ASCIIToUTF16("phish");
+ std::u16string page_text = ASCIIToUTF16("phish");
delegate_->PageCaptured(&page_text, true);
// Once the non-preliminary capture happens, classification should begin.
@@ -440,7 +440,7 @@
url.spec().c_str());
Mock::VerifyAndClearExpectations(classifier_);
OnStartPhishingDetection(url);
- base::string16 page_text = ASCIIToUTF16("phish");
+ std::u16string page_text = ASCIIToUTF16("phish");
{
InSequence s;
EXPECT_CALL(*classifier_, CancelPendingClassification());
@@ -471,7 +471,7 @@
LoadHTMLWithUrlOverride("<html><body>phish</body></html>",
url.spec().c_str());
Mock::VerifyAndClearExpectations(classifier_);
- base::string16 page_text = ASCIIToUTF16("phish");
+ std::u16string page_text = ASCIIToUTF16("phish");
OnStartPhishingDetection(url);
{
InSequence s;
diff --git a/chrome/renderer/searchbox/searchbox.cc b/chrome/renderer/searchbox/searchbox.cc
index 7439d1f0..8511df8 100644
--- a/chrome/renderer/searchbox/searchbox.cc
+++ b/chrome/renderer/searchbox/searchbox.cc
@@ -285,7 +285,7 @@
return base::OptionalOrNullptr(theme_);
}
-void SearchBox::Paste(const base::string16& text) {
+void SearchBox::Paste(const std::u16string& text) {
embedded_search_service_->PasteAndOpenDropdown(page_seq_no_, text);
}
@@ -438,7 +438,7 @@
embedded_search_service_->ConfirmThemeChanges();
}
-void SearchBox::QueryAutocomplete(const base::string16& input,
+void SearchBox::QueryAutocomplete(const std::u16string& input,
bool prevent_inline_autocomplete) {
embedded_search_service_->QueryAutocomplete(input,
prevent_inline_autocomplete);
diff --git a/chrome/renderer/searchbox/searchbox.h b/chrome/renderer/searchbox/searchbox.h
index cf274ef..4cb0f1a 100644
--- a/chrome/renderer/searchbox/searchbox.h
+++ b/chrome/renderer/searchbox/searchbox.h
@@ -93,7 +93,7 @@
InstantMostVisitedItem* item) const;
// Sends PasteAndOpenDropdown to the browser.
- void Paste(const base::string16& text);
+ void Paste(const std::u16string& text);
// Will return null if the theme info hasn't been set yet.
const NtpTheme* GetNtpTheme() const;
@@ -194,7 +194,7 @@
// search term. |prevent_inline_autocomplete| is true if the result set should
// not require inline autocomplete for the default match. Handled by
// |QueryAutocompleteResult|.
- void QueryAutocomplete(const base::string16& input,
+ void QueryAutocomplete(const std::u16string& input,
bool prevent_inline_autocomplete);
// Deletes |AutocompleteMatch| by index of the result.
diff --git a/chrome/renderer/searchbox/searchbox_extension.cc b/chrome/renderer/searchbox/searchbox_extension.cc
index cb6c34b7..ce3245b 100644
--- a/chrome/renderer/searchbox/searchbox_extension.cc
+++ b/chrome/renderer/searchbox/searchbox_extension.cc
@@ -641,7 +641,7 @@
// Handlers for JS functions.
static void DeleteAutocompleteMatch(int line);
static void Paste(const std::string& text);
- static void QueryAutocomplete(const base::string16& input,
+ static void QueryAutocomplete(const std::u16string& input,
bool prevent_inline_autocomplete);
static void StopAutocomplete(bool clear_result);
static void LogCharTypedToRepaintLatency(uint32_t latency_ms);
@@ -757,7 +757,7 @@
}
// static
-void SearchBoxBindings::QueryAutocomplete(const base::string16& input,
+void SearchBoxBindings::QueryAutocomplete(const std::u16string& input,
bool prevent_inline_autocomplete) {
SearchBox* search_box = GetSearchBoxForCurrentContext();
if (!search_box)
@@ -1141,7 +1141,7 @@
// Limit the title to |kMaxCustomLinkTitleLength| characters. If truncated,
// adds an ellipsis.
- base::string16 truncated_title =
+ std::u16string truncated_title =
gfx::TruncateString(base::UTF8ToUTF16(title), kMaxCustomLinkTitleLength,
gfx::CHARACTER_BREAK);
diff --git a/chrome/renderer/searchbox/searchbox_extension.h b/chrome/renderer/searchbox/searchbox_extension.h
index 5a836ff..e96830a 100644
--- a/chrome/renderer/searchbox/searchbox_extension.h
+++ b/chrome/renderer/searchbox/searchbox_extension.h
@@ -29,7 +29,7 @@
// Helpers to dispatch Javascript events.
static void DispatchChromeIdentityCheckResult(blink::WebLocalFrame* frame,
- const base::string16& identity,
+ const std::u16string& identity,
bool identity_match);
static void DispatchFocusChange(blink::WebLocalFrame* frame);
static void DispatchAddCustomLinkResult(blink::WebLocalFrame* frame,
diff --git a/chrome/service/cloud_print/cloud_print_connector.cc b/chrome/service/cloud_print/cloud_print_connector.cc
index 0d13a95..6b1fe40 100644
--- a/chrome/service/cloud_print/cloud_print_connector.cc
+++ b/chrome/service/cloud_print/cloud_print_connector.cc
@@ -609,7 +609,7 @@
LOG(ERROR) << "CP_CONNECTOR: Failed to get printer info"
<< ", printer name: " << printer_name;
// This printer failed to register, notify the server of this failure.
- base::string16 printer_name_utf16 = base::UTF8ToUTF16(printer_name);
+ std::u16string printer_name_utf16 = base::UTF8ToUTF16(printer_name);
std::string status_message = l10n_util::GetStringFUTF8(
IDS_CLOUD_PRINT_REGISTER_PRINTER_FAILED,
printer_name_utf16,
diff --git a/chrome/service/cloud_print/print_system_win.cc b/chrome/service/cloud_print/print_system_win.cc
index 3e1ac48..77c7ec607 100644
--- a/chrome/service/cloud_print/print_system_win.cc
+++ b/chrome/service/cloud_print/print_system_win.cc
@@ -293,7 +293,7 @@
}
DOCINFO di = {0};
di.cbSize = sizeof(DOCINFO);
- base::string16 doc_name = base::UTF8ToUTF16(job_title);
+ std::u16string doc_name = base::UTF8ToUTF16(job_title);
DCHECK(printing::SimplifyDocumentTitle(doc_name) == doc_name);
di.lpszDocName = base::as_wcstr(doc_name);
job_id_ = StartDoc(dc, &di);
diff --git a/chrome/service/cloud_print/printer_job_handler.cc b/chrome/service/cloud_print/printer_job_handler.cc
index f38a0630..9a84cad 100644
--- a/chrome/service/cloud_print/printer_job_handler.cc
+++ b/chrome/service/cloud_print/printer_job_handler.cc
@@ -769,7 +769,7 @@
base::Time::Now() - job_start_time_);
DCHECK(job_spooler_.get());
- base::string16 document_name =
+ std::u16string document_name =
job_details.job_title_.empty()
? l10n_util::GetStringUTF16(IDS_DEFAULT_PRINT_DOCUMENT_TITLE)
: base::UTF8ToUTF16(job_details.job_title_);
diff --git a/chrome/service/service_process.cc b/chrome/service/service_process.cc
index d9ccd40..92e0179 100644
--- a/chrome/service/service_process.cc
+++ b/chrome/service/service_process.cc
@@ -114,10 +114,10 @@
// The encoding we use for the info is "title|context|direction" where
// direction is either env_vars::kRtlLocale or env_vars::kLtrLocale depending
// on the current locale.
- base::string16 dlg_strings(
+ std::u16string dlg_strings(
l10n_util::GetStringUTF16(IDS_CRASH_RECOVERY_TITLE));
dlg_strings.push_back('|');
- base::string16 adjusted_string(l10n_util::GetStringFUTF16(
+ std::u16string adjusted_string(l10n_util::GetStringFUTF16(
IDS_SERVICE_CRASH_RECOVERY_CONTENT,
l10n_util::GetStringUTF16(IDS_GOOGLE_CLOUD_PRINT)));
base::i18n::AdjustStringForLocaleDirection(&adjusted_string);
diff --git a/chrome/service/service_utility_process_host.cc b/chrome/service/service_utility_process_host.cc
index e1b9c0fe..4993b897 100644
--- a/chrome/service/service_utility_process_host.cc
+++ b/chrome/service/service_utility_process_host.cc
@@ -113,7 +113,7 @@
// mojom::PdfToEmfConverterClient:
void PreCacheFontCharacters(
const std::vector<uint8_t>& logfont_data,
- const base::string16& characters,
+ const std::u16string& characters,
PreCacheFontCharactersCallback callback) override {
std::move(callback).Run();
}
diff --git a/chrome/services/mac_notifications/public/cpp/notification_category_manager.h b/chrome/services/mac_notifications/public/cpp/notification_category_manager.h
index 4676290..7de6ef6f 100644
--- a/chrome/services/mac_notifications/public/cpp/notification_category_manager.h
+++ b/chrome/services/mac_notifications/public/cpp/notification_category_manager.h
@@ -25,7 +25,7 @@
// buttons.
class API_AVAILABLE(macos(10.14)) NotificationCategoryManager {
public:
- using Buttons = std::vector<base::string16>;
+ using Buttons = std::vector<std::u16string>;
explicit NotificationCategoryManager(
UNUserNotificationCenter* notification_center);
diff --git a/chrome/services/util_win/public/mojom/util_win_mojom_traits.cc b/chrome/services/util_win/public/mojom/util_win_mojom_traits.cc
index c859760a..bc1ef7b 100644
--- a/chrome/services/util_win/public/mojom/util_win_mojom_traits.cc
+++ b/chrome/services/util_win/public/mojom/util_win_mojom_traits.cc
@@ -106,31 +106,31 @@
}
// static
-const base::string16& StructTraits<
+const std::u16string& StructTraits<
chrome::mojom::InspectionResultDataView,
ModuleInspectionResult>::location(const ModuleInspectionResult& input) {
return input.location;
}
// static
-const base::string16& StructTraits<
+const std::u16string& StructTraits<
chrome::mojom::InspectionResultDataView,
ModuleInspectionResult>::basename(const ModuleInspectionResult& input) {
return input.basename;
}
// static
-const base::string16& StructTraits<
+const std::u16string& StructTraits<
chrome::mojom::InspectionResultDataView,
ModuleInspectionResult>::product_name(const ModuleInspectionResult& input) {
return input.product_name;
}
// static
-const base::string16& StructTraits<
+const std::u16string& StructTraits<
chrome::mojom::InspectionResultDataView,
ModuleInspectionResult>::description(const ModuleInspectionResult& input) {
return input.description;
}
// static
-const base::string16& StructTraits<
+const std::u16string& StructTraits<
chrome::mojom::InspectionResultDataView,
ModuleInspectionResult>::version(const ModuleInspectionResult& input) {
return input.version;
@@ -150,7 +150,7 @@
return input.certificate_info.path;
}
// static
-const base::string16&
+const std::u16string&
StructTraits<chrome::mojom::InspectionResultDataView, ModuleInspectionResult>::
certificate_subject(const ModuleInspectionResult& input) {
return input.certificate_info.subject;
diff --git a/chrome/services/util_win/public/mojom/util_win_mojom_traits.h b/chrome/services/util_win/public/mojom/util_win_mojom_traits.h
index db723c3..2f61722 100644
--- a/chrome/services/util_win/public/mojom/util_win_mojom_traits.h
+++ b/chrome/services/util_win/public/mojom/util_win_mojom_traits.h
@@ -36,17 +36,17 @@
template <>
struct StructTraits<chrome::mojom::InspectionResultDataView,
ModuleInspectionResult> {
- static const base::string16& location(const ModuleInspectionResult& input);
- static const base::string16& basename(const ModuleInspectionResult& input);
- static const base::string16& product_name(
+ static const std::u16string& location(const ModuleInspectionResult& input);
+ static const std::u16string& basename(const ModuleInspectionResult& input);
+ static const std::u16string& product_name(
const ModuleInspectionResult& input);
- static const base::string16& description(const ModuleInspectionResult& input);
- static const base::string16& version(const ModuleInspectionResult& input);
+ static const std::u16string& description(const ModuleInspectionResult& input);
+ static const std::u16string& version(const ModuleInspectionResult& input);
static chrome::mojom::CertificateType certificate_type(
const ModuleInspectionResult& input);
static const base::FilePath& certificate_path(
const ModuleInspectionResult& input);
- static const base::string16& certificate_subject(
+ static const std::u16string& certificate_subject(
const ModuleInspectionResult& input);
static bool Read(chrome::mojom::InspectionResultDataView data,
@@ -55,10 +55,10 @@
template <>
struct StructTraits<chrome::mojom::FileFilterSpecDataView, ui::FileFilterSpec> {
- static const base::string16& description(const ui::FileFilterSpec& input) {
+ static const std::u16string& description(const ui::FileFilterSpec& input) {
return input.description;
}
- static const base::string16& extension_spec(const ui::FileFilterSpec& input) {
+ static const std::u16string& extension_spec(const ui::FileFilterSpec& input) {
return input.extension_spec;
}
diff --git a/chrome/services/util_win/util_win_impl.cc b/chrome/services/util_win/util_win_impl.cc
index 4ae0926..d2ca113c 100644
--- a/chrome/services/util_win/util_win_impl.cc
+++ b/chrome/services/util_win/util_win_impl.cc
@@ -248,11 +248,11 @@
void UtilWinImpl::CallExecuteSelectFile(
ui::SelectFileDialog::Type type,
uint32_t owner,
- const base::string16& title,
+ const std::u16string& title,
const base::FilePath& default_path,
const std::vector<ui::FileFilterSpec>& filter,
int32_t file_type_index,
- const base::string16& default_extension,
+ const std::u16string& default_extension,
CallExecuteSelectFileCallback callback) {
base::win::ScopedCOMInitializer scoped_com_initializer;
diff --git a/chrome/services/util_win/util_win_impl.h b/chrome/services/util_win/util_win_impl.h
index 4dd251e..7753ac6 100644
--- a/chrome/services/util_win/util_win_impl.h
+++ b/chrome/services/util_win/util_win_impl.h
@@ -26,11 +26,11 @@
void IsPinnedToTaskbar(IsPinnedToTaskbarCallback callback) override;
void CallExecuteSelectFile(ui::SelectFileDialog::Type type,
uint32_t owner,
- const base::string16& title,
+ const std::u16string& title,
const base::FilePath& default_path,
const std::vector<ui::FileFilterSpec>& filter,
int32_t file_type_index,
- const base::string16& default_extension,
+ const std::u16string& default_extension,
CallExecuteSelectFileCallback callback) override;
void InspectModule(const base::FilePath& module_path,
InspectModuleCallback callback) override;
diff --git a/chrome/test/base/browser_with_test_window_test.cc b/chrome/test/base/browser_with_test_window_test.cc
index ef2797a5..b3c481a 100644
--- a/chrome/test/base/browser_with_test_window_test.cc
+++ b/chrome/test/base/browser_with_test_window_test.cc
@@ -166,7 +166,7 @@
void BrowserWithTestWindowTest::NavigateAndCommitActiveTabWithTitle(
Browser* navigating_browser,
const GURL& url,
- const base::string16& title) {
+ const std::u16string& title) {
WebContents* contents =
navigating_browser->tab_strip_model()->GetActiveWebContents();
NavigationController* controller = &contents->GetController();
@@ -176,7 +176,7 @@
TestingProfile* BrowserWithTestWindowTest::CreateProfile() {
return profile_manager_->CreateTestingProfile(
- "testing_profile", nullptr, base::string16(), 0, std::string(),
+ "testing_profile", nullptr, std::u16string(), 0, std::string(),
GetTestingFactories());
}
diff --git a/chrome/test/base/browser_with_test_window_test.h b/chrome/test/base/browser_with_test_window_test.h
index b43da6d..0482e96 100644
--- a/chrome/test/base/browser_with_test_window_test.h
+++ b/chrome/test/base/browser_with_test_window_test.h
@@ -165,7 +165,7 @@
// Set the |title| of the current tab.
void NavigateAndCommitActiveTabWithTitle(Browser* browser,
const GURL& url,
- const base::string16& title);
+ const std::u16string& title);
// Creates the profile used by this test. The caller doesn't own the return
// value.
diff --git a/chrome/test/base/extension_js_browser_test.cc b/chrome/test/base/extension_js_browser_test.cc
index 8e985fd..36ce921 100644
--- a/chrome/test/base/extension_js_browser_test.cc
+++ b/chrome/test/base/extension_js_browser_test.cc
@@ -33,7 +33,7 @@
std::vector<base::Value> args;
args.push_back(base::Value(test_fixture));
args.push_back(base::Value(test_name));
- std::vector<base::string16> scripts;
+ std::vector<std::u16string> scripts;
base::Value test_runner_params(base::Value::Type::DICTIONARY);
if (embedded_test_server()->Started()) {
@@ -53,7 +53,7 @@
scripts.push_back(
BuildRunTestJSCall(is_async, "RUN_TEST_F", std::move(args)));
- base::string16 script_16 =
+ std::u16string script_16 =
base::JoinString(scripts, base::ASCIIToUTF16("\n"));
std::string script = base::UTF16ToUTF8(script_16);
diff --git a/chrome/test/base/in_process_browser_test.cc b/chrome/test/base/in_process_browser_test.cc
index c4118fc..449b541 100644
--- a/chrome/test/base/in_process_browser_test.cc
+++ b/chrome/test/base/in_process_browser_test.cc
@@ -525,7 +525,7 @@
base::RunLoop run_loop;
profile_manager->CreateProfileAsync(
guest_path, base::BindRepeating(&UnblockOnProfileCreation, &run_loop),
- base::string16(), std::string());
+ std::u16string(), std::string());
run_loop.Run();
Profile* profile = profile_manager->GetProfileByPath(guest_path);
diff --git a/chrome/test/base/javascript_browser_test.cc b/chrome/test/base/javascript_browser_test.cc
index 06f1f8b..7269b7a 100644
--- a/chrome/test/base/javascript_browser_test.cc
+++ b/chrome/test/base/javascript_browser_test.cc
@@ -55,7 +55,7 @@
// TODO(dtseng): Make this return bool (success/failure) and remove ASSERt_TRUE
// calls.
void JavaScriptBrowserTest::BuildJavascriptLibraries(
- std::vector<base::string16>* libraries) {
+ std::vector<std::u16string>* libraries) {
base::ScopedAllowBlockingForTesting allow_blocking;
ASSERT_TRUE(libraries != NULL);
std::vector<base::FilePath>::iterator user_libraries_iterator;
@@ -95,7 +95,7 @@
}
}
-base::string16 JavaScriptBrowserTest::BuildRunTestJSCall(
+std::u16string JavaScriptBrowserTest::BuildRunTestJSCall(
bool is_async,
const std::string& function_name,
std::vector<base::Value> test_func_args) {
diff --git a/chrome/test/base/javascript_browser_test.h b/chrome/test/base/javascript_browser_test.h
index 9d329ce6..11b557d 100644
--- a/chrome/test/base/javascript_browser_test.h
+++ b/chrome/test/base/javascript_browser_test.h
@@ -32,13 +32,13 @@
// Builds a vector of strings of all added javascript libraries suitable for
// execution by subclasses.
- void BuildJavascriptLibraries(std::vector<base::string16>* libraries);
+ void BuildJavascriptLibraries(std::vector<std::u16string>* libraries);
// Builds a string with a call to the runTest JS function, passing the
// given |is_async|, |test_name| and its |args|.
// This is then suitable for execution by subclasses in a
// |RunJavaScriptBrowserTestF| call.
- base::string16 BuildRunTestJSCall(bool is_async,
+ std::u16string BuildRunTestJSCall(bool is_async,
const std::string& test_name,
std::vector<base::Value> args);
diff --git a/chrome/test/base/test_browser_window.h b/chrome/test/base/test_browser_window.h
index 10438e07..6c4877e1 100644
--- a/chrome/test/base/test_browser_window.h
+++ b/chrome/test/base/test_browser_window.h
@@ -157,7 +157,7 @@
bool is_user_gesture) override;
#if BUILDFLAG(ENABLE_ONE_CLICK_SIGNIN)
void ShowOneClickSigninConfirmation(
- const base::string16& email,
+ const std::u16string& email,
base::OnceCallback<void(bool)> confirmed_callback) override {}
#endif
bool IsDownloadShelfVisible() const override;
diff --git a/chrome/test/base/testing_profile_manager.cc b/chrome/test/base/testing_profile_manager.cc
index 5bc1c2a..9188191 100644
--- a/chrome/test/base/testing_profile_manager.cc
+++ b/chrome/test/base/testing_profile_manager.cc
@@ -76,7 +76,7 @@
TestingProfile* TestingProfileManager::CreateTestingProfile(
const std::string& profile_name,
std::unique_ptr<sync_preferences::PrefServiceSyncable> prefs,
- const base::string16& user_name,
+ const std::u16string& user_name,
int avatar_id,
const std::string& supervised_user_id,
TestingProfile::TestingFactories testing_factories,
diff --git a/chrome/test/base/testing_profile_manager.h b/chrome/test/base/testing_profile_manager.h
index 3e1d76a0..c7ff888 100644
--- a/chrome/test/base/testing_profile_manager.h
+++ b/chrome/test/base/testing_profile_manager.h
@@ -64,7 +64,7 @@
TestingProfile* CreateTestingProfile(
const std::string& profile_name,
std::unique_ptr<sync_preferences::PrefServiceSyncable> prefs,
- const base::string16& user_name,
+ const std::u16string& user_name,
int avatar_id,
const std::string& supervised_user_id,
TestingProfile::TestingFactories testing_factories,
diff --git a/chrome/test/base/ui_test_utils.cc b/chrome/test/base/ui_test_utils.cc
index 4ea109f0..5cf2bdb 100644
--- a/chrome/test/base/ui_test_utils.cc
+++ b/chrome/test/base/ui_test_utils.cc
@@ -188,7 +188,7 @@
} // namespace
-bool GetCurrentTabTitle(const Browser* browser, base::string16* title) {
+bool GetCurrentTabTitle(const Browser* browser, std::u16string* title) {
WebContents* web_contents =
browser->tab_strip_model()->GetActiveWebContents();
if (!web_contents)
@@ -387,7 +387,7 @@
#endif
int FindInPage(WebContents* tab,
- const base::string16& search_string,
+ const std::u16string& search_string,
bool forward,
bool match_case,
int* ordinal,
@@ -507,7 +507,7 @@
HistoryServiceFactory::GetForProfile(profile,
ServiceAccessType::EXPLICIT_ACCESS)
->QueryHistory(
- base::string16(), history::QueryOptions(),
+ std::u16string(), history::QueryOptions(),
base::BindLambdaForTesting([&](history::QueryResults results) {
for (const auto& item : results)
urls_.push_back(item.url());
diff --git a/chrome/test/base/ui_test_utils.h b/chrome/test/base/ui_test_utils.h
index 44491bc..62b544b 100644
--- a/chrome/test/base/ui_test_utils.h
+++ b/chrome/test/base/ui_test_utils.h
@@ -79,7 +79,7 @@
};
// Puts the current tab title in |title|. Returns true on success.
-bool GetCurrentTabTitle(const Browser* browser, base::string16* title);
+bool GetCurrentTabTitle(const Browser* browser, std::u16string* title);
// NavigateToURL* functions navigate the given |browser| to |url| according the
// provided parameters and block until ready (by default - until loading stops,
@@ -168,7 +168,7 @@
// of the current match. |selection_rect| is an optional parameter which is set
// to the location of the current match.
int FindInPage(content::WebContents* tab,
- const base::string16& search_string,
+ const std::u16string& search_string,
bool forward,
bool case_sensitive,
int* ordinal,
diff --git a/chrome/test/base/web_ui_browser_test.cc b/chrome/test/base/web_ui_browser_test.cc
index 5f96246..947ed2f5 100644
--- a/chrome/test/base/web_ui_browser_test.cc
+++ b/chrome/test/base/web_ui_browser_test.cc
@@ -495,8 +495,8 @@
// Get the user libraries. Preloading them individually is best, then
// we can assign each one a filename for better stack traces. Otherwise
// append them all to |content|.
- base::string16 content;
- std::vector<base::string16> libraries;
+ std::u16string content;
+ std::vector<std::u16string> libraries;
if (!libraries_preloaded_) {
BuildJavascriptLibraries(&libraries);
if (!preload_frame) {
@@ -506,7 +506,7 @@
}
if (!function_name.empty()) {
- base::string16 called_function;
+ std::u16string called_function;
if (is_test) {
called_function = BuildRunTestJSCall(is_async, function_name,
std::move(function_arguments));
@@ -525,7 +525,7 @@
bool result = true;
- for (const base::string16& library : libraries)
+ for (const std::u16string& library : libraries)
test_handler_->PreloadJavaScript(library, preload_frame);
if (is_test)
diff --git a/chrome/test/chromedriver/key_converter.cc b/chrome/test/chromedriver/key_converter.cc
index b1cf57c3..bf4347a 100644
--- a/chrome/test/chromedriver/key_converter.cc
+++ b/chrome/test/chromedriver/key_converter.cc
@@ -186,7 +186,7 @@
bool KeyCodeFromShorthandKey(char16_t key_utf16,
ui::KeyboardCode* key_code,
bool* client_should_skip) {
- base::string16 key_str_utf16;
+ std::u16string key_str_utf16;
key_str_utf16.push_back(key_utf16);
std::string key_str_utf8 = base::UTF16ToUTF8(key_str_utf16);
if (key_str_utf8.length() != 1)
@@ -447,13 +447,13 @@
} // namespace
-Status ConvertKeysToKeyEvents(const base::string16& client_keys,
+Status ConvertKeysToKeyEvents(const std::u16string& client_keys,
bool release_modifiers,
int* modifiers,
std::vector<KeyEvent>* client_key_events) {
std::vector<KeyEvent> key_events;
- base::string16 keys = client_keys;
+ std::u16string keys = client_keys;
// Add an implicit NULL character to the end of the input to depress all
// modifiers.
if (release_modifiers)
diff --git a/chrome/test/chromedriver/key_converter.h b/chrome/test/chromedriver/key_converter.h
index d525a02..4bcfed4 100644
--- a/chrome/test/chromedriver/key_converter.h
+++ b/chrome/test/chromedriver/key_converter.h
@@ -20,7 +20,7 @@
// an error message. If |release_modifiers| is true, all modifiers would be
// depressed. |modifiers| acts both an input and an output, however, only when
// the conversion process is successful will |modifiers| be changed.
-Status ConvertKeysToKeyEvents(const base::string16& keys,
+Status ConvertKeysToKeyEvents(const std::u16string& keys,
bool release_modifiers,
int* modifiers,
std::vector<KeyEvent>* key_events);
diff --git a/chrome/test/chromedriver/key_converter_unittest.cc b/chrome/test/chromedriver/key_converter_unittest.cc
index 3f8e486..1a8976cb 100644
--- a/chrome/test/chromedriver/key_converter_unittest.cc
+++ b/chrome/test/chromedriver/key_converter_unittest.cc
@@ -18,7 +18,7 @@
namespace {
-void CheckEvents(const base::string16& keys,
+void CheckEvents(const std::u16string& keys,
const std::vector<KeyEvent>& expected_events,
bool release_modifiers,
int expected_modifiers) {
@@ -42,7 +42,7 @@
EXPECT_EQ(expected_modifiers, modifiers);
}
-void CheckEventsReleaseModifiers(const base::string16& keys,
+void CheckEventsReleaseModifiers(const std::u16string& keys,
const std::vector<KeyEvent>& expected_events) {
CheckEvents(keys, expected_events, true /* release_modifier */,
0 /* expected_modifiers */);
@@ -130,7 +130,7 @@
KeyEventBuilder builder;
std::vector<KeyEvent> key_events;
builder.SetKeyCode(ui::VKEY_SPACE)->SetText(" ", " ")->Generate(&key_events);
- base::string16 keys;
+ std::u16string keys;
keys.push_back(static_cast<char16_t>(0xE00DU));
CheckEventsReleaseModifiers(keys, key_events);
}
@@ -139,7 +139,7 @@
KeyEventBuilder builder;
std::vector<KeyEvent> key_events;
builder.SetKeyCode(ui::VKEY_F1)->Generate(&key_events);
- base::string16 keys;
+ std::u16string keys;
keys.push_back(static_cast<char16_t>(0xE031U));
CheckEventsReleaseModifiers(keys, key_events);
}
@@ -223,7 +223,7 @@
builder.SetKeyCode(ui::VKEY_C)->SetText("c", "C")->Generate(&key_events);
key_events.push_back(
shift_builder.SetType(kKeyUpEventType)->SetModifiers(0)->Build());
- base::string16 keys;
+ std::u16string keys;
keys.push_back(static_cast<char16_t>(0xE008U));
keys.append(base::UTF8ToUTF16("aBc"));
CheckEventsReleaseModifiers(keys, key_events);
@@ -256,7 +256,7 @@
->Build());
key_events.push_back(
builder.SetType(kKeyUpEventType)->SetModifiers(0)->Build());
- base::string16 keys;
+ std::u16string keys;
keys.push_back(static_cast<char16_t>(0xE008U));
keys.push_back(static_cast<char16_t>(0xE008U));
keys.push_back(static_cast<char16_t>(0xE009U));
@@ -305,7 +305,7 @@
TEST(KeyConverter, MAYBE_AllEnglishKeyboardSymbols) {
ui::ScopedKeyboardLayout keyboard_layout(ui::KEYBOARD_LAYOUT_ENGLISH_US);
- base::string16 keys;
+ std::u16string keys;
const ui::KeyboardCode kSymbolKeyCodes[] = {
ui::VKEY_OEM_3,
ui::VKEY_OEM_MINUS,
@@ -364,7 +364,7 @@
for (size_t i = 0; i <= 0x3D; ++i) {
if (i > 0x29 && i < 0x31)
continue;
- base::string16 keys;
+ std::u16string keys;
int modifiers = 0;
keys.push_back(0xE000U + i);
std::vector<KeyEvent> events;
@@ -404,7 +404,7 @@
->AddModifiers(kMetaKeyModifierMask)
->Build());
- base::string16 keys;
+ std::u16string keys;
keys.push_back(static_cast<char16_t>(0xE008U));
keys.push_back(static_cast<char16_t>(0xE009U));
keys.push_back(static_cast<char16_t>(0xE00AU));
@@ -430,7 +430,7 @@
->SetModifiers(0)
->Build());
key_events.push_back(builder.SetKeyCode(ui::VKEY_CONTROL)->Build());
- base::string16 keys;
+ std::u16string keys;
keys.push_back(static_cast<char16_t>(0xE008U));
keys.push_back(static_cast<char16_t>(0xE009U));
diff --git a/chrome/test/chromedriver/keycode_text_conversion_mac.mm b/chrome/test/chromedriver/keycode_text_conversion_mac.mm
index aaa3a6f..bcf1a29 100644
--- a/chrome/test/chromedriver/keycode_text_conversion_mac.mm
+++ b/chrome/test/chromedriver/keycode_text_conversion_mac.mm
@@ -45,7 +45,7 @@
modifier_key_state, LMGetKbdLast(), &dead_key_state);
if (character && !std::iscntrl(character)) {
- base::string16 text16;
+ std::u16string text16;
text16.push_back(character);
*text = base::UTF16ToUTF8(text16);
return true;
@@ -58,7 +58,7 @@
ui::KeyboardCode* key_code,
int* necessary_modifiers,
std::string* error_msg) {
- base::string16 key_string;
+ std::u16string key_string;
key_string.push_back(key);
std::string key_string_utf8 = base::UTF16ToUTF8(key_string);
bool found_code = false;
diff --git a/chrome/test/chromedriver/keycode_text_conversion_ozone.cc b/chrome/test/chromedriver/keycode_text_conversion_ozone.cc
index c85cc033..34efa37 100644
--- a/chrome/test/chromedriver/keycode_text_conversion_ozone.cc
+++ b/chrome/test/chromedriver/keycode_text_conversion_ozone.cc
@@ -79,7 +79,7 @@
ui::KeyboardCode* key_code,
int* necessary_modifiers,
std::string* error_msg) {
- base::string16 key_string;
+ std::u16string key_string;
key_string.push_back(key);
std::string key_string_utf8 = base::UTF16ToUTF8(key_string);
bool found_code = false;
diff --git a/chrome/test/chromedriver/keycode_text_conversion_x.cc b/chrome/test/chromedriver/keycode_text_conversion_x.cc
index 2ed3d01..f3b5cd8 100644
--- a/chrome/test/chromedriver/keycode_text_conversion_x.cc
+++ b/chrome/test/chromedriver/keycode_text_conversion_x.cc
@@ -178,7 +178,7 @@
if (!character)
*text = std::string();
else
- *text = base::UTF16ToUTF8(base::string16(1, character));
+ *text = base::UTF16ToUTF8(std::u16string(1, character));
return true;
}
@@ -191,7 +191,7 @@
error_msg);
}
- std::string key_string(base::UTF16ToUTF8(base::string16(1, key)));
+ std::string key_string(base::UTF16ToUTF8(std::u16string(1, key)));
bool found = false;
ui::KeyboardCode test_code;
int test_modifiers;
diff --git a/chrome/test/chromedriver/server/http_handler.cc b/chrome/test/chromedriver/server/http_handler.cc
index 1aa1124..3ea0e0c 100644
--- a/chrome/test/chromedriver/server/http_handler.cc
+++ b/chrome/test/chromedriver/server/http_handler.cc
@@ -1419,8 +1419,8 @@
url::DecodeURLEscapeSequences(
path_parts[i].data(), path_parts[i].length(),
url::DecodeURLMode::kUTF8OrIsomorphic, &output);
- std::string decoded = base::UTF16ToASCII(
- base::string16(output.data(), output.length()));
+ std::string decoded =
+ base::UTF16ToASCII(std::u16string(output.data(), output.length()));
// Due to crbug.com/533361, the url decoding libraries decodes all of the
// % escape sequences except for %%. We need to handle this case manually.
// So, replacing all the instances of "%%" with "%".
diff --git a/chrome/test/chromedriver/util.cc b/chrome/test/chromedriver/util.cc
index e4a06b8..0e12df2 100644
--- a/chrome/test/chromedriver/util.cc
+++ b/chrome/test/chromedriver/util.cc
@@ -42,10 +42,10 @@
namespace {
const double kCentimetersPerInch = 2.54;
-Status FlattenStringArray(const base::ListValue* src, base::string16* dest) {
- base::string16 keys;
+Status FlattenStringArray(const base::ListValue* src, std::u16string* dest) {
+ std::u16string keys;
for (size_t i = 0; i < src->GetSize(); ++i) {
- base::string16 keys_list_part;
+ std::u16string keys_list_part;
if (!src->GetString(i, &keys_list_part))
return Status(kUnknownError, "keys should be a string");
for (size_t j = 0; j < keys_list_part.size(); ++j) {
@@ -69,7 +69,7 @@
const base::ListValue* key_list,
bool release_modifiers,
int* sticky_modifiers) {
- base::string16 keys;
+ std::u16string keys;
Status status = FlattenStringArray(key_list, &keys);
if (status.IsError())
return status;
diff --git a/chrome/test/origin_policy/origin_policy_browsertest.cc b/chrome/test/origin_policy/origin_policy_browsertest.cc
index 2edc200b..0a85754 100644
--- a/chrome/test/origin_policy/origin_policy_browsertest.cc
+++ b/chrome/test/origin_policy/origin_policy_browsertest.cc
@@ -53,10 +53,10 @@
// Most tests here are set up to use the page title to distinguish between
// successful load or the error page. For those tests, this method implements
// the bulk of the test logic.
- base::string16 NavigateToAndReturnTitle(const char* url) {
+ std::u16string NavigateToAndReturnTitle(const char* url) {
EXPECT_TRUE(server());
ui_test_utils::NavigateToURL(browser(), GURL(server()->GetURL(url)));
- base::string16 title;
+ std::u16string title;
ui_test_utils::GetCurrentTabTitle(browser(), &title);
return title;
}
diff --git a/chrome/test/ppapi/ppapi_test_select_file_dialog_factory.cc b/chrome/test/ppapi/ppapi_test_select_file_dialog_factory.cc
index e9118bb..14ec19a7 100644
--- a/chrome/test/ppapi/ppapi_test_select_file_dialog_factory.cc
+++ b/chrome/test/ppapi/ppapi_test_select_file_dialog_factory.cc
@@ -26,7 +26,7 @@
protected:
// ui::SelectFileDialog
void SelectFileImpl(Type type,
- const base::string16& title,
+ const std::u16string& title,
const base::FilePath& default_path,
const FileTypeInfo* file_types,
int file_type_index,
diff --git a/chrome/third_party/mozilla_security_manager/nsNSSCertHelper.cpp b/chrome/third_party/mozilla_security_manager/nsNSSCertHelper.cpp
index b92ae40..a3beef28 100644
--- a/chrome/third_party/mozilla_security_manager/nsNSSCertHelper.cpp
+++ b/chrome/third_party/mozilla_security_manager/nsNSSCertHelper.cpp
@@ -490,7 +490,7 @@
rv = l10n_util::GetStringUTF8(IDS_CERT_X509_BASIC_CONSTRAINT_IS_NOT_CA);
rv += '\n';
if (value.pathLenConstraint != -1) {
- base::string16 depth;
+ std::u16string depth;
if (value.pathLenConstraint == CERT_UNLIMITED_PATH_CONSTRAINT) {
depth = l10n_util::GetStringUTF16(
IDS_CERT_X509_BASIC_CONSTRAINT_PATH_LEN_UNLIMITED);
@@ -875,7 +875,7 @@
while (*aia != NULL) {
desc = *aia++;
- base::string16 location_str =
+ std::u16string location_str =
base::UTF8ToUTF16(ProcessGeneralName(arena.get(), desc->location));
switch (SECOID_FindOIDTag(&desc->method)) {
case SEC_OID_PKIX_OCSP:
diff --git a/chrome/tools/build/mac/infoplist_strings_util.cc b/chrome/tools/build/mac/infoplist_strings_util.cc
index 8fc5c0c..daa300c 100644
--- a/chrome/tools/build/mac/infoplist_strings_util.cc
+++ b/chrome/tools/build/mac/infoplist_strings_util.cc
@@ -53,7 +53,7 @@
if (data_pack->GetTextEncodingType() == ui::DataPack::UTF8)
return (std::string)data;
if (data_pack->GetTextEncodingType() == ui::DataPack::UTF16) {
- return base::UTF16ToUTF8(base::string16(
+ return base::UTF16ToUTF8(std::u16string(
reinterpret_cast<const char16_t*>(data.data()), data.length() / 2));
}
diff --git a/chrome/tools/convert_dict/aff_reader.cc b/chrome/tools/convert_dict/aff_reader.cc
index f89a9d4..f207a8d 100644
--- a/chrome/tools/convert_dict/aff_reader.cc
+++ b/chrome/tools/convert_dict/aff_reader.cc
@@ -138,7 +138,7 @@
bool AffReader::EncodingToUTF8(const std::string& encoded,
std::string* utf8) const {
- base::string16 word;
+ std::u16string word;
if (!base::CodepageToUTF16(encoded, encoding(),
base::OnStringConversionError::FAIL, &word))
return false;
diff --git a/chrome/tools/convert_dict/convert_dict_unittest.cc b/chrome/tools/convert_dict/convert_dict_unittest.cc
index 6e0e4a68..13132b5 100644
--- a/chrome/tools/convert_dict/convert_dict_unittest.cc
+++ b/chrome/tools/convert_dict/convert_dict_unittest.cc
@@ -66,7 +66,7 @@
// * Creates bdict data.
// * Verify the bdict data.
void RunDictionaryTest(const char* codepage,
- const std::map<base::string16, bool>& word_list) {
+ const std::map<std::u16string, bool>& word_list) {
// Create an affix data and a dictionary data.
std::string aff_data(base::StringPrintf("SET %s\n", codepage));
@@ -104,7 +104,7 @@
for (size_t i = 0; i < dic_reader.words().size(); ++i) {
SCOPED_TRACE(base::StringPrintf("dic_reader.words()[%" PRIuS "]: %s",
i, dic_reader.words()[i].first.c_str()));
- base::string16 word(base::UTF8ToUTF16(dic_reader.words()[i].first));
+ std::u16string word(base::UTF8ToUTF16(dic_reader.words()[i].first));
EXPECT_TRUE(word_list.find(word) != word_list.end());
}
@@ -146,11 +146,10 @@
L"I", L"he", L"she", L"it", L"we", L"you", L"they",
};
- std::map<base::string16, bool> word_list;
+ std::map<std::u16string, bool> word_list;
for (size_t i = 0; i < base::size(kWords); ++i) {
- word_list.insert(
- std::make_pair<base::string16, bool>(base::WideToUTF16(kWords[i]),
- true));
+ word_list.insert(std::make_pair<std::u16string, bool>(
+ base::WideToUTF16(kWords[i]), true));
}
RunDictionaryTest(kCodepage, word_list);
@@ -170,11 +169,10 @@
L"\x043e\x043d\x0438",
};
- std::map<base::string16, bool> word_list;
+ std::map<std::u16string, bool> word_list;
for (size_t i = 0; i < base::size(kWords); ++i) {
- word_list.insert(
- std::make_pair<base::string16, bool>(base::WideToUTF16(kWords[i]),
- true));
+ word_list.insert(std::make_pair<std::u16string, bool>(
+ base::WideToUTF16(kWords[i]), true));
}
RunDictionaryTest(kCodepage, word_list);
@@ -196,11 +194,10 @@
L"\x006d\x0061\x0067\x0075\x006b",
};
- std::map<base::string16, bool> word_list;
+ std::map<std::u16string, bool> word_list;
for (size_t i = 0; i < base::size(kWords); ++i) {
- word_list.insert(
- std::make_pair<base::string16, bool>(base::WideToUTF16(kWords[i]),
- true));
+ word_list.insert(std::make_pair<std::u16string, bool>(
+ base::WideToUTF16(kWords[i]), true));
}
RunDictionaryTest(kCodepage, word_list);
diff --git a/chrome/updater/test/test_app/test_app.cc b/chrome/updater/test/test_app/test_app.cc
index c27e9f7..8147426e 100644
--- a/chrome/updater/test/test_app/test_app.cc
+++ b/chrome/updater/test/test_app/test_app.cc
@@ -42,7 +42,7 @@
bool rollback,
const std::string& version,
int64_t size,
- const base::string16& message);
+ const std::u16string& message);
};
void TestApp::SetUpdateStatus(UpdateStatus status,
@@ -50,7 +50,7 @@
bool rollback,
const std::string& version,
int64_t size,
- const base::string16& message) {
+ const std::u16string& message) {
switch (status) {
case UpdateStatus::INIT:
VLOG(1) << "Updates starting!";
diff --git a/chrome/updater/test/test_app/update_client.cc b/chrome/updater/test/test_app/update_client.cc
index 24e632e..0626d35 100644
--- a/chrome/updater/test/test_app/update_client.cc
+++ b/chrome/updater/test/test_app/update_client.cc
@@ -40,7 +40,7 @@
callback_task_runner_->PostTask(
FROM_HERE, base::BindOnce(callback_, UpdateStatus::INIT, 0, false,
- std::string(), 0, base::string16()));
+ std::string(), 0, std::u16string()));
if (CanCheckForUpdate()) {
BeginUpdateCheck(
@@ -49,7 +49,7 @@
} else {
callback_task_runner_->PostTask(
FROM_HERE, base::BindOnce(callback_, UpdateStatus::FAILED, 0, false,
- std::string(), 0, base::string16()));
+ std::string(), 0, std::u16string()));
}
}
@@ -80,7 +80,7 @@
callback_task_runner_->PostTask(
FROM_HERE, base::BindOnce(callback_, status, 0, false, std::string(), 0,
- base::string16()));
+ std::u16string()));
}
void UpdateClient::RegistrationCompleted(base::OnceCallback<void(int)> callback,
@@ -97,9 +97,9 @@
if (result == UpdateService::Result::kSuccess) {
callback_task_runner_->PostTask(
FROM_HERE, base::BindOnce(callback_, UpdateStatus::NEARLY_UPDATED, 0,
- false, std::string(), 0, base::string16()));
+ false, std::string(), 0, std::u16string()));
} else {
- const base::string16 error_message(base::ASCIIToUTF16(base::StrCat(
+ const std::u16string error_message(base::ASCIIToUTF16(base::StrCat(
{"Error code: ", base::NumberToString(static_cast<int>(result))})));
callback_task_runner_->PostTask(
FROM_HERE, base::BindOnce(callback_, UpdateStatus::FAILED, 0, false,
diff --git a/chrome/updater/test/test_app/update_client.h b/chrome/updater/test/test_app/update_client.h
index 0efad23..008edcd 100644
--- a/chrome/updater/test/test_app/update_client.h
+++ b/chrome/updater/test/test_app/update_client.h
@@ -29,7 +29,7 @@
bool rollback,
const std::string& version,
int64_t update_size,
- const base::string16& message)>;
+ const std::u16string& message)>;
static scoped_refptr<UpdateClient> Create();
diff --git a/chrome/updater/util.h b/chrome/updater/util.h
index d0d732f..619f2b8 100644
--- a/chrome/updater/util.h
+++ b/chrome/updater/util.h
@@ -51,7 +51,7 @@
base::CommandLine MakeElevated(base::CommandLine command_line);
// Functor used by associative containers of strings as a case-insensitive ASCII
-// compare. |T| could be std::string or base::string16.
+// compare. |T| could be std::string or std::u16string.
template <typename T>
struct CaseInsensitiveASCIICompare {
public:
diff --git a/chrome/updater/win/app_install_controller.cc b/chrome/updater/win/app_install_controller.cc
index 4694677..9590ada 100644
--- a/chrome/updater/win/app_install_controller.cc
+++ b/chrome/updater/win/app_install_controller.cc
@@ -72,23 +72,23 @@
// Overrides for InstallProgressObserver.
// Called by the application installer code on the main udpater thread.
void OnCheckingForUpdate() override;
- void OnUpdateAvailable(const base::string16& app_id,
- const base::string16& app_name,
- const base::string16& version_string) override;
- void OnWaitingToDownload(const base::string16& app_id,
- const base::string16& app_name) override;
- void OnDownloading(const base::string16& app_id,
- const base::string16& app_name,
+ void OnUpdateAvailable(const std::u16string& app_id,
+ const std::u16string& app_name,
+ const std::u16string& version_string) override;
+ void OnWaitingToDownload(const std::u16string& app_id,
+ const std::u16string& app_name) override;
+ void OnDownloading(const std::u16string& app_id,
+ const std::u16string& app_name,
int time_remaining_ms,
int pos) override;
- void OnWaitingRetryDownload(const base::string16& app_id,
- const base::string16& app_name,
+ void OnWaitingRetryDownload(const std::u16string& app_id,
+ const std::u16string& app_name,
const base::Time& next_retry_time) override;
- void OnWaitingToInstall(const base::string16& app_id,
- const base::string16& app_name,
+ void OnWaitingToInstall(const std::u16string& app_id,
+ const std::u16string& app_name,
bool* can_start_install) override;
- void OnInstalling(const base::string16& app_id,
- const base::string16& app_name,
+ void OnInstalling(const std::u16string& app_id,
+ const std::u16string& app_name,
int time_remaining_ms,
int pos) override;
void OnPause() override;
@@ -112,9 +112,9 @@
ParamOnUpdateAvailable(const ParamOnUpdateAvailable&) = delete;
ParamOnUpdateAvailable& operator=(const ParamOnUpdateAvailable&) = delete;
- base::string16 app_id;
- base::string16 app_name;
- base::string16 version_string;
+ std::u16string app_id;
+ std::u16string app_name;
+ std::u16string version_string;
};
struct ParamOnDownloading {
@@ -122,8 +122,8 @@
ParamOnDownloading(const ParamOnDownloading&) = delete;
ParamOnDownloading& operator=(const ParamOnDownloading&) = delete;
- base::string16 app_id;
- base::string16 app_name;
+ std::u16string app_id;
+ std::u16string app_name;
int time_remaining_ms = 0;
int pos = 0;
};
@@ -133,8 +133,8 @@
ParamOnWaitingToInstall(const ParamOnWaitingToInstall&) = delete;
ParamOnWaitingToInstall& operator=(const ParamOnWaitingToInstall&) = delete;
- base::string16 app_id;
- base::string16 app_name;
+ std::u16string app_id;
+ std::u16string app_name;
};
struct ParamOnInstalling {
@@ -142,8 +142,8 @@
ParamOnInstalling(const ParamOnInstalling&) = delete;
ParamOnInstalling& operator=(const ParamOnInstalling&) = delete;
- base::string16 app_id;
- base::string16 app_name;
+ std::u16string app_id;
+ std::u16string app_name;
int time_remaining_ms = 0;
int pos = 0;
};
@@ -184,9 +184,9 @@
}
void InstallProgressObserverIPC::OnUpdateAvailable(
- const base::string16& app_id,
- const base::string16& app_name,
- const base::string16& version_string) {
+ const std::u16string& app_id,
+ const std::u16string& app_name,
+ const std::u16string& version_string) {
DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
DCHECK(progress_wnd_);
std::unique_ptr<ParamOnUpdateAvailable> param_on_update_available =
@@ -201,13 +201,13 @@
}
void InstallProgressObserverIPC::OnWaitingToDownload(
- const base::string16& app_id,
- const base::string16& app_name) {
+ const std::u16string& app_id,
+ const std::u16string& app_name) {
NOTREACHED();
}
-void InstallProgressObserverIPC::OnDownloading(const base::string16& app_id,
- const base::string16& app_name,
+void InstallProgressObserverIPC::OnDownloading(const std::u16string& app_id,
+ const std::u16string& app_name,
int time_remaining_ms,
int pos) {
DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
@@ -224,15 +224,15 @@
}
void InstallProgressObserverIPC::OnWaitingRetryDownload(
- const base::string16& app_id,
- const base::string16& app_name,
+ const std::u16string& app_id,
+ const std::u16string& app_name,
const base::Time& next_retry_time) {
NOTREACHED();
}
void InstallProgressObserverIPC::OnWaitingToInstall(
- const base::string16& app_id,
- const base::string16& app_name,
+ const std::u16string& app_id,
+ const std::u16string& app_name,
bool* can_start_install) {
DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
DCHECK(progress_wnd_);
@@ -246,8 +246,8 @@
reinterpret_cast<LPARAM>(param_on_waiting_to_install.release()));
}
-void InstallProgressObserverIPC::OnInstalling(const base::string16& app_id,
- const base::string16& app_name,
+void InstallProgressObserverIPC::OnInstalling(const std::u16string& app_id,
+ const std::u16string& app_name,
int time_remaining_ms,
int pos) {
DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
@@ -380,12 +380,12 @@
void DoExit() override;
// Overrides for CompleteWndEvents. This function is called on the UI thread.
- bool DoLaunchBrowser(const base::string16& url) override;
+ bool DoLaunchBrowser(const std::u16string& url) override;
// Overrides for ProgressWndEvents. These functions are called on the UI
// thread.
bool DoRestartBrowser(bool restart_all_browsers,
- const std::vector<base::string16>& urls) override;
+ const std::vector<std::u16string>& urls) override;
bool DoReboot() override;
void DoCancel() override {}
@@ -419,7 +419,7 @@
// The application ID and the associated application name. The application
// name is displayed by the UI and it must be i18n.
std::string app_id_;
- const base::string16 app_name_;
+ const std::u16string app_name_;
// The out-of-process service used for making RPC calls to install the app.
scoped_refptr<UpdateService> update_service_;
@@ -628,14 +628,14 @@
return ::GetWindowThreadProcessId(progress_wnd_->m_hWnd, nullptr);
}
-bool AppInstallControllerImpl::DoLaunchBrowser(const base::string16& url) {
+bool AppInstallControllerImpl::DoLaunchBrowser(const std::u16string& url) {
DCHECK_EQ(GetUIThreadID(), GetCurrentThreadId());
return false;
}
bool AppInstallControllerImpl::DoRestartBrowser(
bool restart_all_browsers,
- const std::vector<base::string16>& urls) {
+ const std::vector<std::u16string>& urls) {
DCHECK_EQ(GetUIThreadID(), GetCurrentThreadId());
return false;
}
diff --git a/chrome/updater/win/install_progress_observer.h b/chrome/updater/win/install_progress_observer.h
index bedb1c6..117c461 100644
--- a/chrome/updater/win/install_progress_observer.h
+++ b/chrome/updater/win/install_progress_observer.h
@@ -60,9 +60,9 @@
}
struct AppCompletionInfo {
- base::string16 display_name;
- base::string16 app_id;
- base::string16 completion_message;
+ std::u16string display_name;
+ std::u16string app_id;
+ std::u16string completion_message;
CompletionCodes completion_code;
int error_code = 0;
int extra_code1 = 0;
@@ -70,7 +70,7 @@
bool is_canceled = false;
bool is_noupdate = false; // |noupdate| response from server.
std::wstring post_install_launch_command_line;
- base::string16 post_install_url;
+ std::u16string post_install_url;
AppCompletionInfo();
AppCompletionInfo(const AppCompletionInfo&);
@@ -80,7 +80,7 @@
struct ObserverCompletionInfo {
CompletionCodes completion_code = CompletionCodes::COMPLETION_CODE_SUCCESS;
std::wstring completion_text;
- base::string16 help_url;
+ std::u16string help_url;
std::vector<AppCompletionInfo> apps_info;
ObserverCompletionInfo();
@@ -93,23 +93,23 @@
public:
virtual ~InstallProgressObserver() = default;
virtual void OnCheckingForUpdate() = 0;
- virtual void OnUpdateAvailable(const base::string16& app_id,
- const base::string16& app_name,
- const base::string16& version_string) = 0;
- virtual void OnWaitingToDownload(const base::string16& app_id,
- const base::string16& app_name) = 0;
- virtual void OnDownloading(const base::string16& app_id,
- const base::string16& app_name,
+ virtual void OnUpdateAvailable(const std::u16string& app_id,
+ const std::u16string& app_name,
+ const std::u16string& version_string) = 0;
+ virtual void OnWaitingToDownload(const std::u16string& app_id,
+ const std::u16string& app_name) = 0;
+ virtual void OnDownloading(const std::u16string& app_id,
+ const std::u16string& app_name,
int time_remaining_ms,
int pos) = 0;
- virtual void OnWaitingRetryDownload(const base::string16& app_id,
- const base::string16& app_name,
+ virtual void OnWaitingRetryDownload(const std::u16string& app_id,
+ const std::u16string& app_name,
const base::Time& next_retry_time) = 0;
- virtual void OnWaitingToInstall(const base::string16& app_id,
- const base::string16& app_name,
+ virtual void OnWaitingToInstall(const std::u16string& app_id,
+ const std::u16string& app_name,
bool* can_start_install) = 0;
- virtual void OnInstalling(const base::string16& app_id,
- const base::string16& app_name,
+ virtual void OnInstalling(const std::u16string& app_id,
+ const std::u16string& app_name,
int time_remaining_ms,
int pos) = 0;
virtual void OnPause() = 0;
diff --git a/chrome/updater/win/ui/complete_wnd.cc b/chrome/updater/win/ui/complete_wnd.cc
index 60b4625..4a0bd881 100644
--- a/chrome/updater/win/ui/complete_wnd.cc
+++ b/chrome/updater/win/ui/complete_wnd.cc
@@ -86,7 +86,7 @@
void CompleteWnd::DisplayCompletionDialog(bool is_success,
const std::wstring& text,
- const base::string16& help_url) {
+ const std::u16string& help_url) {
if (!OmahaWnd::OnComplete())
return;
diff --git a/chrome/updater/win/ui/complete_wnd.h b/chrome/updater/win/ui/complete_wnd.h
index 6623dc9..1c7f64c 100644
--- a/chrome/updater/win/ui/complete_wnd.h
+++ b/chrome/updater/win/ui/complete_wnd.h
@@ -21,7 +21,7 @@
public:
// Launches the browser and returns true if the browser was successfully
// launched.
- virtual bool DoLaunchBrowser(const base::string16& url) = 0;
+ virtual bool DoLaunchBrowser(const std::u16string& url) = 0;
};
class CompleteWnd : public OmahaWnd {
@@ -35,7 +35,7 @@
void DisplayCompletionDialog(bool is_success,
const std::wstring& text,
- const base::string16& help_url);
+ const std::u16string& help_url);
BEGIN_MSG_MAP(CompleteWnd)
MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
COMMAND_HANDLER(IDC_GET_HELP, BN_CLICKED, OnClickedGetHelp)
@@ -71,7 +71,7 @@
HRESULT SetControlState(bool is_success);
- base::string16 help_url_;
+ std::u16string help_url_;
CompleteWndEvents* events_sink_ = nullptr;
const DWORD control_classes_;
};
diff --git a/chrome/updater/win/ui/progress_wnd.cc b/chrome/updater/win/ui/progress_wnd.cc
index 36c12cc..58ac22f0 100644
--- a/chrome/updater/win/ui/progress_wnd.cc
+++ b/chrome/updater/win/ui/progress_wnd.cc
@@ -322,9 +322,9 @@
ChangeControlState();
}
-void ProgressWnd::OnUpdateAvailable(const base::string16& app_id,
- const base::string16& app_name,
- const base::string16& version_string) {
+void ProgressWnd::OnUpdateAvailable(const std::u16string& app_id,
+ const std::u16string& app_name,
+ const std::u16string& version_string) {
DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
if (base::EqualsCaseInsensitiveASCII(app_id,
@@ -341,8 +341,8 @@
return;
}
-void ProgressWnd::OnWaitingToDownload(const base::string16& app_id,
- const base::string16& app_name) {
+void ProgressWnd::OnWaitingToDownload(const std::u16string& app_id,
+ const std::u16string& app_name) {
DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
if (!IsWindow())
return;
@@ -357,8 +357,8 @@
}
// May be called repeatedly during download.
-void ProgressWnd::OnDownloading(const base::string16& app_id,
- const base::string16& app_name,
+void ProgressWnd::OnDownloading(const std::u16string& app_id,
+ const std::u16string& app_name,
int time_remaining_ms,
int pos) {
DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
@@ -409,8 +409,8 @@
ChangeControlState();
}
-void ProgressWnd::OnWaitingRetryDownload(const base::string16& app_id,
- const base::string16& app_name,
+void ProgressWnd::OnWaitingRetryDownload(const std::u16string& app_id,
+ const std::u16string& app_name,
const base::Time& next_retry_time) {
DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
if (!IsWindow())
@@ -429,8 +429,8 @@
}
}
-void ProgressWnd::OnWaitingToInstall(const base::string16& app_id,
- const base::string16& app_name,
+void ProgressWnd::OnWaitingToInstall(const std::u16string& app_id,
+ const std::u16string& app_name,
bool* can_start_install) {
DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
DCHECK(can_start_install);
@@ -449,8 +449,8 @@
}
// May be called repeatedly during install.
-void ProgressWnd::OnInstalling(const base::string16& app_id,
- const base::string16& app_name,
+void ProgressWnd::OnInstalling(const std::u16string& app_id,
+ const std::u16string& app_name,
int time_remaining_ms,
int pos) {
DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
diff --git a/chrome/updater/win/ui/progress_wnd.h b/chrome/updater/win/ui/progress_wnd.h
index 128ff344..2dcbfb26 100644
--- a/chrome/updater/win/ui/progress_wnd.h
+++ b/chrome/updater/win/ui/progress_wnd.h
@@ -30,7 +30,7 @@
// Restarts the running browsers.
// If |restart_all_browsers| is true, all known browsers will be restarted.
virtual bool DoRestartBrowser(bool restart_all_browsers,
- const std::vector<base::string16>& urls) = 0;
+ const std::vector<std::u16string>& urls) = 0;
// Initiates a reboot and returns whether it was initiated successfully.
virtual bool DoReboot() = 0;
@@ -117,23 +117,23 @@
// Overrides for InstallProgressObserver.
// These functions are called on the thread which owns this window.
void OnCheckingForUpdate() override;
- void OnUpdateAvailable(const base::string16& app_id,
- const base::string16& app_name,
- const base::string16& version_string) override;
- void OnWaitingToDownload(const base::string16& app_id,
- const base::string16& app_name) override;
- void OnDownloading(const base::string16& app_id,
- const base::string16& app_name,
+ void OnUpdateAvailable(const std::u16string& app_id,
+ const std::u16string& app_name,
+ const std::u16string& version_string) override;
+ void OnWaitingToDownload(const std::u16string& app_id,
+ const std::u16string& app_name) override;
+ void OnDownloading(const std::u16string& app_id,
+ const std::u16string& app_name,
int time_remaining_ms,
int pos) override;
- void OnWaitingRetryDownload(const base::string16& app_id,
- const base::string16& app_name,
+ void OnWaitingRetryDownload(const std::u16string& app_id,
+ const std::u16string& app_name,
const base::Time& next_retry_time) override;
- void OnWaitingToInstall(const base::string16& app_id,
- const base::string16& app_name,
+ void OnWaitingToInstall(const std::u16string& app_id,
+ const std::u16string& app_name,
bool* can_start_install) override;
- void OnInstalling(const base::string16& app_id,
- const base::string16& app_name,
+ void OnInstalling(const std::u16string& app_id,
+ const std::u16string& app_name,
int time_remaining_ms,
int pos) override;
void OnPause() override;
@@ -194,7 +194,7 @@
std::unique_ptr<InstallStoppedWnd> install_stopped_wnd_;
ProgressWndEvents* events_sink_ = nullptr;
- std::vector<base::string16> post_install_urls_;
+ std::vector<std::u16string> post_install_urls_;
bool is_canceled_ = false;
struct ControlState {
diff --git a/chrome/updater/win/ui/splash_screen.cc b/chrome/updater/win/ui/splash_screen.cc
index f1d6f3b..40eb793 100644
--- a/chrome/updater/win/ui/splash_screen.cc
+++ b/chrome/updater/win/ui/splash_screen.cc
@@ -34,7 +34,7 @@
} // namespace
-SplashScreen::SplashScreen(const base::string16& bundle_name)
+SplashScreen::SplashScreen(const std::u16string& bundle_name)
: timer_created_(false), alpha_index_(0) {
title_ = GetInstallerDisplayName(bundle_name);
SwitchToState(WindowState::STATE_CREATED);
diff --git a/chrome/updater/win/ui/splash_screen.h b/chrome/updater/win/ui/splash_screen.h
index 329d024..1ed8ab5 100644
--- a/chrome/updater/win/ui/splash_screen.h
+++ b/chrome/updater/win/ui/splash_screen.h
@@ -28,7 +28,7 @@
public:
static constexpr int IDD = IDD_PROGRESS;
- explicit SplashScreen(const base::string16& bundle_name);
+ explicit SplashScreen(const std::u16string& bundle_name);
SplashScreen(const SplashScreen&) = delete;
SplashScreen& operator=(const SplashScreen&) = delete;
~SplashScreen() override;
diff --git a/chrome/updater/win/ui/ui.h b/chrome/updater/win/ui/ui.h
index 5f2a8c1..843a036 100644
--- a/chrome/updater/win/ui/ui.h
+++ b/chrome/updater/win/ui/ui.h
@@ -52,7 +52,7 @@
void SetEventSink(OmahaWndEvents* ev) { events_sink_ = ev; }
void set_scope(UpdaterScope scope) { scope_ = scope; }
- void set_bundle_name(const base::string16& bundle_name) {
+ void set_bundle_name(const std::u16string& bundle_name) {
bundle_name_ = bundle_name;
}
@@ -115,7 +115,7 @@
bool is_complete() { return is_complete_; }
bool is_close_enabled() { return is_close_enabled_; }
UpdaterScope scope() { return scope_; }
- const base::string16& bundle_name() { return bundle_name_; }
+ const std::u16string& bundle_name() { return bundle_name_; }
static const ControlAttributes kVisibleTextAttributes;
static const ControlAttributes kDefaultActiveButtonAttributes;
@@ -141,7 +141,7 @@
OmahaWndEvents* events_sink_;
UpdaterScope scope_;
- base::string16 bundle_name_;
+ std::u16string bundle_name_;
// Handle to large icon to show when ALT-TAB
base::win::ScopedGDIObject<HICON> hicon_;
diff --git a/chrome/updater/win/ui/util.cc b/chrome/updater/win/ui/util.cc
index 29d0a1f..311f25a 100644
--- a/chrome/updater/win/ui/util.cc
+++ b/chrome/updater/win/ui/util.cc
@@ -107,7 +107,7 @@
return S_OK;
}
-std::wstring GetInstallerDisplayName(const base::string16& bundle_name) {
+std::wstring GetInstallerDisplayName(const std::u16string& bundle_name) {
std::wstring display_name = base::AsWString(bundle_name);
if (display_name.empty())
LoadString(IDS_FRIENDLY_COMPANY_NAME, &display_name);
diff --git a/chrome/updater/win/ui/util.h b/chrome/updater/win/ui/util.h
index 3ef7431..4038b2c6 100644
--- a/chrome/updater/win/ui/util.h
+++ b/chrome/updater/win/ui/util.h
@@ -43,7 +43,7 @@
// Returns a localized installer name for a bundle. If |bundle_name| is empty,
// the friendly company name is used.
-std::wstring GetInstallerDisplayName(const base::string16& bundle_name);
+std::wstring GetInstallerDisplayName(const std::u16string& bundle_name);
// Returns the quotient of the two numbers (m/n) rounded upwards to the
// nearest integer type. T should be unsigned integer type, such as unsigned
diff --git a/chrome/utility/importer/bookmark_html_reader.cc b/chrome/utility/importer/bookmark_html_reader.cc
index 8690200..1139d01 100644
--- a/chrome/utility/importer/bookmark_html_reader.cc
+++ b/chrome/utility/importer/bookmark_html_reader.cc
@@ -117,13 +117,13 @@
std::vector<std::string> lines = base::SplitString(
content, "\n", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
- base::string16 last_folder;
+ std::u16string last_folder;
bool last_folder_on_toolbar = false;
bool last_folder_is_empty = true;
bool has_subfolder = false;
bool has_last_folder = false;
base::Time last_folder_add_date;
- std::vector<base::string16> path;
+ std::vector<std::u16string> path;
size_t toolbar_folder_index = 0;
std::string charset = "UTF-8"; // If no charset is specified, assume utf-8.
for (size_t i = 0;
@@ -159,11 +159,11 @@
}
// Get the bookmark entry.
- base::string16 title;
- base::string16 shortcut;
+ std::u16string title;
+ std::u16string shortcut;
GURL url, favicon;
base::Time add_date;
- base::string16 post_data;
+ std::u16string post_data;
bool is_bookmark;
// TODO(jcampan): http://b/issue?id=1196285 we do not support POST based
// keywords yet.
@@ -244,7 +244,7 @@
if (path.empty())
break; // Mismatch <DL>.
- base::string16 folder_title = path.back();
+ std::u16string folder_title = path.back();
path.pop_back();
if (last_folder_is_empty) {
@@ -324,7 +324,7 @@
bool ParseFolderNameFromLine(const std::string& lineDt,
const std::string& charset,
- base::string16* folder_name,
+ std::u16string* folder_name,
bool* is_toolbar_folder,
base::Time* add_date) {
const char kFolderOpen[] = "<H3";
@@ -371,12 +371,12 @@
bool ParseBookmarkFromLine(const std::string& lineDt,
const std::string& charset,
- base::string16* title,
+ std::u16string* title,
GURL* url,
GURL* favicon,
- base::string16* shortcut,
+ std::u16string* shortcut,
base::Time* add_date,
- base::string16* post_data) {
+ std::u16string* post_data) {
const char kItemOpen[] = "<A";
const char kItemClose[] = "</A>";
const char kFeedURLAttribute[] = "FEEDURL";
@@ -419,7 +419,7 @@
// URL
if (GetAttribute(attribute_list, kHrefAttribute, &value)) {
- base::string16 url16;
+ std::u16string url16;
base::CodepageToUTF16(value, charset.c_str(),
base::OnStringConversionError::SKIP, &url16);
url16 = net::UnescapeForHTML(url16);
@@ -459,7 +459,7 @@
bool ParseMinimumBookmarkFromLine(const std::string& lineDt,
const std::string& charset,
- base::string16* title,
+ std::u16string* title,
GURL* url) {
const char kItemOpen[] = "<A";
const char kItemClose[] = "</";
@@ -493,7 +493,7 @@
if (GetAttribute(attribute_list, kHrefAttributeUpper, &value) ||
GetAttribute(attribute_list, kHrefAttributeLower, &value)) {
if (charset.length() != 0) {
- base::string16 url16;
+ std::u16string url16;
base::CodepageToUTF16(value, charset.c_str(),
base::OnStringConversionError::SKIP, &url16);
url16 = net::UnescapeForHTML(url16);
diff --git a/chrome/utility/importer/bookmark_html_reader.h b/chrome/utility/importer/bookmark_html_reader.h
index 6a302e4..be360fb7e 100644
--- a/chrome/utility/importer/bookmark_html_reader.h
+++ b/chrome/utility/importer/bookmark_html_reader.h
@@ -74,7 +74,7 @@
std::string* charset);
bool ParseFolderNameFromLine(const std::string& line,
const std::string& charset,
- base::string16* folder_name,
+ std::u16string* folder_name,
bool* is_toolbar_folder,
base::Time* add_date);
// See above, this will also put the data: URL of the favicon into |*favicon|
@@ -82,12 +82,12 @@
// the contents of the actual POST (with %s for the search term).
bool ParseBookmarkFromLine(const std::string& line,
const std::string& charset,
- base::string16* title,
+ std::u16string* title,
GURL* url,
GURL* favicon,
- base::string16* shortcut,
+ std::u16string* shortcut,
base::Time* add_date,
- base::string16* post_data);
+ std::u16string* post_data);
// Save bookmarks imported from browsers with Firefox 2 compatible bookmark
// systems such as Epiphany. This bookmark format is the same as that of the
// basic Firefox 2 bookmark, but it misses additional properties and uses
@@ -98,7 +98,7 @@
// </dl>
bool ParseMinimumBookmarkFromLine(const std::string& line,
const std::string& charset,
- base::string16* title,
+ std::u16string* title,
GURL* url);
} // namespace internal
diff --git a/chrome/utility/importer/bookmark_html_reader_unittest.cc b/chrome/utility/importer/bookmark_html_reader_unittest.cc
index 4141cb9..cdf8886 100644
--- a/chrome/utility/importer/bookmark_html_reader_unittest.cc
+++ b/chrome/utility/importer/bookmark_html_reader_unittest.cc
@@ -39,7 +39,7 @@
EXPECT_EQ("UTF-8", charset);
// Escaped characters in name.
- base::string16 folder_name;
+ std::u16string folder_name;
bool is_toolbar_folder;
base::Time folder_add_date;
result = internal::ParseFolderNameFromLine(
@@ -56,14 +56,14 @@
"<DT><H3 PERSONAL_TOOLBAR_FOLDER=\"true\"></H3>",
charset, &folder_name, &is_toolbar_folder, &folder_add_date);
EXPECT_TRUE(result);
- EXPECT_EQ(base::string16(), folder_name);
+ EXPECT_EQ(std::u16string(), folder_name);
EXPECT_TRUE(is_toolbar_folder);
// Unicode characters in title and shortcut.
- base::string16 title;
+ std::u16string title;
GURL url, favicon;
- base::string16 shortcut;
- base::string16 post_data;
+ std::u16string shortcut;
+ std::u16string post_data;
base::Time add_date;
result = internal::ParseBookmarkFromLine(
"<DT><A HREF=\"http://chinese.site.cn/path?query=1#ref\" "
@@ -73,7 +73,7 @@
EXPECT_EQ(L"\x4E2D\x6587", UTF16ToWide(title));
EXPECT_EQ("http://chinese.site.cn/path?query=1#ref", url.spec());
EXPECT_EQ(L"\x4E2D", UTF16ToWide(shortcut));
- EXPECT_EQ(base::string16(), post_data);
+ EXPECT_EQ(std::u16string(), post_data);
EXPECT_TRUE(base::Time() == add_date);
// No shortcut, and url contains %22 ('"' character).
@@ -83,8 +83,8 @@
EXPECT_TRUE(result);
EXPECT_EQ(ASCIIToUTF16("name"), title);
EXPECT_EQ("http://domain.com/?q=%22%3C%3E%22", url.spec());
- EXPECT_EQ(base::string16(), shortcut);
- EXPECT_EQ(base::string16(), post_data);
+ EXPECT_EQ(std::u16string(), shortcut);
+ EXPECT_EQ(std::u16string(), post_data);
EXPECT_TRUE(base::Time() == add_date);
result = internal::ParseBookmarkFromLine(
@@ -93,8 +93,8 @@
EXPECT_TRUE(result);
EXPECT_EQ(ASCIIToUTF16("name"), title);
EXPECT_EQ("http://domain.com/?g=%22", url.spec());
- EXPECT_EQ(base::string16(), shortcut);
- EXPECT_EQ(base::string16(), post_data);
+ EXPECT_EQ(std::u16string(), shortcut);
+ EXPECT_EQ(std::u16string(), post_data);
EXPECT_TRUE(base::Time() == add_date);
// Creation date.
@@ -104,8 +104,8 @@
EXPECT_TRUE(result);
EXPECT_EQ(ASCIIToUTF16("name"), title);
EXPECT_EQ(GURL("http://site/"), url);
- EXPECT_EQ(base::string16(), shortcut);
- EXPECT_EQ(base::string16(), post_data);
+ EXPECT_EQ(std::u16string(), shortcut);
+ EXPECT_EQ(std::u16string(), post_data);
EXPECT_TRUE(base::Time::FromTimeT(1121301154) == add_date);
// Post-data
@@ -127,10 +127,10 @@
"<DT><A HREF=\"http://domain.com/?q=%22",
charset, &title, &url, &favicon, &shortcut, &add_date, &post_data);
EXPECT_FALSE(result);
- EXPECT_EQ(base::string16(), title);
+ EXPECT_EQ(std::u16string(), title);
EXPECT_EQ("", url.spec());
- EXPECT_EQ(base::string16(), shortcut);
- EXPECT_EQ(base::string16(), post_data);
+ EXPECT_EQ(std::u16string(), shortcut);
+ EXPECT_EQ(std::u16string(), post_data);
EXPECT_TRUE(base::Time() == add_date);
// Epiphany format.
@@ -324,7 +324,7 @@
void BookmarkHTMLReaderTestWithData::ExpectFirstEmptyFolderBookmark(
const ImportedBookmarkEntry& entry) {
- EXPECT_EQ(base::string16(), entry.title);
+ EXPECT_EQ(std::u16string(), entry.title);
EXPECT_TRUE(entry.is_folder);
EXPECT_EQ(base::Time::FromTimeT(1295938143), entry.creation_time);
EXPECT_EQ(1U, entry.path.size());
@@ -339,7 +339,7 @@
EXPECT_EQ(base::Time::FromTimeT(1234567890), entry.creation_time);
EXPECT_EQ(1U, entry.path.size());
if (entry.path.size() == 1)
- EXPECT_EQ(base::string16(), entry.path.front());
+ EXPECT_EQ(std::u16string(), entry.path.front());
EXPECT_EQ("http://www.tamurayukari.com/", entry.url.spec());
}
diff --git a/chrome/utility/importer/bookmarks_file_importer.cc b/chrome/utility/importer/bookmarks_file_importer.cc
index 83c5c92..a0537784 100644
--- a/chrome/utility/importer/bookmarks_file_importer.cc
+++ b/chrome/utility/importer/bookmarks_file_importer.cc
@@ -102,7 +102,7 @@
&bookmarks, &search_engines, &favicons);
if (!bookmarks.empty() && !cancelled()) {
- base::string16 first_folder_name =
+ std::u16string first_folder_name =
bridge->GetLocalizedString(IDS_BOOKMARK_GROUP);
bridge->AddBookmarks(bookmarks, first_folder_name);
}
diff --git a/chrome/utility/importer/edge_database_reader_unittest_win.cc b/chrome/utility/importer/edge_database_reader_unittest_win.cc
index bb04817..70be1af0 100644
--- a/chrome/utility/importer/edge_database_reader_unittest_win.cc
+++ b/chrome/utility/importer/edge_database_reader_unittest_win.cc
@@ -188,9 +188,9 @@
EXPECT_EQ(expected_filetime_col_value.dwHighDateTime,
filetime_col_value.dwHighDateTime);
- base::string16 row_string =
+ std::u16string row_string =
base::AsString16(base::StringPrintf(L"String: %d", row_count));
- base::string16 str_col_value;
+ std::u16string str_col_value;
EXPECT_TRUE(table_enum->RetrieveColumn(L"StrCol", &str_col_value));
EXPECT_EQ(row_string, str_col_value);
@@ -283,8 +283,8 @@
EXPECT_NE(nullptr, table_enum);
size_t utf8_strings_count = base::size(utf8_strings);
for (size_t row_count = 0; row_count < utf8_strings_count; ++row_count) {
- base::string16 row_string = base::UTF8ToUTF16(utf8_strings[row_count]);
- base::string16 str_col_value;
+ std::u16string row_string = base::UTF8ToUTF16(utf8_strings[row_count]);
+ std::u16string str_col_value;
EXPECT_TRUE(table_enum->RetrieveColumn(L"StrCol", &str_col_value));
EXPECT_EQ(row_string, str_col_value);
if (row_count < utf8_strings_count - 1)
@@ -302,7 +302,7 @@
std::unique_ptr<EdgeDatabaseTableEnumerator> table_enum =
reader.OpenTableEnumerator(L"NonUnicodeTable");
EXPECT_NE(nullptr, table_enum);
- base::string16 str_col_value;
+ std::u16string str_col_value;
EXPECT_FALSE(table_enum->RetrieveColumn(L"StrCol", &str_col_value));
EXPECT_EQ(JET_errInvalidColumnType, table_enum->last_error());
}
@@ -345,7 +345,7 @@
EXPECT_EQ(expected_filetime_col_value.dwHighDateTime,
filetime_col_value.dwHighDateTime);
- base::string16 str_col_value;
+ std::u16string str_col_value;
EXPECT_TRUE(table_enum->RetrieveColumn(L"StrCol", &str_col_value));
EXPECT_TRUE(str_col_value.empty());
diff --git a/chrome/utility/importer/edge_database_reader_win.cc b/chrome/utility/importer/edge_database_reader_win.cc
index bdec1f6..9cace1d4 100644
--- a/chrome/utility/importer/edge_database_reader_win.cc
+++ b/chrome/utility/importer/edge_database_reader_win.cc
@@ -44,10 +44,10 @@
bool ValidateAndConvertValue(const JET_COLTYP column_type,
const std::vector<uint8_t>& column_data,
- base::string16* value) {
+ std::u16string* value) {
if ((column_type == JET_coltypLongText) &&
((column_data.size() % sizeof(char16_t)) == 0)) {
- base::string16& value_ref = *value;
+ std::u16string& value_ref = *value;
size_t char_length = column_data.size() / sizeof(char16_t);
value_ref.resize(char_length);
memcpy(&value_ref[0], &column_data[0], column_data.size());
@@ -185,7 +185,7 @@
template bool EdgeDatabaseTableEnumerator::RetrieveColumn(const std::wstring&,
int64_t*);
template bool EdgeDatabaseTableEnumerator::RetrieveColumn(const std::wstring&,
- base::string16*);
+ std::u16string*);
template bool EdgeDatabaseTableEnumerator::RetrieveColumn(const std::wstring&,
uint32_t*);
diff --git a/chrome/utility/importer/edge_importer_win.cc b/chrome/utility/importer/edge_importer_win.cc
index 09e3630..ae5c8d2 100644
--- a/chrome/utility/importer/edge_importer_win.cc
+++ b/chrome/utility/importer/edge_importer_win.cc
@@ -44,7 +44,7 @@
item_id(GUID_NULL),
parent_id(GUID_NULL) {}
- base::string16 title;
+ std::u16string title;
GURL url;
base::FilePath favicon_file;
bool is_folder;
@@ -57,7 +57,7 @@
ImportedBookmarkEntry ToBookmarkEntry(
bool in_toolbar,
- const std::vector<base::string16>& path) const {
+ const std::vector<std::u16string>& path) const {
ImportedBookmarkEntry entry;
entry.in_toolbar = in_toolbar;
entry.is_folder = is_folder;
@@ -119,7 +119,7 @@
bool is_toolbar,
std::vector<ImportedBookmarkEntry>* bookmarks,
favicon_base::FaviconUsageDataList* favicons,
- std::vector<base::string16>* path) {
+ std::vector<std::u16string>* path) {
for (const EdgeFavoriteEntry* entry : current_entry.children) {
if (entry->is_folder) {
// If the favorites bar then load all children as toolbar items.
@@ -177,7 +177,7 @@
ParseFavoritesDatabase(&bookmarks, &favicons);
if (!bookmarks.empty() && !cancelled()) {
- const base::string16& first_folder_name =
+ const std::u16string& first_folder_name =
l10n_util::GetStringUTF16(IDS_BOOKMARK_GROUP_FROM_EDGE);
bridge_->AddBookmarks(bookmarks, first_folder_name);
}
@@ -248,7 +248,7 @@
continue;
if (!enumerator->RetrieveColumn(L"IsFolder", &entry.is_folder))
continue;
- base::string16 url;
+ std::u16string url;
if (!enumerator->RetrieveColumn(L"URL", &url))
continue;
entry.url = GURL(url);
@@ -256,7 +256,7 @@
continue;
if (!enumerator->RetrieveColumn(L"Title", &entry.title))
continue;
- base::string16 favicon_file;
+ std::u16string favicon_file;
if (!enumerator->RetrieveColumn(L"FaviconFile", &favicon_file))
continue;
if (!favicon_file.empty()) {
@@ -294,6 +294,6 @@
std::sort(entry.second.children.begin(), entry.second.children.end(),
EdgeFavoriteEntryComparator());
}
- std::vector<base::string16> path;
+ std::vector<std::u16string> path;
BuildBookmarkEntries(root_entry, false, bookmarks, favicons, &path);
}
diff --git a/chrome/utility/importer/external_process_importer_bridge.cc b/chrome/utility/importer/external_process_importer_bridge.cc
index d45779e..438e412fd 100644
--- a/chrome/utility/importer/external_process_importer_bridge.cc
+++ b/chrome/utility/importer/external_process_importer_bridge.cc
@@ -38,7 +38,7 @@
void ExternalProcessImporterBridge::AddBookmarks(
const std::vector<ImportedBookmarkEntry>& bookmarks,
- const base::string16& first_folder_name) {
+ const std::u16string& first_folder_name) {
observer_->OnBookmarksImportStart(first_folder_name, bookmarks.size());
// |bookmarks_left| is required for the checks below as Windows has a
@@ -152,7 +152,7 @@
observer_->OnImportFinished(true, std::string());
}
-base::string16 ExternalProcessImporterBridge::GetLocalizedString(
+std::u16string ExternalProcessImporterBridge::GetLocalizedString(
int message_id) {
DCHECK(localized_strings_.count(message_id));
return base::UTF8ToUTF16(localized_strings_[message_id]);
diff --git a/chrome/utility/importer/external_process_importer_bridge.h b/chrome/utility/importer/external_process_importer_bridge.h
index 29633eb..a5723dc 100644
--- a/chrome/utility/importer/external_process_importer_bridge.h
+++ b/chrome/utility/importer/external_process_importer_bridge.h
@@ -42,7 +42,7 @@
// Begin ImporterBridge implementation:
void AddBookmarks(const std::vector<ImportedBookmarkEntry>& bookmarks,
- const base::string16& first_folder_name) override;
+ const std::u16string& first_folder_name) override;
void AddHomePage(const GURL& home_page) override;
@@ -65,7 +65,7 @@
void NotifyItemEnded(importer::ImportItem item) override;
void NotifyEnded() override;
- base::string16 GetLocalizedString(int message_id) override;
+ std::u16string GetLocalizedString(int message_id) override;
// End ImporterBridge implementation.
private:
diff --git a/chrome/utility/importer/firefox_importer.cc b/chrome/utility/importer/firefox_importer.cc
index 7bf2558..2682b3d3 100644
--- a/chrome/utility/importer/firefox_importer.cc
+++ b/chrome/utility/importer/firefox_importer.cc
@@ -101,7 +101,7 @@
int parent;
int id;
GURL url;
- base::string16 title;
+ std::u16string title;
BookmarkItemType type;
std::string keyword;
base::Time date_added;
@@ -281,7 +281,7 @@
continue;
// Find the bookmark path by tracing their links to parent folders.
- std::vector<base::string16> path;
+ std::vector<std::u16string> path;
BookmarkItem* child = item.get();
bool found_path = false;
bool is_in_toolbar = false;
@@ -354,7 +354,7 @@
// Write into profile.
if (!bookmarks.empty() && !cancelled()) {
- const base::string16& first_folder_name =
+ const std::u16string& first_folder_name =
bridge_->GetLocalizedString(IDS_BOOKMARK_GROUP_FROM_FIREFOX);
bridge_->AddBookmarks(bookmarks, first_folder_name);
}
diff --git a/chrome/utility/importer/ie_importer_win.cc b/chrome/utility/importer/ie_importer_win.cc
index 946ce54..4096bd26 100644
--- a/chrome/utility/importer/ie_importer_win.cc
+++ b/chrome/utility/importer/ie_importer_win.cc
@@ -475,7 +475,7 @@
ParseFavoritesFolder(info, &bookmarks, &favicons);
if (!bookmarks.empty() && !cancelled()) {
- const base::string16& first_folder_name =
+ const std::u16string& first_folder_name =
edge_import_mode_
? l10n_util::GetStringUTF16(IDS_BOOKMARK_GROUP_FROM_EDGE)
: l10n_util::GetStringUTF16(IDS_BOOKMARK_GROUP_FROM_IE);
@@ -551,7 +551,7 @@
// Software\Microsoft\Internet Explorer\SearchScopes
// Each key represents a search engine. The URL value contains the URL and
// the DisplayName the name.
- typedef std::map<std::string, base::string16> SearchEnginesMap;
+ typedef std::map<std::string, std::u16string> SearchEnginesMap;
SearchEnginesMap search_engines_map;
for (base::win::RegistryKeyIterator key_iter(HKEY_CURRENT_USER,
kSearchScopePath);
diff --git a/chrome/utility/importer/ie_importer_win.h b/chrome/utility/importer/ie_importer_win.h
index f2b0f5a..563ab431c 100644
--- a/chrome/utility/importer/ie_importer_win.h
+++ b/chrome/utility/importer/ie_importer_win.h
@@ -35,7 +35,7 @@
// A struct that hosts the information of IE Favorite folder.
struct FavoritesInfo {
base::FilePath path;
- base::string16 links_folder;
+ std::u16string links_folder;
};
// IE PStore subkey GUID: AutoComplete password & form data.
diff --git a/chrome/utility/importer/nss_decryptor.cc b/chrome/utility/importer/nss_decryptor.cc
index 7ae4991..a9d0f88f 100644
--- a/chrome/utility/importer/nss_decryptor.cc
+++ b/chrome/utility/importer/nss_decryptor.cc
@@ -71,8 +71,8 @@
struct FirefoxRawPasswordInfo {
std::string host;
std::string realm;
- base::string16 username_element;
- base::string16 password_element;
+ std::u16string username_element;
+ std::u16string password_element;
std::string encrypted_username;
std::string encrypted_password;
std::string form_action;
@@ -97,13 +97,13 @@
} // namespace
-base::string16 NSSDecryptor::Decrypt(const std::string& crypt) const {
+std::u16string NSSDecryptor::Decrypt(const std::string& crypt) const {
// Do nothing if NSS is not loaded.
if (!is_nss_initialized_)
- return base::string16();
+ return std::u16string();
if (crypt.empty())
- return base::string16();
+ return std::u16string();
// The old style password is encoded in base64. They are identified
// by a leading '~'. Otherwise, we should decrypt the text.
@@ -111,12 +111,12 @@
if (crypt[0] != '~') {
std::string decoded_data;
if (!base::Base64Decode(crypt, &decoded_data))
- return base::string16();
+ return std::u16string();
PK11SlotInfo* slot = GetKeySlotForDB();
SECStatus result = PK11_Authenticate(slot, PR_TRUE, NULL);
if (result != SECSuccess) {
FreeSlot(slot);
- return base::string16();
+ return std::u16string();
}
SECItem request;
@@ -139,7 +139,7 @@
} else {
// Deletes the leading '~' before decoding.
if (!base::Base64Decode(crypt.substr(1), &plain))
- return base::string16();
+ return std::u16string();
}
return base::UTF8ToUTF16(plain);
diff --git a/chrome/utility/importer/nss_decryptor_system_nss.h b/chrome/utility/importer/nss_decryptor_system_nss.h
index 6c43492..327ed97 100644
--- a/chrome/utility/importer/nss_decryptor_system_nss.h
+++ b/chrome/utility/importer/nss_decryptor_system_nss.h
@@ -33,7 +33,7 @@
// Decrypts Firefox stored passwords. Before using this method,
// make sure Init() returns true.
- base::string16 Decrypt(const std::string& crypt) const;
+ std::u16string Decrypt(const std::string& crypt) const;
// Reads and parses the Firefox password file logins.json, decrypts the
// username/password and reads other related information.
diff --git a/chrome/utility/importer/nss_decryptor_win.h b/chrome/utility/importer/nss_decryptor_win.h
index 431fdda5..682637c5 100644
--- a/chrome/utility/importer/nss_decryptor_win.h
+++ b/chrome/utility/importer/nss_decryptor_win.h
@@ -126,7 +126,7 @@
// Decrypts Firefox stored passwords. Before using this method,
// make sure Init() returns true.
- base::string16 Decrypt(const std::string& crypt) const;
+ std::u16string Decrypt(const std::string& crypt) const;
// Reads and parses the Firefox password file logins.json, decrypts the
// username/password and reads other related information.
diff --git a/chrome/utility/importer/safari_importer.h b/chrome/utility/importer/safari_importer.h
index 1891fa3e..f107a538 100644
--- a/chrome/utility/importer/safari_importer.h
+++ b/chrome/utility/importer/safari_importer.h
@@ -63,7 +63,7 @@
void ImportBookmarks();
// Parse Safari's stored bookmarks.
- void ParseBookmarks(const base::string16& toolbar_name,
+ void ParseBookmarks(const std::u16string& toolbar_name,
std::vector<ImportedBookmarkEntry>* bookmarks);
// Function to recursively read Bookmarks out of Safari plist.
@@ -73,9 +73,9 @@
// |out_bookmarks| BookMark element array to write into.
void RecursiveReadBookmarksFolder(
NSDictionary* bookmark_folder,
- const std::vector<base::string16>& parent_path_elements,
+ const std::vector<std::u16string>& parent_path_elements,
bool is_in_toolbar,
- const base::string16& toolbar_name,
+ const std::u16string& toolbar_name,
std::vector<ImportedBookmarkEntry>* out_bookmarks);
// Opens the favicon database file.
diff --git a/chrome/utility/importer/safari_importer.mm b/chrome/utility/importer/safari_importer.mm
index 00a1ec6..7701f12 100644
--- a/chrome/utility/importer/safari_importer.mm
+++ b/chrome/utility/importer/safari_importer.mm
@@ -53,14 +53,14 @@
}
void SafariImporter::ImportBookmarks() {
- base::string16 toolbar_name =
+ std::u16string toolbar_name =
bridge_->GetLocalizedString(IDS_BOOKMARK_BAR_FOLDER_NAME);
std::vector<ImportedBookmarkEntry> bookmarks;
ParseBookmarks(toolbar_name, &bookmarks);
// Write bookmarks into profile.
if (!bookmarks.empty() && !cancelled()) {
- const base::string16& first_folder_name =
+ const std::u16string& first_folder_name =
bridge_->GetLocalizedString(IDS_BOOKMARK_GROUP_FROM_SAFARI);
bridge_->AddBookmarks(bookmarks, first_folder_name);
}
@@ -142,9 +142,9 @@
void SafariImporter::RecursiveReadBookmarksFolder(
NSDictionary* bookmark_folder,
- const std::vector<base::string16>& parent_path_elements,
+ const std::vector<std::u16string>& parent_path_elements,
bool is_in_toolbar,
- const base::string16& toolbar_name,
+ const std::u16string& toolbar_name,
std::vector<ImportedBookmarkEntry>* out_bookmarks) {
DCHECK(bookmark_folder);
@@ -189,7 +189,7 @@
return;
}
- std::vector<base::string16> path_elements(parent_path_elements);
+ std::vector<std::u16string> path_elements(parent_path_elements);
// Create a folder for the toolbar, but not for the bookmarks menu.
if (path_elements.empty() && [title isEqualToString:@"BookmarksBar"]) {
is_in_toolbar = true;
@@ -242,7 +242,7 @@
}
void SafariImporter::ParseBookmarks(
- const base::string16& toolbar_name,
+ const std::u16string& toolbar_name,
std::vector<ImportedBookmarkEntry>* bookmarks) {
DCHECK(bookmarks);
@@ -261,7 +261,7 @@
return;
// Recursively read in bookmarks.
- std::vector<base::string16> parent_path_elements;
+ std::vector<std::u16string> parent_path_elements;
RecursiveReadBookmarksFolder(bookmarks_dict, parent_path_elements, false,
toolbar_name, bookmarks);
}
diff --git a/chrome/utility/importer/safari_importer_unittest.mm b/chrome/utility/importer/safari_importer_unittest.mm
index c61e2aa9..6d1e16d 100644
--- a/chrome/utility/importer/safari_importer_unittest.mm
+++ b/chrome/utility/importer/safari_importer_unittest.mm
@@ -62,51 +62,22 @@
bool in_toolbar;
GURL url;
// We store the path with levels of nesting delimited by forward slashes.
- base::string16 path;
- base::string16 title;
+ std::u16string path;
+ std::u16string title;
} kImportedBookmarksData[] = {
- {
- true,
- GURL("http://www.apple.com/"),
- ASCIIToUTF16("Toolbar/"),
- ASCIIToUTF16("Apple")
- },
- {
- true,
- GURL("http://www.yahoo.com/"),
- ASCIIToUTF16("Toolbar/"),
- ASCIIToUTF16("Yahoo!")
- },
- {
- true,
- GURL("http://www.cnn.com/"),
- ASCIIToUTF16("Toolbar/News"),
- ASCIIToUTF16("CNN")
- },
- {
- true,
- GURL("http://www.nytimes.com/"),
- ASCIIToUTF16("Toolbar/News"),
- ASCIIToUTF16("The New York Times")
- },
- {
- false,
- GURL("http://www.reddit.com/"),
- base::string16(),
- ASCIIToUTF16("reddit.com: what's new online!")
- },
- {
- false,
- GURL(),
- base::string16(),
- ASCIIToUTF16("Empty Folder")
- },
- {
- false,
- GURL("http://www.webkit.org/blog/"),
- base::string16(),
- ASCIIToUTF16("Surfin' Safari - The WebKit Blog")
- },
+ {true, GURL("http://www.apple.com/"), ASCIIToUTF16("Toolbar/"),
+ ASCIIToUTF16("Apple")},
+ {true, GURL("http://www.yahoo.com/"), ASCIIToUTF16("Toolbar/"),
+ ASCIIToUTF16("Yahoo!")},
+ {true, GURL("http://www.cnn.com/"), ASCIIToUTF16("Toolbar/News"),
+ ASCIIToUTF16("CNN")},
+ {true, GURL("http://www.nytimes.com/"), ASCIIToUTF16("Toolbar/News"),
+ ASCIIToUTF16("The New York Times")},
+ {false, GURL("http://www.reddit.com/"), std::u16string(),
+ ASCIIToUTF16("reddit.com: what's new online!")},
+ {false, GURL(), std::u16string(), ASCIIToUTF16("Empty Folder")},
+ {false, GURL("http://www.webkit.org/blog/"), std::u16string(),
+ ASCIIToUTF16("Surfin' Safari - The WebKit Blog")},
};
scoped_refptr<SafariImporter> importer(GetSafariImporter());
@@ -120,9 +91,9 @@
EXPECT_EQ(kImportedBookmarksData[i].in_toolbar, entry.in_toolbar);
EXPECT_EQ(kImportedBookmarksData[i].url, entry.url);
- std::vector<base::string16> path = base::SplitString(
- kImportedBookmarksData[i].path, ASCIIToUTF16("/"),
- base::KEEP_WHITESPACE, base::SPLIT_WANT_NONEMPTY);
+ std::vector<std::u16string> path =
+ base::SplitString(kImportedBookmarksData[i].path, ASCIIToUTF16("/"),
+ base::KEEP_WHITESPACE, base::SPLIT_WANT_NONEMPTY);
ASSERT_EQ(path.size(), entry.path.size());
for (size_t j = 0; j < path.size(); ++j) {
EXPECT_EQ(path[j], entry.path[j]);
@@ -138,39 +109,19 @@
bool in_toolbar;
GURL url;
// We store the path with levels of nesting delimited by forward slashes.
- base::string16 path;
- base::string16 title;
+ std::u16string path;
+ std::u16string title;
} kImportedBookmarksData[] = {
- {
- true,
- GURL("http://www.apple.com/"),
- ASCIIToUTF16("Toolbar/"),
- ASCIIToUTF16("Apple")
- },
- {
- true,
- GURL("http://www.yahoo.com/"),
- ASCIIToUTF16("Toolbar/"),
- ASCIIToUTF16("Yahoo!")
- },
- {
- true,
- GURL("http://www.cnn.com/"),
- ASCIIToUTF16("Toolbar/News"),
- ASCIIToUTF16("CNN")
- },
- {
- true,
- GURL("http://www.nytimes.com/"),
- ASCIIToUTF16("Toolbar/News"),
- ASCIIToUTF16("The New York Times")
- },
- {
- false,
- GURL("http://www.webkit.org/blog/"),
- base::string16(),
- ASCIIToUTF16("Surfin' Safari - The WebKit Blog")
- },
+ {true, GURL("http://www.apple.com/"), ASCIIToUTF16("Toolbar/"),
+ ASCIIToUTF16("Apple")},
+ {true, GURL("http://www.yahoo.com/"), ASCIIToUTF16("Toolbar/"),
+ ASCIIToUTF16("Yahoo!")},
+ {true, GURL("http://www.cnn.com/"), ASCIIToUTF16("Toolbar/News"),
+ ASCIIToUTF16("CNN")},
+ {true, GURL("http://www.nytimes.com/"), ASCIIToUTF16("Toolbar/News"),
+ ASCIIToUTF16("The New York Times")},
+ {false, GURL("http://www.webkit.org/blog/"), std::u16string(),
+ ASCIIToUTF16("Surfin' Safari - The WebKit Blog")},
};
scoped_refptr<SafariImporter> importer(
@@ -185,9 +136,9 @@
EXPECT_EQ(kImportedBookmarksData[i].in_toolbar, entry.in_toolbar);
EXPECT_EQ(kImportedBookmarksData[i].url, entry.url);
- std::vector<base::string16> path = base::SplitString(
- kImportedBookmarksData[i].path, ASCIIToUTF16("/"),
- base::KEEP_WHITESPACE, base::SPLIT_WANT_NONEMPTY);
+ std::vector<std::u16string> path =
+ base::SplitString(kImportedBookmarksData[i].path, ASCIIToUTF16("/"),
+ base::KEEP_WHITESPACE, base::SPLIT_WANT_NONEMPTY);
ASSERT_EQ(path.size(), entry.path.size());
for (size_t j = 0; j < path.size(); ++j) {
EXPECT_EQ(path[j], entry.path[j]);
diff --git a/chrome/utility/safe_browsing/mac/dmg_analyzer_unittest.cc b/chrome/utility/safe_browsing/mac/dmg_analyzer_unittest.cc
index c27d41bd..9a53cd2e 100644
--- a/chrome/utility/safe_browsing/mac/dmg_analyzer_unittest.cc
+++ b/chrome/utility/safe_browsing/mac/dmg_analyzer_unittest.cc
@@ -49,7 +49,7 @@
bool Next() override { return ++index_ < entries_.size(); }
- base::string16 GetPath() override {
+ std::u16string GetPath() override {
EXPECT_LT(index_, entries_.size());
return base::UTF8ToUTF16(entries_[index_].path);
}
diff --git a/chrome/utility/safe_browsing/mac/dmg_iterator.cc b/chrome/utility/safe_browsing/mac/dmg_iterator.cc
index 8d883aa..d49ef97 100644
--- a/chrome/utility/safe_browsing/mac/dmg_iterator.cc
+++ b/chrome/utility/safe_browsing/mac/dmg_iterator.cc
@@ -75,7 +75,7 @@
return false;
}
-base::string16 DMGIterator::GetPath() {
+std::u16string DMGIterator::GetPath() {
return hfs_->GetPath();
}
diff --git a/chrome/utility/safe_browsing/mac/dmg_iterator.h b/chrome/utility/safe_browsing/mac/dmg_iterator.h
index 53087d8..22e29df 100644
--- a/chrome/utility/safe_browsing/mac/dmg_iterator.h
+++ b/chrome/utility/safe_browsing/mac/dmg_iterator.h
@@ -47,7 +47,7 @@
virtual bool Next();
// Returns the full path in a DMG filesystem to the current file item.
- virtual base::string16 GetPath();
+ virtual std::u16string GetPath();
// Returns a ReadStream for the current file item.
virtual std::unique_ptr<ReadStream> GetReadStream();
diff --git a/chrome/utility/safe_browsing/mac/hfs.cc b/chrome/utility/safe_browsing/mac/hfs.cc
index e76a74b..e4b81b5 100644
--- a/chrome/utility/safe_browsing/mac/hfs.cc
+++ b/chrome/utility/safe_browsing/mac/hfs.cc
@@ -150,7 +150,7 @@
public:
struct Entry {
uint16_t record_type; // Catalog folder item type.
- base::string16 path; // Full path to the item.
+ std::u16string path; // Full path to the item.
bool unexported; // Whether this is HFS+ private data.
union {
HFSPlusCatalogFile* file;
@@ -182,14 +182,14 @@
// Checks if the HFS+ catalog key is a Mac OS X reserved key that should not
// have it or its contents iterated over.
- bool IsKeyUnexported(const base::string16& path);
+ bool IsKeyUnexported(const std::u16string& path);
ReadStream* stream_; // The stream backing the catalog file.
BTHeaderRec header_; // The header B-tree node.
// Maps CNIDs to their full path. This is used to construct full paths for
// items that descend from the folders in this map.
- std::map<uint32_t, base::string16> folder_cnid_map_;
+ std::map<uint32_t, std::u16string> folder_cnid_map_;
// CNIDs of the non-exported folders reserved by OS X. If an item has this
// CNID as a parent, it should be skipped.
@@ -213,9 +213,9 @@
Entry current_record_; // The record read at |current_leaf_offset_|.
// Constant, string16 versions of the __APPLE_API_PRIVATE values.
- const base::string16 kHFSMetadataFolder =
+ const std::u16string kHFSMetadataFolder =
base::UTF8ToUTF16(base::StringPiece("\x0\x0\x0\x0HFS+ Private Data", 21));
- const base::string16 kHFSDirMetadataFolder =
+ const std::u16string kHFSDirMetadataFolder =
base::UTF8ToUTF16(".HFS+ Private Directory Data\xd");
DISALLOW_COPY_AND_ASSIGN(HFSBTreeIterator);
@@ -306,7 +306,7 @@
return file->bsdInfo.ownerFlags & UF_COMPRESSED;
}
-base::string16 HFSIterator::GetPath() {
+std::u16string HFSIterator::GetPath() {
return catalog_->current_record()->path;
}
@@ -536,7 +536,7 @@
}
// Read and byte-swap the variable-length key string.
- base::string16 key(key_string_length, '\0');
+ std::u16string key(key_string_length, '\0');
for (uint16_t i = 0; i < key_string_length; ++i) {
auto* character = GetLeafData<uint16_t>();
if (!character) {
@@ -589,7 +589,7 @@
++leaf_records_read_;
++current_leaf_records_read_;
- base::string16 path =
+ std::u16string path =
folder_cnid_map_[parent_id] + kFilePathSeparator + key;
current_record_.path = path;
current_record_.file = file;
@@ -675,7 +675,7 @@
return object;
}
-bool HFSBTreeIterator::IsKeyUnexported(const base::string16& key) {
+bool HFSBTreeIterator::IsKeyUnexported(const std::u16string& key) {
return key == kHFSDirMetadataFolder ||
key == kHFSMetadataFolder;
}
diff --git a/chrome/utility/safe_browsing/mac/hfs.h b/chrome/utility/safe_browsing/mac/hfs.h
index f29c0f1..8e68c58 100644
--- a/chrome/utility/safe_browsing/mac/hfs.h
+++ b/chrome/utility/safe_browsing/mac/hfs.h
@@ -66,7 +66,7 @@
bool IsDecmpfsCompressed();
// Returns the full filesystem path of the current iterator item.
- base::string16 GetPath();
+ std::u16string GetPath();
// Returns a stream for the data fork of the current iterator item. This may
// only be called if IsDirectory() and IsHardLink() returns false.
diff --git a/chrome/utility/safe_browsing/mac/hfs_unittest.cc b/chrome/utility/safe_browsing/mac/hfs_unittest.cc
index 2a2ecdd..e98722c9 100644
--- a/chrome/utility/safe_browsing/mac/hfs_unittest.cc
+++ b/chrome/utility/safe_browsing/mac/hfs_unittest.cc
@@ -24,8 +24,8 @@
class HFSIteratorTest : public testing::Test {
public:
void GetTargetFiles(bool case_sensitive,
- std::set<base::string16>* files,
- std::set<base::string16>* dirs) {
+ std::set<std::u16string>* files,
+ std::set<std::u16string>* dirs) {
const char* kBaseFiles[] = {
"first/second/third/fourth/fifth/random",
"first/second/third/fourth/Hello World",
@@ -45,7 +45,7 @@
".Trashes",
};
- const base::string16 dmg_name = base::ASCIIToUTF16("SafeBrowsingDMG/");
+ const std::u16string dmg_name = base::ASCIIToUTF16("SafeBrowsingDMG/");
for (size_t i = 0; i < base::size(kBaseFiles); ++i)
files->insert(dmg_name + base::ASCIIToUTF16(kBaseFiles[i]));
@@ -65,15 +65,15 @@
void TestTargetFiles(safe_browsing::dmg::HFSIterator* hfs_reader,
bool case_sensitive) {
- std::set<base::string16> files, dirs;
+ std::set<std::u16string> files, dirs;
GetTargetFiles(case_sensitive, &files, &dirs);
ASSERT_TRUE(hfs_reader->Open());
while (hfs_reader->Next()) {
- base::string16 path = hfs_reader->GetPath();
+ std::u16string path = hfs_reader->GetPath();
// Skip over .fseventsd files.
if (path.find(base::ASCIIToUTF16("SafeBrowsingDMG/.fseventsd")) !=
- base::string16::npos) {
+ std::u16string::npos) {
continue;
}
if (hfs_reader->IsDirectory())
diff --git a/chromecast/bindings/bindings_manager_cast_browsertest.cc b/chromecast/bindings/bindings_manager_cast_browsertest.cc
index ba4c7054..2a5ea236 100644
--- a/chromecast/bindings/bindings_manager_cast_browsertest.cc
+++ b/chromecast/bindings/bindings_manager_cast_browsertest.cc
@@ -82,7 +82,7 @@
}
// CastWebContents::Observer implementation:
- void UpdateTitle(const base::string16& title) override {
+ void UpdateTitle(const std::u16string& title) override {
// Resumes execution of RunUntilTitleEquals() if |title| matches
// expectations.
std::string title_utf8 = base::UTF16ToUTF8(title);
diff --git a/chromecast/browser/bluetooth/cast_bluetooth_chooser.cc b/chromecast/browser/bluetooth/cast_bluetooth_chooser.cc
index 8a7f0448..6b2047f 100644
--- a/chromecast/browser/bluetooth/cast_bluetooth_chooser.cc
+++ b/chromecast/browser/bluetooth/cast_bluetooth_chooser.cc
@@ -50,7 +50,7 @@
void CastBluetoothChooser::AddOrUpdateDevice(const std::string& device_id,
bool should_update_name,
- const base::string16& device_name,
+ const std::u16string& device_name,
bool is_gatt_connected,
bool is_paired,
int signal_strength_level) {
diff --git a/chromecast/browser/bluetooth/cast_bluetooth_chooser.h b/chromecast/browser/bluetooth/cast_bluetooth_chooser.h
index 2ca52fc..6841653 100644
--- a/chromecast/browser/bluetooth/cast_bluetooth_chooser.h
+++ b/chromecast/browser/bluetooth/cast_bluetooth_chooser.h
@@ -39,7 +39,7 @@
// content::BluetoothChooser implementation:
void AddOrUpdateDevice(const std::string& device_id,
bool should_update_name,
- const base::string16& device_name,
+ const std::u16string& device_name,
bool is_gatt_connected,
bool is_paired,
int signal_strength_level) override;
diff --git a/chromecast/browser/bluetooth/cast_bluetooth_chooser_unittest.cc b/chromecast/browser/bluetooth/cast_bluetooth_chooser_unittest.cc
index 88dc75e..61a2aca 100644
--- a/chromecast/browser/bluetooth/cast_bluetooth_chooser_unittest.cc
+++ b/chromecast/browser/bluetooth/cast_bluetooth_chooser_unittest.cc
@@ -61,7 +61,7 @@
~CastBluetoothChooserTest() override = default;
void AddDeviceToChooser(const std::string& address) {
- chooser().AddOrUpdateDevice(address, false, base::string16(), false, false,
+ chooser().AddOrUpdateDevice(address, false, std::u16string(), false, false,
0);
}
diff --git a/chromecast/browser/cast_extension_host.cc b/chromecast/browser/cast_extension_host.cc
index ec9351f..492ec6d 100644
--- a/chromecast/browser/cast_extension_host.cc
+++ b/chromecast/browser/cast_extension_host.cc
@@ -82,11 +82,11 @@
bool CastExtensionHost::DidAddMessageToConsole(
content::WebContents* source,
blink::mojom::ConsoleMessageLevel log_level,
- const base::string16& message,
+ const std::u16string& message,
int32_t line_no,
- const base::string16& source_id) {
+ const std::u16string& source_id) {
std::string context = "Cast Extension:";
- base::string16 single_line_message;
+ std::u16string single_line_message;
// Mult-line message is not friendly to dumpstate redact.
base::ReplaceChars(message, base::ASCIIToUTF16("\n"),
base::ASCIIToUTF16("\\n "), &single_line_message);
diff --git a/chromecast/browser/cast_extension_host.h b/chromecast/browser/cast_extension_host.h
index 3151a1c..3d5f8a5 100644
--- a/chromecast/browser/cast_extension_host.h
+++ b/chromecast/browser/cast_extension_host.h
@@ -44,9 +44,9 @@
content::NavigationHandle* navigation_handle) override;
bool DidAddMessageToConsole(content::WebContents* source,
blink::mojom::ConsoleMessageLevel log_level,
- const base::string16& message,
+ const std::u16string& message,
int32_t line_no,
- const base::string16& source_id) override;
+ const std::u16string& source_id) override;
void EnterFullscreenModeForTab(
content::RenderFrameHost* requesting_frame,
const blink::mojom::FullscreenOptions& options) override;
diff --git a/chromecast/browser/cast_web_contents.h b/chromecast/browser/cast_web_contents.h
index 437613d..f5a3dd1 100644
--- a/chromecast/browser/cast_web_contents.h
+++ b/chromecast/browser/cast_web_contents.h
@@ -161,7 +161,7 @@
// These methods are calls forwarded from WebContentsObserver.
virtual void MainFrameResized(const gfx::Rect& bounds) {}
- virtual void UpdateTitle(const base::string16& title) {}
+ virtual void UpdateTitle(const std::u16string& title) {}
virtual void UpdateFaviconURL(GURL icon_url) {}
virtual void DidFinishBlockedNavigation(GURL url) {}
virtual void DidFirstVisuallyNonEmptyPaint() {}
@@ -362,7 +362,7 @@
// default-constructed callback. If provided, the callback
// will be invoked on the UI thread.
virtual void ExecuteJavaScript(
- const base::string16& javascript,
+ const std::u16string& javascript,
base::OnceCallback<void(base::Value)> callback) = 0;
// ===========================================================================
diff --git a/chromecast/browser/cast_web_contents_browsertest.cc b/chromecast/browser/cast_web_contents_browsertest.cc
index f3abde4..b0e42f6 100644
--- a/chromecast/browser/cast_web_contents_browsertest.cc
+++ b/chromecast/browser/cast_web_contents_browsertest.cc
@@ -124,7 +124,7 @@
service_manager::InterfaceProvider* frame_interfaces,
blink::AssociatedInterfaceProvider* frame_associated_interfaces));
MOCK_METHOD1(ResourceLoadFailed, void(CastWebContents* cast_web_contents));
- MOCK_METHOD1(UpdateTitle, void(const base::string16& title));
+ MOCK_METHOD1(UpdateTitle, void(const std::u16string& title));
private:
DISALLOW_COPY_AND_ASSIGN(MockCastWebContentsObserver);
@@ -157,7 +157,7 @@
}
// CastWebContents::Observer implementation:
- void UpdateTitle(const base::string16& title) override {
+ void UpdateTitle(const std::u16string& title) override {
// Resumes execution of RunUntilTitleEquals() if |title| matches
// expectations.
std::string title_utf8 = base::UTF16ToUTF8(title);
diff --git a/chromecast/browser/cast_web_contents_impl.cc b/chromecast/browser/cast_web_contents_impl.cc
index 046ef39..d84ef09 100644
--- a/chromecast/browser/cast_web_contents_impl.cc
+++ b/chromecast/browser/cast_web_contents_impl.cc
@@ -343,22 +343,22 @@
std::vector<blink::WebMessagePort> ports) {
DCHECK(!data.empty());
- base::string16 data_utf16;
+ std::u16string data_utf16;
data_utf16 = base::UTF8ToUTF16(data);
// If origin is set as wildcard, no origin scoping would be applied.
constexpr char kWildcardOrigin[] = "*";
- base::Optional<base::string16> target_origin_utf16;
+ base::Optional<std::u16string> target_origin_utf16;
if (target_origin != kWildcardOrigin)
target_origin_utf16 = base::UTF8ToUTF16(target_origin);
content::MessagePortProvider::PostMessageToFrame(
- web_contents(), base::string16(), target_origin_utf16, data_utf16,
+ web_contents(), std::u16string(), target_origin_utf16, data_utf16,
std::move(ports));
}
void CastWebContentsImpl::ExecuteJavaScript(
- const base::string16& javascript,
+ const std::u16string& javascript,
base::OnceCallback<void(base::Value)> callback) {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
if (!web_contents_ || closing_ || !main_frame_loaded_ ||
diff --git a/chromecast/browser/cast_web_contents_impl.h b/chromecast/browser/cast_web_contents_impl.h
index ad2eab0..eac558e0 100644
--- a/chromecast/browser/cast_web_contents_impl.h
+++ b/chromecast/browser/cast_web_contents_impl.h
@@ -75,7 +75,7 @@
const std::string& data,
std::vector<blink::WebMessagePort> ports) override;
void ExecuteJavaScript(
- const base::string16& javascript,
+ const std::u16string& javascript,
base::OnceCallback<void(base::Value)> callback) override;
void AddObserver(Observer* observer) override;
void RemoveObserver(Observer* observer) override;
diff --git a/chromecast/browser/cast_web_view_default.cc b/chromecast/browser/cast_web_view_default.cc
index 45d8932..d48e4b6 100644
--- a/chromecast/browser/cast_web_view_default.cc
+++ b/chromecast/browser/cast_web_view_default.cc
@@ -224,12 +224,12 @@
bool CastWebViewDefault::DidAddMessageToConsole(
content::WebContents* source,
blink::mojom::ConsoleMessageLevel log_level,
- const base::string16& message,
+ const std::u16string& message,
int32_t line_no,
- const base::string16& source_id) {
+ const std::u16string& source_id) {
if (!log_js_console_messages_)
return true;
- base::string16 single_line_message;
+ std::u16string single_line_message;
// Mult-line message is not friendly to dumpstate redact.
base::ReplaceChars(message, base::ASCIIToUTF16("\n"),
base::ASCIIToUTF16("\\n "), &single_line_message);
diff --git a/chromecast/browser/cast_web_view_default.h b/chromecast/browser/cast_web_view_default.h
index 4912042..24de9e4 100644
--- a/chromecast/browser/cast_web_view_default.h
+++ b/chromecast/browser/cast_web_view_default.h
@@ -77,9 +77,9 @@
blink::mojom::MediaStreamType type) override;
bool DidAddMessageToConsole(content::WebContents* source,
blink::mojom::ConsoleMessageLevel log_level,
- const base::string16& message,
+ const std::u16string& message,
int32_t line_no,
- const base::string16& source_id) override;
+ const std::u16string& source_id) override;
void RequestMediaAccessPermission(
content::WebContents* web_contents,
const content::MediaStreamRequest& request,
diff --git a/chromecast/browser/service_manager_context.cc b/chromecast/browser/service_manager_context.cc
index 80b229b..12031c9 100644
--- a/chromecast/browser/service_manager_context.cc
+++ b/chromecast/browser/service_manager_context.cc
@@ -112,7 +112,7 @@
mojo::PendingRemote<service_manager::mojom::Service> Launch(
const service_manager::Identity& identity,
sandbox::policy::SandboxType sandbox_type,
- const base::string16& display_name,
+ const std::u16string& display_name,
LaunchCallback callback) override {
// Start a new process for this service.
mojo::PendingRemote<service_manager::mojom::Service> remote;
@@ -141,7 +141,7 @@
mojo::PendingRemote<service_manager::mojom::Service> Launch(
const service_manager::Identity& identity,
sandbox::policy::SandboxType sandbox_type,
- const base::string16& display_name,
+ const std::u16string& display_name,
LaunchCallback callback) override {
// TODO(https://crbug.com/781334): Support sandboxing.
return launcher_.Start(identity, sandbox::policy::SandboxType::kNoSandbox,
diff --git a/chromecast/browser/test/cast_navigation_browsertest.cc b/chromecast/browser/test/cast_navigation_browsertest.cc
index 7c415146..4a62fb5 100644
--- a/chromecast/browser/test/cast_navigation_browsertest.cc
+++ b/chromecast/browser/test/cast_navigation_browsertest.cc
@@ -39,7 +39,7 @@
NavigateToURL(GURL(url::kAboutBlankURL));
content::TitleWatcher title_watcher(
web_contents, base::ASCIIToUTF16(url::kAboutBlankURL));
- base::string16 result = title_watcher.WaitAndGetTitle();
+ std::u16string result = title_watcher.WaitAndGetTitle();
EXPECT_EQ(url::kAboutBlankURL, base::UTF16ToASCII(result));
}
void PlayAudio(const std::string& media_file) {
@@ -83,7 +83,7 @@
title_watcher.AlsoWaitForTitle(base::ASCIIToUTF16(kEnded));
title_watcher.AlsoWaitForTitle(base::ASCIIToUTF16(kError));
title_watcher.AlsoWaitForTitle(base::ASCIIToUTF16(kFailed));
- base::string16 result = title_watcher.WaitAndGetTitle();
+ std::u16string result = title_watcher.WaitAndGetTitle();
return base::UTF16ToASCII(result);
}
diff --git a/chromecast/browser/test/mock_cast_web_view.h b/chromecast/browser/test/mock_cast_web_view.h
index 5393bb5..170d6437 100644
--- a/chromecast/browser/test/mock_cast_web_view.h
+++ b/chromecast/browser/test/mock_cast_web_view.h
@@ -50,7 +50,7 @@
(override));
MOCK_METHOD(void,
ExecuteJavaScript,
- (const base::string16&, base::OnceCallback<void(base::Value)>),
+ (const std::u16string&, base::OnceCallback<void(base::Value)>),
(override));
MOCK_METHOD(void, AddObserver, (Observer*), (override));
MOCK_METHOD(void, RemoveObserver, (Observer*), (override));
diff --git a/chromecast/common/cast_content_client.cc b/chromecast/common/cast_content_client.cc
index 1a17b5a..26161184 100644
--- a/chromecast/common/cast_content_client.cc
+++ b/chromecast/common/cast_content_client.cc
@@ -116,7 +116,7 @@
#endif
}
-base::string16 CastContentClient::GetLocalizedString(int message_id) {
+std::u16string CastContentClient::GetLocalizedString(int message_id) {
return l10n_util::GetStringUTF16(message_id);
}
diff --git a/chromecast/common/cast_content_client.h b/chromecast/common/cast_content_client.h
index fd5e734d..c866dce 100644
--- a/chromecast/common/cast_content_client.h
+++ b/chromecast/common/cast_content_client.h
@@ -21,7 +21,7 @@
// content::ContentClient implementation:
void SetActiveURL(const GURL& url, std::string top_origin) override;
void AddAdditionalSchemes(Schemes* schemes) override;
- base::string16 GetLocalizedString(int message_id) override;
+ std::u16string GetLocalizedString(int message_id) override;
base::StringPiece GetDataResource(int resource_id,
ui::ScaleFactor scale_factor) override;
base::RefCountedMemory* GetDataResourceBytes(int resource_id) override;
diff --git a/chromecast/common/cast_redirect_manifest_handler.cc b/chromecast/common/cast_redirect_manifest_handler.cc
index a0885a1..110616d 100644
--- a/chromecast/common/cast_redirect_manifest_handler.cc
+++ b/chromecast/common/cast_redirect_manifest_handler.cc
@@ -29,7 +29,7 @@
CastRedirectHandler::~CastRedirectHandler() {}
bool CastRedirectHandler::Parse(extensions::Extension* extension,
- base::string16* error) {
+ std::u16string* error) {
std::unique_ptr<Data> info(new Data);
const base::DictionaryValue* dict;
if (extension->manifest()->GetDictionary(kCastRedirect, &dict)) {
diff --git a/chromecast/common/cast_redirect_manifest_handler.h b/chromecast/common/cast_redirect_manifest_handler.h
index 69f8655..17bb89b 100644
--- a/chromecast/common/cast_redirect_manifest_handler.h
+++ b/chromecast/common/cast_redirect_manifest_handler.h
@@ -21,7 +21,7 @@
CastRedirectHandler();
~CastRedirectHandler() override;
- bool Parse(extensions::Extension* extension, base::string16* error) override;
+ bool Parse(extensions::Extension* extension, std::u16string* error) override;
bool Validate(
const extensions::Extension* extension,
std::string* error,
diff --git a/chromecast/common/cast_resource_delegate.cc b/chromecast/common/cast_resource_delegate.cc
index b88d888..82614b1 100644
--- a/chromecast/common/cast_resource_delegate.cc
+++ b/chromecast/common/cast_resource_delegate.cc
@@ -78,7 +78,7 @@
}
bool CastResourceDelegate::GetLocalizedString(int message_id,
- base::string16* value) const {
+ std::u16string* value) const {
ExtraLocaledStringMap::const_iterator it =
extra_localized_strings_.find(message_id);
if (it != extra_localized_strings_.end()) {
@@ -90,7 +90,7 @@
void CastResourceDelegate::AddExtraLocalizedString(
int resource_id,
- const base::string16& localized) {
+ const std::u16string& localized) {
RemoveExtraLocalizedString(resource_id);
extra_localized_strings_.insert(std::make_pair(resource_id, localized));
}
diff --git a/chromecast/common/cast_resource_delegate.h b/chromecast/common/cast_resource_delegate.h
index 8242836..4d333cd0 100644
--- a/chromecast/common/cast_resource_delegate.h
+++ b/chromecast/common/cast_resource_delegate.h
@@ -49,16 +49,16 @@
bool GetRawDataResource(int resource_id,
ui::ScaleFactor scale_factor,
base::StringPiece* value) const override;
- bool GetLocalizedString(int message_id, base::string16* value) const override;
+ bool GetLocalizedString(int message_id, std::u16string* value) const override;
// Adds/removes/clears extra localized strings.
void AddExtraLocalizedString(int resource_id,
- const base::string16& localized);
+ const std::u16string& localized);
void RemoveExtraLocalizedString(int resource_id);
void ClearAllExtraLocalizedStrings();
private:
- using ExtraLocaledStringMap = std::unordered_map<int, base::string16>;
+ using ExtraLocaledStringMap = std::unordered_map<int, std::u16string>;
ExtraLocaledStringMap extra_localized_strings_;
diff --git a/chromecast/ui/media_control_ui.cc b/chromecast/ui/media_control_ui.cc
index 29d4eb3..8705607 100644
--- a/chromecast/ui/media_control_ui.cc
+++ b/chromecast/ui/media_control_ui.cc
@@ -103,9 +103,9 @@
// Labels.
lbl_title_ =
- view_->AddChildView(std::make_unique<views::Label>(base::string16()));
+ view_->AddChildView(std::make_unique<views::Label>(std::u16string()));
lbl_meta_ =
- view_->AddChildView(std::make_unique<views::Label>(base::string16()));
+ view_->AddChildView(std::make_unique<views::Label>(std::u16string()));
// Progress Bar.
progress_bar_ = view_->AddChildView(std::make_unique<views::ProgressBar>());
diff --git a/chromecast/ui/media_overlay.h b/chromecast/ui/media_overlay.h
index 196ac4d..12e5fc9 100644
--- a/chromecast/ui/media_overlay.h
+++ b/chromecast/ui/media_overlay.h
@@ -27,7 +27,7 @@
virtual void SetController(Controller* controller) = 0;
// Displays a brief toast to the user.
- virtual void ShowMessage(const base::string16& message) = 0;
+ virtual void ShowMessage(const std::u16string& message) = 0;
// Shows the volume bar for a given |volume|.
virtual void ShowVolumeBar(float volume) = 0;
diff --git a/chromecast/ui/media_overlay_impl.cc b/chromecast/ui/media_overlay_impl.cc
index e02dd87c..4522a6e 100644
--- a/chromecast/ui/media_overlay_impl.cc
+++ b/chromecast/ui/media_overlay_impl.cc
@@ -127,7 +127,7 @@
NotifyController();
}
-void MediaOverlayImpl::ShowMessage(const base::string16& message) {
+void MediaOverlayImpl::ShowMessage(const std::u16string& message) {
if (!ui_task_runner_->BelongsToCurrentThread()) {
ui_task_runner_->PostTask(
FROM_HERE, base::BindOnce(&MediaOverlayImpl::ShowMessage,
@@ -157,7 +157,7 @@
volume_panel_->SetVisible(false);
}
-void MediaOverlayImpl::ShowToast(const base::string16& text) {
+void MediaOverlayImpl::ShowToast(const std::u16string& text) {
toast_label_->SetText(text);
toast_label_->SizeToFit(volume_panel_->bounds().width());
toast_label_->SetVisible(true);
diff --git a/chromecast/ui/media_overlay_impl.h b/chromecast/ui/media_overlay_impl.h
index 8ad832e..a8f05588 100644
--- a/chromecast/ui/media_overlay_impl.h
+++ b/chromecast/ui/media_overlay_impl.h
@@ -43,7 +43,7 @@
// MediaOverlay implementation:
void SetController(Controller* controller) override;
- void ShowMessage(const base::string16& message) override;
+ void ShowMessage(const std::u16string& message) override;
void ShowVolumeBar(float volume) override;
// media::MediaPipelineObserver implementation
@@ -60,7 +60,7 @@
void HideVolumeWidget();
- void ShowToast(const base::string16& text);
+ void ShowToast(const std::u16string& text);
void HideToast();
std::unique_ptr<views::Widget> CreateOverlayWidget(
diff --git a/chromeos/components/diagnostics_ui/backend/power_manager_client_conversions.cc b/chromeos/components/diagnostics_ui/backend/power_manager_client_conversions.cc
index 4de9e584b..107f553 100644
--- a/chromeos/components/diagnostics_ui/backend/power_manager_client_conversions.cc
+++ b/chromeos/components/diagnostics_ui/backend/power_manager_client_conversions.cc
@@ -44,12 +44,12 @@
}
}
-base::string16 ConstructPowerTime(
+std::u16string ConstructPowerTime(
mojom::BatteryState battery_state,
const power_manager::PowerSupplyProperties& power_supply_props) {
if (battery_state == mojom::BatteryState::kFull) {
// Return an empty string if the battery is full.
- return base::string16();
+ return std::u16string();
}
int64_t time_in_seconds;
@@ -68,7 +68,7 @@
// If power manager is still calculating battery time or |time_in_seconds|
// is negative (meaning power manager couldn't compute a reasonable time)
// return an empty string.
- return base::string16();
+ return std::u16string();
}
const base::TimeDelta as_time_delta =
diff --git a/chromeos/components/diagnostics_ui/backend/power_manager_client_conversions.h b/chromeos/components/diagnostics_ui/backend/power_manager_client_conversions.h
index e55f4be2..e446d9a 100644
--- a/chromeos/components/diagnostics_ui/backend/power_manager_client_conversions.h
+++ b/chromeos/components/diagnostics_ui/backend/power_manager_client_conversions.h
@@ -25,7 +25,7 @@
// amount of time is unreliable / still being calculated, this returns an
// empty string. Otherwise, the time is returned in DURATION_WIDTH_NARROW
// format.
-base::string16 ConstructPowerTime(
+std::u16string ConstructPowerTime(
mojom::BatteryState battery_state,
const power_manager::PowerSupplyProperties& power_supply_props);
diff --git a/chromeos/components/diagnostics_ui/backend/power_manager_client_conversions_unittest.cc b/chromeos/components/diagnostics_ui/backend/power_manager_client_conversions_unittest.cc
index a99b069..50ac58a04 100644
--- a/chromeos/components/diagnostics_ui/backend/power_manager_client_conversions_unittest.cc
+++ b/chromeos/components/diagnostics_ui/backend/power_manager_client_conversions_unittest.cc
@@ -63,30 +63,30 @@
TEST_F(PowerManagerClientConversionsTest, PowerTime) {
// Full BatteryState returns an empty string
auto props = ConstructPowerSupplyProperties(false, 125, 0);
- EXPECT_EQ(base::string16(),
+ EXPECT_EQ(std::u16string(),
ConstructPowerTime(mojom::BatteryState::kFull, props));
// If the battery is charging but is_calculating_battery_time is true, expect
// an empty string.
props = ConstructPowerSupplyProperties(true, 125, 0);
- EXPECT_EQ(base::string16(),
+ EXPECT_EQ(std::u16string(),
ConstructPowerTime(mojom::BatteryState::kCharging, props));
// If the battery is discharging but is_calculating_battery_time is true,
// expect an empty string.
props = ConstructPowerSupplyProperties(true, 0, 125);
- EXPECT_EQ(base::string16(),
+ EXPECT_EQ(std::u16string(),
ConstructPowerTime(mojom::BatteryState::kDischarging, props));
// If the battery is charging but time_to_full is -1, expect an empty string.
props = ConstructPowerSupplyProperties(false, -1, 0);
- EXPECT_EQ(base::string16(),
+ EXPECT_EQ(std::u16string(),
ConstructPowerTime(mojom::BatteryState::kCharging, props));
// If the battery is discharging but time_to_empty is -1, expect an empty
// string.
props = ConstructPowerSupplyProperties(false, 0, -1);
- EXPECT_EQ(base::string16(),
+ EXPECT_EQ(std::u16string(),
ConstructPowerTime(mojom::BatteryState::kDischarging, props));
// Battery charging with 11220 seconds (3h 7m) remaining.
diff --git a/chromeos/components/diagnostics_ui/backend/session_log_handler_unittest.cc b/chromeos/components/diagnostics_ui/backend/session_log_handler_unittest.cc
index a018b51..92f82a1 100644
--- a/chromeos/components/diagnostics_ui/backend/session_log_handler_unittest.cc
+++ b/chromeos/components/diagnostics_ui/backend/session_log_handler_unittest.cc
@@ -91,7 +91,7 @@
protected:
void SelectFileImpl(Type type,
- const base::string16& title,
+ const std::u16string& title,
const base::FilePath& default_path,
const FileTypeInfo* file_types,
int file_type_index,
diff --git a/chromeos/components/diagnostics_ui/backend/system_data_provider_unittest.cc b/chromeos/components/diagnostics_ui/backend/system_data_provider_unittest.cc
index ef19067..dfad532 100644
--- a/chromeos/components/diagnostics_ui/backend/system_data_provider_unittest.cc
+++ b/chromeos/components/diagnostics_ui/backend/system_data_provider_unittest.cc
@@ -363,7 +363,7 @@
EXPECT_EQ(expected_battery_state, update->battery_state);
if (expected_battery_state == mojom::BatteryState::kFull) {
- EXPECT_EQ(base::string16(), update->power_time);
+ EXPECT_EQ(std::u16string(), update->power_time);
return;
}
@@ -373,7 +373,7 @@
ConstructPowerSupplyProperties(power_source, battery_state,
is_calculating_battery_time, time_to_full,
time_to_empty);
- base::string16 expected_power_time =
+ std::u16string expected_power_time =
ConstructPowerTime(expected_battery_state, props);
EXPECT_EQ(expected_power_time, update->power_time);
diff --git a/chromeos/components/local_search_service/content_extraction_utils.cc b/chromeos/components/local_search_service/content_extraction_utils.cc
index 1d4e055..edd4d16 100644
--- a/chromeos/components/local_search_service/content_extraction_utils.cc
+++ b/chromeos/components/local_search_service/content_extraction_utils.cc
@@ -27,7 +27,7 @@
} // namespace
std::vector<Token> ConsolidateToken(const std::vector<Token>& tokens) {
- std::unordered_map<base::string16, std::vector<WeightedPosition>> dictionary;
+ std::unordered_map<std::u16string, std::vector<WeightedPosition>> dictionary;
for (const auto& token : tokens) {
dictionary[token.content].insert(dictionary[token.content].end(),
token.positions.begin(),
@@ -42,7 +42,7 @@
}
std::vector<Token> ExtractContent(const std::string& content_id,
- const base::string16& text,
+ const std::u16string& text,
double weight,
const std::string& locale) {
// Use two different string tokenizing algorithms for Latin and non Latin
@@ -62,7 +62,7 @@
std::vector<Token> tokens;
for (size_t i = 0; i < num_tokens; i++) {
- const base::string16 word = Normalizer(tokenized_string.tokens()[i]);
+ const std::u16string word = Normalizer(tokenized_string.tokens()[i]);
if (IsStopword(word, locale))
continue;
tokens.push_back(Token(
@@ -85,7 +85,7 @@
return base::Contains(*non_latin_locales, locale.substr(0, 2));
}
-bool IsStopword(const base::string16& word, const std::string& locale) {
+bool IsStopword(const std::u16string& word, const std::string& locale) {
// TODO(thanhdng): Currently we support stopword list for English only. In the
// future, when we need to support other languages, creates resource files to
// store the stopwords.
@@ -134,7 +134,7 @@
return base::Contains(*english_stopwords, base::UTF16ToUTF8(word));
}
-base::string16 Normalizer(const base::string16& word, bool remove_hyphen) {
+std::u16string Normalizer(const std::u16string& word, bool remove_hyphen) {
// Case folding.
icu::UnicodeString source = icu::UnicodeString::fromUTF8(
base::UTF16ToUTF8(base::i18n::FoldCase(word)));
diff --git a/chromeos/components/local_search_service/content_extraction_utils.h b/chromeos/components/local_search_service/content_extraction_utils.h
index 4191001..3fb0df5 100644
--- a/chromeos/components/local_search_service/content_extraction_utils.h
+++ b/chromeos/components/local_search_service/content_extraction_utils.h
@@ -22,7 +22,7 @@
// base::i18n::GetConfiguredLocale(). The format of locale will be
// language-country@variant. Country and variant are optional.
std::vector<Token> ExtractContent(const std::string& content_id,
- const base::string16& text,
+ const std::u16string& text,
double weight,
const std::string& locale);
@@ -35,11 +35,11 @@
// Checks if a word is a stopword given a locale. Locale will be in the
// following format: language-country@variant (country and variant are
// optional).
-bool IsStopword(const base::string16& word, const std::string& locale);
+bool IsStopword(const std::u16string& word, const std::string& locale);
// Returns a normalized version of a string16: removes diacritics, convert to
// lower-case and possibly remove hyphen from the text (set to true by default).
-base::string16 Normalizer(const base::string16& word,
+std::u16string Normalizer(const std::u16string& word,
bool remove_hyphen = true);
} // namespace local_search_service
diff --git a/chromeos/components/local_search_service/content_extraction_utils_unittest.cc b/chromeos/components/local_search_service/content_extraction_utils_unittest.cc
index 711507d..1a349a22 100644
--- a/chromeos/components/local_search_service/content_extraction_utils_unittest.cc
+++ b/chromeos/components/local_search_service/content_extraction_utils_unittest.cc
@@ -17,7 +17,7 @@
TEST(ContentExtractionUtilsTest, ConsolidateTokenTest) {
{
- const base::string16 text(base::UTF8ToUTF16(
+ const std::u16string text(base::UTF8ToUTF16(
"Check duplicate. Duplicate is #@$%^&@#$%#@$^@#$ bad"));
const auto tokens = ConsolidateToken(
ExtractContent("3rd test", text, kDefaultWeight, "en"));
@@ -75,7 +75,7 @@
TEST(ContentExtractionUtilsTest, ExtractContentTest) {
{
- const base::string16 text(base::UTF8ToUTF16(
+ const std::u16string text(base::UTF8ToUTF16(
"Normal... English!!! paragraph: email@gmail.com. Here is a link: "
"https://google.com, ip=8.8.8.8"));
const auto tokens =
@@ -89,7 +89,7 @@
EXPECT_EQ(tokens[1].positions[0].position.length, 7u);
}
{
- const base::string16 text(base::UTF8ToUTF16("@#$%@^你好!!!"));
+ const std::u16string text(base::UTF8ToUTF16("@#$%@^你好!!!"));
const auto tokens = ExtractContent("2nd test", text, kDefaultWeight, "zh");
EXPECT_EQ(tokens.size(), 1u);
diff --git a/chromeos/components/local_search_service/inverted_index.cc b/chromeos/components/local_search_service/inverted_index.cc
index 0a1f193..6736bb93 100644
--- a/chromeos/components/local_search_service/inverted_index.cc
+++ b/chromeos/components/local_search_service/inverted_index.cc
@@ -26,7 +26,7 @@
using ScoreWithPosting = std::pair<double, Posting>;
// Calculates TF-IDF scores for a term
-std::vector<TfidfResult> CalculateTfidf(const base::string16& term,
+std::vector<TfidfResult> CalculateTfidf(const std::u16string& term,
const DocLength& doc_length,
const Dictionary& dictionary) {
std::vector<TfidfResult> results;
@@ -174,7 +174,7 @@
}
InvertedIndex::~InvertedIndex() = default;
-PostingList InvertedIndex::FindTerm(const base::string16& term) const {
+PostingList InvertedIndex::FindTerm(const std::u16string& term) const {
if (dictionary_.find(term) != dictionary_.end())
return dictionary_.at(term);
@@ -182,7 +182,7 @@
}
std::vector<Result> InvertedIndex::FindMatchingDocumentsApproximately(
- const std::unordered_set<base::string16>& terms,
+ const std::unordered_set<std::u16string>& terms,
double prefix_threshold,
double block_threshold) const {
// For each document, its score is the sum of TF-IDF scores of its terms
@@ -190,7 +190,7 @@
// The map is keyed by the document id.
std::unordered_map<std::string, ScoreWithPosting> matching_docs;
for (const auto& kv : tfidf_cache_) {
- const base::string16& index_term = kv.first;
+ const std::u16string& index_term = kv.first;
const std::vector<TfidfResult>& tfidf_results = kv.second;
for (const auto& term : terms) {
if (IsRelevantApproximately(term, index_term, prefix_threshold,
@@ -305,7 +305,7 @@
}
std::vector<TfidfResult> InvertedIndex::GetTfidf(
- const base::string16& term) const {
+ const std::u16string& term) const {
if (tfidf_cache_.find(term) != tfidf_cache_.end()) {
return tfidf_cache_.at(term);
}
diff --git a/chromeos/components/local_search_service/inverted_index.h b/chromeos/components/local_search_service/inverted_index.h
index 393c839..a2737d58 100644
--- a/chromeos/components/local_search_service/inverted_index.h
+++ b/chromeos/components/local_search_service/inverted_index.h
@@ -34,13 +34,13 @@
using DocLength = std::unordered_map<std::string, uint32_t>;
// A map from terms to their PostingList.
-using Dictionary = std::unordered_map<base::string16, PostingList>;
+using Dictionary = std::unordered_map<std::u16string, PostingList>;
// A set of terms.
-using TermSet = std::unordered_set<base::string16>;
+using TermSet = std::unordered_set<std::u16string>;
// Data structure to store TF-IDF cache keyed by terms.
-using TfidfCache = std::unordered_map<base::string16, std::vector<TfidfResult>>;
+using TfidfCache = std::unordered_map<std::u16string, std::vector<TfidfResult>>;
// Tuple to store document state variables.
using DocumentStateVariables = std::tuple<DocLength, Dictionary, TermSet>;
@@ -62,12 +62,12 @@
InvertedIndex& operator=(const InvertedIndex&) = delete;
// Returns document ID and positions of a term.
- PostingList FindTerm(const base::string16& term) const;
+ PostingList FindTerm(const std::u16string& term) const;
// Returns documents that approximately match one or more terms in |terms|.
// Returned documents will be ranked.
std::vector<Result> FindMatchingDocumentsApproximately(
- const std::unordered_set<base::string16>& terms,
+ const std::unordered_set<std::u16string>& terms,
double prefix_threshold,
double block_threshold) const;
@@ -109,7 +109,7 @@
// the cache.
// Note: client of this function should call BuildInvertedIndex before using
// this function to have up-to-date score.
- std::vector<TfidfResult> GetTfidf(const base::string16& term) const;
+ std::vector<TfidfResult> GetTfidf(const std::u16string& term) const;
// Builds the inverted index.
void BuildInvertedIndex();
diff --git a/chromeos/components/local_search_service/inverted_index_search.cc b/chromeos/components/local_search_service/inverted_index_search.cc
index d510d64..3a8d1ae 100644
--- a/chromeos/components/local_search_service/inverted_index_search.cc
+++ b/chromeos/components/local_search_service/inverted_index_search.cc
@@ -56,8 +56,8 @@
return documents;
}
-std::unordered_set<base::string16> GetTokenizedQuery(
- const base::string16& query) {
+std::unordered_set<std::u16string> GetTokenizedQuery(
+ const std::u16string& query) {
// TODO(jiameng): actual input query may not be the same as default locale.
// Need another way to determine actual language of the query.
const TokenizedString::Mode mode =
@@ -66,7 +66,7 @@
: TokenizedString::Mode::kWords;
const TokenizedString tokenized_query(query, mode);
- std::unordered_set<base::string16> tokens;
+ std::unordered_set<std::u16string> tokens;
for (const auto& token : tokenized_query.tokens()) {
// TODO(jiameng): we are not removing stopword because they shouldn't exist
// in the index. However, for performance reason, it may be worth to be
@@ -126,7 +126,7 @@
weak_ptr_factory_.GetWeakPtr(), std::move(callback)));
}
-void InvertedIndexSearch::Find(const base::string16& query,
+void InvertedIndexSearch::Find(const std::u16string& query,
uint32_t max_results,
FindCallback callback) {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
@@ -164,7 +164,7 @@
}
std::vector<std::pair<std::string, uint32_t>>
-InvertedIndexSearch::FindTermForTesting(const base::string16& term) const {
+InvertedIndexSearch::FindTermForTesting(const std::u16string& term) const {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
const PostingList posting_list = inverted_index_->FindTerm(term);
std::vector<std::pair<std::string, uint32_t>> doc_with_freq;
diff --git a/chromeos/components/local_search_service/inverted_index_search.h b/chromeos/components/local_search_service/inverted_index_search.h
index f5a357c8..29e71b0 100644
--- a/chromeos/components/local_search_service/inverted_index_search.h
+++ b/chromeos/components/local_search_service/inverted_index_search.h
@@ -41,7 +41,7 @@
DeleteCallback callback) override;
void UpdateDocuments(const std::vector<Data>& data,
UpdateDocumentsCallback callback) override;
- void Find(const base::string16& query,
+ void Find(const std::u16string& query,
uint32_t max_results,
FindCallback callback) override;
void ClearIndex(ClearIndexCallback callback) override;
@@ -49,7 +49,7 @@
// Returns document id and number of occurrences of |term|.
// Document ids are sorted in alphabetical order.
std::vector<std::pair<std::string, uint32_t>> FindTermForTesting(
- const base::string16& term) const;
+ const std::u16string& term) const;
private:
void FinalizeAddOrUpdate(
diff --git a/chromeos/components/local_search_service/inverted_index_unittest.cc b/chromeos/components/local_search_service/inverted_index_unittest.cc
index efe4a0fc..741a0fc 100644
--- a/chromeos/components/local_search_service/inverted_index_unittest.cc
+++ b/chromeos/components/local_search_service/inverted_index_unittest.cc
@@ -78,12 +78,12 @@
index_.is_index_built_ = false;
}
- PostingList FindTerm(const base::string16& term) {
+ PostingList FindTerm(const std::u16string& term) {
return index_.FindTerm(term);
}
std::vector<Result> FindMatchingDocumentsApproximately(
- const std::unordered_set<base::string16>& terms,
+ const std::unordered_set<std::u16string>& terms,
double prefix_threshold,
double block_threshold) {
return index_.FindMatchingDocumentsApproximately(terms, prefix_threshold,
@@ -152,11 +152,11 @@
ASSERT_TRUE(callback_done);
}
- std::vector<TfidfResult> GetTfidf(const base::string16& term) {
+ std::vector<TfidfResult> GetTfidf(const std::u16string& term) {
return index_.GetTfidf(term);
}
- bool GetTfidfForDocId(const base::string16& term,
+ bool GetTfidfForDocId(const std::u16string& term,
const std::string& docid,
float* tfidf,
size_t* number_positions) {
@@ -187,7 +187,7 @@
bool IsInvertedIndexBuilt() { return index_.IsInvertedIndexBuilt(); }
- std::unordered_map<base::string16, PostingList> GetDictionary() {
+ std::unordered_map<std::u16string, PostingList> GetDictionary() {
return index_.dictionary_;
}
@@ -195,7 +195,7 @@
return index_.doc_length_;
}
- std::unordered_map<base::string16, std::vector<TfidfResult>> GetTfidfCache() {
+ std::unordered_map<std::u16string, std::vector<TfidfResult>> GetTfidfCache() {
return index_.tfidf_cache_;
}
@@ -242,8 +242,8 @@
}
TEST_F(InvertedIndexTest, AddNewDocumentTest) {
- const base::string16 a_utf16(base::UTF8ToUTF16("A"));
- const base::string16 d_utf16(base::UTF8ToUTF16("D"));
+ const std::u16string a_utf16(base::UTF8ToUTF16("A"));
+ const std::u16string d_utf16(base::UTF8ToUTF16("D"));
AddDocuments({{"doc3",
{{a_utf16,
@@ -316,8 +316,8 @@
}
TEST_F(InvertedIndexTest, AddNewDocumentTestCallback) {
- const base::string16 a_utf16(base::UTF8ToUTF16("A"));
- const base::string16 d_utf16(base::UTF8ToUTF16("D"));
+ const std::u16string a_utf16(base::UTF8ToUTF16("A"));
+ const std::u16string d_utf16(base::UTF8ToUTF16("D"));
AddDocumentsAndCheck({{"doc3",
{{a_utf16,
@@ -376,8 +376,8 @@
}
TEST_F(InvertedIndexTest, ReplaceDocumentTest) {
- const base::string16 a_utf16(base::UTF8ToUTF16("A"));
- const base::string16 d_utf16(base::UTF8ToUTF16("D"));
+ const std::u16string a_utf16(base::UTF8ToUTF16("A"));
+ const std::u16string d_utf16(base::UTF8ToUTF16("D"));
AddDocuments({{"doc1",
{{a_utf16,
@@ -418,8 +418,8 @@
}
TEST_F(InvertedIndexTest, ReplaceDocumentTestCallback) {
- const base::string16 a_utf16(base::UTF8ToUTF16("A"));
- const base::string16 d_utf16(base::UTF8ToUTF16("D"));
+ const std::u16string a_utf16(base::UTF8ToUTF16("A"));
+ const std::u16string d_utf16(base::UTF8ToUTF16("D"));
AddDocumentsAndCheck({{"doc1",
{{a_utf16,
@@ -753,8 +753,8 @@
EXPECT_EQ(GetTfidfCache().size(), 3u);
// Add a document and clear the index simultaneously.
- const base::string16 a_utf16(base::UTF8ToUTF16("A"));
- const base::string16 d_utf16(base::UTF8ToUTF16("D"));
+ const std::u16string a_utf16(base::UTF8ToUTF16("A"));
+ const std::u16string d_utf16(base::UTF8ToUTF16("D"));
AddDocuments({{"doc3",
{{a_utf16,
{{kDefaultWeight, {"header", 1, 1}},
@@ -779,8 +779,8 @@
EXPECT_EQ(GetTfidfCache().size(), 3u);
// Add a document and clear the index simultaneously.
- const base::string16 a_utf16(base::UTF8ToUTF16("A"));
- const base::string16 d_utf16(base::UTF8ToUTF16("D"));
+ const std::u16string a_utf16(base::UTF8ToUTF16("A"));
+ const std::u16string d_utf16(base::UTF8ToUTF16("D"));
AddDocumentsAndCheck({{"doc3",
{{a_utf16,
{{kDefaultWeight, {"header", 1, 1}},
@@ -801,10 +801,10 @@
TEST_F(InvertedIndexTest, FindMatchingDocumentsApproximatelyTest) {
const double prefix_threshold = 1.0;
const double block_threshold = 1.0;
- const base::string16 a_utf16(base::UTF8ToUTF16("A"));
- const base::string16 b_utf16(base::UTF8ToUTF16("B"));
- const base::string16 c_utf16(base::UTF8ToUTF16("C"));
- const base::string16 d_utf16(base::UTF8ToUTF16("D"));
+ const std::u16string a_utf16(base::UTF8ToUTF16("A"));
+ const std::u16string b_utf16(base::UTF8ToUTF16("B"));
+ const std::u16string c_utf16(base::UTF8ToUTF16("C"));
+ const std::u16string d_utf16(base::UTF8ToUTF16("D"));
// Replace doc1, same occurrences, just different weights.
AddDocumentsAndCheck({{"doc1",
diff --git a/chromeos/components/local_search_service/linear_map_search.cc b/chromeos/components/local_search_service/linear_map_search.cc
index 557e473..b224998 100644
--- a/chromeos/components/local_search_service/linear_map_search.cc
+++ b/chromeos/components/local_search_service/linear_map_search.cc
@@ -130,7 +130,7 @@
std::move(callback).Run(num_deleted);
}
-void LinearMapSearch::Find(const base::string16& query,
+void LinearMapSearch::Find(const std::u16string& query,
uint32_t max_results,
FindCallback callback) {
const base::TimeTicks start = base::TimeTicks::Now();
@@ -163,7 +163,7 @@
}
std::vector<Result> LinearMapSearch::GetSearchResults(
- const base::string16& query,
+ const std::u16string& query,
uint32_t max_results) const {
std::vector<Result> results;
const TokenizedString tokenized_query(query);
diff --git a/chromeos/components/local_search_service/linear_map_search.h b/chromeos/components/local_search_service/linear_map_search.h
index fb21234..e06c3ca8 100644
--- a/chromeos/components/local_search_service/linear_map_search.h
+++ b/chromeos/components/local_search_service/linear_map_search.h
@@ -51,14 +51,14 @@
DeleteCallback callback) override;
void UpdateDocuments(const std::vector<Data>& data,
UpdateDocumentsCallback callback) override;
- void Find(const base::string16& query,
+ void Find(const std::u16string& query,
uint32_t max_results,
FindCallback callback) override;
void ClearIndex(ClearIndexCallback callback) override;
private:
// Returns all search results for a given query.
- std::vector<Result> GetSearchResults(const base::string16& query,
+ std::vector<Result> GetSearchResults(const std::u16string& query,
uint32_t max_results) const;
KeyToTagVector data_;
diff --git a/chromeos/components/local_search_service/public/mojom/types_mojom_traits.cc b/chromeos/components/local_search_service/public/mojom/types_mojom_traits.cc
index 46ba0ff4..9899837e 100644
--- a/chromeos/components/local_search_service/public/mojom/types_mojom_traits.cc
+++ b/chromeos/components/local_search_service/public/mojom/types_mojom_traits.cc
@@ -78,7 +78,7 @@
Read(chromeos::local_search_service::mojom::ContentDataView data,
chromeos::local_search_service::Content* out) {
std::string id;
- base::string16 content;
+ std::u16string content;
if (!data.ReadId(&id) || !data.ReadContent(&content))
return false;
diff --git a/chromeos/components/local_search_service/public/mojom/types_mojom_traits.h b/chromeos/components/local_search_service/public/mojom/types_mojom_traits.h
index 60cc3f56..f706b06 100644
--- a/chromeos/components/local_search_service/public/mojom/types_mojom_traits.h
+++ b/chromeos/components/local_search_service/public/mojom/types_mojom_traits.h
@@ -40,7 +40,7 @@
static std::string id(const chromeos::local_search_service::Content& c) {
return c.id;
}
- static base::string16 content(
+ static std::u16string content(
const chromeos::local_search_service::Content& c) {
return c.content;
}
diff --git a/chromeos/components/local_search_service/search_utils.cc b/chromeos/components/local_search_service/search_utils.cc
index 428264c..e4eb6d3 100644
--- a/chromeos/components/local_search_service/search_utils.cc
+++ b/chromeos/components/local_search_service/search_utils.cc
@@ -24,8 +24,8 @@
namespace chromeos {
namespace local_search_service {
-float ExactPrefixMatchScore(const base::string16& query,
- const base::string16& text) {
+float ExactPrefixMatchScore(const std::u16string& query,
+ const std::u16string& text) {
const size_t query_len = query.size();
if (query_len == 0)
return 0;
@@ -40,15 +40,15 @@
return 0.0;
}
-float BlockMatchScore(const base::string16& query, const base::string16& text) {
+float BlockMatchScore(const std::u16string& query, const std::u16string& text) {
return chromeos::string_matching::SequenceMatcher(
query, text, false /* use_edit_distance */,
0.1 /*num_matching_blocks_penalty*/)
.Ratio();
}
-bool IsRelevantApproximately(const base::string16& query,
- const base::string16& text,
+bool IsRelevantApproximately(const std::u16string& query,
+ const std::u16string& text,
float prefix_threshold,
float block_threshold) {
return (ExactPrefixMatchScore(query, text) >= prefix_threshold ||
diff --git a/chromeos/components/local_search_service/search_utils.h b/chromeos/components/local_search_service/search_utils.h
index 4ccb57b..9c0e2c10 100644
--- a/chromeos/components/local_search_service/search_utils.h
+++ b/chromeos/components/local_search_service/search_utils.h
@@ -16,17 +16,17 @@
// Score is non-zero if |query| is a prefix of |text|. No case normalization is
// done.
-float ExactPrefixMatchScore(const base::string16& query,
- const base::string16& text);
+float ExactPrefixMatchScore(const std::u16string& query,
+ const std::u16string& text);
// Returns block matching ratio between |query| and |text|. No case
// normalization is done.
-float BlockMatchScore(const base::string16& query, const base::string16& text);
+float BlockMatchScore(const std::u16string& query, const std::u16string& text);
// |query| approximately matches |text| if its prefix score is above the
// |prefix_threshold| or block matching score is above |block_threshold|.
-bool IsRelevantApproximately(const base::string16& query,
- const base::string16& text,
+bool IsRelevantApproximately(const std::u16string& query,
+ const std::u16string& text,
float prefix_threshold,
float block_threshold);
diff --git a/chromeos/components/local_search_service/shared_structs.cc b/chromeos/components/local_search_service/shared_structs.cc
index 6fe5eb891..59e43be 100644
--- a/chromeos/components/local_search_service/shared_structs.cc
+++ b/chromeos/components/local_search_service/shared_structs.cc
@@ -17,7 +17,7 @@
namespace local_search_service {
local_search_service::Content::Content(const std::string& id,
- const base::string16& content,
+ const std::u16string& content,
double weight)
: id(id), content(content), weight(weight) {}
local_search_service::Content::Content() = default;
@@ -56,7 +56,7 @@
WeightedPosition::~WeightedPosition() = default;
Token::Token() = default;
-Token::Token(const base::string16& text,
+Token::Token(const std::u16string& text,
const std::vector<WeightedPosition>& pos)
: content(text), positions(pos) {}
Token::Token(const Token& token)
diff --git a/chromeos/components/local_search_service/shared_structs.h b/chromeos/components/local_search_service/shared_structs.h
index 2752937..de306133 100644
--- a/chromeos/components/local_search_service/shared_structs.h
+++ b/chromeos/components/local_search_service/shared_structs.h
@@ -28,7 +28,7 @@
struct Content {
// An identifier for the content in Data.
std::string id;
- base::string16 content;
+ std::u16string content;
// |weight| represents how important this Content is and is used in
// calculating overall matching score of its enclosing Data item. When a query
// matches a Data item it is matching some Content of the Data. If the
@@ -38,7 +38,7 @@
// extending to kLinearMap.
double weight = 1.0;
Content(const std::string& id,
- const base::string16& content,
+ const std::u16string& content,
double weight = 1.0);
Content();
Content(const Content& content);
@@ -155,9 +155,9 @@
struct Token {
Token();
Token(const Token& token);
- Token(const base::string16& text, const std::vector<WeightedPosition>& pos);
+ Token(const std::u16string& text, const std::vector<WeightedPosition>& pos);
~Token();
- base::string16 content;
+ std::u16string content;
std::vector<WeightedPosition> positions;
};
diff --git a/chromeos/components/phonehub/browser_tabs_model.cc b/chromeos/components/phonehub/browser_tabs_model.cc
index fed4184..d43f08ee9 100644
--- a/chromeos/components/phonehub/browser_tabs_model.cc
+++ b/chromeos/components/phonehub/browser_tabs_model.cc
@@ -13,7 +13,7 @@
BrowserTabsModel::BrowserTabMetadata::BrowserTabMetadata(
GURL url,
- const base::string16& title,
+ const std::u16string& title,
base::Time last_accessed_timestamp,
const gfx::Image& favicon)
: url(url),
diff --git a/chromeos/components/phonehub/browser_tabs_model.h b/chromeos/components/phonehub/browser_tabs_model.h
index eb6e1fb..694431f 100644
--- a/chromeos/components/phonehub/browser_tabs_model.h
+++ b/chromeos/components/phonehub/browser_tabs_model.h
@@ -24,7 +24,7 @@
struct BrowserTabMetadata {
BrowserTabMetadata(GURL url,
- const base::string16& title,
+ const std::u16string& title,
base::Time last_accessed_timestamp,
const gfx::Image& favicon);
BrowserTabMetadata(const BrowserTabMetadata& other);
@@ -34,7 +34,7 @@
bool operator<(const BrowserTabMetadata& other) const;
GURL url;
- base::string16 title;
+ std::u16string title;
base::Time last_accessed_timestamp;
gfx::Image favicon;
};
diff --git a/chromeos/components/phonehub/fake_message_sender.cc b/chromeos/components/phonehub/fake_message_sender.cc
index 07638cb5..46d42f55 100644
--- a/chromeos/components/phonehub/fake_message_sender.cc
+++ b/chromeos/components/phonehub/fake_message_sender.cc
@@ -31,7 +31,7 @@
void FakeMessageSender::SendNotificationInlineReplyRequest(
int64_t notification_id,
- const base::string16& reply_text) {
+ const std::u16string& reply_text) {
notification_inline_reply_requests_.push_back(
std::make_pair(notification_id, reply_text));
}
@@ -84,7 +84,7 @@
return dismiss_notification_requests_.back();
}
-const std::pair<int64_t, base::string16>
+const std::pair<int64_t, std::u16string>
FakeMessageSender::GetRecentNotificationInlineReplyRequest() const {
return notification_inline_reply_requests_.back();
}
diff --git a/chromeos/components/phonehub/fake_message_sender.h b/chromeos/components/phonehub/fake_message_sender.h
index 30cb967..054a20e7 100644
--- a/chromeos/components/phonehub/fake_message_sender.h
+++ b/chromeos/components/phonehub/fake_message_sender.h
@@ -28,7 +28,7 @@
void SendDismissNotificationRequest(int64_t notification_id) override;
void SendNotificationInlineReplyRequest(
int64_t notification_id,
- const base::string16& reply_text) override;
+ const std::u16string& reply_text) override;
void SendShowNotificationAccessSetupRequest() override;
void SendRingDeviceRequest(bool device_ringing_enabled) override;
@@ -36,7 +36,7 @@
bool GetRecentUpdateNotificationModeRequest() const;
bool GetRecentUpdateBatteryModeRequest() const;
int64_t GetRecentDismissNotificationRequest() const;
- const std::pair<int64_t, base::string16>
+ const std::pair<int64_t, std::u16string>
GetRecentNotificationInlineReplyRequest() const;
bool GetRecentRingDeviceRequest() const;
@@ -61,7 +61,7 @@
std::vector<bool> update_notification_mode_requests_;
std::vector<bool> update_battery_mode_requests_;
std::vector<int64_t> dismiss_notification_requests_;
- std::vector<std::pair<int64_t, base::string16>>
+ std::vector<std::pair<int64_t, std::u16string>>
notification_inline_reply_requests_;
std::vector<bool> ring_device_requests_;
size_t show_notification_access_setup_count_ = 0;
diff --git a/chromeos/components/phonehub/fake_notification_manager.cc b/chromeos/components/phonehub/fake_notification_manager.cc
index ad1513b..1ec3060 100644
--- a/chromeos/components/phonehub/fake_notification_manager.cc
+++ b/chromeos/components/phonehub/fake_notification_manager.cc
@@ -11,7 +11,7 @@
FakeNotificationManager::InlineReplyMetadata::InlineReplyMetadata(
int64_t notification_id,
- const base::string16& inline_reply_text)
+ const std::u16string& inline_reply_text)
: notification_id(notification_id), inline_reply_text(inline_reply_text) {}
FakeNotificationManager::InlineReplyMetadata::~InlineReplyMetadata() = default;
@@ -37,7 +37,7 @@
void FakeNotificationManager::SendInlineReply(
int64_t notification_id,
- const base::string16& inline_reply_text) {
+ const std::u16string& inline_reply_text) {
DCHECK(base::Contains(id_to_notification_map_, notification_id));
inline_replies_.emplace_back(notification_id, inline_reply_text);
}
diff --git a/chromeos/components/phonehub/fake_notification_manager.h b/chromeos/components/phonehub/fake_notification_manager.h
index d09247c..02f205b3 100644
--- a/chromeos/components/phonehub/fake_notification_manager.h
+++ b/chromeos/components/phonehub/fake_notification_manager.h
@@ -38,11 +38,11 @@
struct InlineReplyMetadata {
InlineReplyMetadata(int64_t notification_id,
- const base::string16& inline_reply_text);
+ const std::u16string& inline_reply_text);
~InlineReplyMetadata();
int64_t notification_id;
- base::string16 inline_reply_text;
+ std::u16string inline_reply_text;
};
const std::vector<InlineReplyMetadata>& inline_replies() const {
@@ -53,7 +53,7 @@
// NotificationManager:
void DismissNotification(int64_t notification_id) override;
void SendInlineReply(int64_t notification_id,
- const base::string16& inline_reply_text) override;
+ const std::u16string& inline_reply_text) override;
std::vector<int64_t> dismissed_notification_ids_;
std::vector<InlineReplyMetadata> inline_replies_;
diff --git a/chromeos/components/phonehub/message_sender.h b/chromeos/components/phonehub/message_sender.h
index 8bd0db4..e2d4aa50 100644
--- a/chromeos/components/phonehub/message_sender.h
+++ b/chromeos/components/phonehub/message_sender.h
@@ -40,7 +40,7 @@
// |notification_id|.
virtual void SendNotificationInlineReplyRequest(
int64_t notification_id,
- const base::string16& reply_text) = 0;
+ const std::u16string& reply_text) = 0;
// Requests that the phone should show the notification access set up.
virtual void SendShowNotificationAccessSetupRequest() = 0;
diff --git a/chromeos/components/phonehub/message_sender_impl.cc b/chromeos/components/phonehub/message_sender_impl.cc
index 99cc1d937..2f367fc 100644
--- a/chromeos/components/phonehub/message_sender_impl.cc
+++ b/chromeos/components/phonehub/message_sender_impl.cc
@@ -81,7 +81,7 @@
void MessageSenderImpl::SendNotificationInlineReplyRequest(
int64_t notification_id,
- const base::string16& reply_text) {
+ const std::u16string& reply_text) {
proto::NotificationInlineReplyRequest request;
request.set_notification_id(notification_id);
request.set_reply_text(base::UTF16ToUTF8(reply_text));
diff --git a/chromeos/components/phonehub/message_sender_impl.h b/chromeos/components/phonehub/message_sender_impl.h
index 6e56fca..83532bf 100644
--- a/chromeos/components/phonehub/message_sender_impl.h
+++ b/chromeos/components/phonehub/message_sender_impl.h
@@ -34,7 +34,7 @@
void SendDismissNotificationRequest(int64_t notification_id) override;
void SendNotificationInlineReplyRequest(
int64_t notification_id,
- const base::string16& reply_text) override;
+ const std::u16string& reply_text) override;
void SendShowNotificationAccessSetupRequest() override;
void SendRingDeviceRequest(bool device_ringing_enabled) override;
diff --git a/chromeos/components/phonehub/message_sender_unittest.cc b/chromeos/components/phonehub/message_sender_unittest.cc
index 1e6ccec..18ccce2 100644
--- a/chromeos/components/phonehub/message_sender_unittest.cc
+++ b/chromeos/components/phonehub/message_sender_unittest.cc
@@ -104,7 +104,7 @@
TEST_F(MessageSenderImplTest, SendNotificationInlineReplyRequest) {
const int expected_id = 24;
- const base::string16 expected_reply(base::UTF8ToUTF16("Test message"));
+ const std::u16string expected_reply(base::UTF8ToUTF16("Test message"));
proto::NotificationInlineReplyRequest request;
request.set_notification_id(expected_id);
diff --git a/chromeos/components/phonehub/mutable_phone_model.cc b/chromeos/components/phonehub/mutable_phone_model.cc
index a21b9f2..f30583e9 100644
--- a/chromeos/components/phonehub/mutable_phone_model.cc
+++ b/chromeos/components/phonehub/mutable_phone_model.cc
@@ -12,7 +12,7 @@
MutablePhoneModel::~MutablePhoneModel() = default;
void MutablePhoneModel::SetPhoneName(
- const base::Optional<base::string16>& phone_name) {
+ const base::Optional<std::u16string>& phone_name) {
if (phone_name_ == phone_name)
return;
diff --git a/chromeos/components/phonehub/mutable_phone_model.h b/chromeos/components/phonehub/mutable_phone_model.h
index 46e8882..a70955c 100644
--- a/chromeos/components/phonehub/mutable_phone_model.h
+++ b/chromeos/components/phonehub/mutable_phone_model.h
@@ -17,7 +17,7 @@
MutablePhoneModel();
~MutablePhoneModel() override;
- void SetPhoneName(const base::Optional<base::string16>& phone_name);
+ void SetPhoneName(const base::Optional<std::u16string>& phone_name);
void SetPhoneStatusModel(
const base::Optional<PhoneStatusModel>& phone_status_model);
void SetBrowserTabsModel(
diff --git a/chromeos/components/phonehub/mutable_phone_model_unittest.cc b/chromeos/components/phonehub/mutable_phone_model_unittest.cc
index cd5e4b8d..24bdeda 100644
--- a/chromeos/components/phonehub/mutable_phone_model_unittest.cc
+++ b/chromeos/components/phonehub/mutable_phone_model_unittest.cc
@@ -50,7 +50,7 @@
};
TEST_F(MutablePhoneModelTest, PhoneName) {
- const base::string16 fake_phone_name = base::UTF8ToUTF16("Phone name");
+ const std::u16string fake_phone_name = base::UTF8ToUTF16("Phone name");
// Set the phone name to be null (the default value); observers should
// not be notified, since this is not a change.
diff --git a/chromeos/components/phonehub/notification.cc b/chromeos/components/phonehub/notification.cc
index 5f4b95c..15b516e6 100644
--- a/chromeos/components/phonehub/notification.cc
+++ b/chromeos/components/phonehub/notification.cc
@@ -11,7 +11,7 @@
namespace chromeos {
namespace phonehub {
-Notification::AppMetadata::AppMetadata(const base::string16& visible_app_name,
+Notification::AppMetadata::AppMetadata(const std::u16string& visible_app_name,
const std::string& package_name,
const gfx::Image& icon)
: visible_app_name(visible_app_name),
@@ -35,8 +35,8 @@
Importance importance,
int64_t inline_reply_id,
InteractionBehavior interaction_behavior,
- const base::Optional<base::string16>& title,
- const base::Optional<base::string16>& text_content,
+ const base::Optional<std::u16string>& title,
+ const base::Optional<std::u16string>& text_content,
const base::Optional<gfx::Image>& shared_image,
const base::Optional<gfx::Image>& contact_image)
: id_(id),
diff --git a/chromeos/components/phonehub/notification.h b/chromeos/components/phonehub/notification.h
index e97a022..54fd3ef 100644
--- a/chromeos/components/phonehub/notification.h
+++ b/chromeos/components/phonehub/notification.h
@@ -24,7 +24,7 @@
public:
// Describes the app which generates a notification.
struct AppMetadata {
- AppMetadata(const base::string16& visible_app_name,
+ AppMetadata(const std::u16string& visible_app_name,
const std::string& package_name,
const gfx::Image& icon);
AppMetadata(const AppMetadata& other);
@@ -32,7 +32,7 @@
bool operator==(const AppMetadata& other) const;
bool operator!=(const AppMetadata& other) const;
- base::string16 visible_app_name;
+ std::u16string visible_app_name;
std::string package_name;
gfx::Image icon;
};
@@ -80,8 +80,8 @@
Importance importance,
int64_t inline_reply_id,
InteractionBehavior interaction_behavior,
- const base::Optional<base::string16>& title = base::nullopt,
- const base::Optional<base::string16>& text_content = base::nullopt,
+ const base::Optional<std::u16string>& title = base::nullopt,
+ const base::Optional<std::u16string>& text_content = base::nullopt,
const base::Optional<gfx::Image>& shared_image = base::nullopt,
const base::Optional<gfx::Image>& contact_image = base::nullopt);
Notification(const Notification& other);
@@ -99,8 +99,8 @@
InteractionBehavior interaction_behavior() const {
return interaction_behavior_;
}
- const base::Optional<base::string16>& title() const { return title_; }
- const base::Optional<base::string16>& text_content() const {
+ const base::Optional<std::u16string>& title() const { return title_; }
+ const base::Optional<std::u16string>& text_content() const {
return text_content_;
}
const base::Optional<gfx::Image>& shared_image() const {
@@ -117,8 +117,8 @@
Importance importance_;
int64_t inline_reply_id_;
InteractionBehavior interaction_behavior_;
- base::Optional<base::string16> title_;
- base::Optional<base::string16> text_content_;
+ base::Optional<std::u16string> title_;
+ base::Optional<std::u16string> text_content_;
base::Optional<gfx::Image> shared_image_;
base::Optional<gfx::Image> contact_image_;
};
diff --git a/chromeos/components/phonehub/notification_manager.h b/chromeos/components/phonehub/notification_manager.h
index 0fbc920..55d17f3 100644
--- a/chromeos/components/phonehub/notification_manager.h
+++ b/chromeos/components/phonehub/notification_manager.h
@@ -55,7 +55,7 @@
// Sends an inline reply for the notificaiton with the given ID; if no
// notification exists with this ID, this function is a no-op.
virtual void SendInlineReply(int64_t notification_id,
- const base::string16& inline_reply_text) = 0;
+ const std::u16string& inline_reply_text) = 0;
void AddObserver(Observer* observer);
void RemoveObserver(Observer* observer);
diff --git a/chromeos/components/phonehub/notification_manager_impl.cc b/chromeos/components/phonehub/notification_manager_impl.cc
index d959482..58f0166 100644
--- a/chromeos/components/phonehub/notification_manager_impl.cc
+++ b/chromeos/components/phonehub/notification_manager_impl.cc
@@ -49,7 +49,7 @@
void NotificationManagerImpl::SendInlineReply(
int64_t notification_id,
- const base::string16& inline_reply_text) {
+ const std::u16string& inline_reply_text) {
if (!GetNotification(notification_id)) {
PA_LOG(INFO) << "Could not send inline reply for notification with ID "
<< notification_id << ".";
diff --git a/chromeos/components/phonehub/notification_manager_impl.h b/chromeos/components/phonehub/notification_manager_impl.h
index ee5129c..13888fea 100644
--- a/chromeos/components/phonehub/notification_manager_impl.h
+++ b/chromeos/components/phonehub/notification_manager_impl.h
@@ -32,7 +32,7 @@
// NotificationManager:
void DismissNotification(int64_t notification_id) override;
void SendInlineReply(int64_t notification_id,
- const base::string16& inline_reply_text) override;
+ const std::u16string& inline_reply_text) override;
// MultiDeviceSetupClient::Observer:
void OnFeatureStatesChanged(
diff --git a/chromeos/components/phonehub/notification_manager_impl_unittest.cc b/chromeos/components/phonehub/notification_manager_impl_unittest.cc
index 11d11ed..22cb39c 100644
--- a/chromeos/components/phonehub/notification_manager_impl_unittest.cc
+++ b/chromeos/components/phonehub/notification_manager_impl_unittest.cc
@@ -233,14 +233,14 @@
EXPECT_EQ(NotificationState::kAdded, GetNotificationState(expected_id1));
// Simulate sending an inline reply to a notification.
- const base::string16& expected_reply(base::UTF8ToUTF16("test reply"));
+ const std::u16string& expected_reply(base::UTF8ToUTF16("test reply"));
manager().SendInlineReply(expected_id1, expected_reply);
EXPECT_EQ(1u, fake_user_action_recorder_.num_notification_replies());
EXPECT_EQ(1u, GetNumNotifications());
EXPECT_EQ(NotificationState::kAdded, GetNotificationState(expected_id1));
EXPECT_EQ(1u,
fake_message_sender().GetNotificationInlineReplyRequestCallCount());
- std::pair<int64_t, base::string16> pair =
+ std::pair<int64_t, std::u16string> pair =
fake_message_sender().GetRecentNotificationInlineReplyRequest();
EXPECT_EQ(expected_id1, pair.first);
EXPECT_EQ(expected_reply, pair.second);
@@ -248,7 +248,7 @@
// Simulate sending an inline reply to a non-existent notification. Expect
// that no new reply calls were called and that the most recent reply is the
// same as the previous inline reply call.
- manager().SendInlineReply(/*notification_id=*/5, /*reply=*/base::string16());
+ manager().SendInlineReply(/*notification_id=*/5, /*reply=*/std::u16string());
EXPECT_EQ(1u, fake_user_action_recorder_.num_notification_replies());
EXPECT_EQ(1u,
fake_message_sender().GetNotificationInlineReplyRequestCallCount());
diff --git a/chromeos/components/phonehub/notification_processor.cc b/chromeos/components/phonehub/notification_processor.cc
index be256aa..991d36c 100644
--- a/chromeos/components/phonehub/notification_processor.cc
+++ b/chromeos/components/phonehub/notification_processor.cc
@@ -64,11 +64,11 @@
});
bool includes_open_action = actions_it != proto.actions().end();
- base::Optional<base::string16> title = base::nullopt;
+ base::Optional<std::u16string> title = base::nullopt;
if (!proto.title().empty())
title = base::UTF8ToUTF16(proto.title());
- base::Optional<base::string16> text_content = base::nullopt;
+ base::Optional<std::u16string> text_content = base::nullopt;
if (!proto.text_content().empty())
text_content = base::UTF8ToUTF16(proto.text_content());
diff --git a/chromeos/components/phonehub/phone_model.h b/chromeos/components/phonehub/phone_model.h
index e8318ea..a810d60 100644
--- a/chromeos/components/phonehub/phone_model.h
+++ b/chromeos/components/phonehub/phone_model.h
@@ -32,7 +32,7 @@
PhoneModel& operator=(const PhoneModel&) = delete;
virtual ~PhoneModel();
- const base::Optional<base::string16>& phone_name() const {
+ const base::Optional<std::u16string>& phone_name() const {
return phone_name_;
}
@@ -52,7 +52,7 @@
void NotifyModelChanged();
- base::Optional<base::string16> phone_name_;
+ base::Optional<std::u16string> phone_name_;
base::Optional<PhoneStatusModel> phone_status_model_;
base::Optional<BrowserTabsModel> browser_tabs_model_;
diff --git a/chromeos/components/phonehub/phone_status_model.h b/chromeos/components/phonehub/phone_status_model.h
index de7b3488..5853e6b 100644
--- a/chromeos/components/phonehub/phone_status_model.h
+++ b/chromeos/components/phonehub/phone_status_model.h
@@ -48,7 +48,7 @@
SignalStrength signal_strength;
// Name of the service provider (e.g., "Google Fi").
- base::string16 mobile_provider;
+ std::u16string mobile_provider;
};
enum class ChargingState {
diff --git a/chromeos/components/phonehub/phone_status_model_unittest.cc b/chromeos/components/phonehub/phone_status_model_unittest.cc
index c109a68..1e42200 100644
--- a/chromeos/components/phonehub/phone_status_model_unittest.cc
+++ b/chromeos/components/phonehub/phone_status_model_unittest.cc
@@ -59,7 +59,7 @@
TEST(PhoneStatusModelTest, NoReceptionWithMetadata_NoCarrier) {
PhoneStatusModel::MobileConnectionMetadata metadata;
metadata.signal_strength = PhoneStatusModel::SignalStrength::kZeroBars;
- metadata.mobile_provider = base::string16();
+ metadata.mobile_provider = std::u16string();
// If the MobileStatus does not indicate reception, connection metadata should
// be cleared.
diff --git a/chromeos/components/phonehub/tether_controller_impl_unittest.cc b/chromeos/components/phonehub/tether_controller_impl_unittest.cc
index 61383be..9791dbc 100644
--- a/chromeos/components/phonehub/tether_controller_impl_unittest.cc
+++ b/chromeos/components/phonehub/tether_controller_impl_unittest.cc
@@ -64,7 +64,7 @@
metadata.mobile_provider =
mobile_status == PhoneStatusModel::MobileStatus::kSimWithReception
? base::UTF8ToUTF16(kFakeMobileProviderName)
- : base::string16();
+ : std::u16string();
return PhoneStatusModel(mobile_status, metadata,
PhoneStatusModel::ChargingState::kNotCharging,
PhoneStatusModel::BatterySaverState::kOff,
diff --git a/chromeos/components/proximity_auth/fake_lock_handler.cc b/chromeos/components/proximity_auth/fake_lock_handler.cc
index d89e1ba..a5653a6 100644
--- a/chromeos/components/proximity_auth/fake_lock_handler.cc
+++ b/chromeos/components/proximity_auth/fake_lock_handler.cc
@@ -10,7 +10,7 @@
FakeLockHandler::~FakeLockHandler() {}
-void FakeLockHandler::ShowBannerMessage(const base::string16& message,
+void FakeLockHandler::ShowBannerMessage(const std::u16string& message,
bool is_warning) {}
void FakeLockHandler::ShowUserPodCustomIcon(
@@ -23,7 +23,7 @@
void FakeLockHandler::SetAuthType(const AccountId& account_id,
mojom::AuthType auth_type,
- const base::string16& auth_value) {}
+ const std::u16string& auth_value) {}
mojom::AuthType FakeLockHandler::GetAuthType(
const AccountId& account_id) const {
diff --git a/chromeos/components/proximity_auth/fake_lock_handler.h b/chromeos/components/proximity_auth/fake_lock_handler.h
index 93921379..b5946cc 100644
--- a/chromeos/components/proximity_auth/fake_lock_handler.h
+++ b/chromeos/components/proximity_auth/fake_lock_handler.h
@@ -16,7 +16,7 @@
~FakeLockHandler() override;
// LockHandler:
- void ShowBannerMessage(const base::string16& message,
+ void ShowBannerMessage(const std::u16string& message,
bool is_warning) override;
void ShowUserPodCustomIcon(
const AccountId& account_id,
@@ -25,7 +25,7 @@
void EnableInput() override;
void SetAuthType(const AccountId& account_id,
mojom::AuthType auth_type,
- const base::string16& auth_value) override;
+ const std::u16string& auth_value) override;
mojom::AuthType GetAuthType(const AccountId& account_id) const override;
ScreenType GetScreenType() const override;
void Unlock(const AccountId& account_id) override;
diff --git a/chromeos/components/proximity_auth/screenlock_bridge.cc b/chromeos/components/proximity_auth/screenlock_bridge.cc
index 6884a907..9604087 100644
--- a/chromeos/components/proximity_auth/screenlock_bridge.cc
+++ b/chromeos/components/proximity_auth/screenlock_bridge.cc
@@ -85,14 +85,14 @@
}
void ScreenlockBridge::UserPodCustomIconOptions::SetTooltip(
- const base::string16& tooltip,
+ const std::u16string& tooltip,
bool autoshow) {
tooltip_ = tooltip;
autoshow_tooltip_ = autoshow;
}
void ScreenlockBridge::UserPodCustomIconOptions::SetAriaLabel(
- const base::string16& aria_label) {
+ const std::u16string& aria_label) {
aria_label_ = aria_label;
}
diff --git a/chromeos/components/proximity_auth/screenlock_bridge.h b/chromeos/components/proximity_auth/screenlock_bridge.h
index b3f868b..e818ac9 100644
--- a/chromeos/components/proximity_auth/screenlock_bridge.h
+++ b/chromeos/components/proximity_auth/screenlock_bridge.h
@@ -56,11 +56,11 @@
// Sets the icon tooltip. If |autoshow| is set the tooltip is automatically
// shown with the icon.
- void SetTooltip(const base::string16& tooltip, bool autoshow);
+ void SetTooltip(const std::u16string& tooltip, bool autoshow);
// Sets the accessibility label of the icon. If this attribute is not
// provided, then the tooltip will be used.
- void SetAriaLabel(const base::string16& aria_label);
+ void SetAriaLabel(const std::u16string& aria_label);
// If hardlock on click is set, clicking the icon in the screenlock will
// go to state where password is required for unlock.
@@ -70,21 +70,21 @@
UserPodCustomIcon icon() const { return icon_; }
- const base::string16 tooltip() const { return tooltip_; }
+ const std::u16string tooltip() const { return tooltip_; }
bool autoshow_tooltip() const { return autoshow_tooltip_; }
- const base::string16 aria_label() const { return aria_label_; }
+ const std::u16string aria_label() const { return aria_label_; }
bool hardlock_on_click() const { return hardlock_on_click_; }
private:
UserPodCustomIcon icon_;
- base::string16 tooltip_;
+ std::u16string tooltip_;
bool autoshow_tooltip_;
- base::string16 aria_label_;
+ std::u16string aria_label_;
bool hardlock_on_click_;
@@ -96,7 +96,7 @@
enum ScreenType { SIGNIN_SCREEN = 0, LOCK_SCREEN = 1, OTHER_SCREEN = 2 };
// Displays |message| in a banner on the lock screen.
- virtual void ShowBannerMessage(const base::string16& message,
+ virtual void ShowBannerMessage(const std::u16string& message,
bool is_warning) = 0;
// Shows a custom icon in the user pod on the lock screen.
@@ -113,7 +113,7 @@
// Set the authentication type to be used on the lock screen.
virtual void SetAuthType(const AccountId& account_id,
proximity_auth::mojom::AuthType auth_type,
- const base::string16& auth_value) = 0;
+ const std::u16string& auth_value) = 0;
// Returns the authentication type used for a user.
virtual proximity_auth::mojom::AuthType GetAuthType(
diff --git a/chromeos/components/quick_answers/quick_answers_model.h b/chromeos/components/quick_answers/quick_answers_model.h
index 1a07cfb..6e8ea87e 100644
--- a/chromeos/components/quick_answers/quick_answers_model.h
+++ b/chromeos/components/quick_answers/quick_answers_model.h
@@ -84,7 +84,7 @@
text(base::UTF8ToUTF16(text)),
color(color) {}
- base::string16 text;
+ std::u16string text;
// Attributes for text style.
SkColor color = SK_ColorBLACK;
diff --git a/chromeos/components/scanning/scanning_handler.cc b/chromeos/components/scanning/scanning_handler.cc
index 1c03846..9941446 100644
--- a/chromeos/components/scanning/scanning_handler.cc
+++ b/chromeos/components/scanning/scanning_handler.cc
@@ -140,7 +140,7 @@
const std::string name = args->GetList()[1].GetString();
const int count = args->GetList()[2].GetInt();
- const base::string16 localized_string = l10n_util::GetPluralStringFUTF16(
+ const std::u16string localized_string = l10n_util::GetPluralStringFUTF16(
string_id_map_.find(name)->second, count);
ResolveJavascriptCallback(base::Value(callback),
base::Value(localized_string));
diff --git a/chromeos/components/scanning/scanning_handler_unittest.cc b/chromeos/components/scanning/scanning_handler_unittest.cc
index c869190..d6abe7e 100644
--- a/chromeos/components/scanning/scanning_handler_unittest.cc
+++ b/chromeos/components/scanning/scanning_handler_unittest.cc
@@ -59,7 +59,7 @@
protected:
void SelectFileImpl(Type type,
- const base::string16& title,
+ const std::u16string& title,
const base::FilePath& default_path,
const FileTypeInfo* file_types,
int file_type_index,
diff --git a/chromeos/components/security_token_pin/error_generator.cc b/chromeos/components/security_token_pin/error_generator.cc
index 6eb0f22..21c0d16 100644
--- a/chromeos/components/security_token_pin/error_generator.cc
+++ b/chromeos/components/security_token_pin/error_generator.cc
@@ -16,10 +16,10 @@
// equal to this constant. (This is a pure UX heuristic.)
constexpr int kAttemptsLeftThreshold = 3;
-base::string16 GenerateErrorMessage(ErrorLabel error_label,
+std::u16string GenerateErrorMessage(ErrorLabel error_label,
int attempts_left,
bool accept_input) {
- base::string16 error_message;
+ std::u16string error_message;
switch (error_label) {
case ErrorLabel::kInvalidPin:
error_message =
@@ -39,7 +39,7 @@
break;
case ErrorLabel::kNone:
if (attempts_left < 0)
- return base::string16();
+ return std::u16string();
break;
}
diff --git a/chromeos/components/security_token_pin/error_generator.h b/chromeos/components/security_token_pin/error_generator.h
index dc61255..aa65ddf 100644
--- a/chromeos/components/security_token_pin/error_generator.h
+++ b/chromeos/components/security_token_pin/error_generator.h
@@ -17,7 +17,7 @@
// Generate an error message for a security pin token dialog, based on dialog
// parameters |error_label|, |attempts_left|, and |accept_input|.
COMPONENT_EXPORT(SECURITY_TOKEN_PIN)
-base::string16 GenerateErrorMessage(ErrorLabel error_label,
+std::u16string GenerateErrorMessage(ErrorLabel error_label,
int attempts_left,
bool accept_input);
diff --git a/chromeos/components/security_token_pin/error_generator_unittest.cc b/chromeos/components/security_token_pin/error_generator_unittest.cc
index aa52370a..7eb53a51 100644
--- a/chromeos/components/security_token_pin/error_generator_unittest.cc
+++ b/chromeos/components/security_token_pin/error_generator_unittest.cc
@@ -29,7 +29,7 @@
TEST_F(SecurityTokenPinErrorGeneratorTest, NoError) {
EXPECT_EQ(GenerateErrorMessage(ErrorLabel::kNone, /*attempts_left=*/-1,
/*accept_input=*/true),
- base::string16());
+ std::u16string());
}
// Tests the message for the kInvalidPin error.
@@ -85,7 +85,7 @@
TEST_F(SecurityTokenPinErrorGeneratorTest, HiddenAttempts) {
EXPECT_EQ(GenerateErrorMessage(ErrorLabel::kNone, /*attempts_left=*/4,
/*accept_input=*/true),
- base::string16());
+ std::u16string());
}
// Tests the message for the kInvalidPin error with the number of attempts left.
diff --git a/chromeos/components/string_matching/fuzzy_tokenized_string_match.cc b/chromeos/components/string_matching/fuzzy_tokenized_string_match.cc
index 11861be4..c9e32d0 100644
--- a/chromeos/components/string_matching/fuzzy_tokenized_string_match.cc
+++ b/chromeos/components/string_matching/fuzzy_tokenized_string_match.cc
@@ -24,8 +24,8 @@
constexpr double kMaxScore = 1.0;
// Returns sorted tokens from a TokenizedString.
-std::vector<base::string16> ProcessAndSort(const TokenizedString& text) {
- std::vector<base::string16> result;
+std::vector<std::u16string> ProcessAndSort(const TokenizedString& text) {
+ std::vector<std::u16string> result;
for (const auto& token : text.tokens()) {
result.emplace_back(token);
}
@@ -44,14 +44,14 @@
double partial_match_penalty_rate,
bool use_edit_distance,
double num_matching_blocks_penalty) {
- std::set<base::string16> query_token(query.tokens().begin(),
+ std::set<std::u16string> query_token(query.tokens().begin(),
query.tokens().end());
- std::set<base::string16> text_token(text.tokens().begin(),
+ std::set<std::u16string> text_token(text.tokens().begin(),
text.tokens().end());
- std::vector<base::string16> intersection;
- std::vector<base::string16> query_diff_text;
- std::vector<base::string16> text_diff_query;
+ std::vector<std::u16string> intersection;
+ std::vector<std::u16string> query_diff_text;
+ std::vector<std::u16string> text_diff_query;
// Find the intersection and the differences between two set of tokens.
std::set_intersection(query_token.begin(), query_token.end(),
@@ -63,15 +63,15 @@
std::set_difference(text_token.begin(), text_token.end(), query_token.begin(),
query_token.end(), std::back_inserter(text_diff_query));
- const base::string16 intersection_string =
+ const std::u16string intersection_string =
base::JoinString(intersection, base::UTF8ToUTF16(" "));
- const base::string16 query_rewritten =
+ const std::u16string query_rewritten =
intersection.empty()
? base::JoinString(query_diff_text, base::UTF8ToUTF16(" "))
: base::StrCat(
{intersection_string, base::UTF8ToUTF16(" "),
base::JoinString(query_diff_text, base::UTF8ToUTF16(" "))});
- const base::string16 text_rewritten =
+ const std::u16string text_rewritten =
intersection.empty()
? base::JoinString(text_diff_query, base::UTF8ToUTF16(" "))
: base::StrCat(
@@ -109,9 +109,9 @@
double partial_match_penalty_rate,
bool use_edit_distance,
double num_matching_blocks_penalty) {
- const base::string16 query_sorted =
+ const std::u16string query_sorted =
base::JoinString(ProcessAndSort(query), base::UTF8ToUTF16(" "));
- const base::string16 text_sorted =
+ const std::u16string text_sorted =
base::JoinString(ProcessAndSort(text), base::UTF8ToUTF16(" "));
if (partial) {
@@ -124,16 +124,16 @@
}
double FuzzyTokenizedStringMatch::PartialRatio(
- const base::string16& query,
- const base::string16& text,
+ const std::u16string& query,
+ const std::u16string& text,
double partial_match_penalty_rate,
bool use_edit_distance,
double num_matching_blocks_penalty) {
if (query.empty() || text.empty()) {
return kMinScore;
}
- base::string16 shorter = query;
- base::string16 longer = text;
+ std::u16string shorter = query;
+ std::u16string longer = text;
if (shorter.size() > longer.size()) {
shorter = text;
@@ -186,9 +186,9 @@
const double unbase_scale = 0.95;
// Since query.text() and text.text() is not normalized, we use query.tokens()
// and text.tokens() instead.
- const base::string16 query_normalized(
+ const std::u16string query_normalized(
base::JoinString(query.tokens(), base::UTF8ToUTF16(" ")));
- const base::string16 text_normalized(
+ const std::u16string text_normalized(
base::JoinString(text.tokens(), base::UTF8ToUTF16(" ")));
double weighted_ratio =
SequenceMatcher(query_normalized, text_normalized, use_edit_distance,
diff --git a/chromeos/components/string_matching/fuzzy_tokenized_string_match.h b/chromeos/components/string_matching/fuzzy_tokenized_string_match.h
index dd1b9a6..52d5bbdc 100644
--- a/chromeos/components/string_matching/fuzzy_tokenized_string_match.h
+++ b/chromeos/components/string_matching/fuzzy_tokenized_string_match.h
@@ -53,8 +53,8 @@
// Finds the best ratio of shorter text with a part of longer text.
// This function assumes that TokenizedString is already normalized (converted
// to lower case). The return score is in range of [0, 1].
- static double PartialRatio(const base::string16& query,
- const base::string16& text,
+ static double PartialRatio(const std::u16string& query,
+ const std::u16string& text,
double partial_match_penalty_rate,
bool use_edit_distance,
double num_matching_blocks_penalty);
diff --git a/chromeos/components/string_matching/fuzzy_tokenized_string_match_unittest.cc b/chromeos/components/string_matching/fuzzy_tokenized_string_match_unittest.cc
index 691e5a0..fb8b4245 100644
--- a/chromeos/components/string_matching/fuzzy_tokenized_string_match_unittest.cc
+++ b/chromeos/components/string_matching/fuzzy_tokenized_string_match_unittest.cc
@@ -43,8 +43,8 @@
TEST_F(FuzzyTokenizedStringMatchTest, TokenSetRatioTest) {
FuzzyTokenizedStringMatch match;
{
- base::string16 query(base::UTF8ToUTF16("order different in"));
- base::string16 text(base::UTF8ToUTF16("text order"));
+ std::u16string query(base::UTF8ToUTF16("order different in"));
+ std::u16string text(base::UTF8ToUTF16("text order"));
EXPECT_EQ(match.TokenSetRatio(TokenizedString(query), TokenizedString(text),
true, kPartialMatchPenaltyRate, false, 0.0),
1);
@@ -54,8 +54,8 @@
0.67, 0.01);
}
{
- base::string16 query(base::UTF8ToUTF16("short text"));
- base::string16 text(
+ std::u16string query(base::UTF8ToUTF16("short text"));
+ std::u16string text(
base::UTF8ToUTF16("this text is really really really long"));
EXPECT_EQ(match.TokenSetRatio(TokenizedString(query), TokenizedString(text),
true, kPartialMatchPenaltyRate, false, 0.0),
@@ -66,8 +66,8 @@
0.57, 0.01);
}
{
- base::string16 query(base::UTF8ToUTF16("common string"));
- base::string16 text(base::UTF8ToUTF16("nothing is shared"));
+ std::u16string query(base::UTF8ToUTF16("common string"));
+ std::u16string text(base::UTF8ToUTF16("nothing is shared"));
EXPECT_NEAR(
match.TokenSetRatio(TokenizedString(query), TokenizedString(text), true,
kPartialMatchPenaltyRate, false, 0.0),
@@ -78,9 +78,9 @@
0.33, 0.01);
}
{
- base::string16 query(
+ std::u16string query(
base::UTF8ToUTF16("token shared token same shared same"));
- base::string16 text(base::UTF8ToUTF16("token shared token text text long"));
+ std::u16string text(base::UTF8ToUTF16("token shared token text text long"));
EXPECT_EQ(match.TokenSetRatio(TokenizedString(query), TokenizedString(text),
true, kPartialMatchPenaltyRate, false, 0.0),
1);
@@ -94,8 +94,8 @@
TEST_F(FuzzyTokenizedStringMatchTest, TokenSortRatioTest) {
FuzzyTokenizedStringMatch match;
{
- base::string16 query(base::UTF8ToUTF16("order different in"));
- base::string16 text(base::UTF8ToUTF16("text order"));
+ std::u16string query(base::UTF8ToUTF16("order different in"));
+ std::u16string text(base::UTF8ToUTF16("text order"));
EXPECT_NEAR(
match.TokenSortRatio(TokenizedString(query), TokenizedString(text),
true, kPartialMatchPenaltyRate, false, 0.0),
@@ -106,8 +106,8 @@
0.36, 0.01);
}
{
- base::string16 query(base::UTF8ToUTF16("short text"));
- base::string16 text(
+ std::u16string query(base::UTF8ToUTF16("short text"));
+ std::u16string text(
base::UTF8ToUTF16("this text is really really really long"));
EXPECT_EQ(
match.TokenSortRatio(TokenizedString(query), TokenizedString(text),
@@ -119,8 +119,8 @@
0.33, 0.01);
}
{
- base::string16 query(base::UTF8ToUTF16("common string"));
- base::string16 text(base::UTF8ToUTF16("nothing is shared"));
+ std::u16string query(base::UTF8ToUTF16("common string"));
+ std::u16string text(base::UTF8ToUTF16("nothing is shared"));
EXPECT_NEAR(
match.TokenSortRatio(TokenizedString(query), TokenizedString(text),
true, kPartialMatchPenaltyRate, false, 0.0),
@@ -135,32 +135,32 @@
TEST_F(FuzzyTokenizedStringMatchTest, WeightedRatio) {
FuzzyTokenizedStringMatch match;
{
- base::string16 query(base::UTF8ToUTF16("anonymous"));
- base::string16 text(base::UTF8ToUTF16("famous"));
+ std::u16string query(base::UTF8ToUTF16("anonymous"));
+ std::u16string text(base::UTF8ToUTF16("famous"));
EXPECT_NEAR(
match.WeightedRatio(TokenizedString(query), TokenizedString(text),
kPartialMatchPenaltyRate, false, 0.0),
0.67, 0.01);
}
{
- base::string16 query(base::UTF8ToUTF16("Clash.of.clan"));
- base::string16 text(base::UTF8ToUTF16("ClashOfTitan"));
+ std::u16string query(base::UTF8ToUTF16("Clash.of.clan"));
+ std::u16string text(base::UTF8ToUTF16("ClashOfTitan"));
EXPECT_NEAR(
match.WeightedRatio(TokenizedString(query), TokenizedString(text),
kPartialMatchPenaltyRate, false, 0.0),
0.81, 0.01);
}
{
- base::string16 query(base::UTF8ToUTF16("final fantasy"));
- base::string16 text(base::UTF8ToUTF16("finalfantasy"));
+ std::u16string query(base::UTF8ToUTF16("final fantasy"));
+ std::u16string text(base::UTF8ToUTF16("finalfantasy"));
EXPECT_NEAR(
match.WeightedRatio(TokenizedString(query), TokenizedString(text),
kPartialMatchPenaltyRate, false, 0.0),
0.96, 0.01);
}
{
- base::string16 query(base::UTF8ToUTF16("short text!!!"));
- base::string16 text(
+ std::u16string query(base::UTF8ToUTF16("short text!!!"));
+ std::u16string text(
base::UTF8ToUTF16("this sentence is much much much much much longer "
"than the text before"));
EXPECT_NEAR(
@@ -172,57 +172,57 @@
TEST_F(FuzzyTokenizedStringMatchTest, PrefixMatcherTest) {
{
- base::string16 query(base::UTF8ToUTF16("clas"));
- base::string16 text(base::UTF8ToUTF16("Clash of Clan"));
+ std::u16string query(base::UTF8ToUTF16("clas"));
+ std::u16string text(base::UTF8ToUTF16("Clash of Clan"));
EXPECT_NEAR(FuzzyTokenizedStringMatch::PrefixMatcher(TokenizedString(query),
TokenizedString(text)),
0.94, 0.01);
}
{
- base::string16 query(base::UTF8ToUTF16("clash clan"));
- base::string16 text(base::UTF8ToUTF16("Clash of Clan"));
+ std::u16string query(base::UTF8ToUTF16("clash clan"));
+ std::u16string text(base::UTF8ToUTF16("Clash of Clan"));
EXPECT_EQ(FuzzyTokenizedStringMatch::PrefixMatcher(TokenizedString(query),
TokenizedString(text)),
0.0);
}
{
- base::string16 query(base::UTF8ToUTF16("c o c"));
- base::string16 text(base::UTF8ToUTF16("Clash of Clan"));
+ std::u16string query(base::UTF8ToUTF16("c o c"));
+ std::u16string text(base::UTF8ToUTF16("Clash of Clan"));
EXPECT_NEAR(FuzzyTokenizedStringMatch::PrefixMatcher(TokenizedString(query),
TokenizedString(text)),
0.84, 0.01);
}
{
- base::string16 query(base::UTF8ToUTF16("wifi"));
- base::string16 text(base::UTF8ToUTF16("wi-fi"));
+ std::u16string query(base::UTF8ToUTF16("wifi"));
+ std::u16string text(base::UTF8ToUTF16("wi-fi"));
EXPECT_NEAR(FuzzyTokenizedStringMatch::PrefixMatcher(TokenizedString(query),
TokenizedString(text)),
0.91, 0.01);
}
{
- base::string16 query(base::UTF8ToUTF16("clam"));
- base::string16 text(base::UTF8ToUTF16("Clash of Clan"));
+ std::u16string query(base::UTF8ToUTF16("clam"));
+ std::u16string text(base::UTF8ToUTF16("Clash of Clan"));
EXPECT_EQ(FuzzyTokenizedStringMatch::PrefixMatcher(TokenizedString(query),
TokenizedString(text)),
0.0);
}
{
- base::string16 query(base::UTF8ToUTF16("rp"));
- base::string16 text(base::UTF8ToUTF16("Remove Google Play Store"));
+ std::u16string query(base::UTF8ToUTF16("rp"));
+ std::u16string text(base::UTF8ToUTF16("Remove Google Play Store"));
EXPECT_EQ(FuzzyTokenizedStringMatch::PrefixMatcher(TokenizedString(query),
TokenizedString(text)),
0.0);
}
{
- base::string16 query(base::UTF8ToUTF16("remove play"));
- base::string16 text(base::UTF8ToUTF16("Remove Google Play Store"));
+ std::u16string query(base::UTF8ToUTF16("remove play"));
+ std::u16string text(base::UTF8ToUTF16("Remove Google Play Store"));
EXPECT_EQ(FuzzyTokenizedStringMatch::PrefixMatcher(TokenizedString(query),
TokenizedString(text)),
0.0);
}
{
- base::string16 query(base::UTF8ToUTF16("google play"));
- base::string16 text(base::UTF8ToUTF16("Remove Google Play Store"));
+ std::u16string query(base::UTF8ToUTF16("google play"));
+ std::u16string text(base::UTF8ToUTF16("Remove Google Play Store"));
EXPECT_NEAR(FuzzyTokenizedStringMatch::PrefixMatcher(TokenizedString(query),
TokenizedString(text)),
0.99, 0.01);
@@ -232,22 +232,22 @@
TEST_F(FuzzyTokenizedStringMatchTest, ParamThresholdTest1) {
FuzzyTokenizedStringMatch match;
{
- base::string16 query(base::UTF8ToUTF16("anonymous"));
- base::string16 text(base::UTF8ToUTF16("famous"));
+ std::u16string query(base::UTF8ToUTF16("anonymous"));
+ std::u16string text(base::UTF8ToUTF16("famous"));
EXPECT_FALSE(match.IsRelevant(TokenizedString(query), TokenizedString(text),
0.4, false, true, false,
kPartialMatchPenaltyRate, 0.0));
}
{
- base::string16 query(base::UTF8ToUTF16("CC"));
- base::string16 text(base::UTF8ToUTF16("Clash Of Clan"));
+ std::u16string query(base::UTF8ToUTF16("CC"));
+ std::u16string text(base::UTF8ToUTF16("Clash Of Clan"));
EXPECT_FALSE(match.IsRelevant(TokenizedString(query), TokenizedString(text),
0.25, false, true, false,
kPartialMatchPenaltyRate, 0.0));
}
{
- base::string16 query(base::UTF8ToUTF16("Clash.of.clan"));
- base::string16 text(base::UTF8ToUTF16("ClashOfTitan"));
+ std::u16string query(base::UTF8ToUTF16("Clash.of.clan"));
+ std::u16string text(base::UTF8ToUTF16("ClashOfTitan"));
EXPECT_TRUE(match.IsRelevant(TokenizedString(query), TokenizedString(text),
0.4, false, true, false,
kPartialMatchPenaltyRate, 0.0));
@@ -257,22 +257,22 @@
TEST_F(FuzzyTokenizedStringMatchTest, ParamThresholdTest2) {
FuzzyTokenizedStringMatch match;
{
- base::string16 query(base::UTF8ToUTF16("anonymous"));
- base::string16 text(base::UTF8ToUTF16("famous"));
+ std::u16string query(base::UTF8ToUTF16("anonymous"));
+ std::u16string text(base::UTF8ToUTF16("famous"));
EXPECT_FALSE(match.IsRelevant(TokenizedString(query), TokenizedString(text),
0.5, false, true, false,
kPartialMatchPenaltyRate, 0.0));
}
{
- base::string16 query(base::UTF8ToUTF16("CC"));
- base::string16 text(base::UTF8ToUTF16("Clash Of Clan"));
+ std::u16string query(base::UTF8ToUTF16("CC"));
+ std::u16string text(base::UTF8ToUTF16("Clash Of Clan"));
EXPECT_FALSE(match.IsRelevant(TokenizedString(query), TokenizedString(text),
0.25, false, true, false,
kPartialMatchPenaltyRate));
}
{
- base::string16 query(base::UTF8ToUTF16("Clash.of.clan"));
- base::string16 text(base::UTF8ToUTF16("ClashOfTitan"));
+ std::u16string query(base::UTF8ToUTF16("Clash.of.clan"));
+ std::u16string text(base::UTF8ToUTF16("ClashOfTitan"));
EXPECT_FALSE(match.IsRelevant(TokenizedString(query), TokenizedString(text),
0.5, false, true, false,
kPartialMatchPenaltyRate, 0.0));
@@ -281,8 +281,8 @@
TEST_F(FuzzyTokenizedStringMatchTest, OtherParamTest) {
FuzzyTokenizedStringMatch match;
- base::string16 query(base::UTF8ToUTF16("anonymous"));
- base::string16 text(base::UTF8ToUTF16("famous"));
+ std::u16string query(base::UTF8ToUTF16("anonymous"));
+ std::u16string text(base::UTF8ToUTF16("famous"));
EXPECT_FALSE(match.IsRelevant(TokenizedString(query), TokenizedString(text),
0.35, false, false, true,
kPartialMatchPenaltyRate, 0.0));
@@ -291,8 +291,8 @@
TEST_F(FuzzyTokenizedStringMatchTest, ExactTextMatchTest) {
FuzzyTokenizedStringMatch match;
- base::string16 query(base::UTF8ToUTF16("yat"));
- base::string16 text(base::UTF8ToUTF16("YaT"));
+ std::u16string query(base::UTF8ToUTF16("yat"));
+ std::u16string text(base::UTF8ToUTF16("YaT"));
EXPECT_TRUE(match.IsRelevant(TokenizedString(query), TokenizedString(text),
0.35, false, false, true,
kPartialMatchPenaltyRate, 0.0));
diff --git a/chromeos/components/string_matching/sequence_matcher.cc b/chromeos/components/string_matching/sequence_matcher.cc
index 69843b9..56a4786 100644
--- a/chromeos/components/string_matching/sequence_matcher.cc
+++ b/chromeos/components/string_matching/sequence_matcher.cc
@@ -30,8 +30,8 @@
DCHECK_GE(length, 0);
}
-SequenceMatcher::SequenceMatcher(const base::string16& first_string,
- const base::string16& second_string,
+SequenceMatcher::SequenceMatcher(const std::u16string& first_string,
+ const std::u16string& second_string,
bool use_edit_distance,
double num_matching_blocks_penalty)
: first_string_(first_string),
diff --git a/chromeos/components/string_matching/sequence_matcher.h b/chromeos/components/string_matching/sequence_matcher.h
index 140e42f..894eda2 100644
--- a/chromeos/components/string_matching/sequence_matcher.h
+++ b/chromeos/components/string_matching/sequence_matcher.h
@@ -38,8 +38,8 @@
// matching blocks. Value equal to 0 means no penalty. Values greater than 0
// means heavier penalty will be applied to larger number of blocks. This is
// only appled if |use_edit_distance| is false.
- SequenceMatcher(const base::string16& first_string,
- const base::string16& second_string,
+ SequenceMatcher(const std::u16string& first_string,
+ const std::u16string& second_string,
bool use_edit_distance,
double num_matching_blocks_penalty);
@@ -66,8 +66,8 @@
std::vector<Match> GetMatchingBlocks();
private:
- base::string16 first_string_;
- base::string16 second_string_;
+ std::u16string first_string_;
+ std::u16string second_string_;
double num_matching_blocks_penalty_ = 0.0;
double edit_distance_ratio_ = -1.0;
double block_matching_ratio_ = -1.0;
diff --git a/chromeos/components/string_matching/term_break_iterator.cc b/chromeos/components/string_matching/term_break_iterator.cc
index 230c0a9..00b9904 100644
--- a/chromeos/components/string_matching/term_break_iterator.cc
+++ b/chromeos/components/string_matching/term_break_iterator.cc
@@ -15,7 +15,7 @@
namespace chromeos {
namespace string_matching {
-TermBreakIterator::TermBreakIterator(const base::string16& word)
+TermBreakIterator::TermBreakIterator(const std::u16string& word)
: word_(word),
prev_(npos),
pos_(0),
@@ -51,7 +51,7 @@
return prev_ != pos_ || !iter_->end();
}
-const base::string16 TermBreakIterator::GetCurrentTerm() const {
+const std::u16string TermBreakIterator::GetCurrentTerm() const {
DCHECK(prev_ != npos && pos_ != npos);
return word_.substr(prev_, pos_ - prev_);
}
diff --git a/chromeos/components/string_matching/term_break_iterator.h b/chromeos/components/string_matching/term_break_iterator.h
index 4a4d3b90..7dcd9ba 100644
--- a/chromeos/components/string_matching/term_break_iterator.h
+++ b/chromeos/components/string_matching/term_break_iterator.h
@@ -31,7 +31,7 @@
class TermBreakIterator {
public:
// Note that |word| must out live this iterator.
- explicit TermBreakIterator(const base::string16& word);
+ explicit TermBreakIterator(const std::u16string& word);
~TermBreakIterator();
// Advance to the next term. Returns false if at the end of the word.
@@ -39,7 +39,7 @@
// Returns the current term, which is the substr of |word_| in range
// [prev_, pos_).
- const base::string16 GetCurrentTerm() const;
+ const std::u16string GetCurrentTerm() const;
size_t prev() const { return prev_; }
size_t pos() const { return pos_; }
@@ -59,7 +59,7 @@
// Returns new state for given |ch|.
State GetNewState(char16_t ch);
- const base::string16& word_;
+ const std::u16string& word_;
size_t prev_;
size_t pos_;
diff --git a/chromeos/components/string_matching/term_break_iterator_unittest.cc b/chromeos/components/string_matching/term_break_iterator_unittest.cc
index 985bde6b..272ebc72 100644
--- a/chromeos/components/string_matching/term_break_iterator_unittest.cc
+++ b/chromeos/components/string_matching/term_break_iterator_unittest.cc
@@ -13,13 +13,13 @@
using base::UTF8ToUTF16;
TEST(TermBreakIteratorTest, EmptyWord) {
- base::string16 empty;
+ std::u16string empty;
TermBreakIterator iter(empty);
EXPECT_FALSE(iter.Advance());
}
TEST(TermBreakIteratorTest, Simple) {
- base::string16 word(UTF8ToUTF16("simple"));
+ std::u16string word(UTF8ToUTF16("simple"));
TermBreakIterator iter(word);
EXPECT_TRUE(iter.Advance());
EXPECT_EQ(UTF8ToUTF16("simple"), iter.GetCurrentTerm());
@@ -27,7 +27,7 @@
}
TEST(TermBreakIteratorTest, CamelCase) {
- base::string16 word(UTF8ToUTF16("CamelCase"));
+ std::u16string word(UTF8ToUTF16("CamelCase"));
TermBreakIterator iter(word);
EXPECT_TRUE(iter.Advance());
EXPECT_EQ(UTF8ToUTF16("Camel"), iter.GetCurrentTerm());
@@ -37,7 +37,7 @@
}
TEST(TermBreakIteratorTest, LowerToUpper) {
- base::string16 word(UTF8ToUTF16("lowerToUpper"));
+ std::u16string word(UTF8ToUTF16("lowerToUpper"));
TermBreakIterator iter(word);
EXPECT_TRUE(iter.Advance());
EXPECT_EQ(UTF8ToUTF16("lower"), iter.GetCurrentTerm());
@@ -49,7 +49,7 @@
}
TEST(TermBreakIteratorTest, AlphaNumber) {
- base::string16 word(UTF8ToUTF16("Chromium26.0.0.0"));
+ std::u16string word(UTF8ToUTF16("Chromium26.0.0.0"));
TermBreakIterator iter(word);
EXPECT_TRUE(iter.Advance());
EXPECT_EQ(UTF8ToUTF16("Chromium"), iter.GetCurrentTerm());
@@ -59,7 +59,7 @@
}
TEST(TermBreakIteratorTest, StartsWithNumber) {
- base::string16 word(UTF8ToUTF16("123startWithNumber"));
+ std::u16string word(UTF8ToUTF16("123startWithNumber"));
TermBreakIterator iter(word);
EXPECT_TRUE(iter.Advance());
EXPECT_EQ(UTF8ToUTF16("123"), iter.GetCurrentTerm());
@@ -74,7 +74,7 @@
TEST(TermBreakIteratorTest, CaseAndNoCase) {
// "English" + two Chinese chars U+4E2D U+6587 + "Word"
- base::string16 word(UTF8ToUTF16("English\xe4\xb8\xad\xe6\x96\x87Word"));
+ std::u16string word(UTF8ToUTF16("English\xe4\xb8\xad\xe6\x96\x87Word"));
TermBreakIterator iter(word);
EXPECT_TRUE(iter.Advance());
EXPECT_EQ(UTF8ToUTF16("English"), iter.GetCurrentTerm());
diff --git a/chromeos/components/string_matching/tokenized_string.cc b/chromeos/components/string_matching/tokenized_string.cc
index 7a74b52..7be2e73 100644
--- a/chromeos/components/string_matching/tokenized_string.cc
+++ b/chromeos/components/string_matching/tokenized_string.cc
@@ -19,7 +19,7 @@
using base::i18n::BreakIterator;
-TokenizedString::TokenizedString(const base::string16& text, Mode mode)
+TokenizedString::TokenizedString(const std::u16string& text, Mode mode)
: text_(text) {
switch (mode) {
case Mode::kCamelCase:
@@ -47,7 +47,7 @@
if (!break_iter.IsWord())
continue;
- const base::string16 word(break_iter.GetString());
+ const std::u16string word(break_iter.GetString());
const size_t word_start = break_iter.prev();
TermBreakIterator term_iter(word);
while (term_iter.Advance()) {
@@ -83,7 +83,7 @@
// 1. Whitespace chars only: generate a token from |text_| in the range of
// [start, end). Also reset |start| and |end| for next token.
// 2. A punctuation: do nothing and Advance.
- const base::string16 word(break_iter.GetString());
+ const std::u16string word(break_iter.GetString());
const bool only_whitechars =
base::ContainsOnlyChars(word, base::kWhitespaceUTF16);
if (only_whitechars) {
diff --git a/chromeos/components/string_matching/tokenized_string.h b/chromeos/components/string_matching/tokenized_string.h
index 3da869a..7edb8a36 100644
--- a/chromeos/components/string_matching/tokenized_string.h
+++ b/chromeos/components/string_matching/tokenized_string.h
@@ -25,14 +25,14 @@
kWords,
};
- typedef std::vector<base::string16> Tokens;
+ typedef std::vector<std::u16string> Tokens;
typedef std::vector<gfx::Range> Mappings;
- explicit TokenizedString(const base::string16& text,
+ explicit TokenizedString(const std::u16string& text,
Mode mode = Mode::kCamelCase);
~TokenizedString();
- const base::string16& text() const { return text_; }
+ const std::u16string& text() const { return text_; }
const Tokens& tokens() const { return tokens_; }
const Mappings& mappings() const { return mappings_; }
@@ -41,7 +41,7 @@
void TokenizeWords();
// Input text.
- const base::string16 text_;
+ const std::u16string text_;
// Broken down tokens and the index mapping of tokens in original string.
Tokens tokens_;
diff --git a/chromeos/components/string_matching/tokenized_string_char_iterator_unittest.cc b/chromeos/components/string_matching/tokenized_string_char_iterator_unittest.cc
index 0e2a032..9693548 100644
--- a/chromeos/components/string_matching/tokenized_string_char_iterator_unittest.cc
+++ b/chromeos/components/string_matching/tokenized_string_char_iterator_unittest.cc
@@ -23,7 +23,7 @@
// last one is optional and only shows up when IsFirstCharOfToken returns true.
std::string GetIterateState(const TokenizedStringCharIterator& iter) {
return base::StringPrintf(
- "%s%d%s", base::UTF16ToUTF8(base::string16(1, iter.Get())).c_str(),
+ "%s%d%s", base::UTF16ToUTF8(std::u16string(1, iter.Get())).c_str(),
iter.GetArrayPos(), iter.IsFirstCharOfToken() ? "!" : "");
}
diff --git a/chromeos/components/string_matching/tokenized_string_fuzzer.cc b/chromeos/components/string_matching/tokenized_string_fuzzer.cc
index 5c5031f..7796d96c 100644
--- a/chromeos/components/string_matching/tokenized_string_fuzzer.cc
+++ b/chromeos/components/string_matching/tokenized_string_fuzzer.cc
@@ -11,8 +11,8 @@
if (size < 1 || size % 2 != 0)
return 0;
- // Test for base::string16 if size is even.
- base::string16 string_input16(reinterpret_cast<const char16_t*>(data),
+ // Test for std::u16string if size is even.
+ std::u16string string_input16(reinterpret_cast<const char16_t*>(data),
size / 2);
chromeos::string_matching::TokenizedString tokenized_string_from_string16(
string_input16);
diff --git a/chromeos/components/string_matching/tokenized_string_match.cc b/chromeos/components/string_matching/tokenized_string_match.cc
index e08ee1d..de4ce1f 100644
--- a/chromeos/components/string_matching/tokenized_string_match.cc
+++ b/chromeos/components/string_matching/tokenized_string_match.cc
@@ -76,8 +76,8 @@
return relevance_ > kNoMatchScore;
}
-bool TokenizedStringMatch::Calculate(const base::string16& query,
- const base::string16& text) {
+bool TokenizedStringMatch::Calculate(const std::u16string& query,
+ const std::u16string& text) {
const TokenizedString tokenized_query(query);
const TokenizedString tokenized_text(text);
return Calculate(tokenized_query, tokenized_text);
diff --git a/chromeos/components/string_matching/tokenized_string_match.h b/chromeos/components/string_matching/tokenized_string_match.h
index 83d22d1..6efe4ff5 100644
--- a/chromeos/components/string_matching/tokenized_string_match.h
+++ b/chromeos/components/string_matching/tokenized_string_match.h
@@ -35,7 +35,7 @@
bool Calculate(const TokenizedString& query, const TokenizedString& text);
// Convenience wrapper to calculate match from raw string input.
- bool Calculate(const base::string16& query, const base::string16& text);
+ bool Calculate(const std::u16string& query, const std::u16string& text);
double relevance() const { return relevance_; }
const Hits& hits() const { return hits_; }
diff --git a/chromeos/components/string_matching/tokenized_string_match_unittest.cc b/chromeos/components/string_matching/tokenized_string_match_unittest.cc
index 397d7319..210c06a 100644
--- a/chromeos/components/string_matching/tokenized_string_match_unittest.cc
+++ b/chromeos/components/string_matching/tokenized_string_match_unittest.cc
@@ -19,9 +19,9 @@
// Returns a string of |text| marked the hits in |match| using block bracket.
// e.g. text= "Text", match.hits = [{0,1}], returns "[T]ext".
-std::string MatchHit(const base::string16& text,
+std::string MatchHit(const std::u16string& text,
const TokenizedStringMatch& match) {
- base::string16 marked = text;
+ std::u16string marked = text;
const TokenizedStringMatch::Hits& hits = match.hits();
for (TokenizedStringMatch::Hits::const_reverse_iterator it = hits.rbegin();
@@ -48,7 +48,7 @@
TokenizedStringMatch match;
for (size_t i = 0; i < base::size(kTestCases); ++i) {
- const base::string16 text(base::UTF8ToUTF16(kTestCases[i].text));
+ const std::u16string text(base::UTF8ToUTF16(kTestCases[i].text));
EXPECT_FALSE(match.Calculate(base::UTF8ToUTF16(kTestCases[i].query), text))
<< "Test case " << i << " : text=" << kTestCases[i].text
<< ", query=" << kTestCases[i].query;
@@ -75,7 +75,7 @@
TokenizedStringMatch match;
for (size_t i = 0; i < base::size(kTestCases); ++i) {
- const base::string16 text(base::UTF8ToUTF16(kTestCases[i].text));
+ const std::u16string text(base::UTF8ToUTF16(kTestCases[i].text));
EXPECT_TRUE(match.Calculate(base::UTF8ToUTF16(kTestCases[i].query), text));
EXPECT_EQ(kTestCases[i].expect, MatchHit(text, match));
}
@@ -107,7 +107,7 @@
TokenizedStringMatch match_low;
TokenizedStringMatch match_high;
for (size_t i = 0; i < base::size(kTestCases); ++i) {
- const base::string16 text(base::UTF8ToUTF16(kTestCases[i].text));
+ const std::u16string text(base::UTF8ToUTF16(kTestCases[i].text));
EXPECT_TRUE(
match_low.Calculate(base::UTF8ToUTF16(kTestCases[i].query_low), text));
EXPECT_TRUE(match_high.Calculate(
@@ -141,7 +141,7 @@
TokenizedStringMatch match;
for (size_t i = 0; i < base::size(kTestCases); ++i) {
- const base::string16 text(base::UTF8ToUTF16(kTestCases[i].text));
+ const std::u16string text(base::UTF8ToUTF16(kTestCases[i].text));
EXPECT_TRUE(match.Calculate(base::UTF8ToUTF16(kTestCases[i].query), text));
EXPECT_NEAR(match.relevance(), kTestCases[i].expected_score, kEpsilon)
<< "Test case " << i << " : text=" << kTestCases[i].text
diff --git a/chromeos/components/string_matching/tokenized_string_unittest.cc b/chromeos/components/string_matching/tokenized_string_unittest.cc
index a2509f8e..faf129f6 100644
--- a/chromeos/components/string_matching/tokenized_string_unittest.cc
+++ b/chromeos/components/string_matching/tokenized_string_unittest.cc
@@ -14,11 +14,11 @@
namespace {
-base::string16 GetContent(const TokenizedString& tokenized) {
+std::u16string GetContent(const TokenizedString& tokenized) {
const TokenizedString::Tokens& tokens = tokenized.tokens();
const TokenizedString::Mappings& mappings = tokenized.mappings();
- base::string16 str;
+ std::u16string str;
for (size_t i = 0; i < tokens.size(); ++i) {
if (i > 0)
str += ' ';
@@ -30,37 +30,37 @@
} // namespace
TEST(TokenizedStringTest, Empty) {
- base::string16 empty;
+ std::u16string empty;
TokenizedString tokens(empty);
- EXPECT_EQ(base::string16(), GetContent(tokens));
+ EXPECT_EQ(std::u16string(), GetContent(tokens));
TokenizedString token_words(empty, TokenizedString::Mode::kWords);
- EXPECT_EQ(base::string16(), GetContent(token_words));
+ EXPECT_EQ(std::u16string(), GetContent(token_words));
}
TEST(TokenizedStringTest, Basic) {
{
- base::string16 text(base::UTF8ToUTF16("a"));
+ std::u16string text(base::UTF8ToUTF16("a"));
TokenizedString tokens(text);
EXPECT_EQ(base::UTF8ToUTF16("a{0,1}"), GetContent(tokens));
TokenizedString token_words(text, TokenizedString::Mode::kWords);
EXPECT_EQ(base::UTF8ToUTF16("a{0,1}"), GetContent(token_words));
}
{
- base::string16 text(base::UTF8ToUTF16("ScratchPad"));
+ std::u16string text(base::UTF8ToUTF16("ScratchPad"));
TokenizedString tokens(text);
EXPECT_EQ(base::UTF8ToUTF16("scratch{0,7} pad{7,10}"), GetContent(tokens));
TokenizedString token_words(text, TokenizedString::Mode::kWords);
EXPECT_EQ(base::UTF8ToUTF16("scratchpad{0,10}"), GetContent(token_words));
}
{
- base::string16 text(base::UTF8ToUTF16("Chess2.0"));
+ std::u16string text(base::UTF8ToUTF16("Chess2.0"));
TokenizedString tokens(text);
EXPECT_EQ(base::UTF8ToUTF16("chess{0,5} 2.0{5,8}"), GetContent(tokens));
TokenizedString token_words(text, TokenizedString::Mode::kWords);
EXPECT_EQ(base::UTF8ToUTF16("chess2.0{0,8}"), GetContent(token_words));
}
{
- base::string16 text(base::UTF8ToUTF16("Cut the rope"));
+ std::u16string text(base::UTF8ToUTF16("Cut the rope"));
TokenizedString tokens(text);
EXPECT_EQ(base::UTF8ToUTF16("cut{0,3} the{4,7} rope{8,12}"),
GetContent(tokens));
@@ -69,7 +69,7 @@
GetContent(token_words));
}
{
- base::string16 text(base::UTF8ToUTF16("AutoCAD WS"));
+ std::u16string text(base::UTF8ToUTF16("AutoCAD WS"));
TokenizedString tokens(text);
EXPECT_EQ(base::UTF8ToUTF16("auto{0,4} cad{4,7} ws{8,10}"),
GetContent(tokens));
@@ -78,7 +78,7 @@
GetContent(token_words));
}
{
- base::string16 text(base::UTF8ToUTF16("Great TweetDeck"));
+ std::u16string text(base::UTF8ToUTF16("Great TweetDeck"));
TokenizedString tokens(text);
EXPECT_EQ(base::UTF8ToUTF16("great{0,5} tweet{6,11} deck{11,15}"),
GetContent(tokens));
@@ -87,14 +87,14 @@
GetContent(token_words));
}
{
- base::string16 text(base::UTF8ToUTF16("Draw-It!"));
+ std::u16string text(base::UTF8ToUTF16("Draw-It!"));
TokenizedString tokens(text);
EXPECT_EQ(base::UTF8ToUTF16("draw{0,4} it{5,7}"), GetContent(tokens));
TokenizedString token_words(text, TokenizedString::Mode::kWords);
EXPECT_EQ(base::UTF8ToUTF16("draw-it{0,7}"), GetContent(token_words));
}
{
- base::string16 text(base::UTF8ToUTF16("Faxing & Signing"));
+ std::u16string text(base::UTF8ToUTF16("Faxing & Signing"));
TokenizedString tokens(text);
EXPECT_EQ(base::UTF8ToUTF16("faxing{0,6} signing{9,16}"),
GetContent(tokens));
@@ -103,7 +103,7 @@
GetContent(token_words));
}
{
- base::string16 text(base::UTF8ToUTF16("!@#$%^&*()<<<**>>>"));
+ std::u16string text(base::UTF8ToUTF16("!@#$%^&*()<<<**>>>"));
TokenizedString tokens(text);
EXPECT_EQ(base::UTF8ToUTF16(""), GetContent(tokens));
TokenizedString token_words(text, TokenizedString::Mode::kWords);
@@ -113,19 +113,19 @@
TEST(TokenizedStringTest, TokenizeWords) {
{
- base::string16 text(base::UTF8ToUTF16("?! wi-fi abc@gmail.com?!"));
+ std::u16string text(base::UTF8ToUTF16("?! wi-fi abc@gmail.com?!"));
TokenizedString token_words(text, TokenizedString::Mode::kWords);
EXPECT_EQ(base::UTF8ToUTF16("wi-fi{3,8} abc@gmail.com{9,22}"),
GetContent(token_words));
}
{
- base::string16 text(base::UTF8ToUTF16("Hello?! \t \b World! "));
+ std::u16string text(base::UTF8ToUTF16("Hello?! \t \b World! "));
TokenizedString token_words(text, TokenizedString::Mode::kWords);
EXPECT_EQ(base::UTF8ToUTF16("hello{0,5} world{14,19}"),
GetContent(token_words));
}
{
- base::string16 text(base::UTF8ToUTF16(" ?|! *&"));
+ std::u16string text(base::UTF8ToUTF16(" ?|! *&"));
TokenizedString token_words(text, TokenizedString::Mode::kWords);
EXPECT_EQ(base::UTF8ToUTF16(""), GetContent(token_words));
}
diff --git a/chromeos/network/cellular_esim_profile.cc b/chromeos/network/cellular_esim_profile.cc
index 3e0c0aa..2b41d06 100644
--- a/chromeos/network/cellular_esim_profile.cc
+++ b/chromeos/network/cellular_esim_profile.cc
@@ -71,9 +71,9 @@
const dbus::ObjectPath& path,
const std::string& eid,
const std::string& iccid,
- const base::string16& name,
- const base::string16& nickname,
- const base::string16& service_provider,
+ const std::u16string& name,
+ const std::u16string& nickname,
+ const std::u16string& service_provider,
const std::string& activation_code)
: state_(state),
path_(path),
diff --git a/chromeos/network/cellular_esim_profile.h b/chromeos/network/cellular_esim_profile.h
index 8ce0bb60..237378f2 100644
--- a/chromeos/network/cellular_esim_profile.h
+++ b/chromeos/network/cellular_esim_profile.h
@@ -45,9 +45,9 @@
const dbus::ObjectPath& path,
const std::string& eid,
const std::string& iccid,
- const base::string16& name,
- const base::string16& nickname,
- const base::string16& service_provider,
+ const std::u16string& name,
+ const std::u16string& nickname,
+ const std::u16string& service_provider,
const std::string& activation_code);
CellularESimProfile(const CellularESimProfile&);
CellularESimProfile& operator=(const CellularESimProfile&);
@@ -57,9 +57,9 @@
const dbus::ObjectPath& path() const { return path_; }
const std::string& eid() const { return eid_; }
const std::string& iccid() const { return iccid_; }
- const base::string16& name() const { return name_; }
- const base::string16& nickname() const { return nickname_; }
- const base::string16& service_provider() const { return service_provider_; }
+ const std::u16string& name() const { return name_; }
+ const std::u16string& nickname() const { return nickname_; }
+ const std::u16string& service_provider() const { return service_provider_; }
const std::string& activation_code() const { return activation_code_; }
base::Value ToDictionaryValue() const;
@@ -81,13 +81,13 @@
std::string iccid_;
// Service provider’s name for this profile. e.g. “Verizon Plan 1”
- base::string16 name_;
+ std::u16string name_;
// A user configurable nickname for this profile. e.g. “My Personal SIM”
- base::string16 nickname_;
+ std::u16string nickname_;
// Name of the service provider. e.g. “Verizon Wireless”
- base::string16 service_provider_;
+ std::u16string service_provider_;
// An alphanumeric code that can be used to install this profile.
std::string activation_code_;
diff --git a/chromeos/network/onc/onc_certificate_importer_impl.cc b/chromeos/network/onc/onc_certificate_importer_impl.cc
index 7b879883..7b1335a 100644
--- a/chromeos/network/onc/onc_certificate_importer_impl.cc
+++ b/chromeos/network/onc/onc_certificate_importer_impl.cc
@@ -218,7 +218,7 @@
int import_result =
nssdb->ImportFromPKCS12(private_slot.get(), certificate.pkcs12_data(),
- base::string16(), false, &imported_certs);
+ std::u16string(), false, &imported_certs);
if (import_result != net::OK) {
std::string error_string = net::ErrorToString(import_result);
NET_LOG(ERROR) << "Unable to import client certificate with guid: "
diff --git a/chromeos/policy/weekly_time/time_utils.cc b/chromeos/policy/weekly_time/time_utils.cc
index 6f2d7f4..50fe76c3 100644
--- a/chromeos/policy/weekly_time/time_utils.cc
+++ b/chromeos/policy/weekly_time/time_utils.cc
@@ -74,7 +74,7 @@
return true;
}
-base::string16 WeeklyTimeToLocalizedString(const WeeklyTime& weekly_time,
+std::u16string WeeklyTimeToLocalizedString(const WeeklyTime& weekly_time,
base::Clock* clock) {
WeeklyTime result = weekly_time;
if (!weekly_time.timezone_offset()) {
@@ -83,7 +83,7 @@
auto local_time_zone = base::WrapUnique(icu::TimeZone::createDefault());
if (!GetOffsetFromTimezoneToGmt(*local_time_zone, clock, &offset)) {
LOG(ERROR) << "Unable to obtain offset for time agnostic timezone";
- return base::string16();
+ return std::u16string();
}
result = weekly_time.ConvertToCustomTimezone(-offset);
}
diff --git a/chromeos/policy/weekly_time/time_utils.h b/chromeos/policy/weekly_time/time_utils.h
index 8d0d5513..627fae7 100644
--- a/chromeos/policy/weekly_time/time_utils.h
+++ b/chromeos/policy/weekly_time/time_utils.h
@@ -44,7 +44,7 @@
// Similarly, the output will be "Donnerstag 05:00" in a German locale in a GMT
// timezone (there may be slight changes in formatting due to different
// standards in different locales).
-CHROMEOS_EXPORT base::string16 WeeklyTimeToLocalizedString(
+CHROMEOS_EXPORT std::u16string WeeklyTimeToLocalizedString(
const WeeklyTime& weekly_time,
base::Clock* clock);
diff --git a/chromeos/services/cellular_setup/esim_profile.cc b/chromeos/services/cellular_setup/esim_profile.cc
index acc765c..7c31c21 100644
--- a/chromeos/services/cellular_setup/esim_profile.cc
+++ b/chromeos/services/cellular_setup/esim_profile.cc
@@ -137,7 +137,7 @@
weak_ptr_factory_.GetWeakPtr(), std::move(callback)));
}
-void ESimProfile::SetProfileNickname(const base::string16& nickname,
+void ESimProfile::SetProfileNickname(const std::u16string& nickname,
SetProfileNicknameCallback callback) {
if (set_profile_nickname_callback_) {
NET_LOG(ERROR) << "Set Profile Nickname already in progress.";
@@ -281,7 +281,7 @@
}
void ESimProfile::PerformSetProfileNickname(
- const base::string16& nickname,
+ const std::u16string& nickname,
bool request_profile_success,
std::unique_ptr<CellularInhibitor::InhibitLock> inhibit_lock) {
if (!request_profile_success) {
diff --git a/chromeos/services/cellular_setup/esim_profile.h b/chromeos/services/cellular_setup/esim_profile.h
index e82839e..4a3174e 100644
--- a/chromeos/services/cellular_setup/esim_profile.h
+++ b/chromeos/services/cellular_setup/esim_profile.h
@@ -43,7 +43,7 @@
void UninstallProfile(UninstallProfileCallback callback) override;
void EnableProfile(EnableProfileCallback callback) override;
void DisableProfile(DisableProfileCallback callback) override;
- void SetProfileNickname(const base::string16& nickname,
+ void SetProfileNickname(const std::u16string& nickname,
SetProfileNicknameCallback callback) override;
// Update properties for this ESimProfile from D-Bus.
@@ -87,7 +87,7 @@
bool request_profile_success,
std::unique_ptr<CellularInhibitor::InhibitLock> inhibit_lock);
void PerformSetProfileNickname(
- const base::string16& nickname,
+ const std::u16string& nickname,
bool request_profile_success,
std::unique_ptr<CellularInhibitor::InhibitLock> inhibit_lock);
void OnPendingProfileInstallResult(
diff --git a/chromeos/services/cellular_setup/esim_profile_unittest.cc b/chromeos/services/cellular_setup/esim_profile_unittest.cc
index 61a9cb3..5cebe08f 100644
--- a/chromeos/services/cellular_setup/esim_profile_unittest.cc
+++ b/chromeos/services/cellular_setup/esim_profile_unittest.cc
@@ -89,7 +89,7 @@
mojom::ESimOperationResult SetProfileNickname(
const mojo::Remote<mojom::ESimProfile>& esim_profile,
- const base::string16& nickname) {
+ const std::u16string& nickname) {
mojom::ESimOperationResult result;
base::RunLoop run_loop;
@@ -327,7 +327,7 @@
}
TEST_F(ESimProfileTest, SetProfileNickName) {
- const base::string16 test_nickname = base::UTF8ToUTF16("Test nickname");
+ const std::u16string test_nickname = base::UTF8ToUTF16("Test nickname");
HermesEuiccClient::TestInterface* euicc_test =
HermesEuiccClient::Get()->GetTestInterface();
dbus::ObjectPath active_profile_path = euicc_test->AddFakeCarrierProfile(
diff --git a/chromeos/services/device_sync/proto/cryptauth_logging.cc b/chromeos/services/device_sync/proto/cryptauth_logging.cc
index 74b5246..f032ee0 100644
--- a/chromeos/services/device_sync/proto/cryptauth_logging.cc
+++ b/chromeos/services/device_sync/proto/cryptauth_logging.cc
@@ -151,7 +151,7 @@
directive.policy_reference()));
{
- base::string16 checkin_delay;
+ std::u16string checkin_delay;
bool success = base::TimeDurationFormatWithSeconds(
base::TimeDelta::FromMilliseconds(directive.checkin_delay_millis()),
base::DurationFormatWidth::DURATION_WIDTH_NARROW, &checkin_delay);
@@ -167,7 +167,7 @@
directive.retry_attempts());
{
- base::string16 retry_period;
+ std::u16string retry_period;
bool success = base::TimeDurationFormatWithSeconds(
base::TimeDelta::FromMilliseconds(directive.retry_period_millis()),
base::DurationFormatWidth::DURATION_WIDTH_NARROW, &retry_period);
diff --git a/chromeos/services/ime/public/cpp/rulebased/engine.cc b/chromeos/services/ime/public/cpp/rulebased/engine.cc
index d0fe532..ce5f6ffb 100644
--- a/chromeos/services/ime/public/cpp/rulebased/engine.cc
+++ b/chromeos/services/ime/public/cpp/rulebased/engine.cc
@@ -131,7 +131,7 @@
ProcessKeyResult res;
// Reverts the current state.
// If the backspace across over the transat pos, adjusts it.
- base::string16 text = base::UTF8ToUTF16(context_);
+ std::u16string text = base::UTF8ToUTF16(context_);
text = text.substr(0, text.length() - 1);
context_ = base::UTF16ToUTF8(text);
if (transat_ > (int)context_.length())
diff --git a/chromeos/services/ime/public/cpp/rulebased/rules_data.cc b/chromeos/services/ime/public/cpp/rulebased/rules_data.cc
index fdacd8c..8b6a97b 100644
--- a/chromeos/services/ime/public/cpp/rulebased/rules_data.cc
+++ b/chromeos/services/ime/public/cpp/rulebased/rules_data.cc
@@ -201,7 +201,7 @@
// can match the expanded prefix regexp. e.g. "abca".
std::string Prefixalize(const std::string& re_str) {
// Using UTF16 string for iteration in character basis.
- base::string16 restr16 = base::UTF8ToUTF16(re_str);
+ std::u16string restr16 = base::UTF8ToUTF16(re_str);
std::string ret;
bool escape = false;
int bracket = -1;
diff --git a/chromeos/settings/timezone_settings.cc b/chromeos/settings/timezone_settings.cc
index 406de5ef..10e5eed 100644
--- a/chromeos/settings/timezone_settings.cc
+++ b/chromeos/settings/timezone_settings.cc
@@ -281,8 +281,8 @@
// TimezoneSettings implementation:
const icu::TimeZone& GetTimezone() override;
- base::string16 GetCurrentTimezoneID() override;
- void SetTimezoneFromID(const base::string16& timezone_id) override;
+ std::u16string GetCurrentTimezoneID() override;
+ void SetTimezoneFromID(const std::u16string& timezone_id) override;
void AddObserver(Observer* observer) override;
void RemoveObserver(Observer* observer) override;
const std::vector<std::unique_ptr<icu::TimeZone>>& GetTimezoneList()
@@ -347,12 +347,12 @@
return *timezone_.get();
}
-base::string16 TimezoneSettingsBaseImpl::GetCurrentTimezoneID() {
+std::u16string TimezoneSettingsBaseImpl::GetCurrentTimezoneID() {
return chromeos::system::TimezoneSettings::GetTimezoneID(GetTimezone());
}
void TimezoneSettingsBaseImpl::SetTimezoneFromID(
- const base::string16& timezone_id) {
+ const std::u16string& timezone_id) {
std::unique_ptr<icu::TimeZone> timezone(icu::TimeZone::createTimeZone(
icu::UnicodeString(timezone_id.c_str(), timezone_id.size())));
SetTimezone(*timezone);
@@ -483,7 +483,7 @@
}
// static
-base::string16 TimezoneSettings::GetTimezoneID(const icu::TimeZone& timezone) {
+std::u16string TimezoneSettings::GetTimezoneID(const icu::TimeZone& timezone) {
icu::UnicodeString id;
return base::i18n::UnicodeStringToString16(timezone.getID(id));
}
diff --git a/chromeos/settings/timezone_settings.h b/chromeos/settings/timezone_settings.h
index bf18581..c7b5c1b 100644
--- a/chromeos/settings/timezone_settings.h
+++ b/chromeos/settings/timezone_settings.h
@@ -34,11 +34,11 @@
// Returns the current timezone as an icu::Timezone object.
virtual const icu::TimeZone& GetTimezone() = 0;
- virtual base::string16 GetCurrentTimezoneID() = 0;
+ virtual std::u16string GetCurrentTimezoneID() = 0;
// Sets the current timezone and notifies all Observers.
virtual void SetTimezone(const icu::TimeZone& timezone) = 0;
- virtual void SetTimezoneFromID(const base::string16& timezone_id) = 0;
+ virtual void SetTimezoneFromID(const std::u16string& timezone_id) = 0;
virtual void AddObserver(Observer* observer) = 0;
virtual void RemoveObserver(Observer* observer) = 0;
@@ -47,7 +47,7 @@
const = 0;
// Gets timezone ID which is also used as timezone pref value.
- static base::string16 GetTimezoneID(const icu::TimeZone& timezone);
+ static std::u16string GetTimezoneID(const icu::TimeZone& timezone);
protected:
virtual ~TimezoneSettings() {}
diff --git a/chromeos/ui/base/window_properties.cc b/chromeos/ui/base/window_properties.cc
index 05af0e8..b021468 100644
--- a/chromeos/ui/base/window_properties.cc
+++ b/chromeos/ui/base/window_properties.cc
@@ -45,7 +45,7 @@
kWindowPinTypeKey,
WindowPinType::kNone)
-DEFINE_OWNED_UI_CLASS_PROPERTY_KEY(base::string16,
+DEFINE_OWNED_UI_CLASS_PROPERTY_KEY(std::u16string,
kWindowOverviewTitleKey,
nullptr)
diff --git a/chromeos/ui/base/window_properties.h b/chromeos/ui/base/window_properties.h
index 12645e5..04a4b41 100644
--- a/chromeos/ui/base/window_properties.h
+++ b/chromeos/ui/base/window_properties.h
@@ -101,7 +101,7 @@
// A property key whose value is shown in alt-tab/overview mode. If non-value
// is set, the window's title is used.
COMPONENT_EXPORT(CHROMEOS_UI_BASE)
-extern const ui::ClassProperty<base::string16*>* const kWindowOverviewTitleKey;
+extern const ui::ClassProperty<std::u16string*>* const kWindowOverviewTitleKey;
// Alphabetical sort.
diff --git a/chromeos/ui/frame/frame_header.cc b/chromeos/ui/frame/frame_header.cc
index b2ec0d9..a1b7932 100644
--- a/chromeos/ui/frame/frame_header.cc
+++ b/chromeos/ui/frame/frame_header.cc
@@ -261,7 +261,7 @@
}
void FrameHeader::SetFrameTextOverride(
- const base::string16& frame_text_override) {
+ const std::u16string& frame_text_override) {
frame_text_override_ = frame_text_override;
SchedulePaintForTitle();
}
@@ -297,7 +297,7 @@
}
void FrameHeader::PaintTitleBar(gfx::Canvas* canvas) {
- base::string16 text = frame_text_override_;
+ std::u16string text = frame_text_override_;
views::WidgetDelegate* target_widget_delegate =
target_widget_->widget_delegate();
if (text.empty() && target_widget_delegate &&
diff --git a/chromeos/ui/frame/frame_header.h b/chromeos/ui/frame/frame_header.h
index 8094239..5c696b0 100644
--- a/chromeos/ui/frame/frame_header.h
+++ b/chromeos/ui/frame/frame_header.h
@@ -86,7 +86,7 @@
virtual ~FrameHeader();
- const base::string16& frame_text_override() const {
+ const std::u16string& frame_text_override() const {
return frame_text_override_;
}
@@ -131,7 +131,7 @@
// Sets text to display in place of the window's title. This will be shown
// regardless of what ShouldShowWindowTitle() returns.
- void SetFrameTextOverride(const base::string16& frame_text_override);
+ void SetFrameTextOverride(const std::u16string& frame_text_override);
void UpdateFrameHeaderKey();
@@ -200,7 +200,7 @@
// Whether the header should be painted as active.
Mode mode_ = MODE_INACTIVE;
- base::string16 frame_text_override_;
+ std::u16string frame_text_override_;
DISALLOW_COPY_AND_ASSIGN(FrameHeader);
};
diff --git a/content/app_shim_remote_cocoa/render_widget_host_ns_view_bridge.h b/content/app_shim_remote_cocoa/render_widget_host_ns_view_bridge.h
index bc30123..7055439 100644
--- a/content/app_shim_remote_cocoa/render_widget_host_ns_view_bridge.h
+++ b/content/app_shim_remote_cocoa/render_widget_host_ns_view_bridge.h
@@ -50,10 +50,10 @@
void SetCALayerParams(const gfx::CALayerParams& ca_layer_params) override;
void SetBackgroundColor(SkColor color) override;
void SetVisible(bool visible) override;
- void SetTooltipText(const base::string16& display_text) override;
+ void SetTooltipText(const std::u16string& display_text) override;
void SetTextInputState(ui::TextInputType text_input_type,
uint32_t flags) override;
- void SetTextSelection(const base::string16& text,
+ void SetTextSelection(const std::u16string& text,
uint64_t offset,
const gfx::Range& range) override;
void SetCompositionRangeInfo(const gfx::Range& range) override;
@@ -92,7 +92,7 @@
std::unique_ptr<ui::DisplayCALayerTree> display_ca_layer_tree_;
// Cached copy of the tooltip text, to avoid redundant calls.
- base::string16 tooltip_text_;
+ std::u16string tooltip_text_;
// The receiver for this object (only used when remotely instantiated).
mojo::AssociatedReceiver<mojom::RenderWidgetHostNSView> receiver_{this};
diff --git a/content/app_shim_remote_cocoa/render_widget_host_ns_view_bridge.mm b/content/app_shim_remote_cocoa/render_widget_host_ns_view_bridge.mm
index bc0d772..48680c8 100644
--- a/content/app_shim_remote_cocoa/render_widget_host_ns_view_bridge.mm
+++ b/content/app_shim_remote_cocoa/render_widget_host_ns_view_bridge.mm
@@ -159,7 +159,7 @@
}
void RenderWidgetHostNSViewBridge::SetTooltipText(
- const base::string16& tooltip_text) {
+ const std::u16string& tooltip_text) {
// Called from the renderer to tell us what the tooltip text should be. It
// calls us frequently so we need to cache the value to prevent doing a lot
// of repeat work.
@@ -174,7 +174,7 @@
// Windows; we're just trying to be polite. Don't persist the trimmed
// string, as then the comparison above will always fail and we'll try to
// set it again every single time the mouse moves.
- base::string16 display_text = tooltip_text_;
+ std::u16string display_text = tooltip_text_;
if (tooltip_text_.length() > kMaxTooltipLength)
display_text = tooltip_text_.substr(0, kMaxTooltipLength);
@@ -199,7 +199,7 @@
[cocoa_view_ setTextInputFlags:flags];
}
-void RenderWidgetHostNSViewBridge::SetTextSelection(const base::string16& text,
+void RenderWidgetHostNSViewBridge::SetTextSelection(const std::u16string& text,
uint64_t offset,
const gfx::Range& range) {
[cocoa_view_ setTextSelectionText:text offset:offset range:range];
diff --git a/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.h b/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.h
index 8b610a2..d2b45b74 100644
--- a/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.h
+++ b/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.h
@@ -138,7 +138,7 @@
// The text selection, cached from the RenderWidgetHostView.
// |_availableText| contains the selected text and is a substring of the
// full string in the renderer.
- base::string16 _availableText;
+ std::u16string _availableText;
size_t _availableTextOffset;
gfx::Range _textSelectionRange;
@@ -149,10 +149,10 @@
gfx::Range _compositionRange;
// Text to be inserted which was generated by handling a key down event.
- base::string16 _textToBeInserted;
+ std::u16string _textToBeInserted;
// Marked text which was generated by handling a key down event.
- base::string16 _markedText;
+ std::u16string _markedText;
// Selected range of |markedText_|.
NSRange _markedTextSelectedRange;
@@ -251,10 +251,10 @@
// Indicate if the embedding WebContents is showing a web content context menu.
- (void)setShowingContextMenu:(BOOL)showing;
// Set the current TextInputManager::TextSelection from the renderer.
-- (void)setTextSelectionText:(base::string16)text
+- (void)setTextSelectionText:(std::u16string)text
offset:(size_t)offset
range:(gfx::Range)range;
-- (base::string16)selectedText;
+- (std::u16string)selectedText;
// Set the current TextInputManager::CompositionRangeInfo from the renderer.
- (void)setCompositionRange:(gfx::Range)range;
diff --git a/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm b/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm
index 867eebe..cb8d2b7 100644
--- a/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm
+++ b/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm
@@ -443,7 +443,7 @@
[NSSpellChecker.sharedSpellChecker.substitutionsPanel orderFront:sender];
}
-- (void)setTextSelectionText:(base::string16)text
+- (void)setTextSelectionText:(std::u16string)text
offset:(size_t)offset
range:(gfx::Range)range {
_availableText = text;
@@ -487,12 +487,12 @@
[self invalidateTouchBar];
}
-- (base::string16)selectedText {
+- (std::u16string)selectedText {
gfx::Range textRange(_availableTextOffset,
_availableTextOffset + _availableText.size());
gfx::Range intersectionRange = textRange.Intersect(_textSelectionRange);
if (intersectionRange.is_empty())
- return base::string16();
+ return std::u16string();
return _availableText.substr(intersectionRange.start() - _availableTextOffset,
intersectionRange.length());
}
@@ -1826,7 +1826,7 @@
return nil;
gfx::Range expectedRange;
- const base::string16* expectedText;
+ const std::u16string* expectedText;
expectedText = &_availableText;
size_t offset = _availableTextOffset;
@@ -1838,7 +1838,7 @@
if (actualRange)
*actualRange = gfxActualRange.ToNSRange();
- base::string16 string = expectedText->substr(
+ std::u16string string = expectedText->substr(
gfxActualRange.start() - expectedRange.start(), gfxActualRange.length());
return [[[NSAttributedString alloc]
initWithString:base::SysUTF16ToNSString(string)] autorelease];
diff --git a/content/app_shim_remote_cocoa/web_drag_source_mac.mm b/content/app_shim_remote_cocoa/web_drag_source_mac.mm
index c04e64aa..c9dc15e 100644
--- a/content/app_shim_remote_cocoa/web_drag_source_mac.mm
+++ b/content/app_shim_remote_cocoa/web_drag_source_mac.mm
@@ -91,7 +91,7 @@
- (void)lazyWriteToPasteboard:(NSPasteboard*)pboard forType:(NSString*)type {
// NSHTMLPboardType requires the character set to be declared. Otherwise, it
// assumes US-ASCII. Awesome.
- const base::string16 kHtmlHeader = base::ASCIIToUTF16(
+ const std::u16string kHtmlHeader = base::ASCIIToUTF16(
"<meta http-equiv=\"Content-Type\" content=\"text/html;charset=UTF-8\">");
// Be extra paranoid; avoid crashing.
@@ -289,7 +289,7 @@
net::GetMimeTypeFromFile(_downloadFileName, &mimeType);
}
} else {
- base::string16 mimeType16;
+ std::u16string mimeType16;
base::FilePath fileName;
if (content::ParseDownloadMetadata(
_dropData->download_metadata,
diff --git a/content/browser/accessibility/accessibility_auralinux_browsertest.cc b/content/browser/accessibility/accessibility_auralinux_browsertest.cc
index 8bbb8990..4ef27d9 100644
--- a/content/browser/accessibility/accessibility_auralinux_browsertest.cc
+++ b/content/browser/accessibility/accessibility_auralinux_browsertest.cc
@@ -254,7 +254,7 @@
int character_count = atk_text_get_character_count(contenteditable_text);
ASSERT_EQ(13, character_count);
- const base::string16 embedded_character(
+ const std::u16string embedded_character(
1, ui::AXPlatformNodeAuraLinux::kEmbeddedCharacter);
const std::vector<const std::string> expected_hypertext = {
"B", "e", "f", "o", "r", "e", base::UTF16ToUTF8(embedded_character),
@@ -429,7 +429,7 @@
int n_characters = atk_text_get_character_count(atk_text);
ASSERT_LT(newline_offset, n_characters);
- const base::string16 embedded_character(
+ const std::u16string embedded_character(
1, ui::AXPlatformNodeAuraLinux::kEmbeddedCharacter);
std::string expected_string = "Game theory is \"the study of " +
base::UTF16ToUTF8(embedded_character) +
@@ -1316,7 +1316,7 @@
EXPECT_TRUE(ATK_IS_TEXT(list_item_1));
- const base::string16 string16_embed(
+ const std::u16string string16_embed(
1, ui::AXPlatformNodeAuraLinux::kEmbeddedCharacter);
std::string expected_string = base::UTF16ToUTF8(string16_embed) + "Text 1";
diff --git a/content/browser/accessibility/accessibility_browsertest.cc b/content/browser/accessibility/accessibility_browsertest.cc
index 0b52e907..a17673e 100644
--- a/content/browser/accessibility/accessibility_browsertest.cc
+++ b/content/browser/accessibility/accessibility_browsertest.cc
@@ -30,7 +30,7 @@
return web_contents->GetRenderWidgetHostView()->GetNativeViewAccessible();
}
-void AccessibilityBrowserTest::ExecuteScript(const base::string16& script) {
+void AccessibilityBrowserTest::ExecuteScript(const std::u16string& script) {
shell()->web_contents()->GetMainFrame()->ExecuteJavaScriptForTests(
script, base::NullCallback());
}
diff --git a/content/browser/accessibility/accessibility_browsertest.h b/content/browser/accessibility/accessibility_browsertest.h
index 56448e9..05511a44 100644
--- a/content/browser/accessibility/accessibility_browsertest.h
+++ b/content/browser/accessibility/accessibility_browsertest.h
@@ -21,7 +21,7 @@
protected:
gfx::NativeViewAccessible GetRendererAccessible();
- void ExecuteScript(const base::string16& script);
+ void ExecuteScript(const std::u16string& script);
void LoadInitialAccessibilityTreeFromHtml(
const std::string& html,
ui::AXMode accessibility_mode = ui::kAXModeComplete);
diff --git a/content/browser/accessibility/accessibility_event_recorder_win.cc b/content/browser/accessibility/accessibility_event_recorder_win.cc
index d4e972c1..4abbbb6 100644
--- a/content/browser/accessibility/accessibility_event_recorder_win.cc
+++ b/content/browser/accessibility/accessibility_event_recorder_win.cc
@@ -69,7 +69,7 @@
// Pretty-print the embedded object character as <obj> so that test output
// is human-readable.
std::wstring embedded_character = base::UTF16ToWide(
- base::string16(1, BrowserAccessibilityComWin::kEmbeddedCharacter));
+ std::u16string(1, BrowserAccessibilityComWin::kEmbeddedCharacter));
base::ReplaceChars(wstr, embedded_character, L"<obj>", &wstr);
return base::WideToUTF8(wstr);
diff --git a/content/browser/accessibility/accessibility_tree_formatter_uia_win.cc b/content/browser/accessibility/accessibility_tree_formatter_uia_win.cc
index 345248f..d1a4745 100644
--- a/content/browser/accessibility/accessibility_tree_formatter_uia_win.cc
+++ b/content/browser/accessibility/accessibility_tree_formatter_uia_win.cc
@@ -1012,7 +1012,7 @@
base::DictionaryValue* dict) const {
int count;
array->get_Length(&count);
- base::string16 element_list;
+ std::u16string element_list;
for (int i = 0; i < count; i++) {
Microsoft::WRL::ComPtr<IUIAutomationElement> element;
if (SUCCEEDED(array->GetElement(i, &element))) {
@@ -1032,7 +1032,7 @@
dict->SetString(GetPropertyName(propertyId), element_list);
}
-base::string16 AccessibilityTreeFormatterUia::GetNodeName(
+std::u16string AccessibilityTreeFormatterUia::GetNodeName(
IUIAutomationElement* uncached_node) const {
// Update the cache for this node.
if (uncached_node) {
@@ -1048,7 +1048,7 @@
{variant.ptr()->bstrVal, SysStringLen(variant.ptr()->bstrVal)});
}
}
- return base::string16();
+ return std::u16string();
}
void AccessibilityTreeFormatterUia::BuildCacheRequests() {
diff --git a/content/browser/accessibility/accessibility_tree_formatter_uia_win.h b/content/browser/accessibility/accessibility_tree_formatter_uia_win.h
index f5b8297..3de79a5 100644
--- a/content/browser/accessibility/accessibility_tree_formatter_uia_win.h
+++ b/content/browser/accessibility/accessibility_tree_formatter_uia_win.h
@@ -93,7 +93,7 @@
void WriteElementArray(long propertyId,
IUIAutomationElementArray* array,
base::DictionaryValue* dict) const;
- base::string16 GetNodeName(IUIAutomationElement* node) const;
+ std::u16string GetNodeName(IUIAutomationElement* node) const;
std::string ProcessTreeForOutput(
const base::DictionaryValue& node) const override;
void ProcessPropertyForOutput(const std::string& property_name,
diff --git a/content/browser/accessibility/accessibility_tree_formatter_utils_mac.h b/content/browser/accessibility/accessibility_tree_formatter_utils_mac.h
index f1dcf1a..5eec03b 100644
--- a/content/browser/accessibility/accessibility_tree_formatter_utils_mac.h
+++ b/content/browser/accessibility/accessibility_tree_formatter_utils_mac.h
@@ -109,7 +109,7 @@
id PropertyNodeToTextMarkerRange(const ui::AXPropertyNode&) const;
gfx::NativeViewAccessible LineIndexToNode(
- const base::string16 line_index) const;
+ const std::u16string line_index) const;
const id node;
const LineIndexer* line_indexer;
diff --git a/content/browser/accessibility/accessibility_tree_formatter_win.cc b/content/browser/accessibility/accessibility_tree_formatter_win.cc
index 69670fa9..58f27f2 100644
--- a/content/browser/accessibility/accessibility_tree_formatter_win.cc
+++ b/content/browser/accessibility/accessibility_tree_formatter_win.cc
@@ -349,14 +349,14 @@
}
}
-base::string16 RoleVariantToString(const base::win::ScopedVariant& role) {
+std::u16string RoleVariantToString(const base::win::ScopedVariant& role) {
if (role.type() == VT_I4) {
return base::WideToUTF16(IAccessible2RoleToString(V_I4(role.ptr())));
} else if (role.type() == VT_BSTR) {
BSTR bstr_role = V_BSTR(role.ptr());
return base::WideToUTF16({bstr_role, SysStringLen(bstr_role)});
}
- return base::string16();
+ return std::u16string();
}
void AccessibilityTreeFormatterWin::AddMSAAProperties(
@@ -524,9 +524,9 @@
if (ia2->get_attributes(temp_bstr.Receive()) == S_OK) {
// get_attributes() returns a semicolon delimited string. Turn it into a
// ListValue
- std::vector<base::string16> ia2_attributes = base::SplitString(
+ std::vector<std::u16string> ia2_attributes = base::SplitString(
base::WideToUTF16({temp_bstr.Get(), temp_bstr.Length()}),
- base::string16(1, ';'), base::KEEP_WHITESPACE, base::SPLIT_WANT_ALL);
+ std::u16string(1, ';'), base::KEEP_WHITESPACE, base::SPLIT_WANT_ALL);
base::Value::ListStorage attributes;
attributes.reserve(ia2_attributes.size());
@@ -603,7 +603,7 @@
// Replace all embedded characters with the child indices of the
// accessibility objects they refer to.
std::wstring embedded_character = base::UTF16ToWide(
- base::string16(1, BrowserAccessibilityComWin::kEmbeddedCharacter));
+ std::u16string(1, BrowserAccessibilityComWin::kEmbeddedCharacter));
size_t character_index = 0;
size_t hypertext_index = 0;
while (hypertext_index < ia2_hypertext.length()) {
@@ -665,9 +665,9 @@
dict->SetIntPath("table_columns", table_columns);
}
-static base::string16 ProcessAccessiblesArray(IUnknown** accessibles,
+static std::u16string ProcessAccessiblesArray(IUnknown** accessibles,
LONG num_accessibles) {
- base::string16 related_accessibles_string;
+ std::u16string related_accessibles_string;
if (num_accessibles <= 0)
return related_accessibles_string;
@@ -710,7 +710,7 @@
if (SUCCEEDED(
ia2cell->get_rowHeaderCells(&row_headers, &n_row_header_cells)) &&
n_row_header_cells > 0) {
- base::string16 accessibles_desc =
+ std::u16string accessibles_desc =
ProcessAccessiblesArray(row_headers, n_row_header_cells);
CoTaskMemFree(row_headers); // Free the array manually.
dict->SetStringPath("row_headers", accessibles_desc);
@@ -721,7 +721,7 @@
if (SUCCEEDED(ia2cell->get_columnHeaderCells(&column_headers,
&n_column_header_cells)) &&
n_column_header_cells > 0) {
- base::string16 accessibles_desc =
+ std::u16string accessibles_desc =
ProcessAccessiblesArray(column_headers, n_column_header_cells);
CoTaskMemFree(column_headers); // Free the array manually.
dict->SetStringPath("column_headers", accessibles_desc);
@@ -779,7 +779,7 @@
// DCHECK(start_offset == current_offset); // Always at text range start.
if (hr == S_OK && temp_bstr.Get() && wcslen(temp_bstr.Get())) {
// Append offset:<number>.
- base::string16 offset_str =
+ std::u16string offset_str =
base::ASCIIToUTF16("offset:") + base::NumberToString16(start_offset);
text_attributes.Append(offset_str);
// Append name:value pairs.
diff --git a/content/browser/accessibility/accessibility_win_browsertest.cc b/content/browser/accessibility/accessibility_win_browsertest.cc
index 02237f7..f3dcac37 100644
--- a/content/browser/accessibility/accessibility_win_browsertest.cc
+++ b/content/browser/accessibility/accessibility_win_browsertest.cc
@@ -3747,7 +3747,7 @@
contenteditable_text->get_nCharacters(&n_characters));
ASSERT_EQ(13, n_characters);
- const base::string16 embedded_character(
+ const std::u16string embedded_character(
1, BrowserAccessibilityComWin::kEmbeddedCharacter);
const std::wstring expected_hypertext =
L"Before" + base::UTF16ToWide(embedded_character) + L"after.";
@@ -3921,7 +3921,7 @@
Microsoft::WRL::ComPtr<IAccessibleText> paragraph_text;
SetUpSampleParagraph(¶graph_text);
std::wstring embedded_character = base::UTF16ToWide(
- base::string16(1, BrowserAccessibilityComWin::kEmbeddedCharacter));
+ std::u16string(1, BrowserAccessibilityComWin::kEmbeddedCharacter));
std::vector<std::wstring> words = {
L"Game ", L"theory ", L"is ", L"\"",
L"the ", L"study ", L"of ", embedded_character,
@@ -4520,7 +4520,7 @@
// The beforeunload dialog won't be shown unless the page has at
// least one user gesture on it.
auto* main_frame = shell()->web_contents()->GetMainFrame();
- main_frame->ExecuteJavaScriptWithUserGestureForTests(base::string16());
+ main_frame->ExecuteJavaScriptWithUserGestureForTests(std::u16string());
// Trigger a reload here, which will get cancelled.
AppModalDialogWaiter dialog_waiter(shell());
diff --git a/content/browser/accessibility/android_granularity_movement_browsertest.cc b/content/browser/accessibility/android_granularity_movement_browsertest.cc
index 5d8fd52..378045b 100644
--- a/content/browser/accessibility/android_granularity_movement_browsertest.cc
+++ b/content/browser/accessibility/android_granularity_movement_browsertest.cc
@@ -67,7 +67,7 @@
// and fails (by logging an error and returning the empty string) if
// the result when traversing backwards is not the same
// (but in reverse order).
- base::string16 TraverseNodeAtGranularity(BrowserAccessibility* node,
+ std::u16string TraverseNodeAtGranularity(BrowserAccessibility* node,
int granularity) {
AccessibilityNotificationWaiter waiter(shell()->web_contents(),
ui::kAXModeComplete,
@@ -81,13 +81,13 @@
static_cast<BrowserAccessibilityAndroid*>(node);
BrowserAccessibilityManagerAndroid* manager =
static_cast<BrowserAccessibilityManagerAndroid*>(node->manager());
- base::string16 text = android_node->GetInnerText();
- base::string16 concatenated;
+ std::u16string text = android_node->GetInnerText();
+ std::u16string concatenated;
int previous_end_index = -1;
while (manager->NextAtGranularity(granularity, end_index, android_node,
&start_index, &end_index)) {
int len = end_index - start_index;
- base::string16 selection = text.substr(start_index, len);
+ std::u16string selection = text.substr(start_index, len);
if (base::EndsWith(selection, base::ASCIIToUTF16("\n"),
base::CompareCase::INSENSITIVE_ASCII))
selection.erase(selection.size() - 1);
@@ -106,13 +106,13 @@
previous_end_index = end_index;
}
- base::string16 reverse;
+ std::u16string reverse;
previous_end_index = -1;
start_index = end_index;
while (manager->PreviousAtGranularity(
granularity, start_index, android_node, &start_index, &end_index)) {
int len = end_index - start_index;
- base::string16 selection = text.substr(start_index, len);
+ std::u16string selection = text.substr(start_index, len);
if (base::EndsWith(selection, base::ASCIIToUTF16("\n"),
base::CompareCase::INSENSITIVE_ASCII))
selection = selection.substr(0, selection.size() - 1);
@@ -134,7 +134,7 @@
<< "reverse directions!";
LOG(ERROR) << "Forwards: " << concatenated;
LOG(ERROR) << "Backwards " << reverse;
- return base::string16();
+ return std::u16string();
}
return concatenated;
diff --git a/content/browser/accessibility/browser_accessibility.cc b/content/browser/accessibility/browser_accessibility.cc
index c3e5716..56e0f797 100644
--- a/content/browser/accessibility/browser_accessibility.cc
+++ b/content/browser/accessibility/browser_accessibility.cc
@@ -524,7 +524,7 @@
if (effective_start_offset > effective_end_offset)
std::swap(effective_start_offset, effective_end_offset);
- const base::string16& text_str = GetHypertext();
+ const std::u16string& text_str = GetHypertext();
if (effective_start_offset < 0 ||
effective_start_offset >= static_cast<int>(text_str.size()))
return gfx::Rect();
@@ -937,7 +937,7 @@
return node_->GetInheritedStringAttribute(attribute);
}
-base::string16 BrowserAccessibility::GetInheritedString16Attribute(
+std::u16string BrowserAccessibility::GetInheritedString16Attribute(
ax::mojom::StringAttribute attribute) const {
return node_->GetInheritedString16Attribute(attribute);
}
@@ -973,14 +973,14 @@
return GetData().GetStringAttribute(attribute, value);
}
-base::string16 BrowserAccessibility::GetString16Attribute(
+std::u16string BrowserAccessibility::GetString16Attribute(
ax::mojom::StringAttribute attribute) const {
return GetData().GetString16Attribute(attribute);
}
bool BrowserAccessibility::GetString16Attribute(
ax::mojom::StringAttribute attribute,
- base::string16* value) const {
+ std::u16string* value) const {
return GetData().GetString16Attribute(attribute, value);
}
@@ -1006,7 +1006,7 @@
}
bool BrowserAccessibility::GetHtmlAttribute(const char* html_attr,
- base::string16* value) const {
+ std::u16string* value) const {
return GetData().GetHtmlAttribute(html_attr, value);
}
@@ -1103,7 +1103,7 @@
return position;
}
-base::string16 BrowserAccessibility::GetNameAsString16() const {
+std::u16string BrowserAccessibility::GetNameAsString16() const {
return base::UTF8ToUTF16(GetName());
}
@@ -1119,17 +1119,17 @@
return GetStringAttribute(ax::mojom::StringAttribute::kName);
}
-base::string16 BrowserAccessibility::GetHypertext() const {
+std::u16string BrowserAccessibility::GetHypertext() const {
// Overloaded by platforms which require a hypertext accessibility text
// implementation.
- return base::string16();
+ return std::u16string();
}
-base::string16 BrowserAccessibility::GetInnerText() const {
+std::u16string BrowserAccessibility::GetInnerText() const {
return base::UTF8ToUTF16(node()->GetInnerText());
}
-base::string16 BrowserAccessibility::GetValueForControl() const {
+std::u16string BrowserAccessibility::GetValueForControl() const {
return base::UTF8ToUTF16(node()->GetValueForControl());
}
@@ -1317,8 +1317,8 @@
manager_->ax_tree()->GetReverseRelations(attr, GetData().id));
}
-base::string16 BrowserAccessibility::GetAuthorUniqueId() const {
- base::string16 html_id;
+std::u16string BrowserAccessibility::GetAuthorUniqueId() const {
+ std::u16string html_id;
GetData().GetHtmlAttribute("id", &html_id);
return html_id;
}
@@ -1940,7 +1940,7 @@
}
}
-base::string16 BrowserAccessibility::GetLocalizedStringForImageAnnotationStatus(
+std::u16string BrowserAccessibility::GetLocalizedStringForImageAnnotationStatus(
ax::mojom::ImageAnnotationStatus status) const {
ContentClient* content_client = content::GetContentClient();
@@ -1964,7 +1964,7 @@
case ax::mojom::ImageAnnotationStatus::kIneligibleForAnnotation:
case ax::mojom::ImageAnnotationStatus::kSilentlyEligibleForAnnotation:
case ax::mojom::ImageAnnotationStatus::kAnnotationSucceeded:
- return base::string16();
+ return std::u16string();
}
DCHECK(message_id);
@@ -1972,14 +1972,14 @@
return content_client->GetLocalizedString(message_id);
}
-base::string16
+std::u16string
BrowserAccessibility::GetLocalizedRoleDescriptionForUnlabeledImage() const {
ContentClient* content_client = content::GetContentClient();
return content_client->GetLocalizedString(
IDS_AX_UNLABELED_IMAGE_ROLE_DESCRIPTION);
}
-base::string16 BrowserAccessibility::GetLocalizedStringForLandmarkType() const {
+std::u16string BrowserAccessibility::GetLocalizedStringForLandmarkType() const {
ContentClient* content_client = content::GetContentClient();
const ui::AXNodeData& data = GetData();
@@ -2006,7 +2006,7 @@
}
}
-base::string16 BrowserAccessibility::GetLocalizedStringForRoleDescription()
+std::u16string BrowserAccessibility::GetLocalizedStringForRoleDescription()
const {
ContentClient* content_client = content::GetContentClient();
const ui::AXNodeData& data = GetData();
@@ -2111,7 +2111,7 @@
}
}
-base::string16 BrowserAccessibility::GetStyleNameAttributeAsLocalizedString()
+std::u16string BrowserAccessibility::GetStyleNameAttributeAsLocalizedString()
const {
const BrowserAccessibility* current_node = this;
while (current_node) {
diff --git a/content/browser/accessibility/browser_accessibility.h b/content/browser/accessibility/browser_accessibility.h
index 47713d5..6a6c74ec 100644
--- a/content/browser/accessibility/browser_accessibility.h
+++ b/content/browser/accessibility/browser_accessibility.h
@@ -292,7 +292,7 @@
// need to distinguish between the default value and a missing attribute),
// and another that returns the default value for that type if the
// attribute is not present. In addition, strings can be returned as
- // either std::string or base::string16, for convenience.
+ // either std::string or std::u16string, for convenience.
bool HasBoolAttribute(ax::mojom::BoolAttribute attr) const;
bool GetBoolAttribute(ax::mojom::BoolAttribute attr) const;
@@ -305,7 +305,7 @@
bool HasInheritedStringAttribute(ax::mojom::StringAttribute attribute) const;
const std::string& GetInheritedStringAttribute(
ax::mojom::StringAttribute attribute) const;
- base::string16 GetInheritedString16Attribute(
+ std::u16string GetInheritedString16Attribute(
ax::mojom::StringAttribute attribute) const;
bool HasIntAttribute(ax::mojom::IntAttribute attribute) const;
@@ -318,10 +318,10 @@
bool GetStringAttribute(ax::mojom::StringAttribute attribute,
std::string* value) const;
- base::string16 GetString16Attribute(
+ std::u16string GetString16Attribute(
ax::mojom::StringAttribute attribute) const;
bool GetString16Attribute(ax::mojom::StringAttribute attribute,
- base::string16* value) const;
+ std::u16string* value) const;
bool HasIntListAttribute(ax::mojom::IntListAttribute attribute) const;
const std::vector<int32_t>& GetIntListAttribute(
@@ -332,7 +332,7 @@
// Retrieve the value of a html attribute from the attribute map and
// returns true if found.
bool GetHtmlAttribute(const char* attr, std::string* value) const;
- bool GetHtmlAttribute(const char* attr, base::string16* value) const;
+ bool GetHtmlAttribute(const char* attr, std::u16string* value) const;
// Returns true if the bit corresponding to the given enum is 1.
bool HasState(ax::mojom::State state_enum) const;
@@ -381,10 +381,10 @@
// Gets the text offsets where new lines start.
std::vector<int> GetLineStartOffsets() const;
- base::string16 GetNameAsString16() const;
+ std::u16string GetNameAsString16() const;
// AXPlatformNodeDelegate.
- base::string16 GetAuthorUniqueId() const override;
+ std::u16string GetAuthorUniqueId() const override;
const ui::AXNodeData& GetData() const override;
const ui::AXTreeData& GetTreeData() const override;
const ui::AXTree::Selection GetUnignoredSelection() const override;
@@ -412,10 +412,10 @@
std::unique_ptr<ChildIterator> ChildrenEnd() override;
std::string GetName() const override;
- base::string16 GetHypertext() const override;
+ std::u16string GetHypertext() const override;
bool SetHypertextSelection(int start_offset, int end_offset) override;
- base::string16 GetInnerText() const override;
- base::string16 GetValueForControl() const override;
+ std::u16string GetInnerText() const override;
+ std::u16string GetValueForControl() const override;
gfx::Rect GetBoundsRect(
const ui::AXCoordinateSystem coordinate_system,
const ui::AXClippingBehavior clipping_behavior,
@@ -484,12 +484,12 @@
bool IsCellOrHeaderOfARIAGrid() const override;
bool AccessibilityPerformAction(const ui::AXActionData& data) override;
- base::string16 GetLocalizedStringForImageAnnotationStatus(
+ std::u16string GetLocalizedStringForImageAnnotationStatus(
ax::mojom::ImageAnnotationStatus status) const override;
- base::string16 GetLocalizedRoleDescriptionForUnlabeledImage() const override;
- base::string16 GetLocalizedStringForLandmarkType() const override;
- base::string16 GetLocalizedStringForRoleDescription() const override;
- base::string16 GetStyleNameAttributeAsLocalizedString() const override;
+ std::u16string GetLocalizedRoleDescriptionForUnlabeledImage() const override;
+ std::u16string GetLocalizedStringForLandmarkType() const override;
+ std::u16string GetLocalizedStringForRoleDescription() const override;
+ std::u16string GetStyleNameAttributeAsLocalizedString() const override;
ui::TextAttributeMap ComputeTextAttributeMap(
const ui::TextAttributeList& default_attributes) const override;
std::string GetInheritedFontFamilyName() const override;
diff --git a/content/browser/accessibility/browser_accessibility_android.cc b/content/browser/accessibility/browser_accessibility_android.cc
index fa87462..3a6da58 100644
--- a/content/browser/accessibility/browser_accessibility_android.cc
+++ b/content/browser/accessibility/browser_accessibility_android.cc
@@ -92,7 +92,7 @@
manager->FireLocationChanged(this);
}
-base::string16
+std::u16string
BrowserAccessibilityAndroid::GetLocalizedStringForImageAnnotationStatus(
ax::mojom::ImageAnnotationStatus status) const {
// Default to standard text, except for special case of eligible.
@@ -123,8 +123,8 @@
}
void BrowserAccessibilityAndroid::AppendTextToString(
- base::string16 extra_text,
- base::string16* string) const {
+ std::u16string extra_text,
+ std::u16string* string) const {
if (extra_text.empty())
return;
@@ -133,7 +133,7 @@
return;
}
- *string += base::string16(base::ASCIIToUTF16(", ")) + extra_text;
+ *string += std::u16string(base::ASCIIToUTF16(", ")) + extra_text;
}
bool BrowserAccessibilityAndroid::IsCheckable() const {
@@ -497,7 +497,7 @@
static_cast<BrowserAccessibilityManagerAndroid*>(manager());
if (manager_android->prune_tree_for_screen_reader()) {
// Headings with text can drop their children.
- base::string16 name = GetInnerText();
+ std::u16string name = GetInnerText();
if (GetRole() == ax::mojom::Role::kHeading && !name.empty()) {
if (HasFocusableNonOptionChild()) {
return false;
@@ -523,13 +523,13 @@
return false;
}
-base::string16 BrowserAccessibilityAndroid::GetInnerText() const {
+std::u16string BrowserAccessibilityAndroid::GetInnerText() const {
if (ui::IsIframe(GetRole()))
- return base::string16();
+ return std::u16string();
// First, always return the |value| attribute if this is an
// input field.
- base::string16 value = GetValueForControl();
+ std::u16string value = GetValueForControl();
if (ShouldExposeValueAsName())
return value;
@@ -545,7 +545,7 @@
base::StringPrintf("#%02X%02X%02X", red, green, blue));
}
- base::string16 text = GetNameAsString16();
+ std::u16string text = GetNameAsString16();
if (text.empty())
text = value;
@@ -590,15 +590,15 @@
if (text.empty() &&
(ui::IsLink(GetRole()) || ui::IsImageOrVideo(GetRole())) &&
!HasExplicitlyEmptyName()) {
- base::string16 url = GetString16Attribute(ax::mojom::StringAttribute::kUrl);
+ std::u16string url = GetString16Attribute(ax::mojom::StringAttribute::kUrl);
text = ui::AXUrlBaseText(url);
}
return text;
}
-base::string16 BrowserAccessibilityAndroid::GetValueForControl() const {
- base::string16 value = BrowserAccessibility::GetValueForControl();
+std::u16string BrowserAccessibilityAndroid::GetValueForControl() const {
+ std::u16string value = BrowserAccessibility::GetValueForControl();
// Optionally replace entered password text with bullet characters
// based on a user preference.
@@ -613,32 +613,32 @@
// we rely on the password field's shadow dom.
value = BrowserAccessibility::GetInnerText();
} else if (!manager->ShouldExposePasswordText()) {
- value = base::string16(value.size(), ui::kSecurePasswordBullet);
+ value = std::u16string(value.size(), ui::kSecurePasswordBullet);
}
}
return value;
}
-base::string16 BrowserAccessibilityAndroid::GetHint() const {
- std::vector<base::string16> strings;
+std::u16string BrowserAccessibilityAndroid::GetHint() const {
+ std::vector<std::u16string> strings;
// If we're returning the value as the main text, the name needs to be
// part of the hint.
if (ShouldExposeValueAsName()) {
- base::string16 name = GetNameAsString16();
+ std::u16string name = GetNameAsString16();
if (!name.empty())
strings.push_back(name);
}
if (GetData().GetNameFrom() != ax::mojom::NameFrom::kPlaceholder) {
- base::string16 placeholder =
+ std::u16string placeholder =
GetString16Attribute(ax::mojom::StringAttribute::kPlaceholder);
if (!placeholder.empty())
strings.push_back(placeholder);
}
- base::string16 description =
+ std::u16string description =
GetString16Attribute(ax::mojom::StringAttribute::kDescription);
if (!description.empty())
strings.push_back(description);
@@ -646,8 +646,8 @@
return base::JoinString(strings, base::ASCIIToUTF16(" "));
}
-base::string16 BrowserAccessibilityAndroid::GetStateDescription() const {
- std::vector<base::string16> state_descs;
+std::u16string BrowserAccessibilityAndroid::GetStateDescription() const {
+ std::vector<std::u16string> state_descs;
// For multiselectable state, generate a state description. We do not set a
// state description for pop up/<select> to prevent double utterances.
@@ -684,7 +684,7 @@
return base::JoinString(state_descs, base::ASCIIToUTF16(" "));
}
-base::string16 BrowserAccessibilityAndroid::GetMultiselectableStateDescription()
+std::u16string BrowserAccessibilityAndroid::GetMultiselectableStateDescription()
const {
content::ContentClient* content_client = content::GetContentClient();
@@ -707,7 +707,7 @@
// Generate a state description of the form: "multiselectable, x of y
// selected.".
- std::vector<base::string16> values;
+ std::vector<std::u16string> values;
values.push_back(base::NumberToString16(selected_count));
values.push_back(base::NumberToString16(child_count));
return base::ReplaceStringPlaceholders(
@@ -716,7 +716,7 @@
values, nullptr);
}
-base::string16 BrowserAccessibilityAndroid::GetToggleButtonStateDescription()
+std::u16string BrowserAccessibilityAndroid::GetToggleButtonStateDescription()
const {
content::ContentClient* content_client = content::GetContentClient();
@@ -727,20 +727,20 @@
return content_client->GetLocalizedString(IDS_AX_TOGGLE_BUTTON_OFF);
}
-base::string16 BrowserAccessibilityAndroid::GetCheckboxStateDescription()
+std::u16string BrowserAccessibilityAndroid::GetCheckboxStateDescription()
const {
content::ContentClient* content_client = content::GetContentClient();
return content_client->GetLocalizedString(IDS_AX_CHECKBOX_PARTIALLY_CHECKED);
}
-base::string16 BrowserAccessibilityAndroid::GetListBoxStateDescription() const {
+std::u16string BrowserAccessibilityAndroid::GetListBoxStateDescription() const {
content::ContentClient* content_client = content::GetContentClient();
// For empty list boxes, we will return an empty string.
int item_count = GetItemCount();
if (!item_count)
- return base::string16();
+ return std::u16string();
// Otherwise, we will communicate "x items" as the state description.
return base::ReplaceStringPlaceholders(
@@ -748,7 +748,7 @@
base::NumberToString16(item_count), nullptr);
}
-base::string16 BrowserAccessibilityAndroid::GetListBoxItemStateDescription()
+std::u16string BrowserAccessibilityAndroid::GetListBoxItemStateDescription()
const {
content::ContentClient* content_client = content::GetContentClient();
@@ -757,7 +757,7 @@
// If we cannot find the parent collection, escape with an empty string.
if (!parent)
- return base::string16();
+ return std::u16string();
// For list box items, we will communicate "in list, item x of y". We add
// one (1) to our index to offset from counting at 0.
@@ -767,12 +767,12 @@
return base::ReplaceStringPlaceholders(
content_client->GetLocalizedString(
IDS_AX_LIST_BOX_ITEM_STATE_DESCRIPTION),
- std::vector<base::string16>({base::NumberToString16(item_index),
+ std::vector<std::u16string>({base::NumberToString16(item_index),
base::NumberToString16(item_count)}),
nullptr);
}
-base::string16 BrowserAccessibilityAndroid::GetAriaCurrentStateDescription()
+std::u16string BrowserAccessibilityAndroid::GetAriaCurrentStateDescription()
const {
content::ContentClient* content_client = content::GetContentClient();
@@ -803,7 +803,7 @@
return content_client->GetLocalizedString(message_id);
}
-base::string16 BrowserAccessibilityAndroid::GetComboboxExpandedText() const {
+std::u16string BrowserAccessibilityAndroid::GetComboboxExpandedText() const {
content::ContentClient* content_client = content::GetContentClient();
// We consider comboboxes of the form:
@@ -869,7 +869,7 @@
base::NumberToString16(*controlled_node->GetSetSize()), nullptr);
}
-base::string16 BrowserAccessibilityAndroid::GetComboboxExpandedTextFallback()
+std::u16string BrowserAccessibilityAndroid::GetComboboxExpandedTextFallback()
const {
content::ContentClient* content_client = content::GetContentClient();
@@ -910,17 +910,17 @@
return ui::ToString(GetRole());
}
-base::string16 BrowserAccessibilityAndroid::GetRoleDescription() const {
+std::u16string BrowserAccessibilityAndroid::GetRoleDescription() const {
content::ContentClient* content_client = content::GetContentClient();
// As a special case, if we have a heading level return a string like
// "heading level 1", etc. - and if the heading consists of a link,
// append the word link as well.
if (GetRole() == ax::mojom::Role::kHeading) {
- base::string16 role_description;
+ std::u16string role_description;
int level = GetIntAttribute(ax::mojom::IntAttribute::kHierarchicalLevel);
if (level >= 1 && level <= 6) {
- std::vector<base::string16> values;
+ std::vector<std::u16string> values;
values.push_back(base::NumberToString16(level));
role_description = base::ReplaceStringPlaceholders(
content_client->GetLocalizedString(IDS_AX_ROLE_HEADING_WITH_LEVEL),
@@ -1576,7 +1576,7 @@
if (message_id != -1)
return content_client->GetLocalizedString(message_id);
- return base::string16();
+ return std::u16string();
}
int BrowserAccessibilityAndroid::GetItemIndex() const {
@@ -1809,8 +1809,8 @@
}
// static
-size_t BrowserAccessibilityAndroid::CommonPrefixLength(const base::string16 a,
- const base::string16 b) {
+size_t BrowserAccessibilityAndroid::CommonPrefixLength(const std::u16string a,
+ const std::u16string b) {
size_t a_len = a.length();
size_t b_len = b.length();
size_t i = 0;
@@ -1821,8 +1821,8 @@
}
// static
-size_t BrowserAccessibilityAndroid::CommonSuffixLength(const base::string16 a,
- const base::string16 b) {
+size_t BrowserAccessibilityAndroid::CommonSuffixLength(const std::u16string a,
+ const std::u16string b) {
size_t a_len = a.length();
size_t b_len = b.length();
size_t i = 0;
@@ -1836,19 +1836,19 @@
// |BrowserAccessibilityCocoa::computeTextEdit|.
//
// static
-size_t BrowserAccessibilityAndroid::CommonEndLengths(const base::string16 a,
- const base::string16 b) {
+size_t BrowserAccessibilityAndroid::CommonEndLengths(const std::u16string a,
+ const std::u16string b) {
size_t prefix_len = CommonPrefixLength(a, b);
// Remove the matching prefix before finding the suffix. Otherwise, if
// old_value_ is "a" and new_value_ is "aa", "a" will be double-counted as
// both a prefix and a suffix of "aa".
- base::string16 a_body = a.substr(prefix_len, std::string::npos);
- base::string16 b_body = b.substr(prefix_len, std::string::npos);
+ std::u16string a_body = a.substr(prefix_len, std::string::npos);
+ std::u16string b_body = b.substr(prefix_len, std::string::npos);
size_t suffix_len = CommonSuffixLength(a_body, b_body);
return prefix_len + suffix_len;
}
-base::string16 BrowserAccessibilityAndroid::GetTextChangeBeforeText() const {
+std::u16string BrowserAccessibilityAndroid::GetTextChangeBeforeText() const {
return old_value_;
}
@@ -2078,15 +2078,15 @@
return;
}
- base::string16 concatenated_text;
+ std::u16string concatenated_text;
for (auto it = InternalChildrenBegin(); it != InternalChildrenEnd(); ++it) {
BrowserAccessibilityAndroid* child =
static_cast<BrowserAccessibilityAndroid*>(it.get());
- base::string16 child_text = child->GetInnerText();
+ std::u16string child_text = child->GetInnerText();
concatenated_text += child->GetInnerText();
}
- base::string16 text = GetInnerText();
+ std::u16string text = GetInnerText();
if (text.empty() || concatenated_text == text) {
// Great - this node is just the concatenation of its children, so
// we can get the word boundaries recursively.
@@ -2127,7 +2127,7 @@
return false;
}
-base::string16 BrowserAccessibilityAndroid::GetTargetUrl() const {
+std::u16string BrowserAccessibilityAndroid::GetTargetUrl() const {
if (ui::IsImageOrVideo(GetRole()) || ui::IsLink(GetRole()))
return GetString16Attribute(ax::mojom::StringAttribute::kUrl);
@@ -2314,7 +2314,7 @@
BrowserAccessibility::OnDataChanged();
if (IsTextField()) {
- base::string16 value = GetValueForControl();
+ std::u16string value = GetValueForControl();
if (value != new_value_) {
old_value_ = new_value_;
new_value_ = value;
@@ -2337,13 +2337,13 @@
return count;
}
-base::string16 BrowserAccessibilityAndroid::GetContentInvalidErrorMessage()
+std::u16string BrowserAccessibilityAndroid::GetContentInvalidErrorMessage()
const {
content::ContentClient* content_client = content::GetContentClient();
int message_id = -1;
if (!IsContentInvalid())
- return base::string16();
+ return std::u16string();
switch (GetData().GetInvalidState()) {
case ax::mojom::InvalidState::kNone:
@@ -2369,7 +2369,7 @@
if (message_id != -1)
return content_client->GetLocalizedString(message_id);
- return base::string16();
+ return std::u16string();
}
} // namespace content
diff --git a/content/browser/accessibility/browser_accessibility_android.h b/content/browser/accessibility/browser_accessibility_android.h
index ca1ac82..26ba139 100644
--- a/content/browser/accessibility/browser_accessibility_android.h
+++ b/content/browser/accessibility/browser_accessibility_android.h
@@ -26,7 +26,7 @@
// BrowserAccessibility Overrides.
void OnDataChanged() override;
void OnLocationChanged() override;
- base::string16 GetLocalizedStringForImageAnnotationStatus(
+ std::u16string GetLocalizedStringForImageAnnotationStatus(
ax::mojom::ImageAnnotationStatus status) const override;
bool IsCheckable() const;
@@ -88,26 +88,26 @@
const char* GetClassName() const;
bool IsChildOfLeaf() const override;
bool IsLeaf() const override;
- base::string16 GetInnerText() const override;
- base::string16 GetValueForControl() const override;
- base::string16 GetHint() const;
+ std::u16string GetInnerText() const override;
+ std::u16string GetValueForControl() const override;
+ std::u16string GetHint() const;
std::string GetRoleString() const;
- base::string16 GetContentInvalidErrorMessage() const;
+ std::u16string GetContentInvalidErrorMessage() const;
- base::string16 GetStateDescription() const;
- base::string16 GetMultiselectableStateDescription() const;
- base::string16 GetToggleButtonStateDescription() const;
- base::string16 GetCheckboxStateDescription() const;
- base::string16 GetListBoxStateDescription() const;
- base::string16 GetListBoxItemStateDescription() const;
- base::string16 GetAriaCurrentStateDescription() const;
+ std::u16string GetStateDescription() const;
+ std::u16string GetMultiselectableStateDescription() const;
+ std::u16string GetToggleButtonStateDescription() const;
+ std::u16string GetCheckboxStateDescription() const;
+ std::u16string GetListBoxStateDescription() const;
+ std::u16string GetListBoxItemStateDescription() const;
+ std::u16string GetAriaCurrentStateDescription() const;
- base::string16 GetComboboxExpandedText() const;
- base::string16 GetComboboxExpandedTextFallback() const;
+ std::u16string GetComboboxExpandedText() const;
+ std::u16string GetComboboxExpandedTextFallback() const;
- base::string16 GetRoleDescription() const;
+ std::u16string GetRoleDescription() const;
int GetItemIndex() const;
int GetItemCount() const;
@@ -130,7 +130,7 @@
int GetTextChangeFromIndex() const;
int GetTextChangeAddedCount() const;
int GetTextChangeRemovedCount() const;
- base::string16 GetTextChangeBeforeText() const;
+ std::u16string GetTextChangeBeforeText() const;
int GetSelectionStart() const;
int GetSelectionEnd() const;
@@ -173,7 +173,7 @@
int offset);
// Return the target of a link or the source of an image.
- base::string16 GetTargetUrl() const;
+ std::u16string GetTargetUrl() const;
// On Android, spelling errors are returned as "suggestions". Retreive
// all of the suggestions for a given text field as vectors of start
@@ -185,12 +185,12 @@
// This gives BrowserAccessibility::Create access to the class constructor.
friend class BrowserAccessibility;
- static size_t CommonPrefixLength(const base::string16 a,
- const base::string16 b);
- static size_t CommonSuffixLength(const base::string16 a,
- const base::string16 b);
- static size_t CommonEndLengths(const base::string16 a,
- const base::string16 b);
+ static size_t CommonPrefixLength(const std::u16string a,
+ const std::u16string b);
+ static size_t CommonSuffixLength(const std::u16string a,
+ const std::u16string b);
+ static size_t CommonEndLengths(const std::u16string a,
+ const std::u16string b);
BrowserAccessibilityAndroid();
~BrowserAccessibilityAndroid() override;
@@ -203,12 +203,12 @@
bool ShouldExposeValueAsName() const;
int CountChildrenWithRole(ax::mojom::Role role) const;
- void AppendTextToString(base::string16 extra_text,
- base::string16* string) const;
+ void AppendTextToString(std::u16string extra_text,
+ std::u16string* string) const;
- base::string16 cached_text_;
- base::string16 old_value_;
- base::string16 new_value_;
+ std::u16string cached_text_;
+ std::u16string old_value_;
+ std::u16string new_value_;
int32_t unique_id_;
DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityAndroid);
diff --git a/content/browser/accessibility/browser_accessibility_android_unittest.cc b/content/browser/accessibility/browser_accessibility_android_unittest.cc
index 3589577..10964544 100644
--- a/content/browser/accessibility/browser_accessibility_android_unittest.cc
+++ b/content/browser/accessibility/browser_accessibility_android_unittest.cc
@@ -18,7 +18,7 @@
class MockContentClient : public TestContentClient {
public:
- base::string16 GetLocalizedString(int message_id) override {
+ std::u16string GetLocalizedString(int message_id) override {
switch (message_id) {
case IDS_AX_UNLABELED_IMAGE_ROLE_DESCRIPTION:
return base::ASCIIToUTF16("Unlabeled image");
@@ -38,7 +38,7 @@
case IDS_AX_IMAGE_ANNOTATION_NO_DESCRIPTION:
return base::ASCIIToUTF16("No description available.");
default:
- return base::string16();
+ return std::u16string();
}
}
};
@@ -400,7 +400,7 @@
static_cast<BrowserAccessibilityAndroid*>(
manager->GetRoot()->PlatformGetChild(child_index));
- EXPECT_EQ(base::string16(), child->GetRoleDescription());
+ EXPECT_EQ(std::u16string(), child->GetRoleDescription());
}
}
@@ -558,10 +558,10 @@
static_cast<BrowserAccessibilityAndroid*>(
manager->GetRoot()->PlatformGetChild(3));
- EXPECT_EQ(base::string16(), image_none->GetInnerText());
+ EXPECT_EQ(std::u16string(), image_none->GetInnerText());
EXPECT_EQ(base::ASCIIToUTF16("image_name"), image_scheme->GetInnerText());
- EXPECT_EQ(base::string16(), image_ineligible->GetInnerText());
- EXPECT_EQ(base::string16(), image_silent->GetInnerText());
+ EXPECT_EQ(std::u16string(), image_ineligible->GetInnerText());
+ EXPECT_EQ(std::u16string(), image_silent->GetInnerText());
}
TEST_F(BrowserAccessibilityAndroidTest,
diff --git a/content/browser/accessibility/browser_accessibility_auralinux.cc b/content/browser/accessibility/browser_accessibility_auralinux.cc
index 3c4bb24ca..9cbde85 100644
--- a/content/browser/accessibility/browser_accessibility_auralinux.cc
+++ b/content/browser/accessibility/browser_accessibility_auralinux.cc
@@ -53,7 +53,7 @@
return GetNode();
}
-base::string16 BrowserAccessibilityAuraLinux::GetHypertext() const {
+std::u16string BrowserAccessibilityAuraLinux::GetHypertext() const {
return GetNode()->AXPlatformNodeAuraLinux::GetHypertext();
}
diff --git a/content/browser/accessibility/browser_accessibility_auralinux.h b/content/browser/accessibility/browser_accessibility_auralinux.h
index 5dd3b5dc..1f1d821 100644
--- a/content/browser/accessibility/browser_accessibility_auralinux.h
+++ b/content/browser/accessibility/browser_accessibility_auralinux.h
@@ -31,7 +31,7 @@
// BrowserAccessibility methods.
void OnDataChanged() override;
ui::AXPlatformNode* GetAXPlatformNode() const override;
- base::string16 GetHypertext() const override;
+ std::u16string GetHypertext() const override;
gfx::NativeViewAccessible GetNativeViewAccessible() override;
diff --git a/content/browser/accessibility/browser_accessibility_auralinux_unittest.cc b/content/browser/accessibility/browser_accessibility_auralinux_unittest.cc
index 74fbe55..13db23d 100644
--- a/content/browser/accessibility/browser_accessibility_auralinux_unittest.cc
+++ b/content/browser/accessibility/browser_accessibility_auralinux_unittest.cc
@@ -151,7 +151,7 @@
const std::string link_text_name = "Blue";
// Each control (combo / check box, radio button and link) will be represented
// by an embedded object character.
- const base::string16 string16_embed(
+ const std::u16string string16_embed(
1, ui::AXPlatformNodeAuraLinux::kEmbeddedCharacter);
const std::string embed = base::UTF16ToUTF8(string16_embed);
const std::string root_hypertext =
diff --git a/content/browser/accessibility/browser_accessibility_cocoa.h b/content/browser/accessibility/browser_accessibility_cocoa.h
index 21ae738..eff8d3f 100644
--- a/content/browser/accessibility/browser_accessibility_cocoa.h
+++ b/content/browser/accessibility/browser_accessibility_cocoa.h
@@ -23,16 +23,16 @@
// support character echo and other announcements during editing.
struct CONTENT_EXPORT AXTextEdit {
AXTextEdit();
- AXTextEdit(base::string16 inserted_text,
- base::string16 deleted_text,
+ AXTextEdit(std::u16string inserted_text,
+ std::u16string deleted_text,
id edit_text_marker);
AXTextEdit(const AXTextEdit& other);
~AXTextEdit();
bool IsEmpty() const { return inserted_text.empty() && deleted_text.empty(); }
- base::string16 inserted_text;
- base::string16 deleted_text;
+ std::u16string inserted_text;
+ std::u16string deleted_text;
base::scoped_nsprotocol<id> edit_text_marker;
};
@@ -74,7 +74,7 @@
// Whether _children is currently being computed.
bool _gettingChildren;
// Stores the previous value of an edit field.
- base::string16 _oldValue;
+ std::u16string _oldValue;
}
// This creates a cocoa browser accessibility object around
diff --git a/content/browser/accessibility/browser_accessibility_cocoa.mm b/content/browser/accessibility/browser_accessibility_cocoa.mm
index 5885c36..86e5696 100644
--- a/content/browser/accessibility/browser_accessibility_cocoa.mm
+++ b/content/browser/accessibility/browser_accessibility_cocoa.mm
@@ -712,8 +712,8 @@
namespace content {
AXTextEdit::AXTextEdit() = default;
-AXTextEdit::AXTextEdit(base::string16 inserted_text,
- base::string16 deleted_text,
+AXTextEdit::AXTextEdit(std::u16string inserted_text,
+ std::u16string deleted_text,
id edit_text_marker)
: inserted_text(inserted_text),
deleted_text(deleted_text),
@@ -1207,7 +1207,7 @@
case ax::mojom::ImageAnnotationStatus::kAnnotationEmpty:
case ax::mojom::ImageAnnotationStatus::kAnnotationAdult:
case ax::mojom::ImageAnnotationStatus::kAnnotationProcessFailed: {
- base::string16 status_string =
+ std::u16string status_string =
_owner->GetLocalizedStringForImageAnnotationStatus(status);
AppendTextToString(base::UTF16ToUTF8(status_string), &name);
break;
@@ -1908,8 +1908,8 @@
// Starting from macOS 10.11, if the user has edited some text we need to
// dispatch the actual text that changed on the value changed notification.
// We run this code on all macOS versions to get the highest test coverage.
- base::string16 oldValue = _oldValue;
- base::string16 newValue = _owner->GetValueForControl();
+ std::u16string oldValue = _oldValue;
+ std::u16string newValue = _owner->GetValueForControl();
_oldValue = newValue;
if (oldValue.empty() && newValue.empty())
return content::AXTextEdit();
@@ -1935,8 +1935,8 @@
DCHECK_LE(i + j, oldValue.length());
DCHECK_LE(i + j, newValue.length());
- base::string16 deletedText = oldValue.substr(i, oldValue.length() - i - j);
- base::string16 insertedText = newValue.substr(i, newValue.length() - i - j);
+ std::u16string deletedText = oldValue.substr(i, oldValue.length() - i - j);
+ std::u16string insertedText = newValue.substr(i, newValue.length() - i - j);
// Heuristic for editable combobox. If more than 1 character is inserted or
// deleted, and the caret is at the end of the field, assume the entire text
@@ -1951,7 +1951,7 @@
if (size_t{sel_start} == newValue.length() &&
size_t{sel_end} == newValue.length()) {
// Don't include oldValue as it would be announced -- very confusing.
- return content::AXTextEdit(newValue, base::string16(), nil);
+ return content::AXTextEdit(newValue, std::u16string(), nil);
}
}
return content::AXTextEdit(insertedText, deletedText,
@@ -2503,14 +2503,14 @@
// Append the selection state as a string, because VoiceOver will not
// automatically report selection state when an individual item is focused.
- base::string16 name =
+ std::u16string name =
_owner->GetString16Attribute(ax::mojom::StringAttribute::kName);
bool is_selected =
_owner->GetBoolAttribute(ax::mojom::BoolAttribute::kSelected);
int msg_id =
is_selected ? IDS_AX_OBJECT_SELECTED : IDS_AX_OBJECT_NOT_SELECTED;
ContentClient* content_client = content::GetContentClient();
- base::string16 name_with_selection = base::ReplaceStringPlaceholders(
+ std::u16string name_with_selection = base::ReplaceStringPlaceholders(
content_client->GetLocalizedString(msg_id), {name}, nullptr);
return base::SysUTF16ToNSString(name_with_selection);
@@ -2680,7 +2680,7 @@
if (![self instanceActive])
return nil;
- base::string16 innerText = _owner->GetInnerText();
+ std::u16string innerText = _owner->GetInnerText();
if (NSMaxRange(range) > innerText.length())
return nil;
@@ -2695,7 +2695,7 @@
if (![self instanceActive])
return nil;
- base::string16 innerText = _owner->GetInnerText();
+ std::u16string innerText = _owner->GetInnerText();
if (NSMaxRange(range) > innerText.length())
return nil;
@@ -2788,7 +2788,7 @@
int lineIndex = [(NSNumber*)parameter intValue];
const std::vector<int> lineBreaks = _owner->GetLineStartOffsets();
- base::string16 value = _owner->GetValueForControl();
+ std::u16string value = _owner->GetValueForControl();
int valueLength = int{value.size()};
int lineCount = static_cast<int>(lineBreaks.size()) + 1;
diff --git a/content/browser/accessibility/browser_accessibility_com_win.cc b/content/browser/accessibility/browser_accessibility_com_win.cc
index a64f9c6..c7025e1ae 100644
--- a/content/browser/accessibility/browser_accessibility_com_win.cc
+++ b/content/browser/accessibility/browser_accessibility_com_win.cc
@@ -230,7 +230,7 @@
if (!out_x || !out_y || !out_width || !out_height)
return E_INVALIDARG;
- const base::string16& text_str = GetHypertext();
+ const std::u16string& text_str = GetHypertext();
HandleSpecialTextOffset(&offset);
if (offset < 0 || offset > static_cast<LONG>(text_str.size()))
return E_INVALIDARG;
@@ -282,7 +282,7 @@
if (!text)
return E_INVALIDARG;
- const base::string16& text_str = GetHypertext();
+ const std::u16string& text_str = GetHypertext();
HandleSpecialTextOffset(&start_offset);
HandleSpecialTextOffset(&end_offset);
@@ -296,7 +296,7 @@
if (end_offset < 0 || end_offset > len)
return E_INVALIDARG;
- base::string16 substr =
+ std::u16string substr =
text_str.substr(start_offset, end_offset - start_offset);
if (substr.empty())
return S_FALSE;
@@ -324,7 +324,7 @@
if (new_len == 0)
return E_FAIL;
- base::string16 substr = GetHypertext().substr(start, new_len);
+ std::u16string substr = GetHypertext().substr(start, new_len);
new_text->text = SysAllocString(base::as_wcstr(substr));
new_text->start = static_cast<LONG>(start);
new_text->end = static_cast<LONG>(start + new_len);
@@ -349,8 +349,8 @@
if (old_len == 0)
return E_FAIL;
- base::string16 old_hypertext = old_hypertext_.hypertext;
- base::string16 substr = old_hypertext.substr(start, old_len);
+ std::u16string old_hypertext = old_hypertext_.hypertext;
+ std::u16string substr = old_hypertext.substr(start, old_len);
old_text->text = SysAllocString(base::as_wcstr(substr));
old_text->start = static_cast<LONG>(start);
old_text->end = static_cast<LONG>(start + old_len);
@@ -434,7 +434,7 @@
if (!owner())
return E_FAIL;
- const base::string16 text = GetHypertext();
+ const std::u16string text = GetHypertext();
HandleSpecialTextOffset(&offset);
if (offset < 0 || offset > static_cast<LONG>(text.size()))
return E_INVALIDARG;
@@ -919,7 +919,7 @@
return E_INVALIDARG;
}
- base::string16 tag;
+ std::u16string tag;
if (owner()->GetString16Attribute(ax::mojom::StringAttribute::kHtmlTag, &tag))
*node_name = SysAllocString(base::as_wcstr(tag));
else
@@ -1027,7 +1027,7 @@
// We only cache a single style property for now: DISPLAY
- base::string16 display;
+ std::u16string display;
if (max_style_properties == 0 ||
!owner()->GetString16Attribute(ax::mojom::StringAttribute::kDisplay,
&display)) {
@@ -1058,10 +1058,10 @@
// We only cache a single style property for now: DISPLAY
for (USHORT i = 0; i < num_style_properties; ++i) {
- base::string16 name =
+ std::u16string name =
base::ToLowerASCII(base::as_u16cstr(style_properties[i]));
if (name == u"display") {
- base::string16 display =
+ std::u16string display =
owner()->GetString16Attribute(ax::mojom::StringAttribute::kDisplay);
style_values[i] = SysAllocString(base::as_wcstr(display));
} else {
@@ -1202,7 +1202,7 @@
if (owner()->GetRole() != ax::mojom::Role::kMath)
return E_NOTIMPL;
- base::string16 inner_html =
+ std::u16string inner_html =
owner()->GetString16Attribute(ax::mojom::StringAttribute::kInnerHtml);
*innerHTML = SysAllocString(base::as_wcstr(inner_html));
DCHECK(*innerHTML);
@@ -1335,7 +1335,7 @@
if (!owner())
return E_FAIL;
- base::string16 family = owner()->GetInheritedString16Attribute(
+ std::u16string family = owner()->GetInheritedString16Attribute(
ax::mojom::StringAttribute::kFontFamily);
if (family.empty())
return S_FALSE;
@@ -1584,7 +1584,7 @@
if (!owner())
return E_FAIL;
- base::string16 str;
+ std::u16string str;
if (!owner()->GetString16Attribute(attribute, &str))
return S_FALSE;
@@ -1598,7 +1598,7 @@
if (!owner())
return E_FAIL;
- base::string16 str;
+ std::u16string str;
str = owner()->GetNameAsString16();
*value_bstr = SysAllocString(base::as_wcstr(str));
DCHECK(*value_bstr);
diff --git a/content/browser/accessibility/browser_accessibility_com_win.h b/content/browser/accessibility/browser_accessibility_com_win.h
index 0f54531..ff0911a 100644
--- a/content/browser/accessibility/browser_accessibility_com_win.h
+++ b/content/browser/accessibility/browser_accessibility_com_win.h
@@ -78,8 +78,8 @@
// Mappings from roles and states to human readable strings. Initialize
// with |InitializeStringMaps|.
- static std::map<int32_t, base::string16> role_string_map;
- static std::map<int32_t, base::string16> state_string_map;
+ static std::map<int32_t, std::u16string> role_string_map;
+ static std::map<int32_t, std::u16string> state_string_map;
CONTENT_EXPORT BrowserAccessibilityComWin();
CONTENT_EXPORT ~BrowserAccessibilityComWin() override;
diff --git a/content/browser/accessibility/browser_accessibility_manager.cc b/content/browser/accessibility/browser_accessibility_manager.cc
index 2bfbe1a..cbd993a2 100644
--- a/content/browser/accessibility/browser_accessibility_manager.cc
+++ b/content/browser/accessibility/browser_accessibility_manager.cc
@@ -1219,7 +1219,7 @@
}
// static
-base::string16 BrowserAccessibilityManager::GetTextForRange(
+std::u16string BrowserAccessibilityManager::GetTextForRange(
const BrowserAccessibility& start_object,
const BrowserAccessibility& end_object) {
return GetTextForRange(start_object, 0, end_object,
@@ -1227,7 +1227,7 @@
}
// static
-base::string16 BrowserAccessibilityManager::GetTextForRange(
+std::u16string BrowserAccessibilityManager::GetTextForRange(
const BrowserAccessibility& start_object,
int start_offset,
const BrowserAccessibility& end_object,
@@ -1242,7 +1242,7 @@
if (start_offset >=
static_cast<int>(start_object.GetInnerText().length()) ||
end_offset > static_cast<int>(start_object.GetInnerText().length())) {
- return base::string16();
+ return std::u16string();
}
return start_object.GetInnerText().substr(start_offset,
@@ -1252,7 +1252,7 @@
std::vector<const BrowserAccessibility*> text_only_objects =
FindTextOnlyObjectsInRange(start_object, end_object);
if (text_only_objects.empty())
- return base::string16();
+ return std::u16string();
if (text_only_objects.size() == 1) {
// Be a little permissive with the start and end offsets.
@@ -1268,7 +1268,7 @@
return text_object->GetInnerText();
}
- base::string16 text;
+ std::u16string text;
const BrowserAccessibility* start_text_object = text_only_objects[0];
// Figure out if the start and end positions have been reversed.
const BrowserAccessibility* first_object = &start_object;
diff --git a/content/browser/accessibility/browser_accessibility_manager.h b/content/browser/accessibility/browser_accessibility_manager.h
index 2649105..9aa46a8 100644
--- a/content/browser/accessibility/browser_accessibility_manager.h
+++ b/content/browser/accessibility/browser_accessibility_manager.h
@@ -417,13 +417,13 @@
const BrowserAccessibility& start_object,
const BrowserAccessibility& end_object);
- static base::string16 GetTextForRange(
+ static std::u16string GetTextForRange(
const BrowserAccessibility& start_object,
const BrowserAccessibility& end_object);
// If start and end offsets are greater than the text's length, returns all
// the text.
- static base::string16 GetTextForRange(
+ static std::u16string GetTextForRange(
const BrowserAccessibility& start_object,
int start_offset,
const BrowserAccessibility& end_object,
diff --git a/content/browser/accessibility/browser_accessibility_manager_android.cc b/content/browser/accessibility/browser_accessibility_manager_android.cc
index 972aa44..4c03dfdf 100644
--- a/content/browser/accessibility/browser_accessibility_manager_android.cc
+++ b/content/browser/accessibility/browser_accessibility_manager_android.cc
@@ -205,7 +205,7 @@
// When an alertdialog is shown, we will announce the hint, which
// (should) contain the description set by the author. If it is
// empty, then we will try GetInnerText() as a fallback.
- base::string16 text = android_node->GetHint();
+ std::u16string text = android_node->GetHint();
if (text.empty())
text = android_node->GetInnerText();
@@ -248,7 +248,7 @@
case ui::AXEventGenerator::Event::LIVE_REGION_NODE_CHANGED: {
// This event is fired when an object appears in a live region.
// Speak its text.
- base::string16 text = android_node->GetInnerText();
+ std::u16string text = android_node->GetInnerText();
wcax->AnnounceLiveRegionText(text);
break;
}
@@ -355,7 +355,7 @@
int32_t* end_index) {
switch (granularity) {
case ANDROID_ACCESSIBILITY_NODE_INFO_MOVEMENT_GRANULARITY_CHARACTER: {
- base::string16 text = node->GetInnerText();
+ std::u16string text = node->GetInnerText();
if (cursor_index >= static_cast<int32_t>(text.length()))
return false;
base::i18n::UTF16CharIterator iter(text);
@@ -404,7 +404,7 @@
case ANDROID_ACCESSIBILITY_NODE_INFO_MOVEMENT_GRANULARITY_CHARACTER: {
if (cursor_index <= 0)
return false;
- base::string16 text = node->GetInnerText();
+ std::u16string text = node->GetInnerText();
base::i18n::UTF16CharIterator iter(text);
int previous_index = 0;
while (!iter.end() &&
diff --git a/content/browser/accessibility/browser_accessibility_manager_mac.h b/content/browser/accessibility/browser_accessibility_manager_mac.h
index ef3f04e..6b0aefc 100644
--- a/content/browser/accessibility/browser_accessibility_manager_mac.h
+++ b/content/browser/accessibility/browser_accessibility_manager_mac.h
@@ -62,8 +62,8 @@
// Returns an autoreleased object.
NSDictionary* GetUserInfoForValueChangedNotification(
const BrowserAccessibilityCocoa* native_node,
- const base::string16& deleted_text,
- const base::string16& inserted_text,
+ const std::u16string& deleted_text,
+ const std::u16string& inserted_text,
id edit_text_marker) const;
void AnnounceActiveDescendant(BrowserAccessibility* node) const;
diff --git a/content/browser/accessibility/browser_accessibility_manager_mac.mm b/content/browser/accessibility/browser_accessibility_manager_mac.mm
index fb9863c..2a5163a 100644
--- a/content/browser/accessibility/browser_accessibility_manager_mac.mm
+++ b/content/browser/accessibility/browser_accessibility_manager_mac.mm
@@ -317,8 +317,8 @@
DCHECK(node->IsTextField());
mac_notification = NSAccessibilityValueChangedNotification;
if (!text_edits_.empty()) {
- base::string16 deleted_text;
- base::string16 inserted_text;
+ std::u16string deleted_text;
+ std::u16string inserted_text;
int32_t node_id = node->GetId();
const auto iterator = text_edits_.find(node_id);
id edit_text_marker = nil;
@@ -498,8 +498,8 @@
NSDictionary*
BrowserAccessibilityManagerMac::GetUserInfoForValueChangedNotification(
const BrowserAccessibilityCocoa* native_node,
- const base::string16& deleted_text,
- const base::string16& inserted_text,
+ const std::u16string& deleted_text,
+ const std::u16string& inserted_text,
id edit_text_marker) const {
DCHECK(native_node);
if (deleted_text.empty() && inserted_text.empty())
diff --git a/content/browser/accessibility/browser_accessibility_win.cc b/content/browser/accessibility/browser_accessibility_win.cc
index e49d135c..fd823927 100644
--- a/content/browser/accessibility/browser_accessibility_win.cc
+++ b/content/browser/accessibility/browser_accessibility_win.cc
@@ -66,7 +66,7 @@
GetCOM()->FireNativeEvent(EVENT_OBJECT_LOCATIONCHANGE);
}
-base::string16 BrowserAccessibilityWin::GetHypertext() const {
+std::u16string BrowserAccessibilityWin::GetHypertext() const {
return GetCOM()->AXPlatformNodeWin::GetHypertext();
}
diff --git a/content/browser/accessibility/browser_accessibility_win.h b/content/browser/accessibility/browser_accessibility_win.h
index 7d54b402..24537b72 100644
--- a/content/browser/accessibility/browser_accessibility_win.h
+++ b/content/browser/accessibility/browser_accessibility_win.h
@@ -31,7 +31,7 @@
bool CanFireEvents() const override;
ui::AXPlatformNode* GetAXPlatformNode() const override;
void OnLocationChanged() override;
- base::string16 GetHypertext() const override;
+ std::u16string GetHypertext() const override;
const std::vector<gfx::NativeViewAccessible> GetUIADescendants()
const override;
diff --git a/content/browser/accessibility/browser_accessibility_win_unittest.cc b/content/browser/accessibility/browser_accessibility_win_unittest.cc
index 27fd67a..5d58d22 100644
--- a/content/browser/accessibility/browser_accessibility_win_unittest.cc
+++ b/content/browser/accessibility/browser_accessibility_win_unittest.cc
@@ -666,18 +666,18 @@
}
TEST_F(BrowserAccessibilityWinTest, TestComplexHypertext) {
- const base::string16 text1_name = u"One two three.";
- const base::string16 combo_box_name = u"City:";
- const base::string16 combo_box_value = u"Happyland";
- const base::string16 text2_name = u" Four five six.";
- const base::string16 check_box_name = u"I agree";
- const base::string16 check_box_value = u"Checked";
- const base::string16 button_text_name = u"Red";
- const base::string16 link_text_name = u"Blue";
+ const std::u16string text1_name = u"One two three.";
+ const std::u16string combo_box_name = u"City:";
+ const std::u16string combo_box_value = u"Happyland";
+ const std::u16string text2_name = u" Four five six.";
+ const std::u16string check_box_name = u"I agree";
+ const std::u16string check_box_value = u"Checked";
+ const std::u16string button_text_name = u"Red";
+ const std::u16string link_text_name = u"Blue";
// Each control (combo / check box, button and link) will be represented by an
// embedded object character.
- const base::string16 embed(1, BrowserAccessibilityComWin::kEmbeddedCharacter);
- const base::string16 root_hypertext =
+ const std::u16string embed(1, BrowserAccessibilityComWin::kEmbeddedCharacter);
+ const std::u16string root_hypertext =
text1_name + embed + text2_name + embed + embed + embed;
const LONG root_hypertext_len = root_hypertext.length();
@@ -1487,7 +1487,7 @@
EXPECT_IA2_TEXT_AT_OFFSET(menu_accessible_com, 0, IA2_TEXT_BOUNDARY_CHAR,
/*expected_hr=*/S_OK, /*start=*/0, /*end=*/1,
/*text=*/
- base::as_wcstr(base::string16{
+ base::as_wcstr(std::u16string{
ui::AXPlatformNodeBase::kEmbeddedCharacter}));
}
@@ -1661,14 +1661,14 @@
EXPECT_IA2_TEXT_AT_OFFSET(body_accessible_com, 6, IA2_TEXT_BOUNDARY_CHAR,
/*expected_hr=*/S_OK, /*start=*/6, /*end=*/7,
/*text=*/
- base::as_wcstr(base::string16{
+ base::as_wcstr(std::u16string{
ui::AXPlatformNodeBase::kEmbeddedCharacter}));
// L"before" [obj] <[obj]> L"after" L"tail"
EXPECT_IA2_TEXT_AT_OFFSET(body_accessible_com, 7, IA2_TEXT_BOUNDARY_CHAR,
/*expected_hr=*/S_OK, /*start=*/7, /*end=*/8,
/*text=*/
- base::as_wcstr(base::string16{
+ base::as_wcstr(std::u16string{
ui::AXPlatformNodeBase::kEmbeddedCharacter}));
// L"before" [obj] [obj] L"<a>fter" L"tail"
@@ -1727,7 +1727,7 @@
EXPECT_IA2_TEXT_AT_OFFSET(menu_1_accessible_com, 0, IA2_TEXT_BOUNDARY_CHAR,
/*expected_hr=*/S_OK, /*start=*/0, /*end=*/1,
/*text=*/
- base::as_wcstr(base::string16{
+ base::as_wcstr(std::u16string{
ui::AXPlatformNodeBase::kEmbeddedCharacter}));
// [obj]<>
@@ -1780,7 +1780,7 @@
/*expected_hr=*/S_OK, /*start=*/6, /*end=*/7,
/*text=*/
base::as_wcstr(
- base::string16{ui::AXPlatformNodeBase::kEmbeddedCharacter}));
+ std::u16string{ui::AXPlatformNodeBase::kEmbeddedCharacter}));
// L"before" <[obj]> [obj] L"after" L"tail"
EXPECT_IA2_TEXT_BEFORE_OFFSET(body_accessible_com, 6, IA2_TEXT_BOUNDARY_CHAR,
@@ -1806,7 +1806,7 @@
/*expected_hr=*/S_OK, /*start=*/6, /*end=*/7,
/*text=*/
base::as_wcstr(
- base::string16{ui::AXPlatformNodeBase::kEmbeddedCharacter}));
+ std::u16string{ui::AXPlatformNodeBase::kEmbeddedCharacter}));
// L"before" <[obj]> [obj] L"after" L"tail"
EXPECT_IA2_TEXT_AFTER_OFFSET(
@@ -1814,7 +1814,7 @@
/*expected_hr=*/S_OK, /*start=*/7, /*end=*/8,
/*text=*/
base::as_wcstr(
- base::string16{ui::AXPlatformNodeBase::kEmbeddedCharacter}));
+ std::u16string{ui::AXPlatformNodeBase::kEmbeddedCharacter}));
// <[obj]>
EXPECT_IA2_TEXT_AFTER_OFFSET(menu_1_accessible_com, 0, IA2_TEXT_BOUNDARY_CHAR,
@@ -2262,7 +2262,7 @@
base::win::ScopedVariant anchor_target;
base::win::ScopedBstr bstr;
- base::string16 div_hypertext(u"Click ");
+ std::u16string div_hypertext(u"Click ");
div_hypertext.push_back(BrowserAccessibilityComWin::kEmbeddedCharacter);
// div_accessible and link_accessible are the only IA2 hyperlinks.
diff --git a/content/browser/accessibility/cross_platform_accessibility_browsertest.cc b/content/browser/accessibility/cross_platform_accessibility_browsertest.cc
index 36537e9..55fab69 100644
--- a/content/browser/accessibility/cross_platform_accessibility_browsertest.cc
+++ b/content/browser/accessibility/cross_platform_accessibility_browsertest.cc
@@ -839,7 +839,7 @@
auto TestLocalizedLandmarkType =
[root](int child_index, ax::mojom::Role expected_role,
const std::string& expected_name,
- const base::string16& expected_localized_landmark_type = {}) {
+ const std::u16string& expected_localized_landmark_type = {}) {
BrowserAccessibility* node = root->PlatformGetChild(child_index);
ASSERT_NE(nullptr, node);
@@ -922,7 +922,7 @@
auto TestLocalizedRoleDescription =
[root](int child_index,
- const base::string16& expected_localized_role_description = {}) {
+ const std::u16string& expected_localized_role_description = {}) {
BrowserAccessibility* node = root->PlatformGetChild(child_index);
ASSERT_NE(nullptr, node);
@@ -972,7 +972,7 @@
auto TestGetStyleNameAttributeAsLocalizedString =
[](BrowserAccessibility* node, ax::mojom::Role expected_role,
- const base::string16& expected_localized_style_name_attribute = {}) {
+ const std::u16string& expected_localized_style_name_attribute = {}) {
ASSERT_NE(nullptr, node);
EXPECT_EQ(expected_role, node->GetRole());
diff --git a/content/browser/accessibility/one_shot_accessibility_tree_search.cc b/content/browser/accessibility/one_shot_accessibility_tree_search.cc
index b8795810..6895c84 100644
--- a/content/browser/accessibility/one_shot_accessibility_tree_search.cc
+++ b/content/browser/accessibility/one_shot_accessibility_tree_search.cc
@@ -22,8 +22,8 @@
// Given a node, populate a vector with all of the strings from that node's
// attributes that might be relevant for a text search.
void GetNodeStrings(BrowserAccessibility* node,
- std::vector<base::string16>* strings) {
- base::string16 value;
+ std::vector<std::u16string>* strings) {
+ std::u16string value;
if (node->GetString16Attribute(ax::mojom::StringAttribute::kName, &value))
strings->push_back(value);
if (node->GetString16Attribute(ax::mojom::StringAttribute::kDescription,
@@ -204,14 +204,14 @@
return false; // Partly scrolled offscreen.
if (!search_text_.empty()) {
- base::string16 search_text_lower =
+ std::u16string search_text_lower =
base::i18n::ToLower(base::UTF8ToUTF16(search_text_));
- std::vector<base::string16> node_strings;
+ std::vector<std::u16string> node_strings;
GetNodeStrings(node, &node_strings);
bool found_text_match = false;
for (size_t i = 0; i < node_strings.size(); ++i) {
- base::string16 node_string_lower = base::i18n::ToLower(node_strings[i]);
- if (node_string_lower.find(search_text_lower) != base::string16::npos) {
+ std::u16string node_string_lower = base::i18n::ToLower(node_strings[i]);
+ if (node_string_lower.find(search_text_lower) != std::u16string::npos) {
found_text_match = true;
break;
}
diff --git a/content/browser/accessibility/web_contents_accessibility_android.cc b/content/browser/accessibility/web_contents_accessibility_android.cc
index 9a1a274..79686d68 100644
--- a/content/browser/accessibility/web_contents_accessibility_android.cc
+++ b/content/browser/accessibility/web_contents_accessibility_android.cc
@@ -194,10 +194,10 @@
UMA_ACCESSIBILITYSERVICEINFO_MAX)
using SearchKeyToPredicateMap =
- std::unordered_map<base::string16, AccessibilityMatchPredicate>;
+ std::unordered_map<std::u16string, AccessibilityMatchPredicate>;
base::LazyInstance<SearchKeyToPredicateMap>::Leaky
g_search_key_to_predicate_map = LAZY_INSTANCE_INITIALIZER;
-base::LazyInstance<base::string16>::Leaky g_all_search_keys =
+base::LazyInstance<std::u16string>::Leaky g_all_search_keys =
LAZY_INSTANCE_INITIALIZER;
bool SectionPredicate(BrowserAccessibility* start, BrowserAccessibility* node) {
@@ -228,7 +228,7 @@
void AddToPredicateMap(const char* search_key_ascii,
AccessibilityMatchPredicate predicate) {
- base::string16 search_key_utf16 = base::ASCIIToUTF16(search_key_ascii);
+ std::u16string search_key_utf16 = base::ASCIIToUTF16(search_key_ascii);
g_search_key_to_predicate_map.Get()[search_key_utf16] = predicate;
if (!g_all_search_keys.Get().empty())
g_all_search_keys.Get() += base::ASCIIToUTF16(",");
@@ -271,7 +271,7 @@
}
AccessibilityMatchPredicate PredicateForSearchKey(
- const base::string16& element_type) {
+ const std::u16string& element_type) {
InitSearchKeyToPredicateMapIfNeeded();
const auto& iter = g_search_key_to_predicate_map.Get().find(element_type);
if (iter != g_search_key_to_predicate_map.Get().end())
@@ -536,7 +536,7 @@
}
void WebContentsAccessibilityAndroid::AnnounceLiveRegionText(
- const base::string16& text) {
+ const std::u16string& text) {
JNIEnv* env = AttachCurrentThread();
ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
if (obj.is_null())
@@ -892,7 +892,7 @@
base::android::ConvertUTF16ToJavaString(env,
node->GetStateDescription()));
- base::string16 element_id;
+ std::u16string element_id;
if (node->GetHtmlAttribute("id", &element_id)) {
Java_WebContentsAccessibilityImpl_setAccessibilityNodeInfoViewIdResourceName(
env, obj, info,
@@ -955,8 +955,8 @@
switch (event_type) {
case ANDROID_ACCESSIBILITY_EVENT_TEXT_CHANGED: {
- base::string16 before_text = node->GetTextChangeBeforeText();
- base::string16 text = node->GetInnerText();
+ std::u16string before_text = node->GetTextChangeBeforeText();
+ std::u16string text = node->GetInnerText();
Java_WebContentsAccessibilityImpl_setAccessibilityEventTextChangedAttrs(
env, obj, event, node->GetTextChangeFromIndex(),
node->GetTextChangeAddedCount(), node->GetTextChangeRemovedCount(),
@@ -965,7 +965,7 @@
break;
}
case ANDROID_ACCESSIBILITY_EVENT_TEXT_SELECTION_CHANGED: {
- base::string16 text = node->GetInnerText();
+ std::u16string text = node->GetInnerText();
Java_WebContentsAccessibilityImpl_setAccessibilityEventSelectionAttrs(
env, obj, event, node->GetSelectionStart(), node->GetSelectionEnd(),
node->GetEditableTextLength(),
@@ -1187,7 +1187,7 @@
int end_index = -1;
if (root_manager->NextAtGranularity(granularity, cursor_index, node,
&start_index, &end_index)) {
- base::string16 text = node->GetInnerText();
+ std::u16string text = node->GetInnerText();
Java_WebContentsAccessibilityImpl_finishGranularityMoveNext(
env, obj, base::android::ConvertUTF16ToJavaString(env, text),
extend_selection, start_index, end_index);
@@ -1203,7 +1203,7 @@
BrowserAccessibilityAndroid* node = GetAXFromUniqueID(unique_id);
if (!node)
return -1;
- base::string16 text = node->GetInnerText();
+ std::u16string text = node->GetInnerText();
return text.size();
}
@@ -1222,7 +1222,7 @@
}
CHECK(node->GetRole() == ax::mojom::Role::kStaticText);
- base::string16 text = node->GetInnerText();
+ std::u16string text = node->GetInnerText();
CHECK_LT(start_offset, static_cast<int>(text.size()));
CHECK_LE(end_offset, static_cast<int>(text.size()));
diff --git a/content/browser/accessibility/web_contents_accessibility_android.h b/content/browser/accessibility/web_contents_accessibility_android.h
index 6615083..0088986 100644
--- a/content/browser/accessibility/web_contents_accessibility_android.h
+++ b/content/browser/accessibility/web_contents_accessibility_android.h
@@ -308,7 +308,7 @@
void HandleClicked(int32_t unique_id);
void HandleScrollPositionChanged(int32_t unique_id);
void HandleScrolledToAnchor(int32_t unique_id);
- void AnnounceLiveRegionText(const base::string16& text);
+ void AnnounceLiveRegionText(const std::u16string& text);
void HandleTextSelectionChanged(int32_t unique_id);
void HandleEditableTextChanged(int32_t unique_id);
void HandleSliderChanged(int32_t unique_id);
diff --git a/content/browser/android/app_web_message_port.cc b/content/browser/android/app_web_message_port.cc
index 13993f4..808d841f 100644
--- a/content/browser/android/app_web_message_port.cc
+++ b/content/browser/android/app_web_message_port.cc
@@ -71,7 +71,7 @@
std::vector<uint8_t> encoded_message;
base::android::JavaByteArrayToByteVector(env, encoded_data, &encoded_message);
- base::string16 message;
+ std::u16string message;
if (!blink::DecodeStringMessage(encoded_message, &message))
return nullptr;
diff --git a/content/browser/android/date_time_chooser_android.cc b/content/browser/android/date_time_chooser_android.cc
index 6057e9e0..aae7d1d 100644
--- a/content/browser/android/date_time_chooser_android.cc
+++ b/content/browser/android/date_time_chooser_android.cc
@@ -26,8 +26,8 @@
namespace {
-base::string16 SanitizeSuggestionString(const base::string16& string) {
- base::string16 trimmed = string.substr(0, 255);
+std::u16string SanitizeSuggestionString(const std::u16string& string) {
+ std::u16string trimmed = string.substr(0, 255);
icu::UnicodeString sanitized;
for (base::i18n::UTF16CharIterator sanitized_iterator(trimmed);
!sanitized_iterator.end(); sanitized_iterator.Advance()) {
diff --git a/content/browser/android/ime_adapter_android.cc b/content/browser/android/ime_adapter_android.cc
index 16588920..dfd03b0 100644
--- a/content/browser/android/ime_adapter_android.cc
+++ b/content/browser/android/ime_adapter_android.cc
@@ -183,7 +183,7 @@
return;
ScopedJavaLocalRef<jstring> jstring_text =
- ConvertUTF16ToJavaString(env, state.value.value_or(base::string16()));
+ ConvertUTF16ToJavaString(env, state.value.value_or(std::u16string()));
Java_ImeAdapterImpl_updateState(
env, obj, static_cast<int>(state.type), state.flags, state.mode,
static_cast<int>(state.action), state.show_ime_if_needed,
@@ -278,7 +278,7 @@
if (!rwhi)
return;
- base::string16 text16 = ConvertJavaStringToUTF16(env, text_str);
+ std::u16string text16 = ConvertJavaStringToUTF16(env, text_str);
std::vector<ui::ImeTextSpan> ime_text_spans =
GetImeTextSpansFromJava(env, obj, text, text16);
@@ -311,7 +311,7 @@
if (!rwhi)
return;
- base::string16 text16 = ConvertJavaStringToUTF16(env, text_str);
+ std::u16string text16 = ConvertJavaStringToUTF16(env, text_str);
std::vector<ui::ImeTextSpan> ime_text_spans =
GetImeTextSpansFromJava(env, obj, text, text16);
@@ -501,7 +501,7 @@
JNIEnv* env,
const base::android::JavaParamRef<jobject>& obj,
const base::android::JavaParamRef<jobject>& text,
- const base::string16& text16) {
+ const std::u16string& text16) {
std::vector<ui::ImeTextSpan> ime_text_spans;
// Iterate over spans in |text|, dispatch those that we care about (e.g.,
// BackgroundColorSpan) to a matching callback (e.g.,
diff --git a/content/browser/android/ime_adapter_android.h b/content/browser/android/ime_adapter_android.h
index 305d968..7492646 100644
--- a/content/browser/android/ime_adapter_android.h
+++ b/content/browser/android/ime_adapter_android.h
@@ -133,7 +133,7 @@
JNIEnv* env,
const base::android::JavaParamRef<jobject>& obj,
const base::android::JavaParamRef<jobject>& text,
- const base::string16& text16);
+ const std::u16string& text16);
gfx::SizeF old_viewport_size_;
diff --git a/content/browser/android/selection/smart_selection_client.cc b/content/browser/android/selection/smart_selection_client.cc
index 3f1f1600..7201dbd 100644
--- a/content/browser/android/selection/smart_selection_client.cc
+++ b/content/browser/android/selection/smart_selection_client.cc
@@ -72,7 +72,7 @@
int callback_data) {
RenderFrameHost* focused_frame = web_contents_->GetFocusedFrame();
if (!focused_frame) {
- OnSurroundingTextReceived(callback_data, base::string16(), 0, 0);
+ OnSurroundingTextReceived(callback_data, std::u16string(), 0, 0);
return;
}
@@ -89,7 +89,7 @@
}
void SmartSelectionClient::OnSurroundingTextReceived(int callback_data,
- const base::string16& text,
+ const std::u16string& text,
uint32_t start,
uint32_t end) {
JNIEnv* env = AttachCurrentThread();
diff --git a/content/browser/android/selection/smart_selection_client.h b/content/browser/android/selection/smart_selection_client.h
index b537783..b509a0f 100644
--- a/content/browser/android/selection/smart_selection_client.h
+++ b/content/browser/android/selection/smart_selection_client.h
@@ -41,7 +41,7 @@
private:
void OnSurroundingTextReceived(int callback_data,
- const base::string16& text,
+ const std::u16string& text,
uint32_t start,
uint32_t end);
diff --git a/content/browser/appcache/appcache_browsertest.cc b/content/browser/appcache/appcache_browsertest.cc
index c7ca78b..8788373 100644
--- a/content/browser/appcache/appcache_browsertest.cc
+++ b/content/browser/appcache/appcache_browsertest.cc
@@ -73,7 +73,7 @@
GURL main_url =
embedded_test_server.GetURL("/appcache/simple_page_with_manifest.html");
- base::string16 expected_title = base::ASCIIToUTF16("AppCache updated");
+ std::u16string expected_title = base::ASCIIToUTF16("AppCache updated");
// Load the main page twice. The second navigation should have AppCache
// initialized for the page.
@@ -111,7 +111,7 @@
GURL main_url =
embedded_test_server.GetURL("/appcache/simple_page_with_manifest.html");
- base::string16 expected_title = base::ASCIIToUTF16("AppCache updated");
+ std::u16string expected_title = base::ASCIIToUTF16("AppCache updated");
// Load the main page twice. The second navigation should have AppCache
// initialized for the page.
@@ -168,7 +168,7 @@
// First navigation populates AppCache.
{
EXPECT_TRUE(NavigateToURL(shell(), main_url));
- base::string16 expected_title = base::ASCIIToUTF16("AppCache primed");
+ std::u16string expected_title = base::ASCIIToUTF16("AppCache primed");
TitleWatcher title_watcher(shell()->web_contents(), expected_title);
EXPECT_EQ(expected_title, title_watcher.WaitAndGetTitle());
}
@@ -189,7 +189,7 @@
manifest_nonce = "# Version 2";
{
EXPECT_TRUE(NavigateToURL(shell(), main_url));
- base::string16 expected_title = base::ASCIIToUTF16("AppCache updated");
+ std::u16string expected_title = base::ASCIIToUTF16("AppCache updated");
TitleWatcher title_watcher(shell()->web_contents(), expected_title);
EXPECT_EQ(expected_title, title_watcher.WaitAndGetTitle());
}
@@ -290,7 +290,7 @@
GURL main_url =
embedded_test_server.GetURL("/appcache/simple_page_with_manifest.html");
- base::string16 expected_title = base::ASCIIToUTF16("AppCache updated");
+ std::u16string expected_title = base::ASCIIToUTF16("AppCache updated");
EXPECT_TRUE(NavigateToURL(shell(), main_url));
TitleWatcher title_watcher(shell()->web_contents(), expected_title);
diff --git a/content/browser/appcache/appcache_manifest_parser.cc b/content/browser/appcache/appcache_manifest_parser.cc
index eddc0818..bb8120fd 100644
--- a/content/browser/appcache/appcache_manifest_parser.cc
+++ b/content/browser/appcache/appcache_manifest_parser.cc
@@ -335,7 +335,7 @@
// purpose, but AppCache isn't important enough to add conversion code just
// to accelerate manifest decoding.
DCHECK_GE(manifest_size, 0);
- base::string16 wide_manifest_bytes =
+ std::u16string wide_manifest_bytes =
base::UTF8ToUTF16(base::StringPiece(manifest_bytes, manifest_size));
std::string decoded_manifest_bytes = base::UTF16ToUTF8(wide_manifest_bytes);
diff --git a/content/browser/back_forward_cache_browsertest.cc b/content/browser/back_forward_cache_browsertest.cc
index e333304..3fcad5b 100644
--- a/content/browser/back_forward_cache_browsertest.cc
+++ b/content/browser/back_forward_cache_browsertest.cc
@@ -1788,7 +1788,7 @@
" document.title = 'unloaded!';"
"});"));
{
- base::string16 title_when_loaded = base::UTF8ToUTF16("loaded!");
+ std::u16string title_when_loaded = base::UTF8ToUTF16("loaded!");
TitleWatcher title_watcher(web_contents(), title_when_loaded);
EXPECT_EQ(title_watcher.WaitAndGetTitle(), title_when_loaded);
}
@@ -1809,7 +1809,7 @@
EXPECT_EQ(rfh_a, current_frame_host());
EXPECT_TRUE(rfh_b->IsInBackForwardCache());
{
- base::string16 title_when_loaded = base::UTF8ToUTF16("loaded!");
+ std::u16string title_when_loaded = base::UTF8ToUTF16("loaded!");
TitleWatcher title_watcher(web_contents(), title_when_loaded);
EXPECT_EQ(title_watcher.WaitAndGetTitle(), title_when_loaded);
}
@@ -2743,7 +2743,7 @@
base::RunLoop run_loop;
rfh_a->RequestTextSurroundingSelection(
base::BindOnce(
- [](base::RepeatingClosure quit_closure, const base::string16& str,
+ [](base::RepeatingClosure quit_closure, const std::u16string& str,
uint32_t num, uint32_t num2) { quit_closure.Run(); },
run_loop.QuitClosure()),
1);
diff --git a/content/browser/bluetooth/bluetooth_device_scanning_prompt_controller.cc b/content/browser/bluetooth/bluetooth_device_scanning_prompt_controller.cc
index 763f3d1..904c445 100644
--- a/content/browser/bluetooth/bluetooth_device_scanning_prompt_controller.cc
+++ b/content/browser/bluetooth/bluetooth_device_scanning_prompt_controller.cc
@@ -55,7 +55,7 @@
void BluetoothDeviceScanningPromptController::AddFilteredDevice(
const std::string& device_id,
bool should_update_name,
- const base::string16& device_name) {
+ const std::u16string& device_name) {
if (prompt_)
prompt_->AddOrUpdateDevice(device_id, should_update_name, device_name);
}
diff --git a/content/browser/bluetooth/bluetooth_device_scanning_prompt_controller.h b/content/browser/bluetooth/bluetooth_device_scanning_prompt_controller.h
index 2473df4..4fae9719 100644
--- a/content/browser/bluetooth/bluetooth_device_scanning_prompt_controller.h
+++ b/content/browser/bluetooth/bluetooth_device_scanning_prompt_controller.h
@@ -38,7 +38,7 @@
// ShowPermissionPrompt() is called.
void AddFilteredDevice(const std::string& device_id,
bool should_update_name,
- const base::string16& device_name);
+ const std::u16string& device_name);
private:
// The WebBluetoothServiceImpl that owns this instance.
diff --git a/content/browser/bluetooth/web_bluetooth_service_impl.cc b/content/browser/bluetooth/web_bluetooth_service_impl.cc
index 6db5ff0..8f5f62e 100644
--- a/content/browser/bluetooth/web_bluetooth_service_impl.cc
+++ b/content/browser/bluetooth/web_bluetooth_service_impl.cc
@@ -373,7 +373,7 @@
const std::string& device_id,
const base::Optional<std::string>& device_name) {
bool should_update_name = device_name.has_value();
- base::string16 device_name_for_display =
+ std::u16string device_name_for_display =
base::UTF8ToUTF16(device_name.value_or(""));
prompt_controller_->AddFilteredDevice(device_id, should_update_name,
device_name_for_display);
diff --git a/content/browser/browser_child_process_host_impl.cc b/content/browser/browser_child_process_host_impl.cc
index 4e18fd19..9c39184 100644
--- a/content/browser/browser_child_process_host_impl.cc
+++ b/content/browser/browser_child_process_host_impl.cc
@@ -294,7 +294,7 @@
return std::move(metrics_allocator_);
}
-void BrowserChildProcessHostImpl::SetName(const base::string16& name) {
+void BrowserChildProcessHostImpl::SetName(const std::u16string& name) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
data_.name = name;
}
diff --git a/content/browser/browser_child_process_host_impl.h b/content/browser/browser_child_process_host_impl.h
index 9573b452..24a3af8 100644
--- a/content/browser/browser_child_process_host_impl.h
+++ b/content/browser/browser_child_process_host_impl.h
@@ -94,7 +94,7 @@
ChildProcessTerminationInfo GetTerminationInfo(bool known_dead) override;
std::unique_ptr<base::PersistentMemoryAllocator> TakeMetricsAllocator()
override;
- void SetName(const base::string16& name) override;
+ void SetName(const std::u16string& name) override;
void SetMetricsName(const std::string& metrics_name) override;
void SetProcess(base::Process process) override;
diff --git a/content/browser/browsing_data/clear_site_data_handler_browsertest.cc b/content/browser/browsing_data/clear_site_data_handler_browsertest.cc
index 47f968b..65c3801 100644
--- a/content/browser/browsing_data/clear_site_data_handler_browsertest.cc
+++ b/content/browser/browsing_data/clear_site_data_handler_browsertest.cc
@@ -65,7 +65,7 @@
// information to the loaded website's title and C++ will wait until that
// happens.
void WaitForTitle(const Shell* shell, const char* expected_title) {
- base::string16 expected_title_16 = base::ASCIIToUTF16(expected_title);
+ std::u16string expected_title_16 = base::ASCIIToUTF16(expected_title);
TitleWatcher title_watcher(shell->web_contents(), expected_title_16);
ASSERT_EQ(expected_title_16, title_watcher.WaitAndGetTitle());
}
diff --git a/content/browser/cache_storage/cache_storage_dispatcher_host.cc b/content/browser/cache_storage/cache_storage_dispatcher_host.cc
index 5f3b994..49b73b74 100644
--- a/content/browser/cache_storage/cache_storage_dispatcher_host.cc
+++ b/content/browser/cache_storage/cache_storage_dispatcher_host.cc
@@ -666,7 +666,7 @@
[](base::TimeTicks start_time, int64_t trace_id,
blink::mojom::CacheStorage::KeysCallback callback,
std::vector<std::string> cache_names) {
- std::vector<base::string16> string16s;
+ std::vector<std::u16string> string16s;
for (const auto& name : cache_names) {
string16s.push_back(base::UTF8ToUTF16(name));
}
@@ -692,7 +692,7 @@
cache_storage->EnumerateCaches(trace_id, std::move(cb));
}
- void Delete(const base::string16& cache_name,
+ void Delete(const std::u16string& cache_name,
int64_t trace_id,
blink::mojom::CacheStorage::DeleteCallback callback) override {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
@@ -729,7 +729,7 @@
cache_storage->DoomCache(utf8_cache_name, trace_id, std::move(cb));
}
- void Has(const base::string16& cache_name,
+ void Has(const std::u16string& cache_name,
int64_t trace_id,
blink::mojom::CacheStorage::HasCallback callback) override {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
@@ -866,7 +866,7 @@
trace_id, std::move(cb));
}
- void Open(const base::string16& cache_name,
+ void Open(const std::u16string& cache_name,
int64_t trace_id,
blink::mojom::CacheStorage::OpenCallback callback) override {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
diff --git a/content/browser/cache_storage/cache_storage_trace_utils.cc b/content/browser/cache_storage/cache_storage_trace_utils.cc
index d9ba0f4..63f53d4 100644
--- a/content/browser/cache_storage/cache_storage_trace_utils.cc
+++ b/content/browser/cache_storage/cache_storage_trace_utils.cc
@@ -119,7 +119,7 @@
}
std::unique_ptr<base::trace_event::TracedValue> CacheStorageTracedValue(
- const std::vector<base::string16> string_list) {
+ const std::vector<std::u16string> string_list) {
std::unique_ptr<TracedValue> value = std::make_unique<TracedValue>();
value->SetInteger("count", string_list.size());
if (!string_list.empty()) {
diff --git a/content/browser/cache_storage/cache_storage_trace_utils.h b/content/browser/cache_storage/cache_storage_trace_utils.h
index 8c1c96c..fdb9ea5 100644
--- a/content/browser/cache_storage/cache_storage_trace_utils.h
+++ b/content/browser/cache_storage/cache_storage_trace_utils.h
@@ -57,7 +57,7 @@
const std::vector<blink::mojom::BatchOperationPtr>& operation_list);
std::unique_ptr<base::trace_event::TracedValue> CacheStorageTracedValue(
- const std::vector<base::string16> string_list);
+ const std::vector<std::u16string> string_list);
std::unique_ptr<base::trace_event::TracedValue> CacheStorageTracedValue(
const std::vector<blink::mojom::CacheEntryPtr>& entries);
diff --git a/content/browser/contacts/contacts_provider_android.h b/content/browser/contacts/contacts_provider_android.h
index ff2eeb7..879e3a97 100644
--- a/content/browser/contacts/contacts_provider_android.h
+++ b/content/browser/contacts/contacts_provider_android.h
@@ -62,7 +62,7 @@
// The origin that the contacts data will be shared with. Formatted for
// display with the scheme omitted.
- base::string16 formatted_origin_;
+ std::u16string formatted_origin_;
DISALLOW_COPY_AND_ASSIGN(ContactsProviderAndroid);
};
diff --git a/content/browser/conversions/conversion_internals_browsertest.cc b/content/browser/conversions/conversion_internals_browsertest.cc
index 5f53ff8..5840553 100644
--- a/content/browser/conversions/conversion_internals_browsertest.cc
+++ b/content/browser/conversions/conversion_internals_browsertest.cc
@@ -26,7 +26,7 @@
const char kConversionInternalsUrl[] = "chrome://conversion-internals/";
-const base::string16 kCompleteTitle = base::ASCIIToUTF16("Complete");
+const std::u16string kCompleteTitle = base::ASCIIToUTF16("Complete");
} // namespace
@@ -60,7 +60,7 @@
// Registers a mutation observer that sets the window title to |title| when
// the report table is empty.
- void SetTitleOnReportsTableEmpty(const base::string16& title) {
+ void SetTitleOnReportsTableEmpty(const std::u16string& title) {
const std::string kObserveEmptyReportsTableScript = R"(
let table = document.getElementById("report-table-body");
let obs = new MutationObserver(() => {
@@ -265,7 +265,7 @@
EXPECT_EQ(kCompleteTitle, title_watcher.WaitAndGetTitle());
// Click the clear storage button and expect that the report table is emptied.
- const base::string16 kDeleteTitle = base::ASCIIToUTF16("Delete");
+ const std::u16string kDeleteTitle = base::ASCIIToUTF16("Delete");
TitleWatcher delete_title_watcher(shell()->web_contents(), kDeleteTitle);
SetTitleOnReportsTableEmpty(kDeleteTitle);
@@ -305,7 +305,7 @@
EXPECT_EQ(kCompleteTitle, title_watcher.WaitAndGetTitle());
// Click the send reports button and expect that the report table is emptied.
- const base::string16 kSentTitle = base::ASCIIToUTF16("Sent");
+ const std::u16string kSentTitle = base::ASCIIToUTF16("Sent");
TitleWatcher sent_title_watcher(shell()->web_contents(), kSentTitle);
SetTitleOnReportsTableEmpty(kSentTitle);
@@ -318,7 +318,7 @@
MojoJsBindingsCorrectlyScoped) {
EXPECT_TRUE(NavigateToURL(shell(), GURL(kConversionInternalsUrl)));
- const base::string16 passed_title = base::ASCIIToUTF16("passed");
+ const std::u16string passed_title = base::ASCIIToUTF16("passed");
{
TitleWatcher sent_title_watcher(shell()->web_contents(), passed_title);
diff --git a/content/browser/conversions/impression_declaration_browsertest.cc b/content/browser/conversions/impression_declaration_browsertest.cc
index 391eb8b3..d981eab 100644
--- a/content/browser/conversions/impression_declaration_browsertest.cc
+++ b/content/browser/conversions/impression_declaration_browsertest.cc
@@ -330,7 +330,7 @@
// Focus the element, wait for it to receive focus, and simulate an enter
// press.
- base::string16 expected_title = base::ASCIIToUTF16("focused");
+ std::u16string expected_title = base::ASCIIToUTF16("focused");
content::TitleWatcher title_watcher(web_contents(), expected_title);
EXPECT_TRUE(ExecJs(shell(), R"(
let link = document.getElementById('link');
diff --git a/content/browser/devtools/devtools_url_loader_interceptor.cc b/content/browser/devtools/devtools_url_loader_interceptor.cc
index 185ed462..32d860c 100644
--- a/content/browser/devtools/devtools_url_loader_interceptor.cc
+++ b/content/browser/devtools/devtools_url_loader_interceptor.cc
@@ -49,8 +49,8 @@
}
DevToolsURLLoaderInterceptor::AuthChallengeResponse::AuthChallengeResponse(
- const base::string16& username,
- const base::string16& password)
+ const std::u16string& username,
+ const std::u16string& password)
: response_type(kProvideCredentials), credentials(username, password) {}
DevToolsURLLoaderInterceptor::FilterEntry::FilterEntry(
diff --git a/content/browser/devtools/devtools_url_loader_interceptor.h b/content/browser/devtools/devtools_url_loader_interceptor.h
index 774c54e..35befa2 100644
--- a/content/browser/devtools/devtools_url_loader_interceptor.h
+++ b/content/browser/devtools/devtools_url_loader_interceptor.h
@@ -76,8 +76,8 @@
};
explicit AuthChallengeResponse(ResponseType response_type);
- AuthChallengeResponse(const base::string16& username,
- const base::string16& password);
+ AuthChallengeResponse(const std::u16string& username,
+ const std::u16string& password);
const ResponseType response_type;
const net::AuthCredentials credentials;
diff --git a/content/browser/devtools/protocol/devtools_protocol_browsertest.cc b/content/browser/devtools/protocol/devtools_protocol_browsertest.cc
index 066359c..ff95e5c 100644
--- a/content/browser/devtools/protocol/devtools_protocol_browsertest.cc
+++ b/content/browser/devtools/protocol/devtools_protocol_browsertest.cc
@@ -118,7 +118,7 @@
void Handle() {
if (!callback_.is_null()) {
- std::move(callback_).Run(true, base::string16());
+ std::move(callback_).Run(true, std::u16string());
} else {
handle_ = true;
}
@@ -134,13 +134,13 @@
void RunJavaScriptDialog(WebContents* web_contents,
RenderFrameHost* render_frame_host,
JavaScriptDialogType dialog_type,
- const base::string16& message_text,
- const base::string16& default_prompt_text,
+ const std::u16string& message_text,
+ const std::u16string& default_prompt_text,
DialogClosedCallback callback,
bool* did_suppress_message) override {
if (handle_) {
handle_ = false;
- std::move(callback).Run(true, base::string16());
+ std::move(callback).Run(true, std::u16string());
} else {
callback_ = std::move(callback);
}
@@ -153,7 +153,7 @@
bool HandleJavaScriptDialog(WebContents* web_contents,
bool accept,
- const base::string16* prompt_override) override {
+ const std::u16string* prompt_override) override {
is_handled_ = true;
return true;
}
diff --git a/content/browser/devtools/protocol/devtools_protocol_test_support.cc b/content/browser/devtools/protocol/devtools_protocol_test_support.cc
index 459f9d8..50631e4 100644
--- a/content/browser/devtools/protocol/devtools_protocol_test_support.cc
+++ b/content/browser/devtools/protocol/devtools_protocol_test_support.cc
@@ -42,9 +42,9 @@
bool DevToolsProtocolTest::DidAddMessageToConsole(
WebContents* source,
blink::mojom::ConsoleMessageLevel log_level,
- const base::string16& message,
+ const std::u16string& message,
int32_t line_no,
- const base::string16& source_id) {
+ const std::u16string& source_id) {
console_messages_.push_back(base::UTF16ToUTF8(message));
return true;
}
diff --git a/content/browser/devtools/protocol/devtools_protocol_test_support.h b/content/browser/devtools/protocol/devtools_protocol_test_support.h
index 14145e7..fc84d5d3 100644
--- a/content/browser/devtools/protocol/devtools_protocol_test_support.h
+++ b/content/browser/devtools/protocol/devtools_protocol_test_support.h
@@ -32,9 +32,9 @@
// WebContentsDelegate methods:
bool DidAddMessageToConsole(WebContents* source,
blink::mojom::ConsoleMessageLevel log_level,
- const base::string16& message,
+ const std::u16string& message,
int32_t line_no,
- const base::string16& source_id) override;
+ const std::u16string& source_id) override;
blink::SecurityStyle GetSecurityStyle(
content::WebContents* web_contents,
diff --git a/content/browser/devtools/protocol/input_handler.cc b/content/browser/devtools/protocol/input_handler.cc
index 9758aa8..d36f64f 100644
--- a/content/browser/devtools/protocol/input_handler.cc
+++ b/content/browser/devtools/protocol/input_handler.cc
@@ -120,7 +120,7 @@
if (!from.isJust())
return true;
- base::string16 text16 = base::UTF8ToUTF16(from.fromJust());
+ std::u16string text16 = base::UTF8ToUTF16(from.fromJust());
if (text16.size() > blink::WebKeyboardEvent::kTextLengthCap)
return false;
@@ -641,7 +641,7 @@
void InputHandler::InsertText(const std::string& text,
std::unique_ptr<InsertTextCallback> callback) {
- base::string16 text16 = base::UTF8ToUTF16(text);
+ std::u16string text16 = base::UTF8ToUTF16(text);
if (!host_ || !host_->GetRenderWidgetHost()) {
callback->sendFailure(Response::InternalError());
return;
diff --git a/content/browser/devtools/protocol/native_input_event_builder_mac.mm b/content/browser/devtools/protocol/native_input_event_builder_mac.mm
index fede3262..70b08ea 100644
--- a/content/browser/devtools/protocol/native_input_event_builder_mac.mm
+++ b/content/browser/devtools/protocol/native_input_event_builder_mac.mm
@@ -25,7 +25,7 @@
textStartAddr + NativeWebKeyboardEvent::kTextLengthCap, '\0') -
textStartAddr;
NSString* character =
- base::SysUTF16ToNSString(base::string16(textStartAddr, textLength));
+ base::SysUTF16ToNSString(std::u16string(textStartAddr, textLength));
int modifiers = event.GetModifiers();
NSUInteger flags =
(modifiers & blink::WebInputEvent::kShiftKey ? NSShiftKeyMask : 0) |
diff --git a/content/browser/devtools/protocol/page_handler.cc b/content/browser/devtools/protocol/page_handler.cc
index 1c1d1fd..2195f601 100644
--- a/content/browser/devtools/protocol/page_handler.cc
+++ b/content/browser/devtools/protocol/page_handler.cc
@@ -303,8 +303,8 @@
}
void PageHandler::DidRunJavaScriptDialog(const GURL& url,
- const base::string16& message,
- const base::string16& default_prompt,
+ const std::u16string& message,
+ const std::u16string& default_prompt,
JavaScriptDialogType dialog_type,
bool has_non_devtools_handlers,
JavaScriptDialogCallback callback) {
@@ -335,7 +335,7 @@
}
void PageHandler::DidCloseJavaScriptDialog(bool success,
- const base::string16& user_input) {
+ const std::u16string& user_input) {
if (!enabled_)
return;
pending_dialog_.Reset();
@@ -362,7 +362,7 @@
web_contents && web_contents->GetDelegate() &&
web_contents->GetDelegate()->GetJavaScriptDialogManager(web_contents);
if (!has_dialog_manager)
- std::move(pending_dialog_).Run(false, base::string16());
+ std::move(pending_dialog_).Run(false, std::u16string());
pending_dialog_.Reset();
}
@@ -554,7 +554,7 @@
// and DownloadTargetDeterminer::GenerateFileName in
// chrome/browser/download/download_target_determiner.cc
// for the more comprehensive logic.
- const base::string16 likely_filename = net::GetSuggestedFilename(
+ const std::u16string likely_filename = net::GetSuggestedFilename(
item->GetURL(), item->GetContentDisposition(), std::string(),
item->GetSuggestedFilename(), item->GetMimeType(), "download");
@@ -943,7 +943,7 @@
if (pending_dialog_.is_null())
return Response::InvalidParams("No dialog is showing");
- base::string16 prompt_override;
+ std::u16string prompt_override;
if (prompt_text.isJust())
prompt_override = base::UTF8ToUTF16(prompt_text.fromJust());
std::move(pending_dialog_).Run(accept, prompt_override);
diff --git a/content/browser/devtools/protocol/page_handler.h b/content/browser/devtools/protocol/page_handler.h
index 9db6464e..be667cb7 100644
--- a/content/browser/devtools/protocol/page_handler.h
+++ b/content/browser/devtools/protocol/page_handler.h
@@ -84,15 +84,15 @@
using JavaScriptDialogCallback =
content::JavaScriptDialogManager::DialogClosedCallback;
void DidRunJavaScriptDialog(const GURL& url,
- const base::string16& message,
- const base::string16& default_prompt,
+ const std::u16string& message,
+ const std::u16string& default_prompt,
JavaScriptDialogType dialog_type,
bool has_non_devtools_handlers,
JavaScriptDialogCallback callback);
void DidRunBeforeUnloadConfirm(const GURL& url,
bool has_non_devtools_handlers,
JavaScriptDialogCallback callback);
- void DidCloseJavaScriptDialog(bool success, const base::string16& user_input);
+ void DidCloseJavaScriptDialog(bool success, const std::u16string& user_input);
void NavigationReset(NavigationRequest* navigation_request);
void DownloadWillBegin(FrameTreeNode* ftn, download::DownloadItem* item);
diff --git a/content/browser/devtools/protocol/storage_handler.cc b/content/browser/devtools/protocol/storage_handler.cc
index f4ee850..639ef8a 100644
--- a/content/browser/devtools/protocol/storage_handler.cc
+++ b/content/browser/devtools/protocol/storage_handler.cc
@@ -211,8 +211,8 @@
void OnIndexedDBContentChanged(
const url::Origin& origin,
- const base::string16& database_name,
- const base::string16& object_store_name) override {
+ const std::u16string& database_name,
+ const std::u16string& object_store_name) override {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (!owner_)
return;
@@ -523,8 +523,8 @@
void StorageHandler::NotifyIndexedDBContentChanged(
const std::string& origin,
- const base::string16& database_name,
- const base::string16& object_store_name) {
+ const std::u16string& database_name,
+ const std::u16string& object_store_name) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
frontend_->IndexedDBContentUpdated(origin, base::UTF16ToUTF8(database_name),
base::UTF16ToUTF8(object_store_name));
diff --git a/content/browser/devtools/protocol/storage_handler.h b/content/browser/devtools/protocol/storage_handler.h
index 7e21fdb..c228b7b4 100644
--- a/content/browser/devtools/protocol/storage_handler.h
+++ b/content/browser/devtools/protocol/storage_handler.h
@@ -91,8 +91,8 @@
const std::string& name);
void NotifyIndexedDBListChanged(const std::string& origin);
void NotifyIndexedDBContentChanged(const std::string& origin,
- const base::string16& database_name,
- const base::string16& object_store_name);
+ const std::u16string& database_name,
+ const std::u16string& object_store_name);
Response FindStoragePartition(const Maybe<std::string>& browser_context_id,
StoragePartition** storage_partition);
diff --git a/content/browser/download/download_browsertest.cc b/content/browser/download/download_browsertest.cc
index d6ebfb70..3c3fceba 100644
--- a/content/browser/download/download_browsertest.cc
+++ b/content/browser/download/download_browsertest.cc
@@ -3742,7 +3742,7 @@
origin_one.StartAcceptingConnections();
origin_two.StartAcceptingConnections();
- base::string16 expected_title(base::UTF8ToUTF16("hello"));
+ std::u16string expected_title(base::UTF8ToUTF16("hello"));
TitleWatcher observer(shell()->web_contents(), expected_title);
EXPECT_TRUE(
NavigateToURL(shell(), referrer_url,
diff --git a/content/browser/download/drag_download_util.cc b/content/browser/download/drag_download_util.cc
index 11cfe3ca..eaf232c2 100644
--- a/content/browser/download/drag_download_util.cc
+++ b/content/browser/download/drag_download_util.cc
@@ -23,18 +23,18 @@
namespace content {
-bool ParseDownloadMetadata(const base::string16& metadata,
- base::string16* mime_type,
+bool ParseDownloadMetadata(const std::u16string& metadata,
+ std::u16string* mime_type,
base::FilePath* file_name,
GURL* url) {
const char16_t separator = L':';
size_t mime_type_end_pos = metadata.find(separator);
- if (mime_type_end_pos == base::string16::npos)
+ if (mime_type_end_pos == std::u16string::npos)
return false;
size_t file_name_end_pos = metadata.find(separator, mime_type_end_pos + 1);
- if (file_name_end_pos == base::string16::npos)
+ if (file_name_end_pos == std::u16string::npos)
return false;
GURL parsed_url = GURL(metadata.substr(file_name_end_pos + 1));
@@ -44,8 +44,8 @@
if (mime_type)
*mime_type = metadata.substr(0, mime_type_end_pos);
if (file_name) {
- base::string16 file_name_str = metadata.substr(
- mime_type_end_pos + 1, file_name_end_pos - mime_type_end_pos - 1);
+ std::u16string file_name_str = metadata.substr(
+ mime_type_end_pos + 1, file_name_end_pos - mime_type_end_pos - 1);
*file_name = base::FilePath::FromUTF16Unsafe(file_name_str);
}
if (url)
diff --git a/content/browser/download/drag_download_util.h b/content/browser/download/drag_download_util.h
index 4e477159..fb23fab 100644
--- a/content/browser/download/drag_download_util.h
+++ b/content/browser/download/drag_download_util.h
@@ -31,8 +31,8 @@
// appropriately.
// For example, we can have
// text/plain:example.txt:http://example.com/example.txt
-bool ParseDownloadMetadata(const base::string16& metadata,
- base::string16* mime_type,
+bool ParseDownloadMetadata(const std::u16string& metadata,
+ std::u16string* mime_type,
base::FilePath* file_name,
GURL* url);
diff --git a/content/browser/download/save_package.cc b/content/browser/download/save_package.cc
index e402aba6..4ceea290 100644
--- a/content/browser/download/save_package.cc
+++ b/content/browser/download/save_package.cc
@@ -1318,7 +1318,7 @@
// static
base::FilePath SavePackage::CreateDirectoryOnFileThread(
- const base::string16& title,
+ const std::u16string& title,
const GURL& page_url,
bool can_save_as_complete,
const std::string& mime_type,
diff --git a/content/browser/download/save_package.h b/content/browser/download/save_package.h
index 783be979..83b22b9e 100644
--- a/content/browser/download/save_package.h
+++ b/content/browser/download/save_package.h
@@ -312,7 +312,7 @@
static GURL GetUrlToBeSaved(WebContents* web_contents);
static base::FilePath CreateDirectoryOnFileThread(
- const base::string16& title,
+ const std::u16string& title,
const GURL& page_url,
bool can_save_as_complete,
const std::string& mime_type,
@@ -391,7 +391,7 @@
base::FilePath saved_main_directory_path_;
// The title of the page the user wants to save.
- const base::string16 title_;
+ const std::u16string title_;
// Used to calculate package download speed (in files per second).
const base::TimeTicks start_tick_;
diff --git a/content/browser/download/save_package_browsertest.cc b/content/browser/download/save_package_browsertest.cc
index 4c89f39..a25638c 100644
--- a/content/browser/download/save_package_browsertest.cc
+++ b/content/browser/download/save_package_browsertest.cc
@@ -295,7 +295,7 @@
download_manager->SetDelegate(old_delegate);
EXPECT_TRUE(NavigateToURL(shell(), GURL("about:blank")));
- base::string16 expected_title = base::ASCIIToUTF16("Hello");
+ std::u16string expected_title = base::ASCIIToUTF16("Hello");
TitleWatcher title_watcher(shell()->web_contents(), expected_title);
EXPECT_TRUE(NavigateToURL(
shell(), wbn_file_url,
diff --git a/content/browser/file_system/file_system_url_loader_factory.cc b/content/browser/file_system/file_system_url_loader_factory.cc
index f18a82b..7a63e44 100644
--- a/content/browser/file_system/file_system_url_loader_factory.cc
+++ b/content/browser/file_system/file_system_url_loader_factory.cc
@@ -291,7 +291,7 @@
relative_path =
base::FilePath(FILE_PATH_LITERAL("/") + relative_path.value());
#endif
- const base::string16& title = relative_path.LossyDisplayName();
+ const std::u16string& title = relative_path.LossyDisplayName();
data_.append(net::GetDirectoryListingHeader(title));
}
@@ -329,7 +329,7 @@
}
const DirectoryEntry& entry = entries_[index];
- const base::string16& name = base::FilePath(entry.name).LossyDisplayName();
+ const std::u16string& name = base::FilePath(entry.name).LossyDisplayName();
data_.append(net::GetDirectoryListingEntry(
name, std::string(),
entry.type == filesystem::mojom::FsFileType::DIRECTORY, file_info.size,
diff --git a/content/browser/file_system_access/file_system_access_directory_handle_impl.cc b/content/browser/file_system_access/file_system_access_directory_handle_impl.cc
index dedf355..b386fe1 100644
--- a/content/browser/file_system_access/file_system_access_directory_handle_impl.cc
+++ b/content/browser/file_system_access/file_system_access_directory_handle_impl.cc
@@ -452,7 +452,7 @@
return false;
}
- base::string16 component16;
+ std::u16string component16;
#if defined(OS_WIN)
component16.assign(component.value().begin(), component.value().end());
#else
diff --git a/content/browser/file_system_access/file_system_chooser.cc b/content/browser/file_system_access/file_system_chooser.cc
index 3f1a544..fa4c151 100644
--- a/content/browser/file_system_access/file_system_chooser.cc
+++ b/content/browser/file_system_access/file_system_chooser.cc
@@ -115,7 +115,7 @@
bool GetFileTypesFromAcceptsOption(
const blink::mojom::ChooseFileSystemEntryAcceptsOption& option,
std::vector<base::FilePath::StringType>* extensions,
- base::string16* description) {
+ std::u16string* description) {
std::set<base::FilePath::StringType> extension_set;
for (const std::string& extension_string : option.extensions) {
@@ -156,7 +156,7 @@
if (extensions->empty())
return false;
- base::string16 sanitized_description = option.description;
+ std::u16string sanitized_description = option.description;
if (!sanitized_description.empty()) {
sanitized_description = base::CollapseWhitespace(
sanitized_description, /*trim_sequences_with_line_breaks=*/false);
@@ -176,7 +176,7 @@
for (const auto& option : accepts_types_info->accepts) {
std::vector<base::FilePath::StringType> extensions;
- base::string16 description;
+ std::u16string description;
if (!GetFileTypesFromAcceptsOption(*option, &extensions, &description))
continue; // No extensions were found for this option, skip it.
@@ -282,7 +282,7 @@
// SelectFile.
listener->dialog_->SelectFile(
- options.type(), /*title=*/base::string16(), options.default_path(),
+ options.type(), /*title=*/std::u16string(), options.default_path(),
&options.file_type_info(), options.default_file_type_index(),
/*default_extension=*/base::FilePath::StringType(),
web_contents ? web_contents->GetTopLevelNativeWindow() : nullptr,
diff --git a/content/browser/file_system_access/file_system_chooser_test_helpers.cc b/content/browser/file_system_access/file_system_chooser_test_helpers.cc
index 3dfe58a..86a393f9 100644
--- a/content/browser/file_system_access/file_system_chooser_test_helpers.cc
+++ b/content/browser/file_system_access/file_system_chooser_test_helpers.cc
@@ -20,7 +20,7 @@
protected:
void SelectFileImpl(Type type,
- const base::string16& title,
+ const std::u16string& title,
const base::FilePath& default_path,
const FileTypeInfo* file_types,
int file_type_index,
@@ -63,7 +63,7 @@
protected:
void SelectFileImpl(Type type,
- const base::string16& title,
+ const std::u16string& title,
const base::FilePath& default_path,
const FileTypeInfo* file_types,
int file_type_index,
diff --git a/content/browser/find_request_manager.cc b/content/browser/find_request_manager.cc
index 09eb4d6..70088ce 100644
--- a/content/browser/find_request_manager.cc
+++ b/content/browser/find_request_manager.cc
@@ -221,7 +221,7 @@
FindRequestManager::FindRequest::FindRequest(
int id,
- const base::string16& search_text,
+ const std::u16string& search_text,
blink::mojom::FindOptionsPtr options)
: id(id), search_text(search_text), options(std::move(options)) {}
@@ -268,7 +268,7 @@
FindRequestManager::~FindRequestManager() = default;
void FindRequestManager::Find(int request_id,
- const base::string16& search_text,
+ const std::u16string& search_text,
blink::mojom::FindOptionsPtr options) {
// Every find request must have a unique ID, and these IDs must strictly
// increase so that newer requests always have greater IDs than older
diff --git a/content/browser/find_request_manager.h b/content/browser/find_request_manager.h
index 8c85cbb..72ca89df 100644
--- a/content/browser/find_request_manager.h
+++ b/content/browser/find_request_manager.h
@@ -39,7 +39,7 @@
// Initiates a find operation for |search_text| with the options specified in
// |options|. |request_id| uniquely identifies the find request.
void Find(int request_id,
- const base::string16& search_text,
+ const std::u16string& search_text,
blink::mojom::FindOptionsPtr options);
// Stops the active find session and clears the general highlighting of the
@@ -120,14 +120,14 @@
int id = kInvalidId;
// The text that is being searched for in this find request.
- base::string16 search_text;
+ std::u16string search_text;
// The set of find options in effect for this find request.
blink::mojom::FindOptionsPtr options;
FindRequest();
FindRequest(int id,
- const base::string16& search_text,
+ const std::u16string& search_text,
blink::mojom::FindOptionsPtr options);
FindRequest(const FindRequest& request);
~FindRequest();
diff --git a/content/browser/indexed_db/database_impl.cc b/content/browser/indexed_db/database_impl.cc
index 143f9b23..d6ee1e0 100644
--- a/content/browser/indexed_db/database_impl.cc
+++ b/content/browser/indexed_db/database_impl.cc
@@ -71,7 +71,7 @@
void DatabaseImpl::RenameObjectStore(int64_t transaction_id,
int64_t object_store_id,
- const base::string16& new_name) {
+ const std::u16string& new_name) {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
if (!connection_->IsConnected())
return;
@@ -455,7 +455,7 @@
void DatabaseImpl::CreateIndex(int64_t transaction_id,
int64_t object_store_id,
int64_t index_id,
- const base::string16& name,
+ const std::u16string& name,
const IndexedDBKeyPath& key_path,
bool unique,
bool multi_entry) {
@@ -507,7 +507,7 @@
void DatabaseImpl::RenameIndex(int64_t transaction_id,
int64_t object_store_id,
int64_t index_id,
- const base::string16& new_name) {
+ const std::u16string& new_name) {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
if (!connection_->IsConnected())
return;
diff --git a/content/browser/indexed_db/database_impl.h b/content/browser/indexed_db/database_impl.h
index 5b9a550..d4a8196 100644
--- a/content/browser/indexed_db/database_impl.h
+++ b/content/browser/indexed_db/database_impl.h
@@ -44,7 +44,7 @@
// blink::mojom::IDBDatabase implementation
void RenameObjectStore(int64_t transaction_id,
int64_t object_store_id,
- const base::string16& new_name) override;
+ const std::u16string& new_name) override;
void CreateTransaction(
mojo::PendingAssociatedReceiver<blink::mojom::IDBTransaction>
transaction_receiver,
@@ -107,7 +107,7 @@
void CreateIndex(int64_t transaction_id,
int64_t object_store_id,
int64_t index_id,
- const base::string16& name,
+ const std::u16string& name,
const blink::IndexedDBKeyPath& key_path,
bool unique,
bool multi_entry) override;
@@ -117,7 +117,7 @@
void RenameIndex(int64_t transaction_id,
int64_t object_store_id,
int64_t index_id,
- const base::string16& new_name) override;
+ const std::u16string& new_name) override;
void Abort(int64_t transaction_id) override;
private:
diff --git a/content/browser/indexed_db/fake_indexed_db_metadata_coding.cc b/content/browser/indexed_db/fake_indexed_db_metadata_coding.cc
index d1af521..f6fb946a 100644
--- a/content/browser/indexed_db/fake_indexed_db_metadata_coding.cc
+++ b/content/browser/indexed_db/fake_indexed_db_metadata_coding.cc
@@ -22,14 +22,14 @@
leveldb::Status FakeIndexedDBMetadataCoding::ReadDatabaseNames(
TransactionalLevelDBDatabase* db,
const std::string& origin_identifier,
- std::vector<base::string16>* names) {
+ std::vector<std::u16string>* names) {
return Status::OK();
}
leveldb::Status FakeIndexedDBMetadataCoding::ReadMetadataForDatabaseName(
TransactionalLevelDBDatabase* db,
const std::string& origin_identifier,
- const base::string16& name,
+ const std::u16string& name,
IndexedDBDatabaseMetadata* metadata,
bool* found) {
return Status::OK();
@@ -38,7 +38,7 @@
leveldb::Status FakeIndexedDBMetadataCoding::CreateDatabase(
TransactionalLevelDBDatabase* database,
const std::string& origin_identifier,
- const base::string16& name,
+ const std::u16string& name,
int64_t version,
IndexedDBDatabaseMetadata* metadata) {
metadata->name = name;
@@ -58,7 +58,7 @@
leveldb::Status FakeIndexedDBMetadataCoding::FindDatabaseId(
TransactionalLevelDBDatabase* db,
const std::string& origin_identifier,
- const base::string16& name,
+ const std::u16string& name,
int64_t* id,
bool* found) {
return Status::OK();
@@ -68,7 +68,7 @@
TransactionalLevelDBTransaction* transaction,
int64_t database_id,
int64_t object_store_id,
- base::string16 name,
+ std::u16string name,
blink::IndexedDBKeyPath key_path,
bool auto_increment,
IndexedDBObjectStoreMetadata* metadata) {
@@ -83,8 +83,8 @@
leveldb::Status FakeIndexedDBMetadataCoding::RenameObjectStore(
TransactionalLevelDBTransaction* transaction,
int64_t database_id,
- base::string16 new_name,
- base::string16* old_name,
+ std::u16string new_name,
+ std::u16string* old_name,
IndexedDBObjectStoreMetadata* metadata) {
*old_name = std::move(metadata->name);
metadata->name = std::move(new_name);
@@ -103,7 +103,7 @@
int64_t database_id,
int64_t object_store_id,
int64_t index_id,
- base::string16 name,
+ std::u16string name,
blink::IndexedDBKeyPath key_path,
bool is_unique,
bool is_multi_entry,
@@ -120,8 +120,8 @@
TransactionalLevelDBTransaction* transaction,
int64_t database_id,
int64_t object_store_id,
- base::string16 new_name,
- base::string16* old_name,
+ std::u16string new_name,
+ std::u16string* old_name,
IndexedDBIndexMetadata* metadata) {
*old_name = std::move(metadata->name);
metadata->name = std::move(new_name);
diff --git a/content/browser/indexed_db/fake_indexed_db_metadata_coding.h b/content/browser/indexed_db/fake_indexed_db_metadata_coding.h
index 3d85fbe..f399a3d 100644
--- a/content/browser/indexed_db/fake_indexed_db_metadata_coding.h
+++ b/content/browser/indexed_db/fake_indexed_db_metadata_coding.h
@@ -35,18 +35,18 @@
leveldb::Status ReadDatabaseNames(
TransactionalLevelDBDatabase* db,
const std::string& origin_identifier,
- std::vector<base::string16>* names) override;
+ std::vector<std::u16string>* names) override;
leveldb::Status ReadMetadataForDatabaseName(
TransactionalLevelDBDatabase* db,
const std::string& origin_identifier,
- const base::string16& name,
+ const std::u16string& name,
blink::IndexedDBDatabaseMetadata* metadata,
bool* found) override;
leveldb::Status CreateDatabase(
TransactionalLevelDBDatabase* database,
const std::string& origin_identifier,
- const base::string16& name,
+ const std::u16string& name,
int64_t version,
blink::IndexedDBDatabaseMetadata* metadata) override;
@@ -58,7 +58,7 @@
leveldb::Status FindDatabaseId(TransactionalLevelDBDatabase* db,
const std::string& origin_identifier,
- const base::string16& name,
+ const std::u16string& name,
int64_t* id,
bool* found) override;
@@ -66,7 +66,7 @@
TransactionalLevelDBTransaction* transaction,
int64_t database_id,
int64_t object_store_id,
- base::string16 name,
+ std::u16string name,
blink::IndexedDBKeyPath key_path,
bool auto_increment,
blink::IndexedDBObjectStoreMetadata* metadata) override;
@@ -74,8 +74,8 @@
leveldb::Status RenameObjectStore(
TransactionalLevelDBTransaction* transaction,
int64_t database_id,
- base::string16 new_name,
- base::string16* old_name,
+ std::u16string new_name,
+ std::u16string* old_name,
blink::IndexedDBObjectStoreMetadata* metadata) override;
leveldb::Status DeleteObjectStore(
@@ -87,7 +87,7 @@
int64_t database_id,
int64_t object_store_id,
int64_t index_id,
- base::string16 name,
+ std::u16string name,
blink::IndexedDBKeyPath key_path,
bool is_unique,
bool is_multi_entry,
@@ -96,8 +96,8 @@
leveldb::Status RenameIndex(TransactionalLevelDBTransaction* transaction,
int64_t database_id,
int64_t object_store_id,
- base::string16 new_name,
- base::string16* old_name,
+ std::u16string new_name,
+ std::u16string* old_name,
blink::IndexedDBIndexMetadata* metadata) override;
leveldb::Status DeleteIndex(
diff --git a/content/browser/indexed_db/indexed_db_backing_store.cc b/content/browser/indexed_db/indexed_db_backing_store.cc
index 53a2ea87..e468c46d 100644
--- a/content/browser/indexed_db/indexed_db_backing_store.cc
+++ b/content/browser/indexed_db/indexed_db_backing_store.cc
@@ -317,9 +317,9 @@
while (!slice.empty()) {
bool is_file;
int64_t blob_number;
- base::string16 type;
+ std::u16string type;
int64_t size;
- base::string16 file_name;
+ std::u16string file_name;
if (!DecodeBool(&slice, &is_file))
return false;
@@ -362,9 +362,9 @@
case IndexedDBExternalObject::ObjectType::kBlob:
case IndexedDBExternalObject::ObjectType::kFile: {
int64_t blob_number;
- base::string16 type;
+ std::u16string type;
int64_t size;
- base::string16 file_name;
+ std::u16string file_name;
if (!DecodeVarInt(&slice, &blob_number) ||
!DatabaseMetaDataKey::IsValidBlobNumber(blob_number)) {
@@ -814,7 +814,7 @@
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
Status status = leveldb::Status::OK();
- std::vector<base::string16> names;
+ std::vector<std::u16string> names;
IndexedDBMetadataCoding metadata_coding;
status = metadata_coding.ReadDatabaseNames(db, origin_identifier_, &names);
if (!status.ok())
@@ -870,7 +870,7 @@
DCHECK(filesystem_proxy_);
Status status = leveldb::Status::OK();
- std::vector<base::string16> names;
+ std::vector<std::u16string> names;
IndexedDBMetadataCoding metadata_coding;
status = metadata_coding.ReadDatabaseNames(db, origin_identifier_, &names);
if (!status.ok())
@@ -957,7 +957,7 @@
DCHECK(filesystem_proxy_);
Status status = leveldb::Status::OK();
- std::vector<base::string16> names;
+ std::vector<std::u16string> names;
IndexedDBMetadataCoding metadata_coding;
status = metadata_coding.ReadDatabaseNames(db, origin_identifier_, &names);
if (!status.ok())
@@ -1097,7 +1097,7 @@
IndexedDBMetadataCoding metadata_coding;
leveldb::Status status = leveldb::Status::OK();
- std::vector<base::string16> names;
+ std::vector<std::u16string> names;
status =
metadata_coding.ReadDatabaseNames(db_.get(), origin_identifier_, &names);
if (!status.ok())
@@ -1140,7 +1140,7 @@
}
Status IndexedDBBackingStore::DeleteDatabase(
- const base::string16& name,
+ const std::u16string& name,
TransactionalLevelDBTransaction* transaction) {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
#if DCHECK_IS_ON()
diff --git a/content/browser/indexed_db/indexed_db_backing_store.h b/content/browser/indexed_db/indexed_db_backing_store.h
index 4ca4baa..d5a38539 100644
--- a/content/browser/indexed_db/indexed_db_backing_store.h
+++ b/content/browser/indexed_db/indexed_db_backing_store.h
@@ -417,7 +417,7 @@
// Compact is public for testing.
virtual void Compact();
virtual leveldb::Status DeleteDatabase(
- const base::string16& name,
+ const std::u16string& name,
TransactionalLevelDBTransaction* transaction);
static bool RecordCorruptionInfo(const base::FilePath& path_base,
diff --git a/content/browser/indexed_db/indexed_db_backing_store_unittest.cc b/content/browser/indexed_db/indexed_db_backing_store_unittest.cc
index d0fe4068..383d66b 100644
--- a/content/browser/indexed_db/indexed_db_backing_store_unittest.cc
+++ b/content/browser/indexed_db/indexed_db_backing_store_unittest.cc
@@ -516,8 +516,8 @@
key3_ = IndexedDBKey(ASCIIToUTF16("key3"));
}
- IndexedDBExternalObject CreateBlobInfo(const base::string16& file_name,
- const base::string16& type,
+ IndexedDBExternalObject CreateBlobInfo(const std::u16string& file_name,
+ const std::u16string& type,
base::Time last_modified,
int64_t size) {
auto uuid = base::GenerateGUID();
@@ -537,7 +537,7 @@
return info;
}
- IndexedDBExternalObject CreateBlobInfo(const base::string16& type,
+ IndexedDBExternalObject CreateBlobInfo(const std::u16string& type,
int64_t size) {
auto uuid = base::GenerateGUID();
mojo::PendingRemote<blink::mojom::Blob> remote;
@@ -1500,18 +1500,18 @@
base::RunLoop loop;
idb_context_->IDBTaskRunner()->PostTask(
FROM_HERE, base::BindLambdaForTesting([&]() {
- const base::string16 database_name(ASCIIToUTF16("db1"));
+ const std::u16string database_name(ASCIIToUTF16("db1"));
int64_t database_id;
const int64_t version = 9;
const int64_t object_store_id = 99;
- const base::string16 object_store_name(ASCIIToUTF16("object_store1"));
+ const std::u16string object_store_name(ASCIIToUTF16("object_store1"));
const bool auto_increment = true;
const IndexedDBKeyPath object_store_key_path(
ASCIIToUTF16("object_store_key"));
const int64_t index_id = 999;
- const base::string16 index_name(ASCIIToUTF16("index1"));
+ const std::u16string index_name(ASCIIToUTF16("index1"));
const bool unique = true;
const bool multi_entry = true;
const IndexedDBKeyPath index_key_path(ASCIIToUTF16("index_key"));
@@ -1595,12 +1595,12 @@
}
TEST_F(IndexedDBBackingStoreTest, GetDatabaseNames) {
- const base::string16 db1_name(ASCIIToUTF16("db1"));
+ const std::u16string db1_name(ASCIIToUTF16("db1"));
const int64_t db1_version = 1LL;
// Database records with DEFAULT_VERSION represent
// stale data, and should not be enumerated.
- const base::string16 db2_name(ASCIIToUTF16("db2"));
+ const std::u16string db2_name(ASCIIToUTF16("db2"));
const int64_t db2_version = IndexedDBDatabaseMetadata::DEFAULT_VERSION;
IndexedDBMetadataCoding metadata_coding;
@@ -1618,7 +1618,7 @@
EXPECT_TRUE(s.ok());
EXPECT_GT(db2.id, db1.id);
- std::vector<base::string16> names;
+ std::vector<std::u16string> names;
s = metadata_coding.ReadDatabaseNames(
backing_store()->db(), backing_store()->origin_identifier(), &names);
EXPECT_TRUE(s.ok());
@@ -1722,10 +1722,10 @@
// The database metadata needs to be written so we can verify the blob entry
// keys are not detected.
- const base::string16 database_name(ASCIIToUTF16("db1"));
+ const std::u16string database_name(ASCIIToUTF16("db1"));
const int64_t version = 9;
- const base::string16 object_store_name(ASCIIToUTF16("object_store1"));
+ const std::u16string object_store_name(ASCIIToUTF16("object_store1"));
const bool auto_increment = true;
const IndexedDBKeyPath object_store_key_path(
ASCIIToUTF16("object_store_key"));
@@ -1829,10 +1829,10 @@
// The database metadata needs to be written so the blob entry keys can
// be detected.
- const base::string16 database_name(ASCIIToUTF16("db1"));
+ const std::u16string database_name(ASCIIToUTF16("db1"));
const int64_t version = 9;
- const base::string16 object_store_name(ASCIIToUTF16("object_store1"));
+ const std::u16string object_store_name(ASCIIToUTF16("object_store1"));
const bool auto_increment = true;
const IndexedDBKeyPath object_store_key_path(
ASCIIToUTF16("object_store_key"));
@@ -1947,10 +1947,10 @@
int64_t database_id;
const int64_t object_store_id = 99;
- const base::string16 database_name(ASCIIToUTF16("db1"));
+ const std::u16string database_name(ASCIIToUTF16("db1"));
const int64_t version = 9;
- const base::string16 object_store_name(ASCIIToUTF16("object_store1"));
+ const std::u16string object_store_name(ASCIIToUTF16("object_store1"));
const bool auto_increment = true;
const IndexedDBKeyPath object_store_key_path(
ASCIIToUTF16("object_store_key"));
@@ -2093,10 +2093,10 @@
int64_t database_id;
const int64_t object_store_id = 99;
- const base::string16 database_name(ASCIIToUTF16("db1"));
+ const std::u16string database_name(ASCIIToUTF16("db1"));
const int64_t version = 9;
- const base::string16 object_store_name(ASCIIToUTF16("object_store1"));
+ const std::u16string object_store_name(ASCIIToUTF16("object_store1"));
const bool auto_increment = true;
const IndexedDBKeyPath object_store_key_path(
ASCIIToUTF16("object_store_key"));
diff --git a/content/browser/indexed_db/indexed_db_browsertest.cc b/content/browser/indexed_db/indexed_db_browsertest.cc
index e665f3bf..ec3ae44 100644
--- a/content/browser/indexed_db/indexed_db_browsertest.cc
+++ b/content/browser/indexed_db/indexed_db_browsertest.cc
@@ -144,7 +144,7 @@
if (hash)
url = GURL(url.spec() + hash);
- base::string16 expected_title16(ASCIIToUTF16(expected_string));
+ std::u16string expected_title16(ASCIIToUTF16(expected_string));
TitleWatcher title_watcher(shell->web_contents(), expected_title16);
EXPECT_TRUE(NavigateToURL(shell, url));
EXPECT_EQ(expected_title16, title_watcher.WaitAndGetTitle());
@@ -1105,7 +1105,7 @@
NavigateAndWaitForTitle(new_shell, "version_change_blocked.html", "#tab2",
"setVersion(3) blocked");
- base::string16 expected_title16(ASCIIToUTF16("setVersion(3) complete"));
+ std::u16string expected_title16(ASCIIToUTF16("setVersion(3) complete"));
TitleWatcher title_watcher(new_shell->web_contents(), expected_title16);
shell()->web_contents()->GetMainFrame()->GetProcess()->Shutdown(0);
@@ -1120,7 +1120,7 @@
constexpr char kFilename[] = "force_close_event.html";
NavigateAndWaitForTitle(shell(), kFilename, nullptr, "connection ready");
DeleteForOrigin(url::Origin::Create(GetTestUrl("indexeddb", kFilename)));
- base::string16 expected_title16(ASCIIToUTF16("connection closed"));
+ std::u16string expected_title16(ASCIIToUTF16("connection closed"));
TitleWatcher title_watcher(shell()->web_contents(), expected_title16);
title_watcher.AlsoWaitForTitle(ASCIIToUTF16("connection closed with error"));
EXPECT_EQ(expected_title16, title_watcher.WaitAndGetTitle());
diff --git a/content/browser/indexed_db/indexed_db_class_factory.cc b/content/browser/indexed_db/indexed_db_class_factory.cc
index 58c6c3e..e63e70c 100644
--- a/content/browser/indexed_db/indexed_db_class_factory.cc
+++ b/content/browser/indexed_db/indexed_db_class_factory.cc
@@ -91,7 +91,7 @@
std::pair<std::unique_ptr<IndexedDBDatabase>, leveldb::Status>
IndexedDBClassFactory::CreateIndexedDBDatabase(
- const base::string16& name,
+ const std::u16string& name,
IndexedDBBackingStore* backing_store,
IndexedDBFactory* factory,
TasksAvailableCallback tasks_available_callback,
diff --git a/content/browser/indexed_db/indexed_db_class_factory.h b/content/browser/indexed_db/indexed_db_class_factory.h
index ab5bf0b..6ce550a 100644
--- a/content/browser/indexed_db/indexed_db_class_factory.h
+++ b/content/browser/indexed_db/indexed_db_class_factory.h
@@ -62,7 +62,7 @@
// database has tasks to run.
virtual std::pair<std::unique_ptr<IndexedDBDatabase>, leveldb::Status>
CreateIndexedDBDatabase(
- const base::string16& name,
+ const std::u16string& name,
IndexedDBBackingStore* backing_store,
IndexedDBFactory* factory,
TasksAvailableCallback tasks_available_callback,
diff --git a/content/browser/indexed_db/indexed_db_connection_coordinator.cc b/content/browser/indexed_db/indexed_db_connection_coordinator.cc
index b32a531..258104c 100644
--- a/content/browser/indexed_db/indexed_db_connection_coordinator.cc
+++ b/content/browser/indexed_db/indexed_db_connection_coordinator.cc
@@ -146,7 +146,7 @@
saved_leveldb_status_ = db_->OpenInternal();
if (!saved_leveldb_status_.ok()) {
// TODO(jsbell): Consider including sanitized leveldb status message.
- base::string16 message;
+ std::u16string message;
if (pending_->version == IndexedDBDatabaseMetadata::NO_VERSION) {
message = ASCIIToUTF16(
"Internal error opening database with no version specified.");
diff --git a/content/browser/indexed_db/indexed_db_context_impl.cc b/content/browser/indexed_db/indexed_db_context_impl.cc
index 4de2739..1daf306 100644
--- a/content/browser/indexed_db/indexed_db_context_impl.cc
+++ b/content/browser/indexed_db/indexed_db_context_impl.cc
@@ -824,8 +824,8 @@
void IndexedDBContextImpl::NotifyIndexedDBContentChanged(
const Origin& origin,
- const base::string16& database_name,
- const base::string16& object_store_name) {
+ const std::u16string& database_name,
+ const std::u16string& object_store_name) {
for (auto& observer : observers_) {
observer->OnIndexedDBContentChanged(origin, database_name,
object_store_name);
diff --git a/content/browser/indexed_db/indexed_db_context_impl.h b/content/browser/indexed_db/indexed_db_context_impl.h
index e7983cf..b245f54 100644
--- a/content/browser/indexed_db/indexed_db_context_impl.h
+++ b/content/browser/indexed_db/indexed_db_context_impl.h
@@ -202,8 +202,8 @@
void NotifyIndexedDBListChanged(const url::Origin& origin);
void NotifyIndexedDBContentChanged(const url::Origin& origin,
- const base::string16& database_name,
- const base::string16& object_store_name);
+ const std::u16string& database_name,
+ const std::u16string& object_store_name);
private:
friend class base::RefCountedThreadSafe<IndexedDBContextImpl>;
diff --git a/content/browser/indexed_db/indexed_db_database.cc b/content/browser/indexed_db/indexed_db_database.cc
index 84efb3d..bd882b84 100644
--- a/content/browser/indexed_db/indexed_db_database.cc
+++ b/content/browser/indexed_db/indexed_db_database.cc
@@ -92,7 +92,7 @@
}
IndexedDBDatabaseError CreateError(blink::mojom::IDBException code,
- const base::string16& message,
+ const std::u16string& message,
IndexedDBTransaction* transaction) {
transaction->IncrementNumErrorsSent();
return IndexedDBDatabaseError(code, message);
@@ -153,7 +153,7 @@
default;
IndexedDBDatabase::IndexedDBDatabase(
- const base::string16& name,
+ const std::u16string& name,
IndexedDBBackingStore* backing_store,
IndexedDBFactory* factory,
IndexedDBClassFactory* class_factory,
@@ -428,7 +428,7 @@
leveldb::Status IndexedDBDatabase::CreateObjectStoreOperation(
int64_t object_store_id,
- const base::string16& name,
+ const std::u16string& name,
const IndexedDBKeyPath& key_path,
bool auto_increment,
IndexedDBTransaction* transaction) {
@@ -514,7 +514,7 @@
leveldb::Status IndexedDBDatabase::RenameObjectStoreOperation(
int64_t object_store_id,
- const base::string16& new_name,
+ const std::u16string& new_name,
IndexedDBTransaction* transaction) {
DCHECK(transaction);
IDB_TRACE1("IndexedDBDatabase::RenameObjectStore", "txn.id",
@@ -531,7 +531,7 @@
IndexedDBObjectStoreMetadata& object_store_metadata =
metadata_.object_stores[object_store_id];
- base::string16 old_name;
+ std::u16string old_name;
Status s = metadata_coding_->RenameObjectStore(
transaction->BackingStoreTransaction()->transaction(),
@@ -550,7 +550,7 @@
void IndexedDBDatabase::RenameObjectStoreAbortOperation(
int64_t object_store_id,
- base::string16 old_name) {
+ std::u16string old_name) {
IDB_TRACE("IndexedDBDatabase::RenameObjectStoreAbortOperation");
DCHECK(metadata_.object_stores.find(object_store_id) !=
@@ -590,7 +590,7 @@
leveldb::Status IndexedDBDatabase::CreateIndexOperation(
int64_t object_store_id,
int64_t index_id,
- const base::string16& name,
+ const std::u16string& name,
const IndexedDBKeyPath& key_path,
bool unique,
bool multi_entry,
@@ -679,7 +679,7 @@
leveldb::Status IndexedDBDatabase::RenameIndexOperation(
int64_t object_store_id,
int64_t index_id,
- const base::string16& new_name,
+ const std::u16string& new_name,
IndexedDBTransaction* transaction) {
DCHECK(transaction);
IDB_TRACE1("IndexedDBDatabase::RenameIndex", "txn.id", transaction->id());
@@ -694,7 +694,7 @@
IndexedDBIndexMetadata& index_metadata =
metadata_.object_stores[object_store_id].indexes[index_id];
- base::string16 old_name;
+ std::u16string old_name;
Status s = metadata_coding_->RenameIndex(
transaction->BackingStoreTransaction()->transaction(),
transaction->database()->id(), object_store_id, new_name, &old_name,
@@ -711,7 +711,7 @@
void IndexedDBDatabase::RenameIndexAbortOperation(int64_t object_store_id,
int64_t index_id,
- base::string16 old_name) {
+ std::u16string old_name) {
IDB_TRACE("IndexedDBDatabase::RenameIndexAbortOperation");
DCHECK(metadata_.object_stores.find(object_store_id) !=
@@ -1146,7 +1146,7 @@
}
std::vector<std::unique_ptr<IndexWriter>> index_writers;
- base::string16 error_message;
+ std::u16string error_message;
bool obeys_constraints = false;
bool backing_store_success = MakeIndexWriters(
transaction, backing_store_, id(), object_store, *key, key_was_generated,
@@ -1266,7 +1266,7 @@
std::vector<blink::IndexedDBKey> keys;
for (auto& put_param : params) {
std::vector<std::unique_ptr<IndexWriter>> index_writers;
- base::string16 error_message;
+ std::u16string error_message;
IndexedDBBackingStore::RecordIdentifier record_identifier;
bool obeys_constraints = false;
bool backing_store_success = MakeIndexWriters(
@@ -1353,7 +1353,7 @@
}
std::vector<std::unique_ptr<IndexWriter>> index_writers;
- base::string16 error_message;
+ std::u16string error_message;
bool obeys_constraints = false;
DCHECK(metadata_.object_stores.find(object_store_id) !=
metadata_.object_stores.end());
diff --git a/content/browser/indexed_db/indexed_db_database.h b/content/browser/indexed_db/indexed_db_database.h
index 978fef2..0b8b05f 100644
--- a/content/browser/indexed_db/indexed_db_database.h
+++ b/content/browser/indexed_db/indexed_db_database.h
@@ -63,7 +63,7 @@
class CONTENT_EXPORT IndexedDBDatabase {
public:
// Identifier is pair of (origin, database name).
- using Identifier = std::pair<url::Origin, base::string16>;
+ using Identifier = std::pair<url::Origin, std::u16string>;
// Used to report irrecoverable backend errors. The second argument can be
// null.
using ErrorCallback =
@@ -78,7 +78,7 @@
IndexedDBBackingStore* backing_store() { return backing_store_; }
int64_t id() const { return metadata_.id; }
- const base::string16& name() const { return metadata_.name; }
+ const std::u16string& name() const { return metadata_.name; }
const url::Origin& origin() const { return identifier_.first; }
const blink::IndexedDBDatabaseMetadata& metadata() const { return metadata_; }
@@ -151,7 +151,7 @@
leveldb::Status CreateObjectStoreOperation(
int64_t object_store_id,
- const base::string16& name,
+ const std::u16string& name,
const blink::IndexedDBKeyPath& key_path,
bool auto_increment,
IndexedDBTransaction* transaction);
@@ -163,10 +163,10 @@
blink::IndexedDBObjectStoreMetadata object_store_metadata);
leveldb::Status RenameObjectStoreOperation(int64_t object_store_id,
- const base::string16& new_name,
+ const std::u16string& new_name,
IndexedDBTransaction* transaction);
void RenameObjectStoreAbortOperation(int64_t object_store_id,
- base::string16 old_name);
+ std::u16string old_name);
leveldb::Status VersionChangeOperation(
int64_t version,
@@ -176,7 +176,7 @@
leveldb::Status CreateIndexOperation(int64_t object_store_id,
int64_t index_id,
- const base::string16& name,
+ const std::u16string& name,
const blink::IndexedDBKeyPath& key_path,
bool unique,
bool multi_entry,
@@ -191,11 +191,11 @@
leveldb::Status RenameIndexOperation(int64_t object_store_id,
int64_t index_id,
- const base::string16& new_name,
+ const std::u16string& new_name,
IndexedDBTransaction* transaction);
void RenameIndexAbortOperation(int64_t object_store_id,
int64_t index_id,
- base::string16 old_name);
+ std::u16string old_name);
leveldb::Status GetOperation(
base::WeakPtr<IndexedDBDispatcherHost> dispatcher_host,
@@ -322,7 +322,7 @@
friend class IndexedDBConnectionCoordinator::OpenRequest;
friend class IndexedDBConnectionCoordinator::DeleteRequest;
- IndexedDBDatabase(const base::string16& name,
+ IndexedDBDatabase(const std::u16string& name,
IndexedDBBackingStore* backing_store,
IndexedDBFactory* factory,
IndexedDBClassFactory* class_factory,
diff --git a/content/browser/indexed_db/indexed_db_database_error.cc b/content/browser/indexed_db/indexed_db_database_error.cc
index 649d834b..c5adce5 100644
--- a/content/browser/indexed_db/indexed_db_database_error.cc
+++ b/content/browser/indexed_db/indexed_db_database_error.cc
@@ -18,7 +18,7 @@
: code_(code), message_(base::ASCIIToUTF16(message)) {}
IndexedDBDatabaseError::IndexedDBDatabaseError(blink::mojom::IDBException code,
- const base::string16& message)
+ const std::u16string& message)
: code_(code), message_(message) {}
IndexedDBDatabaseError::~IndexedDBDatabaseError() = default;
diff --git a/content/browser/indexed_db/indexed_db_database_error.h b/content/browser/indexed_db/indexed_db_database_error.h
index e4a2a09..10adf89 100644
--- a/content/browser/indexed_db/indexed_db_database_error.h
+++ b/content/browser/indexed_db/indexed_db_database_error.h
@@ -21,17 +21,17 @@
explicit IndexedDBDatabaseError(blink::mojom::IDBException code);
IndexedDBDatabaseError(blink::mojom::IDBException code, const char* message);
IndexedDBDatabaseError(blink::mojom::IDBException code,
- const base::string16& message);
+ const std::u16string& message);
~IndexedDBDatabaseError();
IndexedDBDatabaseError& operator=(const IndexedDBDatabaseError& rhs);
blink::mojom::IDBException code() const { return code_; }
- const base::string16& message() const { return message_; }
+ const std::u16string& message() const { return message_; }
private:
blink::mojom::IDBException code_ = blink::mojom::IDBException::kNoError;
- base::string16 message_;
+ std::u16string message_;
};
} // namespace content
diff --git a/content/browser/indexed_db/indexed_db_dispatcher_host.cc b/content/browser/indexed_db/indexed_db_dispatcher_host.cc
index 3727bfd..683eebd 100644
--- a/content/browser/indexed_db/indexed_db_dispatcher_host.cc
+++ b/content/browser/indexed_db/indexed_db_dispatcher_host.cc
@@ -285,7 +285,7 @@
mojo::PendingAssociatedRemote<blink::mojom::IDBCallbacks> pending_callbacks,
mojo::PendingAssociatedRemote<blink::mojom::IDBDatabaseCallbacks>
database_callbacks_remote,
- const base::string16& name,
+ const std::u16string& name,
int64_t version,
mojo::PendingAssociatedReceiver<blink::mojom::IDBTransaction>
transaction_receiver,
@@ -315,7 +315,7 @@
void IndexedDBDispatcherHost::DeleteDatabase(
mojo::PendingAssociatedRemote<blink::mojom::IDBCallbacks> pending_callbacks,
- const base::string16& name,
+ const std::u16string& name,
bool force_close) {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
diff --git a/content/browser/indexed_db/indexed_db_dispatcher_host.h b/content/browser/indexed_db/indexed_db_dispatcher_host.h
index 2e45354..b00483b 100644
--- a/content/browser/indexed_db/indexed_db_dispatcher_host.h
+++ b/content/browser/indexed_db/indexed_db_dispatcher_host.h
@@ -111,14 +111,14 @@
pending_callbacks,
mojo::PendingAssociatedRemote<blink::mojom::IDBDatabaseCallbacks>
database_callbacks_remote,
- const base::string16& name,
+ const std::u16string& name,
int64_t version,
mojo::PendingAssociatedReceiver<blink::mojom::IDBTransaction>
transaction_receiver,
int64_t transaction_id) override;
void DeleteDatabase(mojo::PendingAssociatedRemote<blink::mojom::IDBCallbacks>
pending_callbacks,
- const base::string16& name,
+ const std::u16string& name,
bool force_close) override;
void AbortTransactionsAndCompactDatabase(
AbortTransactionsAndCompactDatabaseCallback callback) override;
diff --git a/content/browser/indexed_db/indexed_db_dispatcher_host_unittest.cc b/content/browser/indexed_db/indexed_db_dispatcher_host_unittest.cc
index 957b4c8..4a17337 100644
--- a/content/browser/indexed_db/indexed_db_dispatcher_host_unittest.cc
+++ b/content/browser/indexed_db/indexed_db_dispatcher_host_unittest.cc
@@ -95,7 +95,7 @@
TestDatabaseConnection(scoped_refptr<base::SequencedTaskRunner> task_runner,
url::Origin origin,
- base::string16 db_name,
+ std::u16string db_name,
int64_t version,
int64_t upgrade_txn_id)
: task_runner(std::move(task_runner)),
@@ -125,7 +125,7 @@
scoped_refptr<base::SequencedTaskRunner> task_runner;
url::Origin origin;
- base::string16 db_name;
+ std::u16string db_name;
int64_t version;
int64_t upgrade_txn_id;
@@ -159,8 +159,8 @@
void OnIndexedDBContentChanged(
const url::Origin& origin,
- const base::string16& database_name,
- const base::string16& object_store_name) override {
+ const std::u16string& database_name,
+ const std::u16string& object_store_name) override {
++notify_content_changed_count;
}
@@ -529,7 +529,7 @@
external_objects.push_back(
blink::mojom::IDBExternalObject::NewBlobOrFile(
blink::mojom::IDBBlobInfo::New(std::move(blob), "fakeUUID",
- base::string16(), 100,
+ std::u16string(), 100,
nullptr)));
std::string value = "hello";
@@ -1432,9 +1432,9 @@
TEST_F(IndexedDBDispatcherHostTest, DatabaseOperationSequencing) {
const int64_t kDBVersion = 1;
const int64_t kTransactionId = 1;
- const base::string16 kObjectStoreName1 = base::ASCIIToUTF16("os1");
- const base::string16 kObjectStoreName2 = base::ASCIIToUTF16("os2");
- const base::string16 kObjectStoreName3 = base::ASCIIToUTF16("os3");
+ const std::u16string kObjectStoreName1 = base::ASCIIToUTF16("os1");
+ const std::u16string kObjectStoreName2 = base::ASCIIToUTF16("os2");
+ const std::u16string kObjectStoreName3 = base::ASCIIToUTF16("os3");
std::unique_ptr<TestDatabaseConnection> connection;
IndexedDBDatabaseMetadata metadata;
diff --git a/content/browser/indexed_db/indexed_db_external_object.cc b/content/browser/indexed_db/indexed_db_external_object.cc
index 97f10f4..38b68efa 100644
--- a/content/browser/indexed_db/indexed_db_external_object.cc
+++ b/content/browser/indexed_db/indexed_db_external_object.cc
@@ -56,7 +56,7 @@
IndexedDBExternalObject::IndexedDBExternalObject(
mojo::PendingRemote<blink::mojom::Blob> blob_remote,
const std::string& uuid,
- const base::string16& type,
+ const std::u16string& type,
int64_t size)
: object_type_(ObjectType::kBlob),
blob_remote_(std::move(blob_remote)),
@@ -64,7 +64,7 @@
type_(type),
size_(size) {}
-IndexedDBExternalObject::IndexedDBExternalObject(const base::string16& type,
+IndexedDBExternalObject::IndexedDBExternalObject(const std::u16string& type,
int64_t size,
int64_t blob_number)
: object_type_(ObjectType::kBlob),
@@ -75,8 +75,8 @@
IndexedDBExternalObject::IndexedDBExternalObject(
mojo::PendingRemote<blink::mojom::Blob> blob_remote,
const std::string& uuid,
- const base::string16& file_name,
- const base::string16& type,
+ const std::u16string& file_name,
+ const std::u16string& type,
const base::Time& last_modified,
const int64_t size)
: object_type_(ObjectType::kFile),
@@ -89,8 +89,8 @@
IndexedDBExternalObject::IndexedDBExternalObject(
int64_t blob_number,
- const base::string16& type,
- const base::string16& file_name,
+ const std::u16string& type,
+ const std::u16string& file_name,
const base::Time& last_modified,
const int64_t size)
: object_type_(ObjectType::kFile),
diff --git a/content/browser/indexed_db/indexed_db_external_object.h b/content/browser/indexed_db/indexed_db_external_object.h
index 4e78b41..90f337a 100644
--- a/content/browser/indexed_db/indexed_db_external_object.h
+++ b/content/browser/indexed_db/indexed_db_external_object.h
@@ -42,9 +42,9 @@
// These two are used for Blobs.
IndexedDBExternalObject(mojo::PendingRemote<blink::mojom::Blob> blob_remote,
const std::string& uuid,
- const base::string16& type,
+ const std::u16string& type,
int64_t size);
- IndexedDBExternalObject(const base::string16& type,
+ IndexedDBExternalObject(const std::u16string& type,
int64_t size,
int64_t blob_number);
// These two are used for Files.
@@ -54,13 +54,13 @@
// it should be considered corrupt.
IndexedDBExternalObject(mojo::PendingRemote<blink::mojom::Blob> blob_remote,
const std::string& uuid,
- const base::string16& file_name,
- const base::string16& type,
+ const std::u16string& file_name,
+ const std::u16string& type,
const base::Time& last_modified,
const int64_t size);
IndexedDBExternalObject(int64_t blob_number,
- const base::string16& type,
- const base::string16& file_name,
+ const std::u16string& type,
+ const std::u16string& file_name,
const base::Time& last_modified,
const int64_t size);
// These are for File System Access handles.
@@ -89,9 +89,9 @@
}
void Clone(mojo::PendingReceiver<blink::mojom::Blob> receiver) const;
mojo::SharedRemote<blink::mojom::Blob> remote() const { return blob_remote_; }
- const base::string16& type() const { return type_; }
+ const std::u16string& type() const { return type_; }
int64_t size() const { return size_; }
- const base::string16& file_name() const { return file_name_; }
+ const std::u16string& file_name() const { return file_name_; }
const base::FilePath indexed_db_file_path() const {
return indexed_db_file_path_;
}
@@ -130,14 +130,14 @@
// If blob_remote_ is true, this is the blob's uuid.
std::string uuid_;
// Mime type.
- base::string16 type_;
+ std::u16string type_;
// This is the path of the file that was copied into the IndexedDB system.
// Only populated when reading from the database.
base::FilePath indexed_db_file_path_;
// -1 if unknown for File.
int64_t size_ = kUnknownSize;
// Only for File.
- base::string16 file_name_;
+ std::u16string file_name_;
// Only for File; valid only if size is.
base::Time last_modified_;
diff --git a/content/browser/indexed_db/indexed_db_factory.h b/content/browser/indexed_db/indexed_db_factory.h
index a0f5ffae..d2f735ee 100644
--- a/content/browser/indexed_db/indexed_db_factory.h
+++ b/content/browser/indexed_db/indexed_db_factory.h
@@ -37,23 +37,21 @@
virtual ~IndexedDBFactory() = default;
using OriginDBMap =
- base::flat_map<base::string16, std::unique_ptr<IndexedDBDatabase>>;
+ base::flat_map<std::u16string, std::unique_ptr<IndexedDBDatabase>>;
virtual void GetDatabaseInfo(scoped_refptr<IndexedDBCallbacks> callbacks,
const url::Origin& origin,
const base::FilePath& data_directory) = 0;
- virtual void Open(
- const base::string16& name,
- std::unique_ptr<IndexedDBPendingConnection> connection,
- const url::Origin& origin,
- const base::FilePath& data_directory) = 0;
+ virtual void Open(const std::u16string& name,
+ std::unique_ptr<IndexedDBPendingConnection> connection,
+ const url::Origin& origin,
+ const base::FilePath& data_directory) = 0;
- virtual void DeleteDatabase(
- const base::string16& name,
- scoped_refptr<IndexedDBCallbacks> callbacks,
- const url::Origin& origin,
- const base::FilePath& data_directory,
- bool force_close) = 0;
+ virtual void DeleteDatabase(const std::u16string& name,
+ scoped_refptr<IndexedDBCallbacks> callbacks,
+ const url::Origin& origin,
+ const base::FilePath& data_directory,
+ bool force_close) = 0;
virtual void AbortTransactionsAndCompactDatabase(
base::OnceCallback<void(leveldb::Status)> callback,
@@ -99,8 +97,8 @@
virtual void NotifyIndexedDBContentChanged(
const url::Origin& origin,
- const base::string16& database_name,
- const base::string16& object_store_name) = 0;
+ const std::u16string& database_name,
+ const std::u16string& object_store_name) = 0;
protected:
IndexedDBFactory() {}
diff --git a/content/browser/indexed_db/indexed_db_factory_impl.cc b/content/browser/indexed_db/indexed_db_factory_impl.cc
index 106c72b..585e7f2 100644
--- a/content/browser/indexed_db/indexed_db_factory_impl.cc
+++ b/content/browser/indexed_db/indexed_db_factory_impl.cc
@@ -232,7 +232,7 @@
}
void IndexedDBFactoryImpl::Open(
- const base::string16& name,
+ const std::u16string& name,
std::unique_ptr<IndexedDBPendingConnection> connection,
const Origin& origin,
const base::FilePath& data_directory) {
@@ -287,7 +287,7 @@
}
void IndexedDBFactoryImpl::DeleteDatabase(
- const base::string16& name,
+ const std::u16string& name,
scoped_refptr<IndexedDBCallbacks> callbacks,
const Origin& origin,
const base::FilePath& data_directory,
@@ -329,7 +329,7 @@
// TODO(dmurph): Get rid of on-demand metadata loading, and store metadata
// in-memory in the backing store.
IndexedDBMetadataCoding metadata_coding;
- std::vector<base::string16> names;
+ std::vector<std::u16string> names;
s = metadata_coding.ReadDatabaseNames(
factory->backing_store()->db(),
factory->backing_store()->origin_identifier(), &names);
@@ -561,8 +561,8 @@
void IndexedDBFactoryImpl::NotifyIndexedDBContentChanged(
const url::Origin& origin,
- const base::string16& database_name,
- const base::string16& object_store_name) {
+ const std::u16string& database_name,
+ const std::u16string& object_store_name) {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
if (!context_)
return;
@@ -1013,7 +1013,7 @@
}
bool IndexedDBFactoryImpl::IsDatabaseOpen(const Origin& origin,
- const base::string16& name) const {
+ const std::u16string& name) const {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
auto it = factories_per_origin_.find(origin);
if (it == factories_per_origin_.end())
diff --git a/content/browser/indexed_db/indexed_db_factory_impl.h b/content/browser/indexed_db/indexed_db_factory_impl.h
index 72ea9fa5..ec382485 100644
--- a/content/browser/indexed_db/indexed_db_factory_impl.h
+++ b/content/browser/indexed_db/indexed_db_factory_impl.h
@@ -65,12 +65,12 @@
void GetDatabaseInfo(scoped_refptr<IndexedDBCallbacks> callbacks,
const url::Origin& origin,
const base::FilePath& data_directory) override;
- void Open(const base::string16& name,
+ void Open(const std::u16string& name,
std::unique_ptr<IndexedDBPendingConnection> connection,
const url::Origin& origin,
const base::FilePath& data_directory) override;
- void DeleteDatabase(const base::string16& name,
+ void DeleteDatabase(const std::u16string& name,
scoped_refptr<IndexedDBCallbacks> callbacks,
const url::Origin& origin,
const base::FilePath& data_directory,
@@ -114,8 +114,8 @@
void NotifyIndexedDBContentChanged(
const url::Origin& origin,
- const base::string16& database_name,
- const base::string16& object_store_name) override;
+ const std::u16string& database_name,
+ const std::u16string& object_store_name) override;
int64_t GetInMemoryDBSize(const url::Origin& origin) const override;
@@ -213,7 +213,7 @@
// Testing helpers, so unit tests don't need to grovel through internal
// state.
bool IsDatabaseOpen(const url::Origin& origin,
- const base::string16& name) const;
+ const std::u16string& name) const;
bool IsBackingStoreOpen(const url::Origin& origin) const;
bool IsBackingStorePendingClose(const url::Origin& origin) const;
diff --git a/content/browser/indexed_db/indexed_db_factory_unittest.cc b/content/browser/indexed_db/indexed_db_factory_unittest.cc
index 2903c09..1c45a75 100644
--- a/content/browser/indexed_db/indexed_db_factory_unittest.cc
+++ b/content/browser/indexed_db/indexed_db_factory_unittest.cc
@@ -146,7 +146,7 @@
std::tuple<std::unique_ptr<IndexedDBConnection>,
scoped_refptr<MockIndexedDBDatabaseCallbacks>>
CreateConnectionForDatatabase(const Origin& origin,
- const base::string16& name) {
+ const std::u16string& name) {
auto callbacks = base::MakeRefCounted<MockIndexedDBCallbacks>();
auto db_callbacks = base::MakeRefCounted<MockIndexedDBDatabaseCallbacks>();
const int64_t transaction_id = 1;
@@ -749,7 +749,7 @@
SetupContext();
const Origin origin = Origin::Create(GURL("http://localhost:81"));
- const base::string16 name = ASCIIToUTF16("db");
+ const std::u16string name = ASCIIToUTF16("db");
std::unique_ptr<IndexedDBConnection> connection;
scoped_refptr<MockIndexedDBDatabaseCallbacks> db_callbacks;
@@ -853,7 +853,7 @@
base::MakeRefCounted<IndexedDBDatabaseCallbacks>(
nullptr, mojo::NullAssociatedRemote(), context()->IDBTaskRunner());
const Origin origin = Origin::Create(GURL("http://localhost:81"));
- const base::string16 name(ASCIIToUTF16("name"));
+ const std::u16string name(ASCIIToUTF16("name"));
auto create_transaction_callback =
base::BindOnce(&CreateAndBindTransactionPlaceholder);
auto connection = std::make_unique<IndexedDBPendingConnection>(
@@ -906,7 +906,7 @@
TEST_F(IndexedDBFactoryTest, DatabaseFailedOpen) {
SetupContext();
const Origin origin = Origin::Create(GURL("http://localhost:81"));
- const base::string16 db_name(ASCIIToUTF16("db"));
+ const std::u16string db_name(ASCIIToUTF16("db"));
const int64_t transaction_id = 1;
auto callbacks = base::MakeRefCounted<MockIndexedDBCallbacks>();
diff --git a/content/browser/indexed_db/indexed_db_fake_backing_store.cc b/content/browser/indexed_db/indexed_db_fake_backing_store.cc
index 1fe9947..0dbe6a6 100644
--- a/content/browser/indexed_db/indexed_db_fake_backing_store.cc
+++ b/content/browser/indexed_db/indexed_db_fake_backing_store.cc
@@ -60,7 +60,7 @@
IndexedDBFakeBackingStore::~IndexedDBFakeBackingStore() = default;
leveldb::Status IndexedDBFakeBackingStore::DeleteDatabase(
- const base::string16& name,
+ const std::u16string& name,
TransactionalLevelDBTransaction* transaction) {
return leveldb::Status::OK();
}
diff --git a/content/browser/indexed_db/indexed_db_fake_backing_store.h b/content/browser/indexed_db/indexed_db_fake_backing_store.h
index e4762c51..9ee2c77 100644
--- a/content/browser/indexed_db/indexed_db_fake_backing_store.h
+++ b/content/browser/indexed_db/indexed_db_fake_backing_store.h
@@ -34,7 +34,7 @@
~IndexedDBFakeBackingStore() override;
leveldb::Status DeleteDatabase(
- const base::string16& name,
+ const std::u16string& name,
TransactionalLevelDBTransaction* transaction) override;
leveldb::Status PutRecord(IndexedDBBackingStore::Transaction* transaction,
diff --git a/content/browser/indexed_db/indexed_db_index_writer.cc b/content/browser/indexed_db/indexed_db_index_writer.cc
index bf1ade76..8d274a5 100644
--- a/content/browser/indexed_db/indexed_db_index_writer.cc
+++ b/content/browser/indexed_db/indexed_db_index_writer.cc
@@ -40,7 +40,7 @@
int64_t index_id,
bool* can_add_keys,
const IndexedDBKey& primary_key,
- base::string16* error_message) const {
+ std::u16string* error_message) const {
*can_add_keys = false;
for (const auto& key : keys_) {
bool ok = AddingKeyAllowed(backing_store, transaction, database_id,
@@ -119,7 +119,7 @@
bool key_was_generated,
const std::vector<IndexedDBIndexKeys>& index_keys,
std::vector<std::unique_ptr<IndexWriter>>* index_writers,
- base::string16* error_message,
+ std::u16string* error_message,
bool* completed) {
*completed = false;
diff --git a/content/browser/indexed_db/indexed_db_index_writer.h b/content/browser/indexed_db/indexed_db_index_writer.h
index cae2210..4d4aca3 100644
--- a/content/browser/indexed_db/indexed_db_index_writer.h
+++ b/content/browser/indexed_db/indexed_db_index_writer.h
@@ -40,7 +40,7 @@
int64_t index_id,
bool* can_add_keys,
const blink::IndexedDBKey& primary_key,
- base::string16* error_message) const WARN_UNUSED_RESULT;
+ std::u16string* error_message) const WARN_UNUSED_RESULT;
leveldb::Status WriteIndexKeys(
const IndexedDBBackingStore::RecordIdentifier& record,
@@ -75,7 +75,7 @@
bool key_was_generated,
const std::vector<blink::IndexedDBIndexKeys>& index_keys,
std::vector<std::unique_ptr<IndexWriter>>* index_writers,
- base::string16* error_message,
+ std::u16string* error_message,
bool* completed) WARN_UNUSED_RESULT;
} // namespace content
diff --git a/content/browser/indexed_db/indexed_db_leveldb_coding.cc b/content/browser/indexed_db/indexed_db_leveldb_coding.cc
index 60e9c762..292d0bbb 100644
--- a/content/browser/indexed_db/indexed_db_leveldb_coding.cc
+++ b/content/browser/indexed_db/indexed_db_leveldb_coding.cc
@@ -128,7 +128,7 @@
} while (n);
}
-void EncodeString(const base::string16& value, std::string* into) {
+void EncodeString(const std::u16string& value, std::string* into) {
if (value.empty())
return;
// Backing store is UTF-16BE, convert from host endianness.
@@ -154,7 +154,7 @@
DCHECK(into->size() >= value.size());
}
-void EncodeStringWithLength(const base::string16& value, std::string* into) {
+void EncodeStringWithLength(const std::u16string& value, std::string* into) {
EncodeVarInt(value.length(), into);
EncodeString(value, into);
}
@@ -235,7 +235,7 @@
break;
}
case blink::mojom::IDBKeyPathType::Array: {
- const std::vector<base::string16>& array = value.array();
+ const std::vector<std::u16string>& array = value.array();
size_t count = array.size();
EncodeVarInt(count, into);
for (size_t i = 0; i < count; ++i) {
@@ -288,7 +288,7 @@
return true;
}
-bool DecodeString(StringPiece* slice, base::string16* value) {
+bool DecodeString(StringPiece* slice, std::u16string* value) {
if (slice->empty()) {
value->clear();
return true;
@@ -297,7 +297,7 @@
// Backing store is UTF-16BE, convert to host endianness.
DCHECK(!(slice->size() % sizeof(char16_t)));
size_t length = slice->size() / sizeof(char16_t);
- base::string16 decoded;
+ std::u16string decoded;
decoded.reserve(length);
const char16_t* encoded = reinterpret_cast<const char16_t*>(slice->begin());
for (unsigned i = 0; i < length; ++i)
@@ -308,7 +308,7 @@
return true;
}
-bool DecodeStringWithLength(StringPiece* slice, base::string16* value) {
+bool DecodeStringWithLength(StringPiece* slice, std::u16string* value) {
if (slice->empty())
return false;
@@ -398,7 +398,7 @@
return true;
}
case kIndexedDBKeyStringTypeByte: {
- base::string16 s;
+ std::u16string s;
if (!DecodeStringWithLength(slice, &s))
return false;
*value = std::make_unique<IndexedDBKey>(std::move(s));
@@ -449,7 +449,7 @@
// always written as typed.
if (slice->size() < 3 || (*slice)[0] != kIndexedDBKeyPathTypeCodedByte1 ||
(*slice)[1] != kIndexedDBKeyPathTypeCodedByte2) {
- base::string16 s;
+ std::u16string s;
if (!DecodeString(slice, &s))
return false;
*value = IndexedDBKeyPath(s);
@@ -468,7 +468,7 @@
*value = IndexedDBKeyPath();
return true;
case blink::mojom::IDBKeyPathType::String: {
- base::string16 string;
+ std::u16string string;
if (!DecodeStringWithLength(slice, &string))
return false;
DCHECK(slice->empty());
@@ -476,13 +476,13 @@
return true;
}
case blink::mojom::IDBKeyPathType::Array: {
- std::vector<base::string16> array;
+ std::vector<std::u16string> array;
int64_t count;
if (!DecodeVarInt(slice, &count))
return false;
DCHECK_GE(count, 0);
while (count--) {
- base::string16 string;
+ std::u16string string;
if (!DecodeStringWithLength(slice, &string))
return false;
array.push_back(string);
@@ -1575,7 +1575,7 @@
}
std::string DatabaseNameKey::Encode(const std::string& origin_identifier,
- const base::string16& database_name) {
+ const std::u16string& database_name) {
std::string ret = KeyPrefix::EncodeEmpty();
ret.push_back(kDatabaseNameTypeByte);
EncodeStringWithLength(base::ASCIIToUTF16(origin_identifier), &ret);
@@ -1585,7 +1585,7 @@
std::string DatabaseNameKey::EncodeMinKeyForOrigin(
const std::string& origin_identifier) {
- return Encode(origin_identifier, base::string16());
+ return Encode(origin_identifier, std::u16string());
}
std::string DatabaseNameKey::EncodeStopKeyForOrigin(
@@ -1943,7 +1943,7 @@
std::string ObjectStoreNamesKey::Encode(
int64_t database_id,
- const base::string16& object_store_name) {
+ const std::u16string& object_store_name) {
KeyPrefix prefix(database_id);
std::string ret = prefix.Encode();
ret.push_back(kObjectStoreNamesTypeByte);
@@ -1986,7 +1986,7 @@
std::string IndexNamesKey::Encode(int64_t database_id,
int64_t object_store_id,
- const base::string16& index_name) {
+ const std::u16string& index_name) {
KeyPrefix prefix(database_id);
std::string ret = prefix.Encode();
ret.push_back(kIndexNamesKeyTypeByte);
diff --git a/content/browser/indexed_db/indexed_db_leveldb_coding.h b/content/browser/indexed_db/indexed_db_leveldb_coding.h
index 8434474..300bb08 100644
--- a/content/browser/indexed_db/indexed_db_leveldb_coding.h
+++ b/content/browser/indexed_db/indexed_db_leveldb_coding.h
@@ -51,9 +51,9 @@
// number. The Decoder must know how to calculate the size of the encoded int,
// typically by having this reside at the end of the value or key.
CONTENT_EXPORT void EncodeInt(int64_t value, std::string* into);
-CONTENT_EXPORT void EncodeString(const base::string16& value,
+CONTENT_EXPORT void EncodeString(const std::u16string& value,
std::string* into);
-CONTENT_EXPORT void EncodeStringWithLength(const base::string16& value,
+CONTENT_EXPORT void EncodeStringWithLength(const std::u16string& value,
std::string* into);
CONTENT_EXPORT void EncodeBinary(const std::string& value, std::string* into);
CONTENT_EXPORT void EncodeBinary(base::span<const uint8_t> value,
@@ -73,10 +73,10 @@
CONTENT_EXPORT WARN_UNUSED_RESULT bool DecodeInt(base::StringPiece* slice,
int64_t* value);
CONTENT_EXPORT WARN_UNUSED_RESULT bool DecodeString(base::StringPiece* slice,
- base::string16* value);
+ std::u16string* value);
CONTENT_EXPORT WARN_UNUSED_RESULT bool DecodeStringWithLength(
base::StringPiece* slice,
- base::string16* value);
+ std::u16string* value);
CONTENT_EXPORT WARN_UNUSED_RESULT bool DecodeBinary(base::StringPiece* slice,
std::string* value);
// The returned span is only valid as long as the date behind |slice| is
@@ -276,20 +276,20 @@
public:
static bool Decode(base::StringPiece* slice, DatabaseNameKey* result);
CONTENT_EXPORT static std::string Encode(const std::string& origin_identifier,
- const base::string16& database_name);
+ const std::u16string& database_name);
static std::string EncodeMinKeyForOrigin(
const std::string& origin_identifier);
static std::string EncodeStopKeyForOrigin(
const std::string& origin_identifier);
- base::string16 origin() const { return origin_; }
- base::string16 database_name() const { return database_name_; }
+ std::u16string origin() const { return origin_; }
+ std::u16string database_name() const { return database_name_; }
int Compare(const DatabaseNameKey& other);
std::string DebugString() const;
private:
- base::string16 origin_; // TODO(jsbell): Store encoded strings, or just
+ std::u16string origin_; // TODO(jsbell): Store encoded strings, or just
// pointers.
- base::string16 database_name_;
+ std::u16string database_name_;
};
class DatabaseMetaDataKey {
@@ -422,15 +422,15 @@
static bool Decode(base::StringPiece* slice, ObjectStoreNamesKey* result);
CONTENT_EXPORT static std::string Encode(
int64_t database_id,
- const base::string16& object_store_name);
+ const std::u16string& object_store_name);
int Compare(const ObjectStoreNamesKey& other);
std::string DebugString() const;
- base::string16 object_store_name() const { return object_store_name_; }
+ std::u16string object_store_name() const { return object_store_name_; }
private:
// TODO(jsbell): Store the encoded string, or just pointers to it.
- base::string16 object_store_name_;
+ std::u16string object_store_name_;
};
class IndexNamesKey {
@@ -441,15 +441,15 @@
static bool Decode(base::StringPiece* slice, IndexNamesKey* result);
CONTENT_EXPORT static std::string Encode(int64_t database_id,
int64_t object_store_id,
- const base::string16& index_name);
+ const std::u16string& index_name);
int Compare(const IndexNamesKey& other);
std::string DebugString() const;
- base::string16 index_name() const { return index_name_; }
+ std::u16string index_name() const { return index_name_; }
private:
int64_t object_store_id_;
- base::string16 index_name_;
+ std::u16string index_name_;
};
class ObjectStoreDataKey {
diff --git a/content/browser/indexed_db/indexed_db_leveldb_coding_encodeidbkey_fuzzer.cc b/content/browser/indexed_db/indexed_db_leveldb_coding_encodeidbkey_fuzzer.cc
index 99df2ad..5b18543 100644
--- a/content/browser/indexed_db/indexed_db_leveldb_coding_encodeidbkey_fuzzer.cc
+++ b/content/browser/indexed_db/indexed_db_leveldb_coding_encodeidbkey_fuzzer.cc
@@ -73,7 +73,7 @@
if (fuzzed_data->remaining_bytes() < 1)
return IndexedDBKey(base::UTF8ToUTF16(std::string()));
auto str_size = fuzzed_data->ConsumeIntegral<size_t>();
- base::string16 data_str =
+ std::u16string data_str =
base::UTF8ToUTF16(fuzzed_data->ConsumeBytesAsString(str_size));
return IndexedDBKey(data_str);
}
diff --git a/content/browser/indexed_db/indexed_db_leveldb_coding_encodeidbkeypath_fuzzer.cc b/content/browser/indexed_db/indexed_db_leveldb_coding_encodeidbkeypath_fuzzer.cc
index 642d4f7..f91d2b1 100644
--- a/content/browser/indexed_db/indexed_db_leveldb_coding_encodeidbkeypath_fuzzer.cc
+++ b/content/browser/indexed_db/indexed_db_leveldb_coding_encodeidbkeypath_fuzzer.cc
@@ -33,7 +33,7 @@
// Create and add string16s to |paths| until |vector_size| is reached or the
// end of |data| is reached.
- std::vector<base::string16> paths;
+ std::vector<std::u16string> paths;
for (size_t i = 0; i < vector_size && fuzzed_data->remaining_bytes() > 0;
++i) {
// Consume sizeof(size_t) bytes to determine the size of the string to
diff --git a/content/browser/indexed_db/indexed_db_leveldb_coding_unittest.cc b/content/browser/indexed_db/indexed_db_leveldb_coding_unittest.cc
index 2359329..2c5f087d 100644
--- a/content/browser/indexed_db/indexed_db_leveldb_coding_unittest.cc
+++ b/content/browser/indexed_db/indexed_db_leveldb_coding_unittest.cc
@@ -253,7 +253,7 @@
}
}
-static std::string WrappedEncodeString(base::string16 value) {
+static std::string WrappedEncodeString(std::u16string value) {
std::string buffer;
EncodeString(value, &buffer);
return buffer;
@@ -266,20 +266,20 @@
EXPECT_EQ(0u, WrappedEncodeString(ASCIIToUTF16("")).size());
EXPECT_EQ(2u, WrappedEncodeString(ASCIIToUTF16("a")).size());
EXPECT_EQ(6u, WrappedEncodeString(ASCIIToUTF16("foo")).size());
- EXPECT_EQ(6u, WrappedEncodeString(base::string16(test_string_a)).size());
- EXPECT_EQ(4u, WrappedEncodeString(base::string16(test_string_b)).size());
+ EXPECT_EQ(6u, WrappedEncodeString(std::u16string(test_string_a)).size());
+ EXPECT_EQ(4u, WrappedEncodeString(std::u16string(test_string_b)).size());
}
TEST(IndexedDBLevelDBCodingTest, DecodeString) {
const char16_t test_string_a[] = {'f', 'o', 'o', '\0'};
const char16_t test_string_b[] = {0xdead, 0xbeef, '\0'};
- std::vector<base::string16> test_cases = {base::string16(), ASCIIToUTF16("a"),
+ std::vector<std::u16string> test_cases = {std::u16string(), ASCIIToUTF16("a"),
ASCIIToUTF16("foo"), test_string_a,
test_string_b};
for (size_t i = 0; i < test_cases.size(); ++i) {
- const base::string16& test_case = test_cases[i];
+ const std::u16string& test_case = test_cases[i];
std::string v = WrappedEncodeString(test_case);
StringPiece slice;
@@ -287,7 +287,7 @@
slice = StringPiece(&*v.begin(), v.size());
}
- base::string16 result;
+ std::u16string result;
EXPECT_TRUE(DecodeString(&slice, &result));
EXPECT_EQ(test_case, result);
EXPECT_TRUE(slice.empty());
@@ -301,7 +301,7 @@
}
}
-static std::string WrappedEncodeStringWithLength(base::string16 value) {
+static std::string WrappedEncodeStringWithLength(std::u16string value) {
std::string buffer;
EncodeStringWithLength(value, &buffer);
return buffer;
@@ -311,12 +311,12 @@
const char16_t test_string_a[] = {'f', 'o', 'o', '\0'};
const char16_t test_string_b[] = {0xdead, 0xbeef, '\0'};
- EXPECT_EQ(1u, WrappedEncodeStringWithLength(base::string16()).size());
+ EXPECT_EQ(1u, WrappedEncodeStringWithLength(std::u16string()).size());
EXPECT_EQ(3u, WrappedEncodeStringWithLength(ASCIIToUTF16("a")).size());
EXPECT_EQ(
- 7u, WrappedEncodeStringWithLength(base::string16(test_string_a)).size());
+ 7u, WrappedEncodeStringWithLength(std::u16string(test_string_a)).size());
EXPECT_EQ(
- 5u, WrappedEncodeStringWithLength(base::string16(test_string_b)).size());
+ 5u, WrappedEncodeStringWithLength(std::u16string(test_string_b)).size());
}
TEST(IndexedDBLevelDBCodingTest, DecodeStringWithLength) {
@@ -329,19 +329,19 @@
long_string[i] = i;
long_string[kLongStringLen] = 0;
- std::vector<base::string16> test_cases = {ASCIIToUTF16(""),
+ std::vector<std::u16string> test_cases = {ASCIIToUTF16(""),
ASCIIToUTF16("a"),
ASCIIToUTF16("foo"),
- base::string16(test_string_a),
- base::string16(test_string_b),
- base::string16(long_string)};
+ std::u16string(test_string_a),
+ std::u16string(test_string_b),
+ std::u16string(long_string)};
for (size_t i = 0; i < test_cases.size(); ++i) {
- base::string16 s = test_cases[i];
+ std::u16string s = test_cases[i];
std::string v = WrappedEncodeStringWithLength(s);
ASSERT_GT(v.size(), 0u);
StringPiece slice(v);
- base::string16 res;
+ std::u16string res;
EXPECT_TRUE(DecodeStringWithLength(&slice, &res));
EXPECT_EQ(s, res);
EXPECT_TRUE(slice.empty());
@@ -382,24 +382,24 @@
const char16_t test_string_e[] = {0xd834, 0xdd1e, '\0'};
const char16_t test_string_f[] = {0xfffd, '\0'};
- std::vector<base::string16> test_cases = {
+ std::vector<std::u16string> test_cases = {
ASCIIToUTF16(""),
ASCIIToUTF16("a"),
ASCIIToUTF16("b"),
ASCIIToUTF16("baaa"),
ASCIIToUTF16("baab"),
ASCIIToUTF16("c"),
- base::string16(test_string_a),
- base::string16(test_string_b),
- base::string16(test_string_c),
- base::string16(test_string_d),
- base::string16(test_string_e),
- base::string16(test_string_f),
+ std::u16string(test_string_a),
+ std::u16string(test_string_b),
+ std::u16string(test_string_c),
+ std::u16string(test_string_d),
+ std::u16string(test_string_e),
+ std::u16string(test_string_f),
};
for (size_t i = 0; i < test_cases.size() - 1; ++i) {
- base::string16 a = test_cases[i];
- base::string16 b = test_cases[i + 1];
+ std::u16string a = test_cases[i];
+ std::u16string b = test_cases[i + 1];
EXPECT_LT(a.compare(b), 0);
EXPECT_GT(b.compare(a), 0);
@@ -567,7 +567,7 @@
}
{
- key_paths.push_back(IndexedDBKeyPath(base::string16()));
+ key_paths.push_back(IndexedDBKeyPath(std::u16string()));
char expected[] = {0, 0, // Header
1, // Type is string
0 // Length is 0
@@ -598,7 +598,7 @@
}
{
- std::vector<base::string16> array = {base::string16(), ASCIIToUTF16("foo"),
+ std::vector<std::u16string> array = {std::u16string(), ASCIIToUTF16("foo"),
ASCIIToUTF16("foo.bar")};
key_paths.push_back(IndexedDBKeyPath(array));
@@ -686,7 +686,7 @@
std::vector<std::string> encoded_paths;
{
- key_paths.push_back(IndexedDBKeyPath(base::string16()));
+ key_paths.push_back(IndexedDBKeyPath(std::u16string()));
encoded_paths.push_back(std::string());
}
{
diff --git a/content/browser/indexed_db/indexed_db_leveldb_operations.cc b/content/browser/indexed_db/indexed_db_leveldb_operations.cc
index 6c3d451e..e9c18c7 100644
--- a/content/browser/indexed_db/indexed_db_leveldb_operations.cc
+++ b/content/browser/indexed_db/indexed_db_leveldb_operations.cc
@@ -218,7 +218,7 @@
template <typename DBOrTransaction>
Status GetString(DBOrTransaction* db,
const StringPiece& key,
- base::string16* found_string,
+ std::u16string* found_string,
bool* found) {
std::string result;
*found = false;
@@ -236,17 +236,17 @@
template Status GetString<TransactionalLevelDBTransaction>(
TransactionalLevelDBTransaction* txn,
const StringPiece& key,
- base::string16* found_string,
+ std::u16string* found_string,
bool* found);
template Status GetString<TransactionalLevelDBDatabase>(
TransactionalLevelDBDatabase* db,
const StringPiece& key,
- base::string16* found_string,
+ std::u16string* found_string,
bool* found);
leveldb::Status PutString(TransactionalLevelDBTransaction* transaction,
const StringPiece& key,
- const base::string16& value) {
+ const std::u16string& value) {
std::string buffer;
EncodeString(value, &buffer);
return transaction->Put(key, &buffer);
diff --git a/content/browser/indexed_db/indexed_db_leveldb_operations.h b/content/browser/indexed_db/indexed_db_leveldb_operations.h
index e3e2886..131dd07 100644
--- a/content/browser/indexed_db/indexed_db_leveldb_operations.h
+++ b/content/browser/indexed_db/indexed_db_leveldb_operations.h
@@ -132,13 +132,13 @@
template <typename DBOrTransaction>
WARN_UNUSED_RESULT leveldb::Status GetString(DBOrTransaction* db,
const base::StringPiece& key,
- base::string16* found_string,
+ std::u16string* found_string,
bool* found);
WARN_UNUSED_RESULT leveldb::Status PutString(
TransactionalLevelDBTransaction* transaction,
const base::StringPiece& key,
- const base::string16& value);
+ const std::u16string& value);
WARN_UNUSED_RESULT leveldb::Status PutIDBKeyPath(
TransactionalLevelDBTransaction* transaction,
diff --git a/content/browser/indexed_db/indexed_db_metadata_coding.cc b/content/browser/indexed_db/indexed_db_metadata_coding.cc
index 706cf31b..fc7873d 100644
--- a/content/browser/indexed_db/indexed_db_metadata_coding.cc
+++ b/content/browser/indexed_db/indexed_db_metadata_coding.cc
@@ -102,7 +102,7 @@
// TODO(jsbell): Do this by direct key lookup rather than iteration, to
// simplify.
int64_t index_id = meta_data_key.IndexId();
- base::string16 index_name;
+ std::u16string index_name;
{
StringPiece slice(it->Value());
if (!DecodeString(&slice, &index_name) || !slice.empty())
@@ -211,7 +211,7 @@
// TODO(jsbell): Do this by direct key lookup rather than iteration, to
// simplify.
- base::string16 object_store_name;
+ std::u16string object_store_name;
{
StringPiece slice(it->Value());
if (!DecodeString(&slice, &object_store_name) || !slice.empty())
@@ -415,7 +415,7 @@
Status ReadMetadataForDatabaseNameInternal(
DatabaseOrTransaction* db_or_transaction,
const std::string& origin_identifier,
- const base::string16& name,
+ const std::u16string& name,
IndexedDBDatabaseMetadata* metadata,
bool* found) {
IDB_TRACE("IndexedDBMetadataCoding::ReadMetadataForDatabaseName");
@@ -494,7 +494,7 @@
Status IndexedDBMetadataCoding::ReadDatabaseNames(
TransactionalLevelDBDatabase* db,
const std::string& origin_identifier,
- std::vector<base::string16>* names) {
+ std::vector<std::u16string>* names) {
std::vector<blink::mojom::IDBNameAndVersionPtr> names_and_versions;
Status s = ReadDatabaseNamesAndVersionsInternal(db, origin_identifier,
&names_and_versions);
@@ -507,7 +507,7 @@
Status IndexedDBMetadataCoding::ReadDatabaseNames(
TransactionalLevelDBTransaction* transaction,
const std::string& origin_identifier,
- std::vector<base::string16>* names) {
+ std::vector<std::u16string>* names) {
std::vector<blink::mojom::IDBNameAndVersionPtr> names_and_versions;
Status s = ReadDatabaseNamesAndVersionsInternal(
transaction, origin_identifier, &names_and_versions);
@@ -520,7 +520,7 @@
Status IndexedDBMetadataCoding::ReadMetadataForDatabaseName(
TransactionalLevelDBDatabase* db,
const std::string& origin_identifier,
- const base::string16& name,
+ const std::u16string& name,
IndexedDBDatabaseMetadata* metadata,
bool* found) {
return ReadMetadataForDatabaseNameInternal(db, origin_identifier, name,
@@ -530,7 +530,7 @@
Status IndexedDBMetadataCoding::ReadMetadataForDatabaseName(
TransactionalLevelDBTransaction* transaction,
const std::string& origin_identifier,
- const base::string16& name,
+ const std::u16string& name,
IndexedDBDatabaseMetadata* metadata,
bool* found) {
return ReadMetadataForDatabaseNameInternal(transaction, origin_identifier,
@@ -540,7 +540,7 @@
Status IndexedDBMetadataCoding::CreateDatabase(
TransactionalLevelDBDatabase* db,
const std::string& origin_identifier,
- const base::string16& name,
+ const std::u16string& name,
int64_t version,
IndexedDBDatabaseMetadata* metadata) {
// TODO(jsbell): Don't persist metadata if open fails. http://crbug.com/395472
@@ -612,7 +612,7 @@
Status IndexedDBMetadataCoding::FindDatabaseId(
TransactionalLevelDBDatabase* db,
const std::string& origin_identifier,
- const base::string16& name,
+ const std::u16string& name,
int64_t* id,
bool* found) {
const std::string key = DatabaseNameKey::Encode(origin_identifier, name);
@@ -628,7 +628,7 @@
TransactionalLevelDBTransaction* transaction,
int64_t database_id,
int64_t object_store_id,
- base::string16 name,
+ std::u16string name,
IndexedDBKeyPath key_path,
bool auto_increment,
IndexedDBObjectStoreMetadata* metadata) {
@@ -706,7 +706,7 @@
if (!KeyPrefix::ValidIds(database_id, object_store.id))
return InvalidDBKeyStatus();
- base::string16 object_store_name;
+ std::u16string object_store_name;
bool found = false;
Status s =
GetString(transaction,
@@ -756,8 +756,8 @@
Status IndexedDBMetadataCoding::RenameObjectStore(
TransactionalLevelDBTransaction* transaction,
int64_t database_id,
- base::string16 new_name,
- base::string16* old_name,
+ std::u16string new_name,
+ std::u16string* old_name,
IndexedDBObjectStoreMetadata* metadata) {
if (!KeyPrefix::ValidIds(database_id, metadata->id))
return InvalidDBKeyStatus();
@@ -767,7 +767,7 @@
const std::string new_names_key =
ObjectStoreNamesKey::Encode(database_id, new_name);
- base::string16 old_name_check;
+ std::u16string old_name_check;
bool found = false;
Status s = GetString(transaction, name_key, &old_name_check, &found);
// TODO(dmurph): Change DELETE_OBJECT_STORE to RENAME_OBJECT_STORE & fix UMA.
@@ -807,7 +807,7 @@
int64_t database_id,
int64_t object_store_id,
int64_t index_id,
- base::string16 name,
+ std::u16string name,
IndexedDBKeyPath key_path,
bool is_unique,
bool is_multi_entry,
@@ -873,8 +873,8 @@
TransactionalLevelDBTransaction* transaction,
int64_t database_id,
int64_t object_store_id,
- base::string16 new_name,
- base::string16* old_name,
+ std::u16string new_name,
+ std::u16string* old_name,
IndexedDBIndexMetadata* metadata) {
if (!KeyPrefix::ValidIds(database_id, object_store_id, metadata->id))
return InvalidDBKeyStatus();
diff --git a/content/browser/indexed_db/indexed_db_metadata_coding.h b/content/browser/indexed_db/indexed_db_metadata_coding.h
index 9327d2c..e2e858e 100644
--- a/content/browser/indexed_db/indexed_db_metadata_coding.h
+++ b/content/browser/indexed_db/indexed_db_metadata_coding.h
@@ -42,11 +42,11 @@
virtual leveldb::Status ReadDatabaseNames(
TransactionalLevelDBDatabase* db,
const std::string& origin_identifier,
- std::vector<base::string16>* names);
+ std::vector<std::u16string>* names);
virtual leveldb::Status ReadDatabaseNames(
TransactionalLevelDBTransaction* transaction,
const std::string& origin_identifier,
- std::vector<base::string16>* names);
+ std::vector<std::u16string>* names);
// Reads in the list of database names and versions for the given origin.
virtual leveldb::Status ReadDatabaseNamesAndVersions(
@@ -59,13 +59,13 @@
virtual leveldb::Status ReadMetadataForDatabaseName(
TransactionalLevelDBDatabase* db,
const std::string& origin_identifier,
- const base::string16& name,
+ const std::u16string& name,
blink::IndexedDBDatabaseMetadata* metadata,
bool* found);
virtual leveldb::Status ReadMetadataForDatabaseName(
TransactionalLevelDBTransaction* transaction,
const std::string& origin_identifier,
- const base::string16& name,
+ const std::u16string& name,
blink::IndexedDBDatabaseMetadata* metadata,
bool* found);
@@ -73,7 +73,7 @@
virtual leveldb::Status CreateDatabase(
TransactionalLevelDBDatabase* database,
const std::string& origin_identifier,
- const base::string16& name,
+ const std::u16string& name,
int64_t version,
blink::IndexedDBDatabaseMetadata* metadata);
@@ -87,7 +87,7 @@
// Reads only the database id, if found.
virtual leveldb::Status FindDatabaseId(TransactionalLevelDBDatabase* db,
const std::string& origin_identifier,
- const base::string16& name,
+ const std::u16string& name,
int64_t* id,
bool* found);
@@ -96,7 +96,7 @@
TransactionalLevelDBTransaction* transaction,
int64_t database_id,
int64_t object_store_id,
- base::string16 name,
+ std::u16string name,
blink::IndexedDBKeyPath key_path,
bool auto_increment,
blink::IndexedDBObjectStoreMetadata* metadata);
@@ -112,8 +112,8 @@
virtual leveldb::Status RenameObjectStore(
TransactionalLevelDBTransaction* transaction,
int64_t database_id,
- base::string16 new_name,
- base::string16* old_name,
+ std::u16string new_name,
+ std::u16string* old_name,
blink::IndexedDBObjectStoreMetadata* metadata);
// Creates a new index metadata and writes it to the transaction.
@@ -122,7 +122,7 @@
int64_t database_id,
int64_t object_store_id,
int64_t index_id,
- base::string16 name,
+ std::u16string name,
blink::IndexedDBKeyPath key_path,
bool is_unique,
bool is_multi_entry,
@@ -140,8 +140,8 @@
TransactionalLevelDBTransaction* transaction,
int64_t database_id,
int64_t object_store_id,
- base::string16 new_name,
- base::string16* old_name,
+ std::u16string new_name,
+ std::u16string* old_name,
blink::IndexedDBIndexMetadata* metadata);
private:
diff --git a/content/browser/indexed_db/indexed_db_origin_state.cc b/content/browser/indexed_db/indexed_db_origin_state.cc
index 951f5ac..6fd22b2 100644
--- a/content/browser/indexed_db/indexed_db_origin_state.cc
+++ b/content/browser/indexed_db/indexed_db_origin_state.cc
@@ -169,14 +169,14 @@
// Because finishing all transactions could cause a database to be destructed
// (which would mutate the database_ map), save the keys beforehand and use
// those.
- std::vector<base::string16> origins;
+ std::vector<std::u16string> origins;
origins.reserve(databases_.size());
for (const auto& pair : databases_) {
origins.push_back(pair.first);
}
base::WeakPtr<IndexedDBOriginState> weak_ptr = AsWeakPtr();
- for (const base::string16& origin : origins) {
+ for (const std::u16string& origin : origins) {
auto it = databases_.find(origin);
if (it == databases_.end())
continue;
@@ -279,7 +279,7 @@
}
IndexedDBDatabase* IndexedDBOriginState::AddDatabase(
- const base::string16& name,
+ const std::u16string& name,
std::unique_ptr<IndexedDBDatabase> database) {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
DCHECK(!base::Contains(databases_, name));
diff --git a/content/browser/indexed_db/indexed_db_origin_state.h b/content/browser/indexed_db/indexed_db_origin_state.h
index 20fc5de..894d6b6 100644
--- a/content/browser/indexed_db/indexed_db_origin_state.h
+++ b/content/browser/indexed_db/indexed_db_origin_state.h
@@ -54,7 +54,7 @@
public:
using TearDownCallback = base::RepeatingCallback<void(leveldb::Status)>;
using OriginDBMap =
- base::flat_map<base::string16, std::unique_ptr<IndexedDBDatabase>>;
+ base::flat_map<std::u16string, std::unique_ptr<IndexedDBDatabase>>;
// Maximum time interval between runs of the IndexedDBSweeper. Sweeping only
// occurs after backing store close.
@@ -180,7 +180,7 @@
// Test needs access to CompactionKillSwitchWorks.
FRIEND_TEST_ALL_PREFIXES(IndexedDBFactoryTest, CompactionKillSwitchWorks);
- IndexedDBDatabase* AddDatabase(const base::string16& name,
+ IndexedDBDatabase* AddDatabase(const std::u16string& name,
std::unique_ptr<IndexedDBDatabase> database);
// Returns a new handle to this factory. If this object was in its closing
diff --git a/content/browser/indexed_db/indexed_db_pre_close_task_queue_unittest.cc b/content/browser/indexed_db/indexed_db_pre_close_task_queue_unittest.cc
index f0493a60..197f240 100644
--- a/content/browser/indexed_db/indexed_db_pre_close_task_queue_unittest.cc
+++ b/content/browser/indexed_db/indexed_db_pre_close_task_queue_unittest.cc
@@ -30,7 +30,7 @@
namespace {
constexpr base::TimeDelta kTestMaxRunTime = base::TimeDelta::FromSeconds(30);
-const base::string16 kDBName = base::ASCIIToUTF16("TestDBName");
+const std::u16string kDBName = base::ASCIIToUTF16("TestDBName");
constexpr int64_t kDBId = 1;
constexpr int64_t kDBVersion = 2;
constexpr int64_t kDBMaxObjectStoreId = 29;
diff --git a/content/browser/indexed_db/mock_browsertest_indexed_db_class_factory.cc b/content/browser/indexed_db/mock_browsertest_indexed_db_class_factory.cc
index 4d2f46e..06a754e 100644
--- a/content/browser/indexed_db/mock_browsertest_indexed_db_class_factory.cc
+++ b/content/browser/indexed_db/mock_browsertest_indexed_db_class_factory.cc
@@ -56,7 +56,7 @@
class IndexedDBTestDatabase : public IndexedDBDatabase {
public:
IndexedDBTestDatabase(
- const base::string16& name,
+ const std::u16string& name,
IndexedDBBackingStore* backing_store,
IndexedDBFactory* factory,
IndexedDBClassFactory* class_factory,
@@ -370,7 +370,7 @@
std::pair<std::unique_ptr<IndexedDBDatabase>, leveldb::Status>
MockBrowserTestIndexedDBClassFactory::CreateIndexedDBDatabase(
- const base::string16& name,
+ const std::u16string& name,
IndexedDBBackingStore* backing_store,
IndexedDBFactory* factory,
TasksAvailableCallback tasks_available_callback,
diff --git a/content/browser/indexed_db/mock_browsertest_indexed_db_class_factory.h b/content/browser/indexed_db/mock_browsertest_indexed_db_class_factory.h
index a9c818d..8922fd2 100644
--- a/content/browser/indexed_db/mock_browsertest_indexed_db_class_factory.h
+++ b/content/browser/indexed_db/mock_browsertest_indexed_db_class_factory.h
@@ -44,7 +44,7 @@
std::pair<std::unique_ptr<IndexedDBDatabase>, leveldb::Status>
CreateIndexedDBDatabase(
- const base::string16& name,
+ const std::u16string& name,
IndexedDBBackingStore* backing_store,
IndexedDBFactory* factory,
TasksAvailableCallback tasks_available_callback,
diff --git a/content/browser/indexed_db/mock_indexed_db_factory.h b/content/browser/indexed_db/mock_indexed_db_factory.h
index f50653e3..1a0fdd89 100644
--- a/content/browser/indexed_db/mock_indexed_db_factory.h
+++ b/content/browser/indexed_db/mock_indexed_db_factory.h
@@ -28,21 +28,20 @@
void(scoped_refptr<IndexedDBCallbacks> callbacks,
const url::Origin& origin,
const base::FilePath& data_directory));
- MOCK_METHOD4(
- OpenProxy,
- void(const base::string16& name,
- IndexedDBPendingConnection* connection,
- const url::Origin& origin,
- const base::FilePath& data_directory));
+ MOCK_METHOD4(OpenProxy,
+ void(const std::u16string& name,
+ IndexedDBPendingConnection* connection,
+ const url::Origin& origin,
+ const base::FilePath& data_directory));
// Googlemock can't deal with move-only types, so *Proxy() is a workaround.
- void Open(const base::string16& name,
+ void Open(const std::u16string& name,
std::unique_ptr<IndexedDBPendingConnection> connection,
const url::Origin& origin,
const base::FilePath& data_directory) override {
OpenProxy(name, connection.get(), origin, data_directory);
}
MOCK_METHOD5(DeleteDatabase,
- void(const base::string16& name,
+ void(const std::u16string& name,
scoped_refptr<IndexedDBCallbacks> callbacks,
const url::Origin& origin,
const base::FilePath& data_directory,
@@ -95,8 +94,8 @@
MOCK_METHOD1(NotifyIndexedDBListChanged, void(const url::Origin& origin));
MOCK_METHOD3(NotifyIndexedDBContentChanged,
void(const url::Origin& origin,
- const base::string16& database_name,
- const base::string16& object_store_name));
+ const std::u16string& database_name,
+ const std::u16string& object_store_name));
private:
DISALLOW_COPY_AND_ASSIGN(MockIndexedDBFactory);
diff --git a/content/browser/indexed_db/mock_mojo_indexed_db_callbacks.h b/content/browser/indexed_db/mock_mojo_indexed_db_callbacks.h
index 3fd3bb6..9c4d9a7e 100644
--- a/content/browser/indexed_db/mock_mojo_indexed_db_callbacks.h
+++ b/content/browser/indexed_db/mock_mojo_indexed_db_callbacks.h
@@ -31,13 +31,13 @@
MOCK_METHOD2(Error,
void(blink::mojom::IDBException code,
- const base::string16& message));
+ const std::u16string& message));
MOCK_METHOD1(SuccessNamesAndVersionsList,
void(std::vector<blink::mojom::IDBNameAndVersionPtr> list));
MOCK_METHOD1(SuccessStringList,
- void(const std::vector<base::string16>& value));
+ void(const std::vector<std::u16string>& value));
MOCK_METHOD1(Blocked, void(int64_t existing_version));
diff --git a/content/browser/indexed_db/mock_mojo_indexed_db_database_callbacks.h b/content/browser/indexed_db/mock_mojo_indexed_db_database_callbacks.h
index e5c9fe3..5c16eef 100644
--- a/content/browser/indexed_db/mock_mojo_indexed_db_database_callbacks.h
+++ b/content/browser/indexed_db/mock_mojo_indexed_db_database_callbacks.h
@@ -29,7 +29,7 @@
MOCK_METHOD3(Abort,
void(int64_t transaction_id,
blink::mojom::IDBException code,
- const base::string16& message));
+ const std::u16string& message));
MOCK_METHOD1(Complete, void(int64_t transaction_id));
private:
diff --git a/content/browser/indexed_db/transaction_impl.cc b/content/browser/indexed_db/transaction_impl.cc
index 09081d2e..1abde1c 100644
--- a/content/browser/indexed_db/transaction_impl.cc
+++ b/content/browser/indexed_db/transaction_impl.cc
@@ -44,7 +44,7 @@
}
void TransactionImpl::CreateObjectStore(int64_t object_store_id,
- const base::string16& name,
+ const std::u16string& name,
const blink::IndexedDBKeyPath& key_path,
bool auto_increment) {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
diff --git a/content/browser/indexed_db/transaction_impl.h b/content/browser/indexed_db/transaction_impl.h
index 4289b73..af93195 100644
--- a/content/browser/indexed_db/transaction_impl.h
+++ b/content/browser/indexed_db/transaction_impl.h
@@ -38,7 +38,7 @@
// blink::mojom::IDBTransaction implementation
void CreateObjectStore(int64_t object_store_id,
- const base::string16& name,
+ const std::u16string& name,
const blink::IndexedDBKeyPath& key_path,
bool auto_increment) override;
void DeleteObjectStore(int64_t object_store_id) override;
diff --git a/content/browser/loader/cors_file_origin_browsertest.cc b/content/browser/loader/cors_file_origin_browsertest.cc
index 2c3802c..c09f647 100644
--- a/content/browser/loader/cors_file_origin_browsertest.cc
+++ b/content/browser/loader/cors_file_origin_browsertest.cc
@@ -74,7 +74,7 @@
// Does not appear in the expectations, but the title can be on unexpected
// failures.
- base::string16 wrong_origin_string =
+ std::u16string wrong_origin_string =
base::ASCIIToUTF16("FAIL: response text does not match");
watcher->AlsoWaitForTitle(wrong_origin_string);
return watcher;
@@ -88,8 +88,8 @@
return "cors_file_origin_test.html";
}
- const base::string16& pass_string() const { return pass_string_; }
- const base::string16& fail_string() const { return fail_string_; }
+ const std::u16string& pass_string() const { return pass_string_; }
+ const std::u16string& fail_string() const { return fail_string_; }
uint16_t port() {
base::AutoLock lock(lock_);
@@ -174,8 +174,8 @@
uint16_t port_;
bool is_preflight_requested_ = false;
- const base::string16 pass_string_;
- const base::string16 fail_string_;
+ const std::u16string pass_string_;
+ const std::u16string fail_string_;
DISALLOW_COPY_AND_ASSIGN(CorsFileOriginBrowserTest);
};
diff --git a/content/browser/loader/cors_origin_pattern_setter_browsertest.cc b/content/browser/loader/cors_origin_pattern_setter_browsertest.cc
index 61e7a90a..3116e9c 100644
--- a/content/browser/loader/cors_origin_pattern_setter_browsertest.cc
+++ b/content/browser/loader/cors_origin_pattern_setter_browsertest.cc
@@ -110,8 +110,8 @@
std::string host_ip() { return embedded_test_server()->base_url().host(); }
- const base::string16& pass_string() const { return pass_string_; }
- const base::string16& fail_string() const { return fail_string_; }
+ const std::u16string& pass_string() const { return pass_string_; }
+ const std::u16string& fail_string() const { return fail_string_; }
WebContents* web_contents() { return shell()->web_contents(); }
@@ -129,9 +129,9 @@
embedded_test_server()->host_port_pair().host());
}
- const base::string16 pass_string_ = base::ASCIIToUTF16("PASS");
- const base::string16 fail_string_ = base::ASCIIToUTF16("FAIL");
- const base::string16 script_ = base::ASCIIToUTF16("reason");
+ const std::u16string pass_string_ = base::ASCIIToUTF16("PASS");
+ const std::u16string fail_string_ = base::ASCIIToUTF16("FAIL");
+ const std::u16string script_ = base::ASCIIToUTF16("reason");
DISALLOW_COPY_AND_ASSIGN(CorsOriginPatternSetterBrowserTest);
};
diff --git a/content/browser/loader/cors_preflight_cache_browsertest.cc b/content/browser/loader/cors_preflight_cache_browsertest.cc
index 4ff34e5..b20ec068 100644
--- a/content/browser/loader/cors_preflight_cache_browsertest.cc
+++ b/content/browser/loader/cors_preflight_cache_browsertest.cc
@@ -30,7 +30,7 @@
namespace {
const char kTestPath[] = "/loader/cors_preflight.html";
-const base::string16 kTestDone = base::string16(base::ASCIIToUTF16("DONE"));
+const std::u16string kTestDone = std::u16string(base::ASCIIToUTF16("DONE"));
// Tests end to end behaviors on CORS preflight and its cache.
class CorsPreflightCacheBrowserTest : public ContentBrowserTest {
diff --git a/content/browser/loader/cross_site_document_blocking_browsertest.cc b/content/browser/loader/cross_site_document_blocking_browsertest.cc
index 08be3f3e..33e7d9b 100644
--- a/content/browser/loader/cross_site_document_blocking_browsertest.cc
+++ b/content/browser/loader/cross_site_document_blocking_browsertest.cc
@@ -1160,7 +1160,7 @@
GURL main_url = app_cache_content_server.GetURL(
"/appcache/simple_page_with_manifest.html");
EXPECT_TRUE(NavigateToURL(shell(), main_url));
- base::string16 expected_title = base::ASCIIToUTF16("AppCache updated");
+ std::u16string expected_title = base::ASCIIToUTF16("AppCache updated");
content::TitleWatcher title_watcher(shell()->web_contents(), expected_title);
EXPECT_EQ(expected_title, title_watcher.WaitAndGetTitle());
EXPECT_TRUE(NavigateToURL(shell(), main_url));
@@ -1227,7 +1227,7 @@
GURL main_url = embedded_test_server()->GetURL(
"/site_isolation/appcached_cross_origin_resource.html");
EXPECT_TRUE(NavigateToURL(shell(), main_url));
- base::string16 expected_title = base::ASCIIToUTF16("AppCache updated");
+ std::u16string expected_title = base::ASCIIToUTF16("AppCache updated");
content::TitleWatcher title_watcher(shell()->web_contents(), expected_title);
EXPECT_EQ(expected_title, title_watcher.WaitAndGetTitle());
@@ -1268,7 +1268,7 @@
GURL main_url = embedded_test_server()->GetURL(
"/appcache/simple_page_with_manifest.html");
EXPECT_TRUE(NavigateToURL(shell(), main_url));
- base::string16 expected_title = base::ASCIIToUTF16("AppCache updated");
+ std::u16string expected_title = base::ASCIIToUTF16("AppCache updated");
content::TitleWatcher title_watcher(shell()->web_contents(), expected_title);
EXPECT_EQ(expected_title, title_watcher.WaitAndGetTitle());
EXPECT_TRUE(NavigateToURL(shell(), main_url));
@@ -1322,7 +1322,7 @@
GURL main_url = embedded_test_server()->GetURL(
"/appcache/simple_page_with_manifest.html");
EXPECT_TRUE(NavigateToURL(shell(), main_url));
- base::string16 expected_title = base::ASCIIToUTF16("AppCache updated");
+ std::u16string expected_title = base::ASCIIToUTF16("AppCache updated");
content::TitleWatcher title_watcher(shell()->web_contents(), expected_title);
EXPECT_EQ(expected_title, title_watcher.WaitAndGetTitle());
EXPECT_TRUE(NavigateToURL(shell(), main_url));
diff --git a/content/browser/loader/file_url_loader_factory.cc b/content/browser/loader/file_url_loader_factory.cc
index fd3fe0f..06d857cb 100644
--- a/content/browser/loader/file_url_loader_factory.cc
+++ b/content/browser/loader/file_url_loader_factory.cc
@@ -263,7 +263,7 @@
if (!wrote_header_) {
wrote_header_ = true;
- const base::string16& title = path_.AsUTF16Unsafe();
+ const std::u16string& title = path_.AsUTF16Unsafe();
pending_data_.append(net::GetDirectoryListingHeader(title));
// If not a top-level directory, add a link to the parent directory. To
diff --git a/content/browser/loader/loader_browsertest.cc b/content/browser/loader/loader_browsertest.cc
index b756a63..1c0ee7e 100644
--- a/content/browser/loader/loader_browsertest.cc
+++ b/content/browser/loader/loader_browsertest.cc
@@ -76,13 +76,13 @@
}
void CheckTitleTest(const GURL& url, const std::string& expected_title) {
- base::string16 expected_title16(ASCIIToUTF16(expected_title));
+ std::u16string expected_title16(ASCIIToUTF16(expected_title));
TitleWatcher title_watcher(shell()->web_contents(), expected_title16);
EXPECT_TRUE(NavigateToURL(shell(), url));
EXPECT_EQ(expected_title16, title_watcher.WaitAndGetTitle());
}
- bool GetPopupTitle(const GURL& url, base::string16* title) {
+ bool GetPopupTitle(const GURL& url, std::u16string* title) {
EXPECT_TRUE(NavigateToURL(shell(), url));
ShellAddedObserver new_shell_observer;
@@ -119,7 +119,7 @@
ASSERT_TRUE(embedded_test_server()->Start());
GURL url(embedded_test_server()->GetURL("/dynamic1.html"));
- base::string16 title;
+ std::u16string title;
ASSERT_TRUE(GetPopupTitle(url, &title));
EXPECT_TRUE(base::StartsWith(title, ASCIIToUTF16("My Popup Title"),
base::CompareCase::SENSITIVE))
@@ -132,7 +132,7 @@
ASSERT_TRUE(embedded_test_server()->Start());
GURL url(embedded_test_server()->GetURL("/dynamic2.html"));
- base::string16 title;
+ std::u16string title;
ASSERT_TRUE(GetPopupTitle(url, &title));
EXPECT_TRUE(base::StartsWith(title, ASCIIToUTF16("My Dynamic Title"),
base::CompareCase::SENSITIVE))
@@ -159,7 +159,7 @@
// Wait for the stale-while-revalidate tests to pass by observing the page's
// title. If the renderer crashes, the test immediately fails.
- base::string16 expected_title = base::ASCIIToUTF16("Pass");
+ std::u16string expected_title = base::ASCIIToUTF16("Pass");
TitleWatcher title_watcher(web_contents, expected_title);
// The invocation of runTest() below starts a test written in JavaScript, that
@@ -481,7 +481,7 @@
// URLs are prohibited by policy from interacting with sensitive chrome
// pages of which the error page is one. Instead, use automation to kick
// off the navigation, and wait to see that the tab loads.
- base::string16 expected_title16(ASCIIToUTF16("Title Of Awesomeness"));
+ std::u16string expected_title16(ASCIIToUTF16("Title Of Awesomeness"));
TitleWatcher title_watcher(shell()->web_contents(), expected_title16);
bool success;
@@ -580,7 +580,7 @@
"http://localhost:%u/set_cookie.html", embedded_test_server()->port()));
GURL url(embedded_test_server()->GetURL("/redirect?" + set_cookie_url));
- base::string16 expected_title16(ASCIIToUTF16("cookie set"));
+ std::u16string expected_title16(ASCIIToUTF16("cookie set"));
TitleWatcher title_watcher(shell()->web_contents(), expected_title16);
EXPECT_TRUE(NavigateToURL(shell(), url,
GURL(set_cookie_url) /* expected_commit_url */));
diff --git a/content/browser/loader/prefetch_browsertest_base.cc b/content/browser/loader/prefetch_browsertest_base.cc
index 4d2c727..7f323e6 100644
--- a/content/browser/loader/prefetch_browsertest_base.cc
+++ b/content/browser/loader/prefetch_browsertest_base.cc
@@ -110,7 +110,7 @@
void PrefetchBrowserTestBase::NavigateToURLAndWaitTitle(
const GURL& url,
const std::string& title) {
- base::string16 title16 = base::ASCIIToUTF16(title);
+ std::u16string title16 = base::ASCIIToUTF16(title);
TitleWatcher title_watcher(shell()->web_contents(), title16);
// Execute the JavaScript code to triger the followup navigation from the
// current page.
diff --git a/content/browser/loader/quic_transport_browsertest.cc b/content/browser/loader/quic_transport_browsertest.cc
index ffb425ac..a40d143b 100644
--- a/content/browser/loader/quic_transport_browsertest.cc
+++ b/content/browser/loader/quic_transport_browsertest.cc
@@ -117,19 +117,19 @@
"I+ryIVl5ksb8KijTneC3y7z1wBFn5x35O5is9g5n/KM=");
}
- bool WaitForTitle(const base::string16& expected_title,
- const std::vector<base::string16> additional_titles) {
+ bool WaitForTitle(const std::u16string& expected_title,
+ const std::vector<std::u16string> additional_titles) {
TitleWatcher title_watcher(shell()->web_contents(), expected_title);
for (const auto& title : additional_titles) {
title_watcher.AlsoWaitForTitle(title);
}
- base::string16 actual_title = title_watcher.WaitAndGetTitle();
+ std::u16string actual_title = title_watcher.WaitAndGetTitle();
EXPECT_EQ(expected_title, actual_title);
return expected_title == actual_title;
}
- bool WaitForTitle(const base::string16& title) {
+ bool WaitForTitle(const std::u16string& title) {
return WaitForTitle(title, {});
}
diff --git a/content/browser/log_console_message.cc b/content/browser/log_console_message.cc
index e838818..76d45c1 100644
--- a/content/browser/log_console_message.cc
+++ b/content/browser/log_console_message.cc
@@ -33,11 +33,11 @@
}
void LogConsoleMessage(blink::mojom::ConsoleMessageLevel log_level,
- const base::string16& message,
+ const std::u16string& message,
int32_t line_number,
bool is_builtin_component,
bool is_off_the_record,
- const base::string16& source_id) {
+ const std::u16string& source_id) {
const int32_t resolved_level =
is_builtin_component ? ConsoleMessageLevelToLogSeverity(log_level)
: ::logging::LOG_INFO;
diff --git a/content/browser/log_console_message.h b/content/browser/log_console_message.h
index ab1508c..e194e6a4 100644
--- a/content/browser/log_console_message.h
+++ b/content/browser/log_console_message.h
@@ -19,11 +19,11 @@
// Optionally logs a message from the console, depending on the set logging
// levels and incognito state.
void LogConsoleMessage(blink::mojom::ConsoleMessageLevel log_level,
- const base::string16& message,
+ const std::u16string& message,
int32_t line_number,
bool is_builtin_component,
bool is_off_the_record,
- const base::string16& source_id);
+ const std::u16string& source_id);
} // namespace content
diff --git a/content/browser/manifest/manifest_browsertest.cc b/content/browser/manifest/manifest_browsertest.cc
index ceb6fb5..e30be52f 100644
--- a/content/browser/manifest/manifest_browsertest.cc
+++ b/content/browser/manifest/manifest_browsertest.cc
@@ -57,9 +57,9 @@
bool DidAddMessageToConsole(WebContents* source,
blink::mojom::ConsoleMessageLevel log_level,
- const base::string16& message,
+ const std::u16string& message,
int32_t line_no,
- const base::string16& source_id) override;
+ const std::u16string& source_id) override;
private:
WebContents* web_contents_;
@@ -186,9 +186,9 @@
bool MockWebContentsDelegate::DidAddMessageToConsole(
WebContents* source,
blink::mojom::ConsoleMessageLevel log_level,
- const base::string16& message,
+ const std::u16string& message,
int32_t line_no,
- const base::string16& source_id) {
+ const std::u16string& source_id) {
DCHECK(source == web_contents_);
if (log_level == blink::mojom::ConsoleMessageLevel::kError ||
diff --git a/content/browser/media/android/media_resource_getter_impl.cc b/content/browser/media/android/media_resource_getter_impl.cc
index 9a8d137..86ea560 100644
--- a/content/browser/media/android/media_resource_getter_impl.cc
+++ b/content/browser/media/android/media_resource_getter_impl.cc
@@ -198,7 +198,7 @@
if (credentials)
std::move(callback).Run(credentials->username(), credentials->password());
else
- std::move(callback).Run(base::string16(), base::string16());
+ std::move(callback).Run(std::u16string(), std::u16string());
}
void MediaResourceGetterImpl::GetPlatformPathFromURL(
diff --git a/content/browser/media/media_browsertest.cc b/content/browser/media/media_browsertest.cc
index 9a14c45..4db24f9 100644
--- a/content/browser/media/media_browsertest.cc
+++ b/content/browser/media/media_browsertest.cc
@@ -90,7 +90,7 @@
base::ASCIIToUTF16(expected_title));
AddTitlesToAwait(&title_watcher);
EXPECT_TRUE(NavigateToURL(shell(), gurl));
- base::string16 result = title_watcher.WaitAndGetTitle();
+ std::u16string result = title_watcher.WaitAndGetTitle();
CleanupTest();
return base::UTF16ToASCII(result);
@@ -100,12 +100,12 @@
#if defined(OS_ANDROID)
// We only do this cleanup on Android, as a workaround for a test-only OOM
// bug. See http://crbug.com/727542
- const base::string16 cleaner_title = base::ASCIIToUTF16(kClean);
+ const std::u16string cleaner_title = base::ASCIIToUTF16(kClean);
TitleWatcher clean_title_watcher(shell()->web_contents(), cleaner_title);
GURL cleaner_url = content::GetFileUrlWithQuery(
media::GetTestDataFilePath("cleaner.html"), "");
EXPECT_TRUE(NavigateToURL(shell(), cleaner_url));
- base::string16 cleaner_result = clean_title_watcher.WaitAndGetTitle();
+ std::u16string cleaner_result = clean_title_watcher.WaitAndGetTitle();
EXPECT_EQ(cleaner_result, cleaner_title);
#endif
}
diff --git a/content/browser/media/media_internals.cc b/content/browser/media/media_internals.cc
index 18e36b6a..c866d2f 100644
--- a/content/browser/media/media_internals.cc
+++ b/content/browser/media/media_internals.cc
@@ -51,7 +51,7 @@
namespace {
-base::string16 SerializeUpdate(const std::string& function,
+std::u16string SerializeUpdate(const std::string& function,
const base::Value* value) {
return content::WebUI::GetJavascriptCall(
function, std::vector<const base::Value*>(1, value));
@@ -361,7 +361,7 @@
// Converts the |event| to a |update|. Returns whether the conversion succeeded.
static bool ConvertEventToUpdate(int render_process_id,
const media::MediaLogRecord& event,
- base::string16* update) {
+ std::u16string* update) {
DCHECK(update);
base::DictionaryValue dict;
@@ -420,7 +420,7 @@
// Notify observers that |event| has occurred.
for (const auto& event : events) {
if (CanUpdate()) {
- base::string16 update;
+ std::u16string update;
if (ConvertEventToUpdate(render_process_id, event, &update))
SendUpdate(update);
}
@@ -460,7 +460,7 @@
DCHECK_CURRENTLY_ON(BrowserThread::UI);
for (const auto& saved_events : saved_events_by_process_) {
for (const auto& event : saved_events.second) {
- base::string16 update;
+ std::u16string update;
if (ConvertEventToUpdate(saved_events.first, event, &update))
SendUpdate(update);
}
@@ -506,13 +506,13 @@
set_explicit_feature_data(
features::kAudioServiceSandbox,
GetContentClient()->browser()->ShouldSandboxAudioService());
- base::string16 audio_info_update =
+ std::u16string audio_info_update =
SerializeUpdate("media.updateGeneralAudioInformation", &audio_info_data);
SendUpdate(audio_info_update);
}
void MediaInternals::SendAudioStreamData() {
- base::string16 audio_stream_update;
+ std::u16string audio_stream_update;
{
base::AutoLock auto_lock(lock_);
audio_stream_update = SerializeUpdate("media.onReceiveAudioStreamData",
@@ -627,7 +627,7 @@
render_frame_id);
}
-void MediaInternals::SendUpdate(const base::string16& update) {
+void MediaInternals::SendUpdate(const std::u16string& update) {
// SendUpdate() may be called from any thread, but must run on the UI thread.
if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) {
GetUIThreadTaskRunner({})->PostTask(
diff --git a/content/browser/media/media_internals.h b/content/browser/media/media_internals.h
index ab3aae0a..052f860 100644
--- a/content/browser/media/media_internals.h
+++ b/content/browser/media/media_internals.h
@@ -50,7 +50,7 @@
public NotificationObserver {
public:
// Called with the update string.
- using UpdateCallback = base::RepeatingCallback<void(const base::string16&)>;
+ using UpdateCallback = base::RepeatingCallback<void(const std::u16string&)>;
static MediaInternals* GetInstance();
@@ -134,7 +134,7 @@
// Sends |update| to each registered UpdateCallback. Safe to call from any
// thread, but will forward to the IO thread.
- void SendUpdate(const base::string16& update);
+ void SendUpdate(const std::u16string& update);
// Saves |event| so that it can be sent later in SendHistoricalMediaEvents().
void SaveEvent(int process_id, const media::MediaLogRecord& event);
diff --git a/content/browser/media/media_internals_handler.cc b/content/browser/media/media_internals_handler.cc
index b089566..9d5ee56 100644
--- a/content/browser/media/media_internals_handler.cc
+++ b/content/browser/media/media_internals_handler.cc
@@ -39,7 +39,7 @@
proxy_->GetEverything();
}
-void MediaInternalsMessageHandler::OnUpdate(const base::string16& update) {
+void MediaInternalsMessageHandler::OnUpdate(const std::u16string& update) {
// Don't try to execute JavaScript in a RenderView that no longer exists nor
// if the chrome://media-internals page hasn't finished loading.
RenderFrameHost* host = web_ui()->GetWebContents()->GetMainFrame();
diff --git a/content/browser/media/media_internals_handler.h b/content/browser/media/media_internals_handler.h
index 6fc290b..71a53ab 100644
--- a/content/browser/media/media_internals_handler.h
+++ b/content/browser/media/media_internals_handler.h
@@ -31,7 +31,7 @@
void OnGetEverything(const base::ListValue* list);
// MediaInternals message handlers.
- void OnUpdate(const base::string16& update);
+ void OnUpdate(const std::u16string& update);
private:
scoped_refptr<MediaInternalsProxy> proxy_;
diff --git a/content/browser/media/media_internals_proxy.cc b/content/browser/media/media_internals_proxy.cc
index e8afdd4..5ab92ff 100644
--- a/content/browser/media/media_internals_proxy.cc
+++ b/content/browser/media/media_internals_proxy.cc
@@ -60,7 +60,7 @@
// static
void MediaInternalsProxy::UpdateUIOnUIThread(
MediaInternalsMessageHandler* handler,
- const base::string16& update) {
+ const std::u16string& update) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
handler->OnUpdate(update);
}
diff --git a/content/browser/media/media_internals_proxy.h b/content/browser/media/media_internals_proxy.h
index a2bbfe58..b7bfbda 100644
--- a/content/browser/media/media_internals_proxy.h
+++ b/content/browser/media/media_internals_proxy.h
@@ -45,7 +45,7 @@
// Callback for MediaInternals to update. Must be called on UI thread.
static void UpdateUIOnUIThread(MediaInternalsMessageHandler* handler,
- const base::string16& update);
+ const std::u16string& update);
MediaInternals::UpdateCallback update_callback_;
diff --git a/content/browser/media/media_internals_unittest.cc b/content/browser/media/media_internals_unittest.cc
index 99b8d51..ab4b44e 100644
--- a/content/browser/media/media_internals_unittest.cc
+++ b/content/browser/media/media_internals_unittest.cc
@@ -48,7 +48,7 @@
protected:
// Extracts and deserializes the JSON update data; merges into |update_data_|.
- virtual void UpdateCallbackImpl(const base::string16& update) {
+ virtual void UpdateCallbackImpl(const std::u16string& update) {
// Each update string looks like "<JavaScript Function Name>({<JSON>});"
// or for video capabilities: "<JavaScript Function Name>([{<JSON>}]);".
// In the second case we will be able to extract the dictionary if it is the
@@ -339,7 +339,7 @@
}
protected:
- void UpdateCallbackImpl(const base::string16& update) override {
+ void UpdateCallbackImpl(const std::u16string& update) override {
base::AutoLock auto_lock(lock_);
MediaInternalsTestBase::UpdateCallbackImpl(update);
call_count_++;
diff --git a/content/browser/media/media_suspend_browsertest.cc b/content/browser/media/media_suspend_browsertest.cc
index ec8bf4a..014ed0cb 100644
--- a/content/browser/media/media_suspend_browsertest.cc
+++ b/content/browser/media/media_suspend_browsertest.cc
@@ -33,11 +33,11 @@
media::GetTestDataFilePath("media_suspend_test.html"),
media::GetURLQueryString(query_params));
- const base::string16 kError = base::ASCIIToUTF16(media::kError);
+ const std::u16string kError = base::ASCIIToUTF16(media::kError);
{
VLOG(0) << "Waiting for test URL: " << gurl << ", to load.";
- const base::string16 kLoaded = base::ASCIIToUTF16("LOADED");
+ const std::u16string kLoaded = base::ASCIIToUTF16("LOADED");
TitleWatcher title_watcher(shell()->web_contents(), kLoaded);
title_watcher.AlsoWaitForTitle(kError);
EXPECT_TRUE(NavigateToURL(shell(), gurl));
@@ -46,7 +46,7 @@
{
VLOG(0) << "Suspending and waiting for suspend to occur.";
- const base::string16 kSuspended = base::ASCIIToUTF16("SUSPENDED");
+ const std::u16string kSuspended = base::ASCIIToUTF16("SUSPENDED");
TitleWatcher title_watcher(shell()->web_contents(), kSuspended);
title_watcher.AlsoWaitForTitle(kError);
static_cast<WebContentsImpl*>(shell()->web_contents())
@@ -62,7 +62,7 @@
{
VLOG(0) << "Waiting for playback to resume.";
- const base::string16 kEnded = base::ASCIIToUTF16(media::kEnded);
+ const std::u16string kEnded = base::ASCIIToUTF16(media::kEnded);
TitleWatcher title_watcher(shell()->web_contents(), kEnded);
title_watcher.AlsoWaitForTitle(kError);
ASSERT_TRUE(ExecuteScript(shell(), "video.play();"));
diff --git a/content/browser/media/midi_browsertest.cc b/content/browser/media/midi_browsertest.cc
index 703382b5..78785811 100644
--- a/content/browser/media/midi_browsertest.cc
+++ b/content/browser/media/midi_browsertest.cc
@@ -23,14 +23,14 @@
~MidiBrowserTest() override {}
void NavigateAndCheckResult(const std::string& path) {
- const base::string16 expected = base::ASCIIToUTF16("pass");
+ const std::u16string expected = base::ASCIIToUTF16("pass");
content::TitleWatcher watcher(shell()->web_contents(), expected);
- const base::string16 failed = base::ASCIIToUTF16("fail");
+ const std::u16string failed = base::ASCIIToUTF16("fail");
watcher.AlsoWaitForTitle(failed);
EXPECT_TRUE(NavigateToURL(shell(), https_test_server_->GetURL(path)));
- const base::string16 result = watcher.WaitAndGetTitle();
+ const std::u16string result = watcher.WaitAndGetTitle();
#if defined(OS_LINUX) || defined(OS_CHROMEOS)
// Try does not allow accessing /dev/snd/seq, and it results in a platform
// specific initialization error. See http://crbug.com/371230.
diff --git a/content/browser/media/session/media_session_impl.cc b/content/browser/media/session/media_session_impl.cc
index 6bb7c81..2647c08 100644
--- a/content/browser/media/session/media_session_impl.cc
+++ b/content/browser/media/session/media_session_impl.cc
@@ -167,8 +167,8 @@
return check_size;
}
-base::string16 SanitizeMediaTitle(const base::string16 title) {
- base::string16 out;
+std::u16string SanitizeMediaTitle(const std::u16string title) {
+ std::u16string out;
base::TrimString(title, base::ASCIIToUTF16(" "), &out);
return out;
}
@@ -1490,7 +1490,7 @@
const GURL& url = web_contents()->GetLastCommittedURL();
// If the url is a file then we should display a placeholder.
- base::string16 formatted_origin =
+ std::u16string formatted_origin =
url.SchemeIsFile()
? content_client->GetLocalizedString(IDS_MEDIA_SESSION_FILE_SOURCE)
: url_formatter::FormatUrl(
diff --git a/content/browser/media/session/media_session_impl_browsertest.cc b/content/browser/media/session/media_session_impl_browsertest.cc
index af8882e1..0b09b29 100644
--- a/content/browser/media/session/media_session_impl_browsertest.cc
+++ b/content/browser/media/session/media_session_impl_browsertest.cc
@@ -56,7 +56,7 @@
const double kDuckingVolumeMultiplier = 0.2;
const double kDifferentDuckingVolumeMultiplier = 0.018;
-const base::string16 kExpectedSourceTitlePrefix =
+const std::u16string kExpectedSourceTitlePrefix =
base::ASCIIToUTF16("http://example.com:");
constexpr gfx::Size kDefaultFaviconSize = gfx::Size(16, 16);
@@ -279,8 +279,8 @@
bool IsDucking() const { return media_session_->is_ducking_; }
- base::string16 GetExpectedSourceTitle() {
- base::string16 expected_title =
+ std::u16string GetExpectedSourceTitle() {
+ std::u16string expected_title =
base::StrCat({kExpectedSourceTitlePrefix,
base::NumberToString16(embedded_test_server()->port())});
diff --git a/content/browser/media/session/media_session_impl_service_routing_unittest.cc b/content/browser/media/session/media_session_impl_service_routing_unittest.cc
index 6f7f452..7b586b1 100644
--- a/content/browser/media/session/media_session_impl_service_routing_unittest.cc
+++ b/content/browser/media/session/media_session_impl_service_routing_unittest.cc
@@ -203,7 +203,7 @@
return empty_metadata_;
}
- const base::string16& GetSourceTitleForNonEmptyMetadata() const {
+ const std::u16string& GetSourceTitleForNonEmptyMetadata() const {
return empty_metadata_.source_title;
}
diff --git a/content/browser/media/system_media_controls_notifier_unittest.cc b/content/browser/media/system_media_controls_notifier_unittest.cc
index 01421511..79a76bb 100644
--- a/content/browser/media/system_media_controls_notifier_unittest.cc
+++ b/content/browser/media/system_media_controls_notifier_unittest.cc
@@ -55,8 +55,8 @@
void SimulateStopped() { notifier_->MediaSessionInfoChanged(nullptr); }
void SimulateMetadataChanged(bool empty,
- base::string16 title,
- base::string16 artist) {
+ std::u16string title,
+ std::u16string artist) {
if (!empty) {
media_session::MediaMetadata metadata;
metadata.title = title;
@@ -118,8 +118,8 @@
}
TEST_F(SystemMediaControlsNotifierTest, ProperlyUpdatesMetadata) {
- base::string16 title = base::ASCIIToUTF16("title");
- base::string16 artist = base::ASCIIToUTF16("artist");
+ std::u16string title = base::ASCIIToUTF16("title");
+ std::u16string artist = base::ASCIIToUTF16("artist");
EXPECT_CALL(mock_system_media_controls(), SetTitle(title));
EXPECT_CALL(mock_system_media_controls(), SetArtist(artist));
@@ -134,7 +134,7 @@
EXPECT_CALL(mock_system_media_controls(), SetArtist(_)).Times(0);
EXPECT_CALL(mock_system_media_controls(), ClearMetadata());
- SimulateMetadataChanged(true, base::string16(), base::string16());
+ SimulateMetadataChanged(true, std::u16string(), std::u16string());
}
TEST_F(SystemMediaControlsNotifierTest, ProperlyUpdatesImage) {
diff --git a/content/browser/message_port_provider.cc b/content/browser/message_port_provider.cc
index 2f6c6b1f..00f6d69 100644
--- a/content/browser/message_port_provider.cc
+++ b/content/browser/message_port_provider.cc
@@ -29,9 +29,9 @@
void PostMessageToFrameInternal(
WebContents* web_contents,
- const base::string16& source_origin,
- const base::string16& target_origin,
- const base::string16& data,
+ const std::u16string& source_origin,
+ const std::u16string& target_origin,
+ const std::u16string& data,
std::vector<blink::MessagePortDescriptor> ports) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
@@ -53,10 +53,10 @@
}
#if defined(OS_ANDROID)
-base::string16 ToString16(JNIEnv* env,
+std::u16string ToString16(JNIEnv* env,
const base::android::JavaParamRef<jstring>& s) {
if (s.is_null())
- return base::string16();
+ return std::u16string();
return base::android::ConvertJavaStringToUTF16(env, s);
}
#endif
@@ -66,9 +66,9 @@
// static
void MessagePortProvider::PostMessageToFrame(
WebContents* web_contents,
- const base::string16& source_origin,
- const base::string16& target_origin,
- const base::string16& data) {
+ const std::u16string& source_origin,
+ const std::u16string& target_origin,
+ const std::u16string& data) {
PostMessageToFrameInternal(web_contents, source_origin, target_origin, data,
std::vector<blink::MessagePortDescriptor>());
}
@@ -92,9 +92,9 @@
// static
void MessagePortProvider::PostMessageToFrame(
WebContents* web_contents,
- const base::string16& source_origin,
- const base::Optional<base::string16>& target_origin,
- const base::string16& data,
+ const std::u16string& source_origin,
+ const base::Optional<std::u16string>& target_origin,
+ const std::u16string& data,
std::vector<blink::WebMessagePort> ports) {
// Extract the underlying descriptors.
std::vector<blink::MessagePortDescriptor> descriptors;
diff --git a/content/browser/net/trust_token_browsertest.cc b/content/browser/net/trust_token_browsertest.cc
index c4e3cb09..10fd5629 100644
--- a/content/browser/net/trust_token_browsertest.cc
+++ b/content/browser/net/trust_token_browsertest.cc
@@ -707,7 +707,7 @@
// network::kTrustTokenAdditionalSigningDataMaxSizeBytes code units, once it's
// converted to UTF-8 it will contain more than that many bytes, so we expect
// that it will get rejected by the network service.
- base::string16 overlong_signing_data(
+ std::u16string overlong_signing_data(
network::kTrustTokenAdditionalSigningDataMaxSizeBytes,
u'€' /* char16 literal */);
ASSERT_LE(overlong_signing_data.size(),
diff --git a/content/browser/notifications/devtools_event_logging.cc b/content/browser/notifications/devtools_event_logging.cc
index 1e04df75e..06a812c 100644
--- a/content/browser/notifications/devtools_event_logging.cc
+++ b/content/browser/notifications/devtools_event_logging.cc
@@ -125,7 +125,7 @@
BrowserContext* browser_context,
const NotificationDatabaseData& data,
const base::Optional<int>& action_index,
- const base::Optional<base::string16>& reply) {
+ const base::Optional<std::u16string>& reply) {
DevToolsCallback callback = GetDevToolsCallback(browser_context, data);
if (!callback)
return;
diff --git a/content/browser/notifications/devtools_event_logging.h b/content/browser/notifications/devtools_event_logging.h
index c46a226..1fc15343 100644
--- a/content/browser/notifications/devtools_event_logging.h
+++ b/content/browser/notifications/devtools_event_logging.h
@@ -39,7 +39,7 @@
BrowserContext* browser_context,
const NotificationDatabaseData& data,
const base::Optional<int>& action_index,
- const base::Optional<base::string16>& reply);
+ const base::Optional<std::u16string>& reply);
} // namespace notifications
} // namespace content
diff --git a/content/browser/notifications/notification_event_dispatcher_impl.cc b/content/browser/notifications/notification_event_dispatcher_impl.cc
index 1e49c53..e84c7c2 100644
--- a/content/browser/notifications/notification_event_dispatcher_impl.cc
+++ b/content/browser/notifications/notification_event_dispatcher_impl.cc
@@ -220,7 +220,7 @@
const scoped_refptr<ServiceWorkerVersion>& service_worker,
const NotificationDatabaseData& notification_database_data,
const base::Optional<int>& action_index,
- const base::Optional<base::string16>& reply,
+ const base::Optional<std::u16string>& reply,
ServiceWorkerVersion::StatusCallback callback,
blink::ServiceWorkerStatusCode start_worker_status) {
DCHECK_CURRENTLY_ON(ServiceWorkerContext::GetCoreThreadId());
@@ -245,7 +245,7 @@
// Dispatches the notification click event on the |service_worker_registration|.
void DoDispatchNotificationClickEvent(
const base::Optional<int>& action_index,
- const base::Optional<base::string16>& reply,
+ const base::Optional<std::u16string>& reply,
const scoped_refptr<PlatformNotificationContext>& notification_context,
BrowserContext* browser_context,
const ServiceWorkerRegistration* service_worker_registration,
@@ -429,7 +429,7 @@
const std::string& notification_id,
const GURL& origin,
const base::Optional<int>& action_index,
- const base::Optional<base::string16>& reply,
+ const base::Optional<std::u16string>& reply,
NotificationDispatchCompleteCallback dispatch_complete_callback) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
diff --git a/content/browser/notifications/notification_event_dispatcher_impl.h b/content/browser/notifications/notification_event_dispatcher_impl.h
index 4c96848..c836840 100644
--- a/content/browser/notifications/notification_event_dispatcher_impl.h
+++ b/content/browser/notifications/notification_event_dispatcher_impl.h
@@ -34,7 +34,7 @@
const std::string& notification_id,
const GURL& origin,
const base::Optional<int>& action_index,
- const base::Optional<base::string16>& reply,
+ const base::Optional<std::u16string>& reply,
NotificationDispatchCompleteCallback dispatch_complete_callback) override;
void DispatchNotificationCloseEvent(
BrowserContext* browser_context,
diff --git a/content/browser/picture_in_picture/picture_in_picture_content_browsertest.cc b/content/browser/picture_in_picture/picture_in_picture_content_browsertest.cc
index 8d386d3..e8d08f8e 100644
--- a/content/browser/picture_in_picture/picture_in_picture_content_browsertest.cc
+++ b/content/browser/picture_in_picture/picture_in_picture_content_browsertest.cc
@@ -169,7 +169,7 @@
// Play first video.
ASSERT_TRUE(ExecJs(shell(), "videos[0].play();"));
- base::string16 expected_title = base::ASCIIToUTF16("videos[0] playing");
+ std::u16string expected_title = base::ASCIIToUTF16("videos[0] playing");
EXPECT_EQ(
expected_title,
TitleWatcher(shell()->web_contents(), expected_title).WaitAndGetTitle());
@@ -215,7 +215,7 @@
embedded_test_server()->GetURL(
"example.com", "/media/picture_in_picture/two-videos.html")));
- base::string16 expected_title = base::ASCIIToUTF16("iframe loaded");
+ std::u16string expected_title = base::ASCIIToUTF16("iframe loaded");
EXPECT_EQ(
expected_title,
TitleWatcher(shell()->web_contents(), expected_title).WaitAndGetTitle());
@@ -310,7 +310,7 @@
ASSERT_TRUE(ExecJs(shell(), "addPlayEventListener();"));
window_controller()->TogglePlayPause();
- base::string16 expected_title = base::ASCIIToUTF16("play");
+ std::u16string expected_title = base::ASCIIToUTF16("play");
EXPECT_EQ(
expected_title,
TitleWatcher(shell()->web_contents(), expected_title).WaitAndGetTitle());
@@ -364,7 +364,7 @@
ASSERT_TRUE(ExecJs(shell(), "addPlayEventListener();"));
window_controller()->TogglePlayPause();
- base::string16 expected_title = base::ASCIIToUTF16("play");
+ std::u16string expected_title = base::ASCIIToUTF16("play");
EXPECT_EQ(
expected_title,
TitleWatcher(shell()->web_contents(), expected_title).WaitAndGetTitle());
@@ -410,7 +410,7 @@
// Hide page and check that video entered Picture-in-Picture automatically.
shell()->web_contents()->WasHidden();
- base::string16 expected_title = base::ASCIIToUTF16("enterpictureinpicture");
+ std::u16string expected_title = base::ASCIIToUTF16("enterpictureinpicture");
EXPECT_EQ(
expected_title,
TitleWatcher(shell()->web_contents(), expected_title).WaitAndGetTitle());
diff --git a/content/browser/plugin_list_unittest.cc b/content/browser/plugin_list_unittest.cc
index d76c9e1..921bc8da 100644
--- a/content/browser/plugin_list_unittest.cc
+++ b/content/browser/plugin_list_unittest.cc
@@ -73,8 +73,8 @@
TEST_F(PluginListTest, BadPluginDescription) {
WebPluginInfo plugin_3043(
- base::string16(), base::FilePath(FILE_PATH_LITERAL("/myplugin.3.0.43")),
- base::string16(), base::string16());
+ std::u16string(), base::FilePath(FILE_PATH_LITERAL("/myplugin.3.0.43")),
+ std::u16string(), std::u16string());
// Simulate loading of the plugins.
plugin_list_.RegisterInternalPlugin(plugin_3043, false);
// Now we should have them in the state we specified above.
diff --git a/content/browser/plugin_service_impl.cc b/content/browser/plugin_service_impl.cc
index 68fe719..d01c8677 100644
--- a/content/browser/plugin_service_impl.cc
+++ b/content/browser/plugin_service_impl.cc
@@ -308,9 +308,9 @@
return false;
}
-base::string16 PluginServiceImpl::GetPluginDisplayNameByPath(
+std::u16string PluginServiceImpl::GetPluginDisplayNameByPath(
const base::FilePath& path) {
- base::string16 plugin_name = path.LossyDisplayName();
+ std::u16string plugin_name = path.LossyDisplayName();
WebPluginInfo info;
if (PluginService::GetInstance()->GetPluginInfoByPath(path, &info) &&
!info.name.empty()) {
diff --git a/content/browser/plugin_service_impl.h b/content/browser/plugin_service_impl.h
index c1d358b..3ce3ad5 100644
--- a/content/browser/plugin_service_impl.h
+++ b/content/browser/plugin_service_impl.h
@@ -62,7 +62,7 @@
std::string* actual_mime_type) override;
bool GetPluginInfoByPath(const base::FilePath& plugin_path,
WebPluginInfo* info) override;
- base::string16 GetPluginDisplayNameByPath(
+ std::u16string GetPluginDisplayNameByPath(
const base::FilePath& path) override;
void GetPlugins(GetPluginsCallback callback) override;
const PepperPluginInfo* GetRegisteredPpapiPluginInfo(
diff --git a/content/browser/ppapi_plugin_process_host.cc b/content/browser/ppapi_plugin_process_host.cc
index 839bb12..7e40de3 100644
--- a/content/browser/ppapi_plugin_process_host.cc
+++ b/content/browser/ppapi_plugin_process_host.cc
@@ -231,7 +231,7 @@
// static
void PpapiPluginProcessHost::FindByName(
- const base::string16& name,
+ const std::u16string& name,
std::vector<PpapiPluginProcessHost*>* hosts) {
for (PpapiPluginProcessHostIterator iter; !iter.Done(); ++iter) {
if (iter->process_.get() && iter->process_->GetData().name == name)
diff --git a/content/browser/ppapi_plugin_process_host.h b/content/browser/ppapi_plugin_process_host.h
index ce1d117..959238f 100644
--- a/content/browser/ppapi_plugin_process_host.h
+++ b/content/browser/ppapi_plugin_process_host.h
@@ -87,7 +87,7 @@
// Returns the instances that match the specified process name.
// It can only be called on the IO thread.
- static void FindByName(const base::string16& name,
+ static void FindByName(const std::u16string& name,
std::vector<PpapiPluginProcessHost*>* hosts);
// IPC::Sender implementation:
diff --git a/content/browser/process_internals/process_internals_browsertest.cc b/content/browser/process_internals/process_internals_browsertest.cc
index f1ed919..917370ab 100644
--- a/content/browser/process_internals/process_internals_browsertest.cc
+++ b/content/browser/process_internals/process_internals_browsertest.cc
@@ -50,7 +50,7 @@
IN_PROC_BROWSER_TEST_F(ProcessInternalsWebUiBrowserTest,
MojoJsBindingsCorrectlyScoped) {
- const base::string16 passed_title = base::ASCIIToUTF16("passed");
+ const std::u16string passed_title = base::ASCIIToUTF16("passed");
GURL url("chrome://process-internals/#web-contents");
EXPECT_TRUE(NavigateToURL(shell(), url));
diff --git a/content/browser/renderer_host/clipboard_host_impl.cc b/content/browser/renderer_host/clipboard_host_impl.cc
index ec32b6d..1730d68 100644
--- a/content/browser/renderer_host/clipboard_host_impl.cc
+++ b/content/browser/renderer_host/clipboard_host_impl.cc
@@ -155,7 +155,7 @@
void ClipboardHostImpl::ReadAvailableTypes(
ui::ClipboardBuffer clipboard_buffer,
ReadAvailableTypesCallback callback) {
- std::vector<base::string16> types;
+ std::vector<std::u16string> types;
clipboard_->ReadAvailableTypes(clipboard_buffer, CreateDataEndpoint().get(),
&types);
std::move(callback).Run(types);
@@ -203,10 +203,10 @@
void ClipboardHostImpl::ReadText(ui::ClipboardBuffer clipboard_buffer,
ReadTextCallback callback) {
if (!IsClipboardPasteAllowed(render_frame_routing_id_)) {
- std::move(callback).Run(base::string16());
+ std::move(callback).Run(std::u16string());
return;
}
- base::string16 result;
+ std::u16string result;
auto data_dst = CreateDataEndpoint();
if (clipboard_->IsFormatAvailable(ui::ClipboardFormatType::GetPlainTextType(),
clipboard_buffer, data_dst.get())) {
@@ -228,7 +228,7 @@
ui::ClipboardFormatType::GetPlainTextType(),
std::move(data),
base::BindOnce(
- [](base::string16 result, ReadTextCallback callback,
+ [](std::u16string result, ReadTextCallback callback,
ClipboardPasteContentAllowed allowed) {
if (!allowed)
result.clear();
@@ -240,10 +240,10 @@
void ClipboardHostImpl::ReadHtml(ui::ClipboardBuffer clipboard_buffer,
ReadHtmlCallback callback) {
if (!IsClipboardPasteAllowed(render_frame_routing_id_)) {
- std::move(callback).Run(base::string16(), GURL(), 0, 0);
+ std::move(callback).Run(std::u16string(), GURL(), 0, 0);
return;
}
- base::string16 markup;
+ std::u16string markup;
std::string src_url_str;
uint32_t fragment_start = 0;
uint32_t fragment_end = 0;
@@ -255,7 +255,7 @@
PasteIfPolicyAllowed(
clipboard_buffer, ui::ClipboardFormatType::GetHtmlType(), std::move(data),
base::BindOnce(
- [](base::string16 markup, std::string src_url_str,
+ [](std::u16string markup, std::string src_url_str,
uint32_t fragment_start, uint32_t fragment_end,
ReadHtmlCallback callback, ClipboardPasteContentAllowed allowed) {
if (!allowed)
@@ -270,17 +270,17 @@
void ClipboardHostImpl::ReadSvg(ui::ClipboardBuffer clipboard_buffer,
ReadSvgCallback callback) {
if (!IsClipboardPasteAllowed(render_frame_routing_id_)) {
- std::move(callback).Run(base::string16());
+ std::move(callback).Run(std::u16string());
return;
}
- base::string16 markup;
+ std::u16string markup;
clipboard_->ReadSvg(clipboard_buffer, /*data_dst=*/nullptr, &markup);
std::string data = base::UTF16ToUTF8(markup);
PasteIfPolicyAllowed(clipboard_buffer, ui::ClipboardFormatType::GetSvgType(),
std::move(data),
base::BindOnce(
- [](base::string16 markup, ReadSvgCallback callback,
+ [](std::u16string markup, ReadSvgCallback callback,
ClipboardPasteContentAllowed allowed) {
if (!allowed)
markup.clear();
@@ -400,13 +400,13 @@
}
void ClipboardHostImpl::ReadCustomData(ui::ClipboardBuffer clipboard_buffer,
- const base::string16& type,
+ const std::u16string& type,
ReadCustomDataCallback callback) {
if (!IsClipboardPasteAllowed(render_frame_routing_id_)) {
- std::move(callback).Run(base::string16());
+ std::move(callback).Run(std::u16string());
return;
}
- base::string16 result;
+ std::u16string result;
auto data_dst = CreateDataEndpoint();
clipboard_->ReadCustomData(clipboard_buffer, type, data_dst.get(), &result);
@@ -415,7 +415,7 @@
clipboard_buffer, ui::ClipboardFormatType::GetWebCustomDataType(),
std::move(data),
base::BindOnce(
- [](base::string16 result, ReadCustomDataCallback callback,
+ [](std::u16string result, ReadCustomDataCallback callback,
ClipboardPasteContentAllowed allowed) {
if (!allowed)
result.clear();
@@ -424,16 +424,16 @@
std::move(result), std::move(callback)));
}
-void ClipboardHostImpl::WriteText(const base::string16& text) {
+void ClipboardHostImpl::WriteText(const std::u16string& text) {
clipboard_writer_->WriteText(text);
}
-void ClipboardHostImpl::WriteHtml(const base::string16& markup,
+void ClipboardHostImpl::WriteHtml(const std::u16string& markup,
const GURL& url) {
clipboard_writer_->WriteHTML(markup, url.spec());
}
-void ClipboardHostImpl::WriteSvg(const base::string16& markup) {
+void ClipboardHostImpl::WriteSvg(const std::u16string& markup) {
clipboard_writer_->WriteSvg(markup);
}
@@ -442,7 +442,7 @@
}
void ClipboardHostImpl::WriteCustomData(
- const base::flat_map<base::string16, base::string16>& data) {
+ const base::flat_map<std::u16string, std::u16string>& data) {
base::Pickle pickle;
ui::WriteCustomDataToPickle(data, &pickle);
clipboard_writer_->WritePickledData(
@@ -450,7 +450,7 @@
}
void ClipboardHostImpl::WriteBookmark(const std::string& url,
- const base::string16& title) {
+ const std::u16string& title) {
clipboard_writer_->WriteBookmark(title, url);
}
diff --git a/content/browser/renderer_host/clipboard_host_impl.h b/content/browser/renderer_host/clipboard_host_impl.h
index 66d6804..fd36e65 100644
--- a/content/browser/renderer_host/clipboard_host_impl.h
+++ b/content/browser/renderer_host/clipboard_host_impl.h
@@ -164,20 +164,20 @@
void ReadFiles(ui::ClipboardBuffer clipboard_buffer,
ReadFilesCallback callback) override;
void ReadCustomData(ui::ClipboardBuffer clipboard_buffer,
- const base::string16& type,
+ const std::u16string& type,
ReadCustomDataCallback callback) override;
- void WriteText(const base::string16& text) override;
- void WriteHtml(const base::string16& markup, const GURL& url) override;
- void WriteSvg(const base::string16& markup) override;
+ void WriteText(const std::u16string& text) override;
+ void WriteHtml(const std::u16string& markup, const GURL& url) override;
+ void WriteSvg(const std::u16string& markup) override;
void WriteSmartPasteMarker() override;
void WriteCustomData(
- const base::flat_map<base::string16, base::string16>& data) override;
+ const base::flat_map<std::u16string, std::u16string>& data) override;
void WriteBookmark(const std::string& url,
- const base::string16& title) override;
+ const std::u16string& title) override;
void WriteImage(const SkBitmap& unsafe_bitmap) override;
void CommitWrite() override;
#if defined(OS_MAC)
- void WriteStringToFindPboard(const base::string16& text) override;
+ void WriteStringToFindPboard(const std::u16string& text) override;
#endif
// Called by PerformPasteIfContentAllowed() when an is allowed request is
diff --git a/content/browser/renderer_host/clipboard_host_impl_mac.mm b/content/browser/renderer_host/clipboard_host_impl_mac.mm
index f333293a..7d47290 100644
--- a/content/browser/renderer_host/clipboard_host_impl_mac.mm
+++ b/content/browser/renderer_host/clipboard_host_impl_mac.mm
@@ -25,7 +25,7 @@
} // namespace
-void ClipboardHostImpl::WriteStringToFindPboard(const base::string16& text) {
+void ClipboardHostImpl::WriteStringToFindPboard(const std::u16string& text) {
if (text.length() <= kMaxFindPboardStringLength) {
NSString* nsText = base::SysUTF16ToNSString(text);
if (nsText) {
diff --git a/content/browser/renderer_host/cursor_manager.cc b/content/browser/renderer_host/cursor_manager.cc
index e339bc85..66fedcb 100644
--- a/content/browser/renderer_host/cursor_manager.cc
+++ b/content/browser/renderer_host/cursor_manager.cc
@@ -23,7 +23,7 @@
}
void CursorManager::SetTooltipTextForView(const RenderWidgetHostViewBase* view,
- const base::string16& tooltip_text) {
+ const std::u16string& tooltip_text) {
if (view == view_under_cursor_) {
root_view_->DisplayTooltipText(tooltip_text);
if (tooltip_observer_for_testing_ && view) {
@@ -42,7 +42,7 @@
// though this is only guaranteed if the view's tooltip is non-empty, so
// clearing here is important. Tooltips sent from the previous view will be
// ignored.
- SetTooltipTextForView(view_under_cursor_, base::string16());
+ SetTooltipTextForView(view_under_cursor_, std::u16string());
view_under_cursor_ = view;
WebCursor cursor(ui::mojom::CursorType::kPointer);
diff --git a/content/browser/renderer_host/cursor_manager.h b/content/browser/renderer_host/cursor_manager.h
index a835fdd..18e746d 100644
--- a/content/browser/renderer_host/cursor_manager.h
+++ b/content/browser/renderer_host/cursor_manager.h
@@ -27,7 +27,7 @@
virtual void OnSetTooltipTextForView(
const RenderWidgetHostViewBase* view,
- const base::string16& tooltip_text) = 0;
+ const std::u16string& tooltip_text) = 0;
};
CursorManager(RenderWidgetHostViewBase* root);
@@ -43,7 +43,7 @@
// Accepts TooltipText updates from views, but only updates what's displayed
// if the requesting view is currently under the mouse cursor.
void SetTooltipTextForView(const RenderWidgetHostViewBase* view,
- const base::string16& tooltip_text);
+ const std::u16string& tooltip_text);
// Notification of a RenderWidgetHostView being destroyed, so that its
// cursor map entry can be removed if it has one. If it is the current
diff --git a/content/browser/renderer_host/data_transfer_util.cc b/content/browser/renderer_host/data_transfer_util.cc
index 32c36d8..c1da59c 100644
--- a/content/browser/renderer_host/data_transfer_util.cc
+++ b/content/browser/renderer_host/data_transfer_util.cc
@@ -118,7 +118,7 @@
item->file_system_id = file_system_file.filesystem_id;
items.push_back(blink::mojom::DragItem::NewFileSystemFile(std::move(item)));
}
- for (const std::pair<base::string16, base::string16> data :
+ for (const std::pair<std::u16string, std::u16string> data :
drop_data.custom_data) {
blink::mojom::DragItemStringPtr item = blink::mojom::DragItemString::New();
item->string_type = base::UTF16ToUTF8(data.first);
diff --git a/content/browser/renderer_host/dwrite_font_file_util_win.cc b/content/browser/renderer_host/dwrite_font_file_util_win.cc
index 6958f633..9158e74 100644
--- a/content/browser/renderer_host/dwrite_font_file_util_win.cc
+++ b/content/browser/renderer_host/dwrite_font_file_util_win.cc
@@ -124,7 +124,7 @@
LogMessageFilterError(MessageFilterError::ADD_LOCAL_FILE_GET_PATH_FAILED);
return hr;
}
- // No need for the null-terminator in base::string16.
+ // No need for the null-terminator in std::u16string.
retrieve_file_path.resize(--path_length);
uint32_t retrieve_ttc_index = font_face->GetIndex();
@@ -139,7 +139,7 @@
}
HRESULT AddFilesForFont(IDWriteFont* font,
- const base::string16& windows_fonts_path,
+ const std::u16string& windows_fonts_path,
std::set<std::wstring>* path_set,
std::set<std::wstring>* custom_font_path_set,
uint32_t* ttc_index) {
@@ -149,7 +149,7 @@
return hr;
}
- base::string16 file_path_folded =
+ std::u16string file_path_folded =
base::i18n::FoldCase(base::WideToUTF16(file_path));
if (!file_path_folded.size())
@@ -166,7 +166,7 @@
return S_OK;
}
-base::string16 GetWindowsFontsPath() {
+std::u16string GetWindowsFontsPath() {
std::vector<wchar_t> font_path_chars;
// SHGetSpecialFolderPath requires at least MAX_PATH characters.
font_path_chars.resize(MAX_PATH);
diff --git a/content/browser/renderer_host/dwrite_font_file_util_win.h b/content/browser/renderer_host/dwrite_font_file_util_win.h
index f4f7031..ce7df8d 100644
--- a/content/browser/renderer_host/dwrite_font_file_util_win.h
+++ b/content/browser/renderer_host/dwrite_font_file_util_win.h
@@ -30,12 +30,12 @@
std::wstring& file_path,
uint32_t& ttc_index);
HRESULT AddFilesForFont(IDWriteFont* font,
- const base::string16& windows_fonts_path,
+ const std::u16string& windows_fonts_path,
std::set<std::wstring>* path_set,
std::set<std::wstring>* custom_font_path_set,
uint32_t* ttc_index);
-base::string16 GetWindowsFontsPath();
+std::u16string GetWindowsFontsPath();
} // namespace content
diff --git a/content/browser/renderer_host/dwrite_font_lookup_table_builder_win.cc b/content/browser/renderer_host/dwrite_font_lookup_table_builder_win.cc
index 3b3913c..4989b3a 100644
--- a/content/browser/renderer_host/dwrite_font_lookup_table_builder_win.cc
+++ b/content/browser/renderer_host/dwrite_font_lookup_table_builder_win.cc
@@ -451,7 +451,7 @@
TRACE_EVENT0("dwrite,fonts",
"DWriteFontLookupTableBuilder::ExtractPathAndNamesFromFamily");
- static base::NoDestructor<base::string16> windows_fonts_path(
+ static base::NoDestructor<std::u16string> windows_fonts_path(
GetWindowsFontsPath());
DWriteFontLookupTableBuilder::FamilyResult family_result;
diff --git a/content/browser/renderer_host/dwrite_font_proxy_impl_win.cc b/content/browser/renderer_host/dwrite_font_proxy_impl_win.cc
index 19c6585..bd15bf3 100644
--- a/content/browser/renderer_host/dwrite_font_proxy_impl_win.cc
+++ b/content/browser/renderer_host/dwrite_font_proxy_impl_win.cc
@@ -77,7 +77,7 @@
// That results in a poor user experience because websites that use those fonts
// usually expect them to be rendered in the regular variant.
bool CheckRequiredStylesPresent(IDWriteFontCollection* collection,
- const base::string16& family_name,
+ const std::u16string& family_name,
uint32_t family_index) {
for (const auto& font_style : kRequiredStyles) {
if (base::EqualsCaseInsensitiveASCII(family_name, font_style.family_name)) {
@@ -126,11 +126,11 @@
std::move(receiver));
}
-void DWriteFontProxyImpl::SetWindowsFontsPathForTesting(base::string16 path) {
+void DWriteFontProxyImpl::SetWindowsFontsPathForTesting(std::u16string path) {
windows_fonts_path_.swap(path);
}
-void DWriteFontProxyImpl::FindFamily(const base::string16& family_name,
+void DWriteFontProxyImpl::FindFamily(const std::u16string& family_name,
FindFamilyCallback callback) {
InitializeDirectWrite();
TRACE_EVENT0("dwrite,fonts", "FontProxyHost::OnFindFamily");
@@ -286,11 +286,11 @@
}
void DWriteFontProxyImpl::MapCharacters(
- const base::string16& text,
+ const std::u16string& text,
blink::mojom::DWriteFontStylePtr font_style,
- const base::string16& locale_name,
+ const std::u16string& locale_name,
uint32_t reading_direction,
- const base::string16& base_family_name,
+ const std::u16string& base_family_name,
MapCharactersCallback callback) {
InitializeDirectWrite();
callback = mojo::WrapCallbackWithDefaultInvokeIfNotRun(
@@ -408,7 +408,7 @@
}
void DWriteFontProxyImpl::MatchUniqueFont(
- const base::string16& unique_font_name,
+ const std::u16string& unique_font_name,
MatchUniqueFontCallback callback) {
TRACE_EVENT0("dwrite,fonts", "DWriteFontProxyImpl::MatchUniqueFont");
diff --git a/content/browser/renderer_host/dwrite_font_proxy_impl_win.h b/content/browser/renderer_host/dwrite_font_proxy_impl_win.h
index 09e4491..337e771d 100644
--- a/content/browser/renderer_host/dwrite_font_proxy_impl_win.h
+++ b/content/browser/renderer_host/dwrite_font_proxy_impl_win.h
@@ -38,24 +38,24 @@
static void Create(
mojo::PendingReceiver<blink::mojom::DWriteFontProxy> receiver);
- void SetWindowsFontsPathForTesting(base::string16 path);
+ void SetWindowsFontsPathForTesting(std::u16string path);
protected:
// blink::mojom::DWriteFontProxy:
- void FindFamily(const base::string16& family_name,
+ void FindFamily(const std::u16string& family_name,
FindFamilyCallback callback) override;
void GetFamilyCount(GetFamilyCountCallback callback) override;
void GetFamilyNames(uint32_t family_index,
GetFamilyNamesCallback callback) override;
void GetFontFiles(uint32_t family_index,
GetFontFilesCallback callback) override;
- void MapCharacters(const base::string16& text,
+ void MapCharacters(const std::u16string& text,
blink::mojom::DWriteFontStylePtr font_style,
- const base::string16& locale_name,
+ const std::u16string& locale_name,
uint32_t reading_direction,
- const base::string16& base_family_name,
+ const std::u16string& base_family_name,
MapCharactersCallback callback) override;
- void MatchUniqueFont(const base::string16& unique_font_name,
+ void MatchUniqueFont(const std::u16string& unique_font_name,
MatchUniqueFontCallback callback) override;
void GetUniqueFontLookupMode(
GetUniqueFontLookupModeCallback callback) override;
@@ -84,7 +84,7 @@
Microsoft::WRL::ComPtr<IDWriteFactory2> factory2_;
Microsoft::WRL::ComPtr<IDWriteFactory3> factory3_;
Microsoft::WRL::ComPtr<IDWriteFontFallback> font_fallback_;
- base::string16 windows_fonts_path_;
+ std::u16string windows_fonts_path_;
base::MappedReadOnlyRegion font_unique_name_table_memory_;
// Temp code to help track down crbug.com/561873
diff --git a/content/browser/renderer_host/dwrite_font_proxy_impl_win_unittest.cc b/content/browser/renderer_host/dwrite_font_proxy_impl_win_unittest.cc
index 275406ff..72cc421c 100644
--- a/content/browser/renderer_host/dwrite_font_proxy_impl_win_unittest.cc
+++ b/content/browser/renderer_host/dwrite_font_proxy_impl_win_unittest.cc
@@ -194,11 +194,11 @@
blink::mojom::DWriteFontStyle::New(DWRITE_FONT_WEIGHT_NORMAL,
DWRITE_FONT_STYLE_NORMAL,
DWRITE_FONT_STRETCH_NORMAL),
- base::string16(), DWRITE_READING_DIRECTION_LEFT_TO_RIGHT,
- base::string16(), &result);
+ std::u16string(), DWRITE_READING_DIRECTION_LEFT_TO_RIGHT,
+ std::u16string(), &result);
EXPECT_NE(UINT32_MAX, result->family_index);
- EXPECT_NE(base::string16(), result->family_name);
+ EXPECT_NE(std::u16string(), result->family_name);
EXPECT_EQ(3u, result->mapped_length);
EXPECT_NE(0.0, result->scale);
EXPECT_NE(0, result->font_style->font_weight);
@@ -216,11 +216,11 @@
blink::mojom::DWriteFontStyle::New(DWRITE_FONT_WEIGHT_NORMAL,
DWRITE_FONT_STYLE_NORMAL,
DWRITE_FONT_STRETCH_NORMAL),
- u"en-us", DWRITE_READING_DIRECTION_LEFT_TO_RIGHT, base::string16(),
+ u"en-us", DWRITE_READING_DIRECTION_LEFT_TO_RIGHT, std::u16string(),
&result);
EXPECT_EQ(UINT32_MAX, result->family_index);
- EXPECT_EQ(base::string16(), result->family_name);
+ EXPECT_EQ(std::u16string(), result->family_name);
EXPECT_EQ(2u, result->mapped_length);
}
@@ -234,11 +234,11 @@
blink::mojom::DWriteFontStyle::New(DWRITE_FONT_WEIGHT_NORMAL,
DWRITE_FONT_STYLE_NORMAL,
DWRITE_FONT_STRETCH_NORMAL),
- u"en-us", DWRITE_READING_DIRECTION_LEFT_TO_RIGHT, base::string16(),
+ u"en-us", DWRITE_READING_DIRECTION_LEFT_TO_RIGHT, std::u16string(),
&result);
EXPECT_NE(UINT32_MAX, result->family_index);
- EXPECT_NE(base::string16(), result->family_name);
+ EXPECT_NE(std::u16string(), result->family_name);
EXPECT_EQ(3u, result->mapped_length);
EXPECT_NE(0.0, result->scale);
EXPECT_NE(0, result->font_style->font_weight);
diff --git a/content/browser/renderer_host/frame_navigation_entry.cc b/content/browser/renderer_host/frame_navigation_entry.cc
index 90f85f2..6388603 100644
--- a/content/browser/renderer_host/frame_navigation_entry.cc
+++ b/content/browser/renderer_host/frame_navigation_entry.cc
@@ -164,7 +164,7 @@
*content_type = base::UTF16ToASCII(
exploded_state.top.http_body.http_content_type.value_or(
- base::string16()));
+ std::u16string()));
return exploded_state.top.http_body.request_body;
}
diff --git a/content/browser/renderer_host/input/autoscroll_browsertest.cc b/content/browser/renderer_host/input/autoscroll_browsertest.cc
index 6421959..413e8f96 100644
--- a/content/browser/renderer_host/input/autoscroll_browsertest.cc
+++ b/content/browser/renderer_host/input/autoscroll_browsertest.cc
@@ -112,7 +112,7 @@
RenderWidgetHostImpl* host = GetWidgetHost();
host->GetView()->SetSize(gfx::Size(400, 400));
- base::string16 ready_title(base::ASCIIToUTF16("ready"));
+ std::u16string ready_title(base::ASCIIToUTF16("ready"));
TitleWatcher watcher(shell()->web_contents(), ready_title);
ignore_result(watcher.WaitAndGetTitle());
diff --git a/content/browser/renderer_host/input/composited_scrolling_browsertest.cc b/content/browser/renderer_host/input/composited_scrolling_browsertest.cc
index c2aff4c..6eab5dd 100644
--- a/content/browser/renderer_host/input/composited_scrolling_browsertest.cc
+++ b/content/browser/renderer_host/input/composited_scrolling_browsertest.cc
@@ -100,7 +100,7 @@
HitTestRegionObserver observer(GetWidgetHost()->GetFrameSinkId());
host->GetView()->SetSize(gfx::Size(400, 400));
- base::string16 ready_title(base::ASCIIToUTF16("ready"));
+ std::u16string ready_title(base::ASCIIToUTF16("ready"));
TitleWatcher watcher(shell()->web_contents(), ready_title);
ignore_result(watcher.WaitAndGetTitle());
diff --git a/content/browser/renderer_host/input/compositor_event_ack_browsertest.cc b/content/browser/renderer_host/input/compositor_event_ack_browsertest.cc
index f5df211..28b6c9aa 100644
--- a/content/browser/renderer_host/input/compositor_event_ack_browsertest.cc
+++ b/content/browser/renderer_host/input/compositor_event_ack_browsertest.cc
@@ -130,7 +130,7 @@
RenderWidgetHostImpl* host = GetWidgetHost();
host->GetView()->SetSize(gfx::Size(400, 400));
- base::string16 ready_title(base::ASCIIToUTF16("ready"));
+ std::u16string ready_title(base::ASCIIToUTF16("ready"));
TitleWatcher watcher(shell()->web_contents(), ready_title);
ignore_result(watcher.WaitAndGetTitle());
diff --git a/content/browser/renderer_host/input/fling_browsertest.cc b/content/browser/renderer_host/input/fling_browsertest.cc
index e74cba6..b86f3d2 100644
--- a/content/browser/renderer_host/input/fling_browsertest.cc
+++ b/content/browser/renderer_host/input/fling_browsertest.cc
@@ -95,7 +95,7 @@
RenderWidgetHostImpl* host = GetWidgetHost();
host->GetView()->SetSize(gfx::Size(400, 400));
- base::string16 ready_title(base::ASCIIToUTF16("ready"));
+ std::u16string ready_title(base::ASCIIToUTF16("ready"));
TitleWatcher watcher(shell()->web_contents(), ready_title);
ignore_result(watcher.WaitAndGetTitle());
SynchronizeThreads();
diff --git a/content/browser/renderer_host/input/input_event_browsertest.cc b/content/browser/renderer_host/input/input_event_browsertest.cc
index 9819845..539995a 100644
--- a/content/browser/renderer_host/input/input_event_browsertest.cc
+++ b/content/browser/renderer_host/input/input_event_browsertest.cc
@@ -89,7 +89,7 @@
host->render_frame_metadata_provider());
host->GetView()->SetSize(gfx::Size(400, 400));
- base::string16 ready_title(base::ASCIIToUTF16("ready"));
+ std::u16string ready_title(base::ASCIIToUTF16("ready"));
TitleWatcher watcher(shell()->web_contents(), ready_title);
ignore_result(watcher.WaitAndGetTitle());
@@ -108,9 +108,9 @@
}
bool URLLoaded() {
- base::string16 ready_title(base::ASCIIToUTF16("ready"));
+ std::u16string ready_title(base::ASCIIToUTF16("ready"));
TitleWatcher watcher(shell()->web_contents(), ready_title);
- const base::string16 title = watcher.WaitAndGetTitle();
+ const std::u16string title = watcher.WaitAndGetTitle();
return title == ready_title;
}
diff --git a/content/browser/renderer_host/input/interaction_mq_dynamic_browsertest.cc b/content/browser/renderer_host/input/interaction_mq_dynamic_browsertest.cc
index 33525ffd0..9ffb543 100644
--- a/content/browser/renderer_host/input/interaction_mq_dynamic_browsertest.cc
+++ b/content/browser/renderer_host/input/interaction_mq_dynamic_browsertest.cc
@@ -40,7 +40,7 @@
rvhi->OnHardwareConfigurationChanged();
GURL test_url = GetTestUrl("", "interaction-mq-dynamic.html");
- const base::string16 kSuccessTitle(base::ASCIIToUTF16("SUCCESS"));
+ const std::u16string kSuccessTitle(base::ASCIIToUTF16("SUCCESS"));
TitleWatcher title_watcher(shell()->web_contents(), kSuccessTitle);
EXPECT_TRUE(NavigateToURL(shell(), test_url));
diff --git a/content/browser/renderer_host/input/main_thread_event_queue_browsertest.cc b/content/browser/renderer_host/input/main_thread_event_queue_browsertest.cc
index 744fa90..6694d4a 100644
--- a/content/browser/renderer_host/input/main_thread_event_queue_browsertest.cc
+++ b/content/browser/renderer_host/input/main_thread_event_queue_browsertest.cc
@@ -97,7 +97,7 @@
RenderWidgetHostImpl* host = GetWidgetHost();
host->GetView()->SetSize(gfx::Size(400, 400));
- base::string16 ready_title(base::ASCIIToUTF16("ready"));
+ std::u16string ready_title(base::ASCIIToUTF16("ready"));
TitleWatcher watcher(shell()->web_contents(), ready_title);
ignore_result(watcher.WaitAndGetTitle());
diff --git a/content/browser/renderer_host/input/scroll_behavior_browsertest.cc b/content/browser/renderer_host/input/scroll_behavior_browsertest.cc
index b0014f3..5c3e3062 100644
--- a/content/browser/renderer_host/input/scroll_behavior_browsertest.cc
+++ b/content/browser/renderer_host/input/scroll_behavior_browsertest.cc
@@ -152,7 +152,7 @@
RenderWidgetHostImpl* host = GetWidgetHost();
host->GetView()->SetSize(gfx::Size(400, 400));
- base::string16 ready_title(base::ASCIIToUTF16("ready"));
+ std::u16string ready_title(base::ASCIIToUTF16("ready"));
TitleWatcher watcher(shell()->web_contents(), ready_title);
ignore_result(watcher.WaitAndGetTitle());
diff --git a/content/browser/renderer_host/input/synthetic_input_browsertest.cc b/content/browser/renderer_host/input/synthetic_input_browsertest.cc
index 0f024afc..54f00c6 100644
--- a/content/browser/renderer_host/input/synthetic_input_browsertest.cc
+++ b/content/browser/renderer_host/input/synthetic_input_browsertest.cc
@@ -53,7 +53,7 @@
HitTestRegionObserver observer(GetRenderWidgetHost()->GetFrameSinkId());
host->GetView()->SetSize(gfx::Size(400, 400));
- base::string16 ready_title(base::ASCIIToUTF16("ready"));
+ std::u16string ready_title(base::ASCIIToUTF16("ready"));
TitleWatcher watcher(shell()->web_contents(), ready_title);
ignore_result(watcher.WaitAndGetTitle());
diff --git a/content/browser/renderer_host/input/touch_action_browsertest.cc b/content/browser/renderer_host/input/touch_action_browsertest.cc
index 790a112..9f3b3bd 100644
--- a/content/browser/renderer_host/input/touch_action_browsertest.cc
+++ b/content/browser/renderer_host/input/touch_action_browsertest.cc
@@ -164,7 +164,7 @@
host->render_frame_metadata_provider());
host->GetView()->SetSize(gfx::Size(400, 400));
- base::string16 ready_title(base::ASCIIToUTF16("ready"));
+ std::u16string ready_title(base::ASCIIToUTF16("ready"));
TitleWatcher watcher(shell()->web_contents(), ready_title);
ignore_result(watcher.WaitAndGetTitle());
@@ -219,9 +219,9 @@
}
bool URLLoaded() {
- base::string16 ready_title(base::ASCIIToUTF16("ready"));
+ std::u16string ready_title(base::ASCIIToUTF16("ready"));
TitleWatcher watcher(shell()->web_contents(), ready_title);
- const base::string16 title = watcher.WaitAndGetTitle();
+ const std::u16string title = watcher.WaitAndGetTitle();
return title == ready_title;
}
diff --git a/content/browser/renderer_host/input/touch_selection_controller_client_aura.cc b/content/browser/renderer_host/input/touch_selection_controller_client_aura.cc
index afb65cc..10ef2b2 100644
--- a/content/browser/renderer_host/input/touch_selection_controller_client_aura.cc
+++ b/content/browser/renderer_host/input/touch_selection_controller_client_aura.cc
@@ -441,7 +441,7 @@
case ui::TouchEditable::kCopy:
return readable && has_selection;
case ui::TouchEditable::kPaste: {
- base::string16 result;
+ std::u16string result;
ui::DataTransferEndpoint data_dst = ui::DataTransferEndpoint(
ui::EndpointType::kDefault, /*notify_if_restricted=*/false);
ui::Clipboard::GetForCurrentThread()->ReadText(
@@ -496,7 +496,7 @@
!handle_drag_in_progress_ && IsQuickMenuAvailable();
}
-base::string16 TouchSelectionControllerClientAura::GetSelectedText() {
+std::u16string TouchSelectionControllerClientAura::GetSelectedText() {
return rwhva_->GetSelectedText();
}
diff --git a/content/browser/renderer_host/input/touch_selection_controller_client_aura.h b/content/browser/renderer_host/input/touch_selection_controller_client_aura.h
index 80ff5cd..f7551e7 100644
--- a/content/browser/renderer_host/input/touch_selection_controller_client_aura.h
+++ b/content/browser/renderer_host/input/touch_selection_controller_client_aura.h
@@ -95,7 +95,7 @@
void ExecuteCommand(int command_id, int event_flags) override;
void RunContextMenu() override;
bool ShouldShowQuickMenu() override;
- base::string16 GetSelectedText() override;
+ std::u16string GetSelectedText() override;
// Not owned, non-null for the lifetime of this object.
RenderWidgetHostViewAura* rwhva_;
diff --git a/content/browser/renderer_host/input/touch_selection_controller_client_child_frame.cc b/content/browser/renderer_host/input/touch_selection_controller_client_child_frame.cc
index 822b3817..bd10d2a3 100644
--- a/content/browser/renderer_host/input/touch_selection_controller_client_child_frame.cc
+++ b/content/browser/renderer_host/input/touch_selection_controller_client_child_frame.cc
@@ -166,7 +166,7 @@
case ui::TouchEditable::kCopy:
return readable && has_selection;
case ui::TouchEditable::kPaste: {
- base::string16 result;
+ std::u16string result;
ui::DataTransferEndpoint data_dst = ui::DataTransferEndpoint(
ui::EndpointType::kDefault, /*notify_if_restricted=*/false);
ui::Clipboard::GetForCurrentThread()->ReadText(
@@ -224,7 +224,7 @@
return true;
}
-base::string16 TouchSelectionControllerClientChildFrame::GetSelectedText() {
+std::u16string TouchSelectionControllerClientChildFrame::GetSelectedText() {
return rwhv_->GetSelectedText();
}
diff --git a/content/browser/renderer_host/input/touch_selection_controller_client_child_frame.h b/content/browser/renderer_host/input/touch_selection_controller_client_child_frame.h
index cb1cc12b..d1bc279 100644
--- a/content/browser/renderer_host/input/touch_selection_controller_client_child_frame.h
+++ b/content/browser/renderer_host/input/touch_selection_controller_client_child_frame.h
@@ -60,7 +60,7 @@
void ExecuteCommand(int command_id, int event_flags) override;
void RunContextMenu() override;
bool ShouldShowQuickMenu() override;
- base::string16 GetSelectedText() override;
+ std::u16string GetSelectedText() override;
gfx::Point ConvertFromRoot(const gfx::PointF& point) const;
diff --git a/content/browser/renderer_host/input/wheel_event_listener_browsertest.cc b/content/browser/renderer_host/input/wheel_event_listener_browsertest.cc
index 83a49ec..2e3713e 100644
--- a/content/browser/renderer_host/input/wheel_event_listener_browsertest.cc
+++ b/content/browser/renderer_host/input/wheel_event_listener_browsertest.cc
@@ -71,7 +71,7 @@
RenderWidgetHostImpl* host = GetWidgetHost();
host->GetView()->SetSize(gfx::Size(400, 400));
- base::string16 ready_title(base::ASCIIToUTF16("ready"));
+ std::u16string ready_title(base::ASCIIToUTF16("ready"));
TitleWatcher watcher(shell()->web_contents(), ready_title);
ignore_result(watcher.WaitAndGetTitle());
diff --git a/content/browser/renderer_host/legacy_render_widget_host_win.cc b/content/browser/renderer_host/legacy_render_widget_host_win.cc
index 0610e5a3..6812d1f5 100644
--- a/content/browser/renderer_host/legacy_render_widget_host_win.cc
+++ b/content/browser/renderer_host/legacy_render_widget_host_win.cc
@@ -86,7 +86,7 @@
// Reset tooltips when parent changed; otherwise tooltips could stay open as
// the former parent wouldn't be forwarded any mouse leave messages.
- host_->DisplayTooltipText(base::string16());
+ host_->DisplayTooltipText(std::u16string());
}
HWND LegacyRenderWidgetHostHWND::GetParent() {
diff --git a/content/browser/renderer_host/modal_close_listener_host_browsertest.cc b/content/browser/renderer_host/modal_close_listener_host_browsertest.cc
index 43c8306..e2c8408 100644
--- a/content/browser/renderer_host/modal_close_listener_host_browsertest.cc
+++ b/content/browser/renderer_host/modal_close_listener_host_browsertest.cc
@@ -44,7 +44,7 @@
render_frame_host_impl)
->SignalIfActive());
- const base::string16 signaled_title = base::ASCIIToUTF16("SUCCESS");
+ const std::u16string signaled_title = base::ASCIIToUTF16("SUCCESS");
TitleWatcher watcher(web_contents(), signaled_title);
watcher.AlsoWaitForTitle(signaled_title);
EXPECT_EQ(signaled_title, watcher.WaitAndGetTitle());
diff --git a/content/browser/renderer_host/navigation_controller_android.cc b/content/browser/renderer_host/navigation_controller_android.cc
index 40a84aa..e4024ce0 100644
--- a/content/browser/renderer_host/navigation_controller_android.cc
+++ b/content/browser/renderer_host/navigation_controller_android.cc
@@ -95,7 +95,7 @@
return map_data;
}
- base::flat_map<std::string, base::string16>& map() { return map_; }
+ base::flat_map<std::string, std::u16string>& map() { return map_; }
// base::SupportsUserData::Data:
std::unique_ptr<Data> Clone() override {
@@ -105,7 +105,7 @@
}
private:
- base::flat_map<std::string, base::string16> map_;
+ base::flat_map<std::string, std::u16string> map_;
DISALLOW_COPY_AND_ASSIGN(MapData);
};
@@ -448,7 +448,7 @@
MapData::Get(navigation_controller_->GetEntryAtIndex(index));
auto iter = map_data->map().find(key);
return ConvertUTF16ToJavaString(
- env, iter == map_data->map().end() ? base::string16() : iter->second);
+ env, iter == map_data->map().end() ? std::u16string() : iter->second);
}
void NavigationControllerAndroid::SetEntryExtraData(
@@ -461,7 +461,7 @@
return;
std::string key = base::android::ConvertJavaStringToUTF8(env, jkey);
- base::string16 value = base::android::ConvertJavaStringToUTF16(env, jvalue);
+ std::u16string value = base::android::ConvertJavaStringToUTF16(env, jvalue);
MapData* map_data =
MapData::Get(navigation_controller_->GetEntryAtIndex(index));
map_data->map()[key] = value;
diff --git a/content/browser/renderer_host/navigation_controller_impl.cc b/content/browser/renderer_host/navigation_controller_impl.cc
index 9af368c..2160142 100644
--- a/content/browser/renderer_host/navigation_controller_impl.cc
+++ b/content/browser/renderer_host/navigation_controller_impl.cc
@@ -561,7 +561,7 @@
auto entry = std::make_unique<NavigationEntryImpl>(
nullptr, // The site instance for tabs is sent on navigation
// (WebContents::GetSiteInstance).
- url_to_load, referrer, initiator_origin, base::string16(), transition,
+ url_to_load, referrer, initiator_origin, std::u16string(), transition,
is_renderer_initiated, blob_url_loader_factory);
entry->SetVirtualURL(virtual_url);
entry->set_user_typed_url(virtual_url);
@@ -1549,7 +1549,7 @@
new_entry = std::make_unique<NavigationEntryImpl>(
rfh->GetSiteInstance(), params.url, Referrer(*params.referrer),
initiator_origin,
- base::string16(), // title
+ std::u16string(), // title
params.transition, request->IsRendererInitiated(),
nullptr); // blob_url_loader_factory
diff --git a/content/browser/renderer_host/navigation_controller_impl_browsertest.cc b/content/browser/renderer_host/navigation_controller_impl_browsertest.cc
index e645c97..940ab5f 100644
--- a/content/browser/renderer_host/navigation_controller_impl_browsertest.cc
+++ b/content/browser/renderer_host/navigation_controller_impl_browsertest.cc
@@ -185,7 +185,7 @@
shell()->LoadDataWithBaseURL(history_url, data, base_url);
}
same_tab_observer.Wait();
- base::string16 actual_title = title_watcher.WaitAndGetTitle();
+ std::u16string actual_title = title_watcher.WaitAndGetTitle();
EXPECT_EQ(title, base::UTF16ToUTF8(actual_title));
}
@@ -7870,10 +7870,10 @@
EXPECT_TRUE(blink::DecodePageState(entry->GetPageState().ToEncodedData(),
&exploded_state));
EXPECT_EQ(url_a,
- GURL(exploded_state.top.url_string.value_or(base::string16())));
+ GURL(exploded_state.top.url_string.value_or(std::u16string())));
EXPECT_EQ(frame_url_a2,
GURL(exploded_state.top.children.at(0).url_string.value_or(
- base::string16())));
+ std::u16string())));
}
// Start a provisional navigation, but abort it by going back before it commits.
@@ -7994,7 +7994,7 @@
EXPECT_TRUE(blink::DecodePageState(entry->GetPageState().ToEncodedData(),
&exploded_state));
EXPECT_EQ(url_b,
- GURL(exploded_state.top.url_string.value_or(base::string16())));
+ GURL(exploded_state.top.url_string.value_or(std::u16string())));
EXPECT_EQ(0U, exploded_state.top.children.size());
// Go back and then forward to see if the PageState loads correctly.
@@ -8088,7 +8088,7 @@
EXPECT_TRUE(blink::DecodePageState(entry->GetPageState().ToEncodedData(),
&exploded_state));
EXPECT_EQ(url_b,
- GURL(exploded_state.top.url_string.value_or(base::string16())));
+ GURL(exploded_state.top.url_string.value_or(std::u16string())));
// Go back and then forward to see if the PageState loads correctly.
controller.GoBack();
@@ -9058,7 +9058,7 @@
return render_frame_host_;
}
- void RunModalAlertDialog(const base::string16& alert_message,
+ void RunModalAlertDialog(const std::u16string& alert_message,
RunModalAlertDialogCallback callback) override {
alert_callback_ = std::move(callback);
alert_message_ = alert_message;
@@ -9074,7 +9074,7 @@
private:
RenderFrameHostImpl* render_frame_host_;
- base::string16 alert_message_;
+ std::u16string alert_message_;
RunModalAlertDialogCallback alert_callback_;
bool has_called_callback_ = false;
};
@@ -9430,7 +9430,7 @@
"/navigation_controller/simple_page_1.html"));
GURL intermediate_url(embedded_test_server()->GetURL(
"/navigation_controller/simple_page_2.html"));
- base::string16 title = base::UTF8ToUTF16("title");
+ std::u16string title = base::UTF8ToUTF16("title");
// Reload from the browser side.
{
@@ -12250,7 +12250,7 @@
// Navigate to a valid page.
EXPECT_TRUE(NavigateToURL(shell(), url));
int initial_entry_id = controller.GetLastCommittedEntry()->GetUniqueID();
- base::string16 initial_title = controller.GetLastCommittedEntry()->GetTitle();
+ std::u16string initial_title = controller.GetLastCommittedEntry()->GetTitle();
// Trigger a post-commit error page navigation.
TestNavigationObserver error_observer(shell()->web_contents());
controller.LoadPostCommitErrorPage(shell()->web_contents()->GetMainFrame(),
diff --git a/content/browser/renderer_host/navigation_controller_impl_unittest.cc b/content/browser/renderer_host/navigation_controller_impl_unittest.cc
index 62d2732..0b7766b 100644
--- a/content/browser/renderer_host/navigation_controller_impl_unittest.cc
+++ b/content/browser/renderer_host/navigation_controller_impl_unittest.cc
@@ -3077,7 +3077,7 @@
NavigationControllerImpl& controller = controller_impl();
const GURL url1("http://foo1");
const GURL url2("http://foo2");
- const base::string16 title(base::ASCIIToUTF16("Title"));
+ const std::u16string title(base::ASCIIToUTF16("Title"));
NavigateAndCommit(url1);
controller.GetVisibleEntry()->SetTitle(title);
@@ -3102,7 +3102,7 @@
NavigationControllerImpl& controller = controller_impl();
const GURL url1("http://foo1");
const GURL url2("http://foo2");
- const base::string16 title(base::ASCIIToUTF16("Title"));
+ const std::u16string title(base::ASCIIToUTF16("Title"));
NavigateAndCommit(url1);
controller.GetVisibleEntry()->SetTitle(title);
@@ -4098,7 +4098,7 @@
main_test_rfh());
// Set title and favicon.
- base::string16 title(base::ASCIIToUTF16("Title"));
+ std::u16string title(base::ASCIIToUTF16("Title"));
FaviconStatus favicon;
favicon.valid = true;
favicon.url = GURL("http://foo/favicon.ico");
@@ -4118,7 +4118,7 @@
main_test_rfh()->SendNavigateWithParams(std::move(params), true);
// The title should immediately be visible on the new NavigationEntry.
- base::string16 new_title =
+ std::u16string new_title =
controller().GetLastCommittedEntry()->GetTitleForDisplay();
EXPECT_EQ(title, new_title);
FaviconStatus new_favicon =
diff --git a/content/browser/renderer_host/navigation_entry_impl.cc b/content/browser/renderer_host/navigation_entry_impl.cc
index 3054d10..a9a1080 100644
--- a/content/browser/renderer_host/navigation_entry_impl.cc
+++ b/content/browser/renderer_host/navigation_entry_impl.cc
@@ -53,7 +53,7 @@
void RecursivelyGenerateFrameEntries(
const blink::ExplodedFrameState& state,
- const std::vector<base::Optional<base::string16>>& referenced_files,
+ const std::vector<base::Optional<std::u16string>>& referenced_files,
NavigationEntryImpl::TreeNode* node) {
// Set a single-frame PageState on the entry.
blink::ExplodedPageState page_state;
@@ -72,13 +72,13 @@
DCHECK(!data.empty()) << "Shouldn't generate an empty PageState.";
node->frame_entry = base::MakeRefCounted<FrameNavigationEntry>(
- UTF16ToUTF8(state.target.value_or(base::string16())),
+ UTF16ToUTF8(state.target.value_or(std::u16string())),
state.item_sequence_number, state.document_sequence_number, nullptr,
- nullptr, GURL(state.url_string.value_or(base::string16())),
+ nullptr, GURL(state.url_string.value_or(std::u16string())),
// TODO(nasko): Supply valid origin once the value is persisted across
// session restore.
nullptr /* origin */,
- Referrer(GURL(state.referrer.value_or(base::string16())),
+ Referrer(GURL(state.referrer.value_or(std::u16string())),
state.referrer_policy),
state.initiator_origin, std::vector<GURL>(),
blink::PageState::CreateFromEncodedData(data), "GET", -1,
@@ -92,7 +92,7 @@
// Don't pass the file list to subframes, since that would result in multiple
// copies of it ending up in the combined list in GetPageState (via
// RecursivelyGenerateFrameState).
- std::vector<base::Optional<base::string16>> empty_file_list;
+ std::vector<base::Optional<std::u16string>> empty_file_list;
for (const blink::ExplodedFrameState& child_state : state.children) {
node->children.push_back(
@@ -102,7 +102,7 @@
}
}
-base::Optional<base::string16> UrlToOptionalString16(const GURL& url) {
+base::Optional<std::u16string> UrlToOptionalString16(const GURL& url) {
if (!url.is_valid())
return base::nullopt;
return base::UTF8ToUTF16(url.spec());
@@ -111,7 +111,7 @@
void RecursivelyGenerateFrameState(
NavigationEntryImpl::TreeNode* node,
blink::ExplodedFrameState* state,
- std::vector<base::Optional<base::string16>>* referenced_files) {
+ std::vector<base::Optional<std::u16string>>* referenced_files) {
// The FrameNavigationEntry's PageState contains just the ExplodedFrameState
// for that particular frame.
blink::ExplodedPageState exploded_page_state;
@@ -310,7 +310,7 @@
GURL(),
Referrer(),
base::nullopt,
- base::string16(),
+ std::u16string(),
ui::PAGE_TRANSITION_LINK,
false,
nullptr) {}
@@ -320,7 +320,7 @@
const GURL& url,
const Referrer& referrer,
const base::Optional<url::Origin>& initiator_origin,
- const base::string16& title,
+ const std::u16string& title,
ui::PageTransition transition_type,
bool is_renderer_initiated,
scoped_refptr<network::SharedURLLoaderFactory> blob_url_loader_factory)
@@ -424,12 +424,12 @@
return virtual_url_.is_empty() ? GetURL() : virtual_url_;
}
-void NavigationEntryImpl::SetTitle(const base::string16& title) {
+void NavigationEntryImpl::SetTitle(const std::u16string& title) {
title_ = title;
cached_display_title_.clear();
}
-const base::string16& NavigationEntryImpl::GetTitle() {
+const std::u16string& NavigationEntryImpl::GetTitle() {
return title_;
}
@@ -478,7 +478,7 @@
frame_tree_->frame_entry->set_site_instance(std::move(site_instance));
}
-const base::string16& NavigationEntryImpl::GetTitleForDisplay() {
+const std::u16string& NavigationEntryImpl::GetTitleForDisplay() {
// Most pages have real titles. Don't even bother caching anything if this is
// the case.
if (!title_.empty())
@@ -490,7 +490,7 @@
return cached_display_title_;
// Use the virtual URL first if any, and fall back on using the real URL.
- base::string16 title;
+ std::u16string title;
if (!virtual_url_.is_empty()) {
title = url_formatter::FormatUrl(virtual_url_);
} else if (!GetURL().is_empty()) {
@@ -502,22 +502,22 @@
// It is necessary to ignore the reference and query parameters or else
// looking for slashes might accidentally return one of those values. See
// https://crbug.com/503003.
- base::string16::size_type refpos = title.find('#');
- base::string16::size_type querypos = title.find('?');
- base::string16::size_type lastpos;
- if (refpos == base::string16::npos)
+ std::u16string::size_type refpos = title.find('#');
+ std::u16string::size_type querypos = title.find('?');
+ std::u16string::size_type lastpos;
+ if (refpos == std::u16string::npos)
lastpos = querypos;
- else if (querypos == base::string16::npos)
+ else if (querypos == std::u16string::npos)
lastpos = refpos;
else
lastpos = (refpos < querypos) ? refpos : querypos;
- base::string16::size_type slashpos = title.rfind('/', lastpos);
- if (slashpos != base::string16::npos)
+ std::u16string::size_type slashpos = title.rfind('/', lastpos);
+ if (slashpos != std::u16string::npos)
title = title.substr(slashpos + 1);
} else if (GetURL().SchemeIs(kChromeUIUntrustedScheme)) {
// For chrome-untrusted:// URLs, leave title blank until the page loads.
- title = base::string16();
+ title = std::u16string();
} else if (base::i18n::StringContainsStrongRTLChars(title)) {
// Wrap the URL in an LTR embedding for proper handling of RTL characters.
@@ -529,7 +529,7 @@
#if defined(OS_ANDROID)
if (GetURL().SchemeIs(url::kContentScheme)) {
- base::string16 file_display_name;
+ std::u16string file_display_name;
if (base::MaybeGetFileDisplayName(base::FilePath(GetURL().spec()),
&file_display_name)) {
title = file_display_name;
@@ -969,7 +969,7 @@
child->frame_entry->page_state().ToEncodedData(),
&exploded_page_state)) {
blink::ExplodedFrameState frame_state = exploded_page_state.top;
- if (UTF16ToUTF8(frame_state.url_string.value_or(base::string16())) ==
+ if (UTF16ToUTF8(frame_state.url_string.value_or(std::u16string())) ==
url::kAboutBlankURL)
is_about_blank = true;
}
diff --git a/content/browser/renderer_host/navigation_entry_impl.h b/content/browser/renderer_host/navigation_entry_impl.h
index ea57929..3f1f36b 100644
--- a/content/browser/renderer_host/navigation_entry_impl.h
+++ b/content/browser/renderer_host/navigation_entry_impl.h
@@ -90,7 +90,7 @@
const GURL& url,
const Referrer& referrer,
const base::Optional<url::Origin>& initiator_origin,
- const base::string16& title,
+ const std::u16string& title,
ui::PageTransition transition_type,
bool is_renderer_initiated,
scoped_refptr<network::SharedURLLoaderFactory> blob_url_loader_factory);
@@ -113,11 +113,11 @@
const Referrer& GetReferrer() override;
void SetVirtualURL(const GURL& url) override;
const GURL& GetVirtualURL() override;
- void SetTitle(const base::string16& title) override;
- const base::string16& GetTitle() override;
+ void SetTitle(const std::u16string& title) override;
+ const std::u16string& GetTitle() override;
void SetPageState(const blink::PageState& state) override;
blink::PageState GetPageState() override;
- const base::string16& GetTitleForDisplay() override;
+ const std::u16string& GetTitleForDisplay() override;
bool IsViewSourceMode() override;
void SetTransitionType(ui::PageTransition transition_type) override;
ui::PageTransition GetTransitionType() override;
@@ -431,7 +431,7 @@
PageType page_type_;
GURL virtual_url_;
bool update_virtual_url_with_url_;
- base::string16 title_;
+ std::u16string title_;
FaviconStatus favicon_;
SSLStatus ssl_;
ui::PageTransition transition_type_;
@@ -470,7 +470,7 @@
// us from having to do URL formatting on the URL every time the title is
// displayed. When the URL, virtual URL, or title is set, this should be
// cleared to force a refresh.
- mutable base::string16 cached_display_title_;
+ mutable std::u16string cached_display_title_;
// This is set to true when this entry is being reloaded and due to changes in
// the state of the URL, it has to be reloaded in a different site instance.
diff --git a/content/browser/renderer_host/navigation_entry_impl_unittest.cc b/content/browser/renderer_host/navigation_entry_impl_unittest.cc
index 532fe98e..3007051 100644
--- a/content/browser/renderer_host/navigation_entry_impl_unittest.cc
+++ b/content/browser/renderer_host/navigation_entry_impl_unittest.cc
@@ -161,7 +161,7 @@
// For chrome-untrusted:// URLs, title is blank.
entry1_->SetURL(GURL("chrome-untrusted://terminal/html/terminal.html"));
- EXPECT_EQ(base::string16(), entry1_->GetTitleForDisplay());
+ EXPECT_EQ(std::u16string(), entry1_->GetTitleForDisplay());
// Title affects GetTitleForDisplay
entry1_->SetTitle(ASCIIToUTF16("Google"));
@@ -242,7 +242,7 @@
EXPECT_EQ(GURL("from2"), entry2_->GetReferrer().url);
// Title
- EXPECT_EQ(base::string16(), entry1_->GetTitle());
+ EXPECT_EQ(std::u16string(), entry1_->GetTitle());
EXPECT_EQ(ASCIIToUTF16("title"), entry2_->GetTitle());
entry2_->SetTitle(ASCIIToUTF16("title2"));
EXPECT_EQ(ASCIIToUTF16("title2"), entry2_->GetTitle());
diff --git a/content/browser/renderer_host/raw_clipboard_host_impl.cc b/content/browser/renderer_host/raw_clipboard_host_impl.cc
index 8a219b9..2c965cb 100644
--- a/content/browser/renderer_host/raw_clipboard_host_impl.cc
+++ b/content/browser/renderer_host/raw_clipboard_host_impl.cc
@@ -88,13 +88,13 @@
ReadAvailableFormatNamesCallback callback) {
if (!HasTransientUserActivation())
return;
- std::vector<base::string16> raw_types =
+ std::vector<std::u16string> raw_types =
clipboard_->ReadAvailablePlatformSpecificFormatNames(
ui::ClipboardBuffer::kCopyPaste, CreateDataEndpoint().get());
std::move(callback).Run(raw_types);
}
-void RawClipboardHostImpl::Read(const base::string16& format,
+void RawClipboardHostImpl::Read(const std::u16string& format,
ReadCallback callback) {
if (!HasTransientUserActivation())
return;
@@ -113,7 +113,7 @@
std::move(callback).Run(std::move(buffer));
}
-void RawClipboardHostImpl::Write(const base::string16& format,
+void RawClipboardHostImpl::Write(const std::u16string& format,
mojo_base::BigBuffer data) {
if (!HasTransientUserActivation())
return;
@@ -140,7 +140,7 @@
// https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-registerclipboardformata
static constexpr int kMaxWindowsClipboardFormats = 0x4000;
static constexpr int kMaxRegisteredFormats = kMaxWindowsClipboardFormats / 4;
- static base::NoDestructor<std::set<base::string16>> registered_formats;
+ static base::NoDestructor<std::set<std::u16string>> registered_formats;
if (!base::Contains(*registered_formats, format)) {
if (registered_formats->size() >= kMaxRegisteredFormats)
return;
diff --git a/content/browser/renderer_host/raw_clipboard_host_impl.h b/content/browser/renderer_host/raw_clipboard_host_impl.h
index d5816c03..a4d7a47 100644
--- a/content/browser/renderer_host/raw_clipboard_host_impl.h
+++ b/content/browser/renderer_host/raw_clipboard_host_impl.h
@@ -38,8 +38,8 @@
// mojom::RawClipboardHost.
void ReadAvailableFormatNames(
ReadAvailableFormatNamesCallback callback) override;
- void Read(const base::string16& format, ReadCallback callback) override;
- void Write(const base::string16& format, mojo_base::BigBuffer data) override;
+ void Read(const std::u16string& format, ReadCallback callback) override;
+ void Write(const std::u16string& format, mojo_base::BigBuffer data) override;
void CommitWrite() override;
std::unique_ptr<ui::DataTransferEndpoint> CreateDataEndpoint();
diff --git a/content/browser/renderer_host/render_frame_host_delegate.cc b/content/browser/renderer_host/render_frame_host_delegate.cc
index 190a88d..bf430a4 100644
--- a/content/browser/renderer_host/render_frame_host_delegate.cc
+++ b/content/browser/renderer_host/render_frame_host_delegate.cc
@@ -34,10 +34,10 @@
bool RenderFrameHostDelegate::DidAddMessageToConsole(
RenderFrameHostImpl* source_frame,
blink::mojom::ConsoleMessageLevel log_level,
- const base::string16& message,
+ const std::u16string& message,
int32_t line_no,
- const base::string16& source_id,
- const base::Optional<base::string16>& untrusted_stack_trace) {
+ const std::u16string& source_id,
+ const base::Optional<std::u16string>& untrusted_stack_trace) {
return false;
}
diff --git a/content/browser/renderer_host/render_frame_host_delegate.h b/content/browser/renderer_host/render_frame_host_delegate.h
index cfeaea1..86f12284 100644
--- a/content/browser/renderer_host/render_frame_host_delegate.h
+++ b/content/browser/renderer_host/render_frame_host_delegate.h
@@ -158,10 +158,10 @@
virtual bool DidAddMessageToConsole(
RenderFrameHostImpl* source_frame,
blink::mojom::ConsoleMessageLevel log_level,
- const base::string16& message,
+ const std::u16string& message,
int32_t line_no,
- const base::string16& source_id,
- const base::Optional<base::string16>& untrusted_stack_trace);
+ const std::u16string& source_id,
+ const base::Optional<std::u16string>& untrusted_stack_trace);
// Called when a RenderFrame for |render_frame_host| is created in the
// renderer process. Use |RenderFrameDeleted| to listen for when this
@@ -183,8 +183,8 @@
// A JavaScript alert, confirmation or prompt dialog should be shown.
virtual void RunJavaScriptDialog(RenderFrameHostImpl* render_frame_host,
- const base::string16& message,
- const base::string16& default_prompt,
+ const std::u16string& message,
+ const std::u16string& default_prompt,
JavaScriptDialogType type,
JavaScriptDialogCallback callback) {}
@@ -227,7 +227,7 @@
// The page's title was changed and should be updated. Only called for the
// top-level frame.
virtual void UpdateTitle(RenderFrameHostImpl* render_frame_host,
- const base::string16& title,
+ const std::u16string& title,
base::i18n::TextDirection title_direction) {}
// The destination URL has changed and should be updated.
diff --git a/content/browser/renderer_host/render_frame_host_impl.cc b/content/browser/renderer_host/render_frame_host_impl.cc
index 1305d74..dacea0f 100644
--- a/content/browser/renderer_host/render_frame_host_impl.cc
+++ b/content/browser/renderer_host/render_frame_host_impl.cc
@@ -1835,8 +1835,8 @@
}
void RenderFrameHostImpl::ExecuteJavaScriptMethod(
- const base::string16& object_name,
- const base::string16& method_name,
+ const std::u16string& object_name,
+ const std::u16string& method_name,
base::Value arguments,
JavaScriptResultCallback callback) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
@@ -1849,7 +1849,7 @@
std::move(callback));
}
-void RenderFrameHostImpl::ExecuteJavaScript(const base::string16& javascript,
+void RenderFrameHostImpl::ExecuteJavaScript(const std::u16string& javascript,
JavaScriptResultCallback callback) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
CHECK(CanExecuteJavaScript());
@@ -1860,7 +1860,7 @@
}
void RenderFrameHostImpl::ExecuteJavaScriptInIsolatedWorld(
- const base::string16& javascript,
+ const std::u16string& javascript,
JavaScriptResultCallback callback,
int32_t world_id) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
@@ -1873,7 +1873,7 @@
}
void RenderFrameHostImpl::ExecuteJavaScriptForTests(
- const base::string16& javascript,
+ const std::u16string& javascript,
JavaScriptResultCallback callback,
int32_t world_id) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
@@ -1886,7 +1886,7 @@
}
void RenderFrameHostImpl::ExecuteJavaScriptWithUserGestureForTests(
- const base::string16& javascript,
+ const std::u16string& javascript,
int32_t world_id) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
@@ -2220,7 +2220,7 @@
iter(&smart_clip_callbacks_);
!iter.IsAtEnd(); iter.Advance()) {
std::move(*iter.GetCurrentValue())
- .Run(base::string16(), base::string16(), gfx::Rect());
+ .Run(std::u16string(), std::u16string(), gfx::Rect());
}
smart_clip_callbacks_.Clear();
#endif // defined(OS_ANDROID)
@@ -2639,11 +2639,11 @@
void RenderFrameHostImpl::DidAddMessageToConsole(
blink::mojom::ConsoleMessageLevel log_level,
- const base::string16& message,
+ const std::u16string& message,
int32_t line_no,
- const base::Optional<base::string16>& source_id,
- const base::Optional<base::string16>& untrusted_stack_trace) {
- base::string16 updated_source_id;
+ const base::Optional<std::u16string>& source_id,
+ const base::Optional<std::u16string>& untrusted_stack_trace) {
+ std::u16string updated_source_id;
if (source_id.has_value())
updated_source_id = *source_id;
if (delegate_->DidAddMessageToConsole(this, log_level, message, line_no,
@@ -3582,8 +3582,8 @@
}
void RenderFrameHostImpl::OnSmartClipDataExtracted(int32_t callback_id,
- const base::string16& text,
- const base::string16& html,
+ const std::u16string& text,
+ const std::u16string& html,
const gfx::Rect& clip_rect) {
std::move(*smart_clip_callbacks_.Lookup(callback_id))
.Run(text, html, clip_rect);
@@ -3592,40 +3592,40 @@
#endif // defined(OS_ANDROID)
void RenderFrameHostImpl::RunModalAlertDialog(
- const base::string16& alert_message,
+ const std::u16string& alert_message,
RunModalAlertDialogCallback response_callback) {
auto dialog_closed_callback = base::BindOnce(
[](RunModalAlertDialogCallback response_callback, bool success,
- const base::string16& response) {
+ const std::u16string& response) {
// The response string is unused but we use a generic mechanism for
// closing the javascript dialog that returns two arguments.
std::move(response_callback).Run();
},
std::move(response_callback));
- RunJavaScriptDialog(alert_message, base::string16(),
+ RunJavaScriptDialog(alert_message, std::u16string(),
JAVASCRIPT_DIALOG_TYPE_ALERT,
std::move(dialog_closed_callback));
}
void RenderFrameHostImpl::RunModalConfirmDialog(
- const base::string16& alert_message,
+ const std::u16string& alert_message,
RunModalConfirmDialogCallback response_callback) {
auto dialog_closed_callback = base::BindOnce(
[](RunModalConfirmDialogCallback response_callback, bool success,
- const base::string16& response) {
+ const std::u16string& response) {
// The response string is unused but we use a generic mechanism for
// closing the javascript dialog that returns two arguments.
std::move(response_callback).Run(success);
},
std::move(response_callback));
- RunJavaScriptDialog(alert_message, base::string16(),
+ RunJavaScriptDialog(alert_message, std::u16string(),
JAVASCRIPT_DIALOG_TYPE_CONFIRM,
std::move(dialog_closed_callback));
}
void RenderFrameHostImpl::RunModalPromptDialog(
- const base::string16& alert_message,
- const base::string16& default_value,
+ const std::u16string& alert_message,
+ const std::u16string& default_value,
RunModalPromptDialogCallback response_callback) {
RunJavaScriptDialog(alert_message, default_value,
JAVASCRIPT_DIALOG_TYPE_PROMPT,
@@ -3633,15 +3633,15 @@
}
void RenderFrameHostImpl::RunJavaScriptDialog(
- const base::string16& message,
- const base::string16& default_prompt,
+ const std::u16string& message,
+ const std::u16string& default_prompt,
JavaScriptDialogType dialog_type,
JavaScriptDialogCallback ipc_response_callback) {
// Don't show the dialog if it's triggered on a non-active RenderFrameHost.
// This happens when the RenderFrameHost is pending deletion or in the
// back-forward cache.
if (lifecycle_state_ != LifecycleState::kActive) {
- std::move(ipc_response_callback).Run(true, base::string16());
+ std::move(ipc_response_callback).Run(true, std::u16string());
return;
}
@@ -3707,7 +3707,7 @@
auto ipc_callback_wrapper = base::BindOnce(
[](RunBeforeUnloadConfirmCallback response_callback, bool success,
- const base::string16& response) {
+ const std::u16string& response) {
// The response string is unused but we use a generic mechanism for
// closing the javascript dialog that returns two arguments.
std::move(response_callback).Run(success);
@@ -3828,7 +3828,7 @@
traffic_annotation));
parameters->set_content_initiated(!blink_parameters->is_context_menu_save);
parameters->set_suggested_name(
- blink_parameters->suggested_name.value_or(base::string16()));
+ blink_parameters->suggested_name.value_or(std::u16string()));
parameters->set_prompt(blink_parameters->is_context_menu_save);
parameters->set_cross_origin_redirects(
blink_parameters->cross_origin_redirects);
@@ -4187,13 +4187,13 @@
}
void RenderFrameHostImpl::UpdateTitle(
- const base::Optional<::base::string16>& title,
+ const base::Optional<::std::u16string>& title,
base::i18n::TextDirection title_direction) {
// This message should only be sent for top-level frames.
if (!is_main_frame())
return;
- base::string16 received_title;
+ std::u16string received_title;
if (title.has_value())
received_title = title.value();
@@ -4869,7 +4869,7 @@
focus_type);
}
-void RenderFrameHostImpl::TextSelectionChanged(const base::string16& text,
+void RenderFrameHostImpl::TextSelectionChanged(const std::u16string& text,
uint32_t offset,
const gfx::Range& range) {
has_selection_ = !text.empty();
@@ -6303,7 +6303,7 @@
void RenderFrameHostImpl::JavaScriptDialogClosed(
JavaScriptDialogCallback dialog_closed_callback,
bool success,
- const base::string16& user_input) {
+ const std::u16string& user_input) {
GetProcess()->SetBlocked(false);
std::move(dialog_closed_callback).Run(success, user_input);
// If executing as part of beforeunload event handling, there may have been
@@ -9549,8 +9549,8 @@
void RenderFrameHostImpl::PostMessageEvent(
const base::Optional<blink::RemoteFrameToken>& source_token,
- const base::string16& source_origin,
- const base::string16& target_origin,
+ const std::u16string& source_origin,
+ const std::u16string& target_origin,
blink::TransferableMessage message) {
DCHECK(is_render_frame_created());
diff --git a/content/browser/renderer_host/render_frame_host_impl.h b/content/browser/renderer_host/render_frame_host_impl.h
index 10d14bbe11a..2dd48f8 100644
--- a/content/browser/renderer_host/render_frame_host_impl.h
+++ b/content/browser/renderer_host/render_frame_host_impl.h
@@ -339,21 +339,21 @@
gfx::NativeView GetNativeView() override;
void AddMessageToConsole(blink::mojom::ConsoleMessageLevel level,
const std::string& message) override;
- void ExecuteJavaScriptMethod(const base::string16& object_name,
- const base::string16& method_name,
+ void ExecuteJavaScriptMethod(const std::u16string& object_name,
+ const std::u16string& method_name,
base::Value arguments,
JavaScriptResultCallback callback) override;
- void ExecuteJavaScript(const base::string16& javascript,
+ void ExecuteJavaScript(const std::u16string& javascript,
JavaScriptResultCallback callback) override;
- void ExecuteJavaScriptInIsolatedWorld(const base::string16& javascript,
+ void ExecuteJavaScriptInIsolatedWorld(const std::u16string& javascript,
JavaScriptResultCallback callback,
int32_t world_id) override;
void ExecuteJavaScriptForTests(
- const base::string16& javascript,
+ const std::u16string& javascript,
JavaScriptResultCallback callback,
int32_t world_id = ISOLATED_WORLD_ID_GLOBAL) override;
void ExecuteJavaScriptWithUserGestureForTests(
- const base::string16& javascript,
+ const std::u16string& javascript,
int32_t world_id = ISOLATED_WORLD_ID_GLOBAL) override;
void ActivateFindInPageResultForAccessibility(int request_id) override;
void InsertVisualStateCallback(VisualStateCallback callback) override;
@@ -943,14 +943,14 @@
#if defined(OS_ANDROID)
// Samsung Galaxy Note-specific "smart clip" stylus text getter.
using ExtractSmartClipDataCallback = base::OnceCallback<
- void(const base::string16&, const base::string16&, const gfx::Rect&)>;
+ void(const std::u16string&, const std::u16string&, const gfx::Rect&)>;
void RequestSmartClipExtract(ExtractSmartClipDataCallback callback,
gfx::Rect rect);
void OnSmartClipDataExtracted(int32_t callback_id,
- const base::string16& text,
- const base::string16& html,
+ const std::u16string& text,
+ const std::u16string& html,
const gfx::Rect& clip_rect);
#endif // defined(OS_ANDROID)
@@ -1345,8 +1345,8 @@
// Posts a message from a frame in another process to the current renderer.
void PostMessageEvent(
const base::Optional<blink::RemoteFrameToken>& source_token,
- const base::string16& source_origin,
- const base::string16& target_origin,
+ const std::u16string& source_origin,
+ const std::u16string& target_origin,
blink::TransferableMessage message);
// Requests to swap the current frame into the frame tree, replacing the
@@ -1738,7 +1738,7 @@
void DispatchLoad() override;
void GoToEntryAtOffset(int32_t offset, bool has_user_gesture) override;
void RenderFallbackContentInParentProcess() override;
- void UpdateTitle(const base::Optional<::base::string16>& title,
+ void UpdateTitle(const base::Optional<::std::u16string>& title,
base::i18n::TextDirection title_direction) override;
void UpdateUserActivationState(
blink::mojom::UserActivationUpdateType update_type,
@@ -1750,12 +1750,12 @@
void ForwardResourceTimingToParent(
blink::mojom::ResourceTimingInfoPtr timing) override;
void DidFinishDocumentLoad() override;
- void RunModalAlertDialog(const base::string16& alert_message,
+ void RunModalAlertDialog(const std::u16string& alert_message,
RunModalAlertDialogCallback callback) override;
- void RunModalConfirmDialog(const base::string16& alert_message,
+ void RunModalConfirmDialog(const std::u16string& alert_message,
RunModalConfirmDialogCallback callback) override;
- void RunModalPromptDialog(const base::string16& alert_message,
- const base::string16& default_value,
+ void RunModalPromptDialog(const std::u16string& alert_message,
+ const std::u16string& default_value,
RunModalPromptDialogCallback callback) override;
void RunBeforeUnloadConfirm(bool is_reload,
RunBeforeUnloadConfirmCallback callback) override;
@@ -1765,7 +1765,7 @@
void FocusedElementChanged(bool is_editable_element,
const gfx::Rect& bounds_in_frame_widget,
blink::mojom::FocusType focus_type) override;
- void TextSelectionChanged(const base::string16& text,
+ void TextSelectionChanged(const std::u16string& text,
uint32_t offset,
const gfx::Range& range) override;
void ShowPopupMenu(
@@ -1804,10 +1804,10 @@
void Detach() override;
void DidAddMessageToConsole(
blink::mojom::ConsoleMessageLevel log_level,
- const base::string16& message,
+ const std::u16string& message,
int32_t line_no,
- const base::Optional<base::string16>& source_id,
- const base::Optional<base::string16>& untrusted_stack_trace) override;
+ const base::Optional<std::u16string>& source_id,
+ const base::Optional<std::u16string>& untrusted_stack_trace) override;
void FrameSizeChanged(const gfx::Size& frame_size) override;
// blink::LocalMainFrameHost overrides:
@@ -2681,8 +2681,8 @@
// Common handler for displaying a javascript dialog from the Run*Dialog
// mojo handlers. This method sets up some initial state before asking the
// delegate to create a dialog.
- void RunJavaScriptDialog(const base::string16& message,
- const base::string16& default_prompt,
+ void RunJavaScriptDialog(const std::u16string& message,
+ const std::u16string& default_prompt,
JavaScriptDialogType dialog_type,
JavaScriptDialogCallback callback);
@@ -2691,7 +2691,7 @@
// callback when done.
void JavaScriptDialogClosed(JavaScriptDialogCallback response_callback,
bool success,
- const base::string16& user_input);
+ const std::u16string& user_input);
// See |SetIsXrOverlaySetup()|
bool HasSeenRecentXrOverlaySetup();
diff --git a/content/browser/renderer_host/render_frame_host_impl_browsertest.cc b/content/browser/renderer_host/render_frame_host_impl_browsertest.cc
index c355e88..e8a114a6 100644
--- a/content/browser/renderer_host/render_frame_host_impl_browsertest.cc
+++ b/content/browser/renderer_host/render_frame_host_impl_browsertest.cc
@@ -422,7 +422,7 @@
}
// Runs the dialog callback.
- void Run(bool success, const base::string16& user_input) {
+ void Run(bool success, const std::u16string& user_input) {
std::move(callback_).Run(success, user_input);
}
@@ -450,8 +450,8 @@
void RunJavaScriptDialog(WebContents* web_contents,
RenderFrameHost* render_frame_host,
JavaScriptDialogType dialog_type,
- const base::string16& message_text,
- const base::string16& default_prompt_text,
+ const std::u16string& message_text,
+ const std::u16string& default_prompt_text,
DialogClosedCallback callback,
bool* did_suppress_message) override {
callback_ = std::move(callback);
@@ -469,7 +469,7 @@
bool HandleJavaScriptDialog(WebContents* web_contents,
bool accept,
- const base::string16* prompt_override) override {
+ const std::u16string* prompt_override) override {
return true;
}
@@ -576,7 +576,7 @@
EXPECT_TRUE(WaitForLoadStop(web_contents()));
// JavaScript onbeforeunload dialogs require a user gesture.
for (auto* frame : web_contents()->GetAllFrames())
- frame->ExecuteJavaScriptWithUserGestureForTests(base::string16());
+ frame->ExecuteJavaScriptWithUserGestureForTests(std::u16string());
// Force a process switch by going to a privileged page. The beforeunload
// timer will be started on the top-level frame but will be paused while the
@@ -590,7 +590,7 @@
EXPECT_TRUE(main_frame->is_waiting_for_beforeunload_completion());
// Answer the dialog.
- dialog_manager.Run(true, base::string16());
+ dialog_manager.Run(true, std::u16string());
// There will be no beforeunload completion callback invocation, so if the
// beforeunload completion callback timer isn't functioning then the
@@ -624,12 +624,12 @@
// Give the page a user gesture and try reloading again. This time there
// should be a dialog. If there is no dialog, the call to Wait will hang.
web_contents()->GetMainFrame()->ExecuteJavaScriptWithUserGestureForTests(
- base::string16());
+ std::u16string());
web_contents()->GetController().Reload(ReloadType::NORMAL, false);
dialog_manager.Wait();
// Answer the dialog.
- dialog_manager.Run(true, base::string16());
+ dialog_manager.Run(true, std::u16string());
EXPECT_TRUE(WaitForLoadStop(web_contents()));
// The reload should have cleared the user gesture bit, so upon leaving again
@@ -659,7 +659,7 @@
// Cancel the dialog.
dialog_manager.reset_url_invalidate_count();
- dialog_manager.Run(false, base::string16());
+ dialog_manager.Run(false, std::u16string());
EXPECT_FALSE(web_contents()->IsLoading());
// Verify there are no pending history items after the dialog is cancelled.
@@ -694,12 +694,12 @@
void CloseDialogAndProceed() {
dialog_manager_->Run(true /* navigation should proceed */,
- base::string16());
+ std::u16string());
}
void CloseDialogAndCancel() {
dialog_manager_->Run(false /* navigation should proceed */,
- base::string16());
+ std::u16string());
}
// Installs a beforeunload handler in the given frame.
@@ -1501,7 +1501,7 @@
// NavigationHandleGrabber::SendingNavigationCommitted(). The navigation
// should get aborted because of the document.open() in the navigating RFH.
NavigationHandleGrabber observer(web_contents());
- const base::string16 title = base::ASCIIToUTF16("done");
+ const std::u16string title = base::ASCIIToUTF16("done");
EXPECT_TRUE(
ExecuteScript(web_contents(), "window.location.href='/title2.html'"));
observer.WaitForTitle2();
@@ -1590,8 +1590,8 @@
xhr_response.Done();
// 4) Wait for the XHR request to complete.
- const base::string16 xhr_aborted_title = base::ASCIIToUTF16("xhr aborted");
- const base::string16 xhr_loaded_title = base::ASCIIToUTF16("xhr loaded");
+ const std::u16string xhr_aborted_title = base::ASCIIToUTF16("xhr aborted");
+ const std::u16string xhr_loaded_title = base::ASCIIToUTF16("xhr loaded");
TitleWatcher watcher(shell()->web_contents(), xhr_loaded_title);
watcher.AlsoWaitForTitle(xhr_aborted_title);
@@ -1644,7 +1644,7 @@
// 3) The end of the response is issued. The renderer must be able to receive
// it.
{
- const base::string16 document_loaded_title =
+ const std::u16string document_loaded_title =
base::ASCIIToUTF16("document loaded");
TitleWatcher watcher(shell()->web_contents(), document_loaded_title);
main_document_response.Send(
@@ -2639,7 +2639,7 @@
// dispatch a before unload with discard as a reason. This should return
// without any dialog being seen.
web_contents()->GetMainFrame()->ExecuteJavaScriptWithUserGestureForTests(
- base::string16());
+ std::u16string());
web_contents()->GetMainFrame()->DispatchBeforeUnload(
RenderFrameHostImpl::BeforeUnloadType::DISCARD, false);
dialog_manager.Wait();
@@ -2666,7 +2666,7 @@
// dispatch a before unload with discard as a reason. This should return
// without any dialog being seen.
web_contents()->GetMainFrame()->ExecuteJavaScriptWithUserGestureForTests(
- base::string16());
+ std::u16string());
// Launch an alert javascript dialog. This pending dialog should block a
// subsequent discarding before unload request.
@@ -2688,7 +2688,7 @@
// Clear the existing javascript dialog so that the associated IPC message
// doesn't leak.
- dialog_manager.Run(true, base::string16());
+ dialog_manager.Run(true, std::u16string());
web_contents()->SetDelegate(nullptr);
web_contents()->SetJavaScriptDialogManagerForTesting(nullptr);
diff --git a/content/browser/renderer_host/render_frame_host_manager_browsertest.cc b/content/browser/renderer_host/render_frame_host_manager_browsertest.cc
index 09a117f94..cc7dc47 100644
--- a/content/browser/renderer_host/render_frame_host_manager_browsertest.cc
+++ b/content/browser/renderer_host/render_frame_host_manager_browsertest.cc
@@ -1108,7 +1108,7 @@
// 3) Post a message from the foo window to the opener. The opener will
// reply, causing the foo window to update its own title.
- base::string16 expected_title = ASCIIToUTF16("msg");
+ std::u16string expected_title = ASCIIToUTF16("msg");
TitleWatcher title_watcher(foo_contents, expected_title);
EXPECT_TRUE(ExecuteScriptAndExtractBool(
foo_contents,
@@ -1215,7 +1215,7 @@
// 2) Post a message containing a MessagePort from opener to the the foo
// window. The foo window will reply via the passed port, causing the opener
// to update its own title.
- base::string16 expected_title = ASCIIToUTF16("msg-back-via-port");
+ std::u16string expected_title = ASCIIToUTF16("msg-back-via-port");
TitleWatcher title_observer(opener_contents, expected_title);
EXPECT_TRUE(ExecuteScriptAndExtractBool(
opener_contents,
@@ -1445,7 +1445,7 @@
shell()->web_contents()->GetController().GetLastCommittedEntry());
// Renderer-initiated navigations should work.
- base::string16 expected_title = ASCIIToUTF16("Title Of Awesomeness");
+ std::u16string expected_title = ASCIIToUTF16("Title Of Awesomeness");
TitleWatcher title_watcher(shell()->web_contents(), expected_title);
GURL url = embedded_test_server()->GetURL("/title2.html");
EXPECT_TRUE(ExecuteScript(
@@ -1555,7 +1555,7 @@
// Now get another reference to the window object, but don't otherwise access
// it. This is to ensure that DidAccessInitialDocument() notifications are not
// incorrectly generated when nothing is modified.
- base::string16 expected_title = ASCIIToUTF16("Modified Title");
+ std::u16string expected_title = ASCIIToUTF16("Modified Title");
TitleWatcher title_watcher(orig_contents, expected_title);
ExecuteScript(orig_contents, "getNewWindowReference();");
ASSERT_EQ(expected_title, title_watcher.WaitAndGetTitle());
@@ -1610,7 +1610,7 @@
// Now modify the contents of the new window from the opener. This will also
// modify the title of the document to give us something to listen for.
- base::string16 expected_title = ASCIIToUTF16("Modified Title");
+ std::u16string expected_title = ASCIIToUTF16("Modified Title");
TitleWatcher title_watcher(orig_contents, expected_title);
ExecuteScript(orig_contents, "modifyNewWindow();");
ASSERT_EQ(expected_title, title_watcher.WaitAndGetTitle());
@@ -1668,7 +1668,7 @@
// Now modify the contents of the new window from the opener. This will also
// modify the title of the document to give us something to listen for.
- base::string16 expected_title = ASCIIToUTF16("Modified Title");
+ std::u16string expected_title = ASCIIToUTF16("Modified Title");
TitleWatcher title_watcher(orig_contents, expected_title);
ExecuteScript(orig_contents, "modifyNewWindow();");
ASSERT_EQ(expected_title, title_watcher.WaitAndGetTitle());
@@ -1719,7 +1719,7 @@
// Now modify the contents of the new window from the opener. This will also
// modify the title of the document to give us something to listen for.
- base::string16 expected_title = ASCIIToUTF16("Modified Title");
+ std::u16string expected_title = ASCIIToUTF16("Modified Title");
TitleWatcher title_watcher(orig_contents, expected_title);
ExecuteScript(orig_contents, "modifyNewWindowWithDocumentOpen();");
ASSERT_EQ(expected_title, title_watcher.WaitAndGetTitle());
@@ -2436,7 +2436,7 @@
EXPECT_TRUE(NavigateToURL(shell(), view_source_url));
// Check that javascript: URLs work.
- base::string16 expected_title = ASCIIToUTF16("msg");
+ std::u16string expected_title = ASCIIToUTF16("msg");
TitleWatcher title_watcher(shell()->web_contents(), expected_title);
shell()->LoadURL(GURL("javascript:document.title='msg'"));
ASSERT_EQ(expected_title, title_watcher.WaitAndGetTitle());
@@ -3232,7 +3232,7 @@
// Check that foo's opener was updated in foo's process. Send a postMessage
// to the opener and check that the right window (bar_shell) receives it.
- base::string16 expected_title = ASCIIToUTF16("opener-msg");
+ std::u16string expected_title = ASCIIToUTF16("opener-msg");
TitleWatcher title_watcher(bar_shell->web_contents(), expected_title);
success = false;
EXPECT_TRUE(ExecuteScriptAndExtractBool(
@@ -3733,7 +3733,7 @@
"window.>
"history.pushState({}, 'foo', 'foo');"
"document.title='foo'; };\n"));
- base::string16 title = web_contents->GetTitle();
+ std::u16string title = web_contents->GetTitle();
NavigationEntryImpl* entry = web_contents->GetController().GetEntryAtIndex(0);
// Navigate the first tab to a different site and wait for the old process to
diff --git a/content/browser/renderer_host/render_frame_host_manager_unittest.cc b/content/browser/renderer_host/render_frame_host_manager_unittest.cc
index 00b20f9..77fef86 100644
--- a/content/browser/renderer_host/render_frame_host_manager_unittest.cc
+++ b/content/browser/renderer_host/render_frame_host_manager_unittest.cc
@@ -889,7 +889,7 @@
const GURL kUrl1("http://www.google.com/");
NavigationEntryImpl entry1(
nullptr /* instance */, kUrl1, Referrer(), base::nullopt,
- base::string16() /* title */, ui::PAGE_TRANSITION_TYPED,
+ std::u16string() /* title */, ui::PAGE_TRANSITION_TYPED,
false /* is_renderer_init */, nullptr /* blob_url_loader_factory */);
host = NavigateToEntry(manager, &entry1);
@@ -914,7 +914,7 @@
NavigationEntryImpl entry2(
nullptr /* instance */, kUrl2,
Referrer(kUrl1, network::mojom::ReferrerPolicy::kDefault),
- kInitiatorOrigin, base::string16() /* title */, ui::PAGE_TRANSITION_LINK,
+ kInitiatorOrigin, std::u16string() /* title */, ui::PAGE_TRANSITION_LINK,
true /* is_renderer_init */, nullptr /* blob_url_loader_factory */);
host = NavigateToEntry(manager, &entry2);
@@ -937,7 +937,7 @@
NavigationEntryImpl entry3(
nullptr /* instance */, kUrl3,
Referrer(kUrl2, network::mojom::ReferrerPolicy::kDefault), base::nullopt,
- base::string16() /* title */, ui::PAGE_TRANSITION_LINK,
+ std::u16string() /* title */, ui::PAGE_TRANSITION_LINK,
false /* is_renderer_init */, nullptr /* blob_url_loader_factory */);
host = NavigateToEntry(manager, &entry3);
@@ -980,7 +980,7 @@
const GURL kUrl(GetWebUIURL("foo"));
NavigationEntryImpl entry(
nullptr /* instance */, kUrl, Referrer(), base::nullopt,
- base::string16() /* title */, ui::PAGE_TRANSITION_TYPED,
+ std::u16string() /* title */, ui::PAGE_TRANSITION_TYPED,
false /* is_renderer_init */, nullptr /* blob_url_loader_factory */);
RenderFrameHostImpl* host = NavigateToEntry(manager, &entry);
@@ -1031,7 +1031,7 @@
const GURL kUrl1(GetWebUIURL("foo"));
NavigationEntryImpl entry1(
nullptr /* instance */, kUrl1, Referrer(), base::nullopt,
- base::string16() /* title */, ui::PAGE_TRANSITION_TYPED,
+ std::u16string() /* title */, ui::PAGE_TRANSITION_TYPED,
false /* is_renderer_init */, nullptr /* blob_url_loader_factory */);
RenderFrameHostImpl* host1 = NavigateToEntry(manager1, &entry1);
@@ -1063,7 +1063,7 @@
url::Origin::Create(GURL("https://initiator.example.com"));
NavigationEntryImpl entry2(
nullptr /* instance */, kUrl2, Referrer(), kInitiatorOrigin,
- base::string16() /* title */, ui::PAGE_TRANSITION_LINK,
+ std::u16string() /* title */, ui::PAGE_TRANSITION_LINK,
true /* is_renderer_init */, nullptr /* blob_url_loader_factory */);
RenderFrameHostImpl* host2 = NavigateToEntry(manager2, &entry2);
@@ -1438,7 +1438,7 @@
const GURL kUrl1("http://www.google.com/");
NavigationEntryImpl entry1(
nullptr /* instance */, kUrl1, Referrer(), base::nullopt,
- base::string16() /* title */, ui::PAGE_TRANSITION_TYPED,
+ std::u16string() /* title */, ui::PAGE_TRANSITION_TYPED,
false /* is_renderer_init */, nullptr /* blob_url_loader_factory */);
host = NavigateToEntry(manager, &entry1);
@@ -1462,7 +1462,7 @@
NavigationEntryImpl entry2(
nullptr /* instance */, kUrl2,
Referrer(kUrl1, network::mojom::ReferrerPolicy::kDefault),
- kInitiatorOrigin, base::string16() /* title */, ui::PAGE_TRANSITION_LINK,
+ kInitiatorOrigin, std::u16string() /* title */, ui::PAGE_TRANSITION_LINK,
true /* is_renderer_init */, nullptr /* blob_url_loader_factory */);
host = NavigateToEntry(manager, &entry2);
@@ -1514,7 +1514,7 @@
const GURL kUrl1("http://www.google.com/");
NavigationEntryImpl entry1(
nullptr /* instance */, kUrl1, Referrer(), base::nullopt,
- base::string16() /* title */, ui::PAGE_TRANSITION_TYPED,
+ std::u16string() /* title */, ui::PAGE_TRANSITION_TYPED,
false /* is_renderer_init */, nullptr /* blob_url_loader_factory */);
RenderFrameHostImpl* host = NavigateToEntry(manager, &entry1);
@@ -1537,7 +1537,7 @@
const GURL kUrl2("http://www.example.com");
NavigationEntryImpl entry2(
nullptr /* instance */, kUrl2, Referrer(), base::nullopt,
- base::string16() /* title */, ui::PAGE_TRANSITION_TYPED,
+ std::u16string() /* title */, ui::PAGE_TRANSITION_TYPED,
false /* is_renderer_init */, nullptr /* blob_url_loader_factory */);
RenderFrameHostImpl* host2 = NavigateToEntry(manager, &entry2);
@@ -1838,7 +1838,7 @@
// 1) The first navigation.
NavigationEntryImpl entryA(
nullptr /* instance */, kUrlA, Referrer(), base::nullopt,
- base::string16() /* title */, ui::PAGE_TRANSITION_TYPED,
+ std::u16string() /* title */, ui::PAGE_TRANSITION_TYPED,
false /* is_renderer_init */, nullptr /* blob_url_loader_factory */);
RenderFrameHostImpl* host1 = NavigateToEntry(iframe1, &entryA);
@@ -1857,7 +1857,7 @@
NavigationEntryImpl entryB(
nullptr /* instance */, kUrlB,
Referrer(kUrlA, network::mojom::ReferrerPolicy::kDefault), base::nullopt,
- base::string16() /* title */, ui::PAGE_TRANSITION_LINK,
+ std::u16string() /* title */, ui::PAGE_TRANSITION_LINK,
false /* is_renderer_init */, nullptr /* blob_url_loader_factory */);
host1 = NavigateToEntry(iframe1, &entryB);
RenderFrameHostImpl* host2 = NavigateToEntry(iframe2, &entryB);
@@ -1992,7 +1992,7 @@
NavigationEntryImpl entry(
nullptr /* instance */, kUrl2,
Referrer(kUrl1, network::mojom::ReferrerPolicy::kDefault), base::nullopt,
- base::string16() /* title */, ui::PAGE_TRANSITION_LINK,
+ std::u16string() /* title */, ui::PAGE_TRANSITION_LINK,
false /* is_renderer_init */, nullptr /* blob_url_loader_factory */);
RenderFrameHostImpl* cross_site = NavigateToEntry(iframe, &entry);
DidNavigateFrame(iframe, cross_site);
@@ -2047,7 +2047,7 @@
const GURL kWebUIUrl(GetWebUIURL("foo"));
NavigationEntryImpl webui_entry(
nullptr /* instance */, kWebUIUrl, Referrer(), base::nullopt,
- base::string16() /* title */, ui::PAGE_TRANSITION_TYPED,
+ std::u16string() /* title */, ui::PAGE_TRANSITION_TYPED,
false /* is_renderer_init */, nullptr /* blob_url_loader_factory */);
RenderFrameHostManager* main_rfhm = contents()->GetRenderManagerForTesting();
RenderFrameHostImpl* webui_rfh = NavigateToEntry(main_rfhm, &webui_entry);
@@ -2059,7 +2059,7 @@
const GURL kSubframeUrl("http://bar.com");
NavigationEntryImpl subframe_entry(
nullptr /* instance */, kSubframeUrl, Referrer(), base::nullopt,
- base::string16() /* title */, ui::PAGE_TRANSITION_LINK,
+ std::u16string() /* title */, ui::PAGE_TRANSITION_LINK,
false /* is_renderer_init */, nullptr /* blob_url_loader_factory */);
RenderFrameHostImpl* bar_rfh =
NavigateToEntry(subframe_rfhm, &subframe_entry);
@@ -2399,7 +2399,7 @@
NavigationEntryImpl entryB(
nullptr /* instance */, kUrlB,
Referrer(kUrlA, network::mojom::ReferrerPolicy::kDefault), base::nullopt,
- base::string16() /* title */, ui::PAGE_TRANSITION_LINK,
+ std::u16string() /* title */, ui::PAGE_TRANSITION_LINK,
false /* is_renderer_init */, nullptr /* blob_url_loader_factory */);
TestRenderFrameHost* host1 =
static_cast<TestRenderFrameHost*>(NavigateToEntry(child1, &entryB));
@@ -2422,7 +2422,7 @@
NavigationEntryImpl entryC(
nullptr /* instance */, kUrlC,
Referrer(kUrlA, network::mojom::ReferrerPolicy::kDefault), base::nullopt,
- base::string16() /* title */, ui::PAGE_TRANSITION_LINK,
+ std::u16string() /* title */, ui::PAGE_TRANSITION_LINK,
false /* is_renderer_init */, nullptr /* blob_url_loader_factory */);
TestRenderFrameHost* host3 =
static_cast<TestRenderFrameHost*>(NavigateToEntry(child3, &entryC));
@@ -2505,7 +2505,7 @@
NavigationEntryImpl entryB(
nullptr /* instance */, kUrlB,
Referrer(kUrlA, network::mojom::ReferrerPolicy::kDefault), base::nullopt,
- base::string16() /* title */, ui::PAGE_TRANSITION_LINK,
+ std::u16string() /* title */, ui::PAGE_TRANSITION_LINK,
false /* is_renderer_init */, nullptr /* blob_url_loader_factory */);
TestRenderFrameHost* hostB =
static_cast<TestRenderFrameHost*>(NavigateToEntry(child, &entryB));
@@ -2521,7 +2521,7 @@
NavigationEntryImpl entryC(
nullptr /* instance */, kUrlC,
Referrer(kUrlA, network::mojom::ReferrerPolicy::kDefault), base::nullopt,
- base::string16() /* title */, ui::PAGE_TRANSITION_LINK,
+ std::u16string() /* title */, ui::PAGE_TRANSITION_LINK,
false /* is_renderer_init */, nullptr /* blob_url_loader_factory */);
TestRenderFrameHost* hostC =
static_cast<TestRenderFrameHost*>(NavigateToEntry(child, &entryC));
@@ -2575,7 +2575,7 @@
// Navigation request to an entry from a previous browsing session.
NavigationEntryImpl entry(
nullptr /* instance */, kInitUrl, Referrer(), base::nullopt,
- base::string16() /* title */, ui::PAGE_TRANSITION_RELOAD,
+ std::u16string() /* title */, ui::PAGE_TRANSITION_RELOAD,
false /* is_renderer_init */, nullptr /* blob_url_loader_factory */);
entry.set_restore_type(RestoreType::kRestored);
NavigateToEntry(manager, &entry);
@@ -2869,7 +2869,7 @@
const GURL kUrl(GetWebUIURL("foo"));
NavigationEntryImpl entry(
nullptr /* instance */, kUrl, Referrer(), base::nullopt,
- base::string16() /* title */, ui::PAGE_TRANSITION_TYPED,
+ std::u16string() /* title */, ui::PAGE_TRANSITION_TYPED,
false /* is_renderer_init */, nullptr /* blob_url_loader_factory */);
FrameNavigationEntry* frame_entry = entry.root_node()->frame_entry.get();
FrameTreeNode* frame_tree_node =
diff --git a/content/browser/renderer_host/render_frame_proxy_host.cc b/content/browser/renderer_host/render_frame_proxy_host.cc
index f282baa..1df6108 100644
--- a/content/browser/renderer_host/render_frame_proxy_host.cc
+++ b/content/browser/renderer_host/render_frame_proxy_host.cc
@@ -520,8 +520,8 @@
void RenderFrameProxyHost::RouteMessageEvent(
const base::Optional<blink::LocalFrameToken>& source_frame_token,
- const base::string16& source_origin,
- const base::string16& target_origin,
+ const std::u16string& source_origin,
+ const std::u16string& target_origin,
blink::TransferableMessage message) {
RenderFrameHostImpl* target_rfh = frame_tree_node()->current_frame_host();
if (!target_rfh->IsRenderFrameLive()) {
diff --git a/content/browser/renderer_host/render_frame_proxy_host.h b/content/browser/renderer_host/render_frame_proxy_host.h
index c6f75257..65979fc9 100644
--- a/content/browser/renderer_host/render_frame_proxy_host.h
+++ b/content/browser/renderer_host/render_frame_proxy_host.h
@@ -178,8 +178,8 @@
const blink::LocalFrameToken& source_frame_token) override;
void RouteMessageEvent(
const base::Optional<blink::LocalFrameToken>& source_frame_token,
- const base::string16& source_origin,
- const base::string16& target_origin,
+ const std::u16string& source_origin,
+ const std::u16string& target_origin,
blink::TransferableMessage message) override;
void PrintCrossProcessSubframe(const gfx::Rect& rect,
int document_cookie) override;
diff --git a/content/browser/renderer_host/render_process_host_browsertest.cc b/content/browser/renderer_host/render_process_host_browsertest.cc
index bb8e318..783aaf3 100644
--- a/content/browser/renderer_host/render_process_host_browsertest.cc
+++ b/content/browser/renderer_host/render_process_host_browsertest.cc
@@ -1209,8 +1209,8 @@
base::MakeRefCounted<DelayedHttpResponseWithResolver::Resolver>();
embedded_test_server()->RegisterRequestHandler(
base::BindRepeating(HandleHungBeaconWithResolver, resolver));
- const base::string16 title = base::ASCIIToUTF16("Resolved");
- const base::string16 waiting = base::ASCIIToUTF16("Waiting");
+ const std::u16string title = base::ASCIIToUTF16("Resolved");
+ const std::u16string waiting = base::ASCIIToUTF16("Waiting");
ASSERT_TRUE(embedded_test_server()->Start());
EXPECT_TRUE(NavigateToURL(
@@ -1235,7 +1235,7 @@
embedded_test_server()->RegisterRequestHandler(
base::BindRepeating(HandleHungBeacon, base::RepeatingClosure()));
ASSERT_TRUE(embedded_test_server()->Start());
- const base::string16 title = base::ASCIIToUTF16("Rejected");
+ const std::u16string title = base::ASCIIToUTF16("Rejected");
TitleWatcher watcher(shell()->web_contents(), title);
diff --git a/content/browser/renderer_host/render_view_host_impl.cc b/content/browser/renderer_host/render_view_host_impl.cc
index 517ee0e4..a0dc55dc 100644
--- a/content/browser/renderer_host/render_view_host_impl.cc
+++ b/content/browser/renderer_host/render_view_host_impl.cc
@@ -135,7 +135,7 @@
#if defined(OS_WIN)
// Fetches the name and font size of a particular Windows system font.
void GetFontInfo(gfx::win::SystemFont system_font,
- base::string16* name,
+ std::u16string* name,
int32_t* size) {
const gfx::Font& font = gfx::win::GetSystemFont(system_font);
*name = base::UTF8ToUTF16(font.GetFontName());
diff --git a/content/browser/renderer_host/render_view_host_unittest.cc b/content/browser/renderer_host/render_view_host_unittest.cc
index c8d56e9..eeef190 100644
--- a/content/browser/renderer_host/render_view_host_unittest.cc
+++ b/content/browser/renderer_host/render_view_host_unittest.cc
@@ -126,7 +126,7 @@
DropData drop_data;
// If `html` is not populated, `html_base_url` won't be populated when
// converting to `DragData` with `DropDataToDragData`.
- drop_data.html = base::string16();
+ drop_data.html = std::u16string();
GURL blocked_url = GURL(kBlockedURL);
GURL file_url = GURL("file:///home/user/secrets.txt");
diff --git a/content/browser/renderer_host/render_widget_host_browsertest.cc b/content/browser/renderer_host/render_widget_host_browsertest.cc
index cdcdf57..7573d08 100644
--- a/content/browser/renderer_host/render_widget_host_browsertest.cc
+++ b/content/browser/renderer_host/render_widget_host_browsertest.cc
@@ -631,7 +631,7 @@
}
// Ensure the renderer didn't explode :).
{
- base::string16 title_when_done[] = {base::UTF8ToUTF16("done 0"),
+ std::u16string title_when_done[] = {base::UTF8ToUTF16("done 0"),
base::UTF8ToUTF16("done 1")};
TitleWatcher title_watcher(shell()->web_contents(), title_when_done[i]);
EXPECT_TRUE(ExecuteScript(root_frame_host,
diff --git a/content/browser/renderer_host/render_widget_host_delegate.h b/content/browser/renderer_host/render_widget_host_delegate.h
index e3fe7f3..4a60eef 100644
--- a/content/browser/renderer_host/render_widget_host_delegate.h
+++ b/content/browser/renderer_host/render_widget_host_delegate.h
@@ -136,7 +136,7 @@
// Send OS Cut/Copy/Paste actions to the focused frame.
virtual void ExecuteEditCommand(
const std::string& command,
- const base::Optional<base::string16>& value) = 0;
+ const base::Optional<std::u16string>& value) = 0;
virtual void Undo() = 0;
virtual void Redo() = 0;
virtual void Cut() = 0;
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc
index ee6cb14..20c2816 100644
--- a/content/browser/renderer_host/render_widget_host_impl.cc
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -267,14 +267,14 @@
void CursorVisibilityChanged(bool visible) override {
DLOG(WARNING) << "Input request on unbound interface";
}
- void ImeSetComposition(const base::string16& text,
+ void ImeSetComposition(const std::u16string& text,
const std::vector<ui::ImeTextSpan>& ime_text_spans,
const gfx::Range& range,
int32_t start,
int32_t end) override {
DLOG(WARNING) << "Input request on unbound interface";
}
- void ImeCommitText(const base::string16& text,
+ void ImeCommitText(const std::u16string& text,
const std::vector<ui::ImeTextSpan>& ime_text_spans,
const gfx::Range& range,
int32_t relative_cursor_position,
@@ -2014,7 +2014,7 @@
RequestForceRedraw(snapshot_id);
}
-void RenderWidgetHostImpl::SelectionChanged(const base::string16& text,
+void RenderWidgetHostImpl::SelectionChanged(const std::u16string& text,
uint32_t offset,
const gfx::Range& range) {
if (view_)
@@ -2109,7 +2109,7 @@
}
void RenderWidgetHostImpl::ImeSetComposition(
- const base::string16& text,
+ const std::u16string& text,
const std::vector<ui::ImeTextSpan>& ime_text_spans,
const gfx::Range& replacement_range,
int selection_start,
@@ -2124,7 +2124,7 @@
}
void RenderWidgetHostImpl::ImeCommitText(
- const base::string16& text,
+ const std::u16string& text,
const std::vector<ui::ImeTextSpan>& ime_text_spans,
const gfx::Range& replacement_range,
int relative_cursor_pos) {
@@ -2148,7 +2148,7 @@
}
void RenderWidgetHostImpl::ImeCancelComposition() {
- GetWidgetInputHandler()->ImeSetComposition(base::string16(),
+ GetWidgetInputHandler()->ImeSetComposition(std::u16string(),
std::vector<ui::ImeTextSpan>(),
gfx::Range::InvalidRange(), 0, 0);
}
@@ -2349,7 +2349,7 @@
}
void RenderWidgetHostImpl::SetToolTipText(
- const base::string16& tooltip_text,
+ const std::u16string& tooltip_text,
base::i18n::TextDirection text_direction_hint) {
if (!GetView())
return;
@@ -2367,7 +2367,7 @@
// trying to detect the directionality from the tooltip text rather than the
// element direction. One could argue that would be a preferable solution
// but we use the current approach to match Fx & IE's behavior.
- base::string16 wrapped_tooltip_text = tooltip_text;
+ std::u16string wrapped_tooltip_text = tooltip_text;
if (!tooltip_text.empty()) {
if (text_direction_hint == base::i18n::LEFT_TO_RIGHT) {
// Force the tooltip to have LTR directionality.
diff --git a/content/browser/renderer_host/render_widget_host_impl.h b/content/browser/renderer_host/render_widget_host_impl.h
index 25b10d1d..36994e3 100644
--- a/content/browser/renderer_host/render_widget_host_impl.h
+++ b/content/browser/renderer_host/render_widget_host_impl.h
@@ -288,7 +288,7 @@
const ChildProcessTerminationInfo& info) override;
// blink::mojom::WidgetHost implementation.
- void SetToolTipText(const base::string16& tooltip_text,
+ void SetToolTipText(const std::u16string& tooltip_text,
base::i18n::TextDirection text_direction_hint) override;
void TextInputStateChanged(ui::mojom::TextInputStatePtr state) override;
void SelectionBoundsChanged(const gfx::Rect& anchor_rect,
@@ -542,7 +542,7 @@
// (on Windows);
// * when it receives a "preedit_changed" signal of GtkIMContext (on Linux);
// * when markedText of NSTextInput is called (on Mac).
- void ImeSetComposition(const base::string16& text,
+ void ImeSetComposition(const std::u16string& text,
const std::vector<ui::ImeTextSpan>& ime_text_spans,
const gfx::Range& replacement_range,
int selection_start,
@@ -555,7 +555,7 @@
// (on Windows);
// * when it receives a "commit" signal of GtkIMContext (on Linux);
// * when insertText of NSTextInput is called (on Mac).
- void ImeCommitText(const base::string16& text,
+ void ImeCommitText(const std::u16string& text,
const std::vector<ui::ImeTextSpan>& ime_text_spans,
const gfx::Range& replacement_range,
int relative_cursor_pos);
@@ -676,7 +676,7 @@
void RendererExited();
// Called from a RenderFrameHost when the text selection has changed.
- void SelectionChanged(const base::string16& text,
+ void SelectionChanged(const std::u16string& text,
uint32_t offset,
const gfx::Range& range);
diff --git a/content/browser/renderer_host/render_widget_host_unittest.cc b/content/browser/renderer_host/render_widget_host_unittest.cc
index fa03518..4942f85 100644
--- a/content/browser/renderer_host/render_widget_host_unittest.cc
+++ b/content/browser/renderer_host/render_widget_host_unittest.cc
@@ -310,9 +310,9 @@
public:
MOCK_METHOD1(OnInputEvent, void(const blink::WebInputEvent&));
#if defined(OS_ANDROID)
- MOCK_METHOD1(OnImeTextCommittedEvent, void(const base::string16& text_str));
+ MOCK_METHOD1(OnImeTextCommittedEvent, void(const std::u16string& text_str));
MOCK_METHOD1(OnImeSetComposingTextEvent,
- void(const base::string16& text_str));
+ void(const std::u16string& text_str));
MOCK_METHOD0(OnImeFinishComposingTextEvent, void());
#endif
};
@@ -445,7 +445,7 @@
void ExecuteEditCommand(
const std::string& command,
- const base::Optional<base::string16>& value) override {}
+ const base::Optional<std::u16string>& value) override {}
void Undo() override {}
void Redo() override {}
diff --git a/content/browser/renderer_host/render_widget_host_view_android.cc b/content/browser/renderer_host/render_widget_host_view_android.cc
index e92cfe0..f970514 100644
--- a/content/browser/renderer_host/render_widget_host_view_android.cc
+++ b/content/browser/renderer_host/render_widget_host_view_android.cc
@@ -1063,7 +1063,7 @@
}
void RenderWidgetHostViewAndroid::SetTooltipText(
- const base::string16& tooltip_text) {
+ const std::u16string& tooltip_text) {
// Tooltips don't makes sense on Android.
}
diff --git a/content/browser/renderer_host/render_widget_host_view_android.h b/content/browser/renderer_host/render_widget_host_view_android.h
index 7c61325..b580c46 100644
--- a/content/browser/renderer_host/render_widget_host_view_android.h
+++ b/content/browser/renderer_host/render_widget_host_view_android.h
@@ -126,7 +126,7 @@
const gfx::Rect& node_bounds_in_screen) override;
void RenderProcessGone() override;
void Destroy() override;
- void SetTooltipText(const base::string16& tooltip_text) override;
+ void SetTooltipText(const std::u16string& tooltip_text) override;
void TransformPointToRootSurface(gfx::PointF* point) override;
gfx::Rect GetBoundsInRootWindow() override;
void ProcessAckedTouchEvent(
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc
index 351e15a..5cf2e4e 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -758,12 +758,12 @@
}
void RenderWidgetHostViewAura::SetTooltipText(
- const base::string16& tooltip_text) {
+ const std::u16string& tooltip_text) {
GetCursorManager()->SetTooltipTextForView(this, tooltip_text);
}
void RenderWidgetHostViewAura::DisplayTooltipText(
- const base::string16& tooltip_text) {
+ const std::u16string& tooltip_text) {
tooltip_ = tooltip_text;
aura::Window* root_window = window_->GetRootWindow();
wm::TooltipClient* tooltip_client = wm::GetTooltipClient(root_window);
@@ -1155,7 +1155,7 @@
}
void RenderWidgetHostViewAura::InsertText(
- const base::string16& text,
+ const std::u16string& text,
InsertTextCursorBehavior cursor_behavior) {
DCHECK_NE(GetTextInputType(), ui::TEXT_INPUT_TYPE_NONE);
@@ -1359,9 +1359,8 @@
return false;
}
-bool RenderWidgetHostViewAura::GetTextFromRange(
- const gfx::Range& range,
- base::string16* text) const {
+bool RenderWidgetHostViewAura::GetTextFromRange(const gfx::Range& range,
+ std::u16string* text) const {
if (!text_input_manager_ || !GetFocusedWidget())
return false;
@@ -1569,7 +1568,7 @@
void RenderWidgetHostViewAura::SetActiveCompositionForAccessibility(
const gfx::Range& range,
- const base::string16& active_composition_text,
+ const std::u16string& active_composition_text,
bool is_composition_committed) {
BrowserAccessibilityManager* manager =
host()->GetRootBrowserAccessibilityManager();
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.h b/content/browser/renderer_host/render_widget_host_view_aura.h
index c7cde56a..c41cc40 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.h
+++ b/content/browser/renderer_host/render_widget_host_view_aura.h
@@ -129,8 +129,8 @@
void RenderProcessGone() override;
void ShowWithVisibility(Visibility web_contents_visibility) override;
void Destroy() override;
- void SetTooltipText(const base::string16& tooltip_text) override;
- void DisplayTooltipText(const base::string16& tooltip_text) override;
+ void SetTooltipText(const std::u16string& tooltip_text) override;
+ void DisplayTooltipText(const std::u16string& tooltip_text) override;
uint32_t GetCaptureSequenceNumber() const override;
bool IsSurfaceAvailableForCopy() override;
void CopyFromSurface(
@@ -197,7 +197,7 @@
void SetCompositionText(const ui::CompositionText& composition) override;
uint32_t ConfirmCompositionText(bool keep_selection) override;
void ClearCompositionText() override;
- void InsertText(const base::string16& text,
+ void InsertText(const std::u16string& text,
InsertTextCursorBehavior cursor_behavior) override;
void InsertChar(const ui::KeyEvent& event) override;
ui::TextInputType GetTextInputType() const override;
@@ -216,7 +216,7 @@
bool SetEditableSelectionRange(const gfx::Range& range) override;
bool DeleteRange(const gfx::Range& range) override;
bool GetTextFromRange(const gfx::Range& range,
- base::string16* text) const override;
+ std::u16string* text) const override;
void OnInputMethodChanged() override;
bool ChangeTextDirectionAndLayoutAlignment(
base::i18n::TextDirection direction) override;
@@ -252,7 +252,7 @@
// composition has been committed or not.
void SetActiveCompositionForAccessibility(
const gfx::Range& range,
- const base::string16& active_composition_text,
+ const std::u16string& active_composition_text,
bool is_composition_committed) override;
#endif
@@ -629,7 +629,7 @@
bool has_composition_text_;
// Current tooltip text.
- base::string16 tooltip_;
+ std::u16string tooltip_;
// Whether or not a frame observer has been added.
bool added_frame_observer_;
diff --git a/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc b/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc
index 8f25d17e..af318630 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc
@@ -5367,7 +5367,7 @@
EXPECT_TRUE(view_->UsesNativeWindowFrame());
// Simulate a tooltip.
- base::string16 tooltip_text(base::ASCIIToUTF16("The tooltip!"));
+ std::u16string tooltip_text(base::ASCIIToUTF16("The tooltip!"));
view_->SetTooltipText(tooltip_text);
EXPECT_FALSE(widget_host_->is_hidden());
EXPECT_EQ(tooltip_text, view_->tooltip_);
@@ -5375,7 +5375,7 @@
// Simulate occlusion, which should clear the tooltip.
view_->WasOccluded();
EXPECT_TRUE(widget_host_->is_hidden());
- EXPECT_EQ(base::string16(), view_->tooltip_);
+ EXPECT_EQ(std::u16string(), view_->tooltip_);
}
#endif
@@ -6049,7 +6049,7 @@
TEST_F(InputMethodResultAuraTest, FinishComposingText) {
base::RepeatingClosure ime_call = base::BindRepeating(
&ui::TextInputClient::InsertText, base::Unretained(text_input_client()),
- base::string16(),
+ std::u16string(),
ui::TextInputClient::InsertTextCursorBehavior::kMoveCursorAfterText);
for (auto index : active_view_sequence_) {
ActivateViewForTextInputManager(views_[index], ui::TEXT_INPUT_TYPE_TEXT);
@@ -6222,7 +6222,7 @@
// This test is for selected text.
TEST_F(InputMethodStateAuraTest, GetSelectedText) {
- base::string16 text = base::ASCIIToUTF16("some text of length 22");
+ std::u16string text = base::ASCIIToUTF16("some text of length 22");
size_t offset = 0U;
gfx::Range selection_range(20, 21);
@@ -6230,7 +6230,7 @@
render_widget_host_delegate()->set_focused_widget(
RenderWidgetHostImpl::From(views_[index]->GetRenderWidgetHost()));
views_[index]->SelectionChanged(text, offset, selection_range);
- base::string16 expected_text = text.substr(
+ std::u16string expected_text = text.substr(
selection_range.GetMin() - offset, selection_range.length());
EXPECT_EQ(expected_text, views_[index]->GetSelectedText());
@@ -6243,7 +6243,7 @@
// This test is for text range.
TEST_F(InputMethodStateAuraTest, GetTextRange) {
- const base::string16 text = base::ASCIIToUTF16("some text of length 22");
+ const std::u16string text = base::ASCIIToUTF16("some text of length 22");
for (auto index : active_view_sequence_) {
ActivateViewForTextInputManager(views_[index], ui::TEXT_INPUT_TYPE_TEXT);
@@ -6305,7 +6305,7 @@
}
TEST_F(InputMethodStateAuraTest, GetTextFromRange) {
- const base::string16 text = base::ASCIIToUTF16("some text of length 22");
+ const std::u16string text = base::ASCIIToUTF16("some text of length 22");
for (auto index : active_view_sequence_) {
ActivateViewForTextInputManager(views_[index], ui::TEXT_INPUT_TYPE_TEXT);
@@ -6316,7 +6316,7 @@
gfx::Range request_range(std::min(index, text.length() - 1),
std::min(index + 3, text.length() - 1));
- base::string16 result;
+ std::u16string result;
EXPECT_TRUE(text_input_client()->GetTextFromRange(request_range, &result));
EXPECT_EQ(text.substr(request_range.start(), request_range.length()),
result);
@@ -6344,11 +6344,11 @@
// Change the selection of the currently focused widget. It suffices to just
// call the method on the view.
- base::string16 expected_text = base::ASCIIToUTF16(texts[index]);
+ std::u16string expected_text = base::ASCIIToUTF16(texts[index]);
views_[index]->SelectionChanged(expected_text, 0U, gfx::Range(0, 5));
// Retrieve the selected text from clipboard and verify it is as expected.
- base::string16 result_text;
+ std::u16string result_text;
clipboard->ReadText(ui::ClipboardBuffer::kSelection,
/* data_dst = */ nullptr, &result_text);
EXPECT_EQ(expected_text, result_text);
@@ -6505,7 +6505,7 @@
input_method->SetFocusedTextInputClient(parent_view_);
input_method->AddObserver(this);
- parent_view_->SelectionChanged(base::string16(), 0, gfx::Range());
+ parent_view_->SelectionChanged(std::u16string(), 0, gfx::Range());
EXPECT_EQ(parent_view_, text_input_client_);
text_input_client_ = nullptr;
diff --git a/content/browser/renderer_host/render_widget_host_view_base.cc b/content/browser/renderer_host/render_widget_host_view_base.cc
index da0698c..fd202aa 100644
--- a/content/browser/renderer_host/render_widget_host_view_base.cc
+++ b/content/browser/renderer_host/render_widget_host_view_base.cc
@@ -145,7 +145,7 @@
return this;
}
-void RenderWidgetHostViewBase::SelectionChanged(const base::string16& text,
+void RenderWidgetHostViewBase::SelectionChanged(const std::u16string& text,
size_t offset,
const gfx::Range& range) {
if (GetTextInputManager())
@@ -280,9 +280,9 @@
return video_capturer;
}
-base::string16 RenderWidgetHostViewBase::GetSelectedText() {
+std::u16string RenderWidgetHostViewBase::GetSelectedText() {
if (!GetTextInputManager())
- return base::string16();
+ return std::u16string();
return GetTextInputManager()->GetTextSelection(this)->selected_text();
}
diff --git a/content/browser/renderer_host/render_widget_host_view_base.h b/content/browser/renderer_host/render_widget_host_view_base.h
index e06a30a..868c5030 100644
--- a/content/browser/renderer_host/render_widget_host_view_base.h
+++ b/content/browser/renderer_host/render_widget_host_view_base.h
@@ -92,7 +92,7 @@
void WasUnOccluded() override {}
void WasOccluded() override {}
void SetIsInVR(bool is_in_vr) override;
- base::string16 GetSelectedText() override;
+ std::u16string GetSelectedText() override;
bool IsMouseLocked() override;
bool GetIsMouseLockedUnadjustedMovementForTesting() override;
bool LockKeyboard(base::Optional<base::flat_set<ui::DomCode>> codes) override;
@@ -185,7 +185,7 @@
virtual RenderWidgetHostViewBase* GetRootView();
// Notifies the View that the renderer text selection has changed.
- virtual void SelectionChanged(const base::string16& text,
+ virtual void SelectionChanged(const std::u16string& text,
size_t offset,
const gfx::Range& range);
@@ -432,10 +432,10 @@
// Tells the View that the tooltip text for the current mouse position over
// the page has changed.
- virtual void SetTooltipText(const base::string16& tooltip_text) = 0;
+ virtual void SetTooltipText(const std::u16string& tooltip_text) = 0;
// Displays the requested tooltip on the screen.
- virtual void DisplayTooltipText(const base::string16& tooltip_text) {}
+ virtual void DisplayTooltipText(const std::u16string& tooltip_text) {}
// Transforms |point| to be in the coordinate space of browser compositor's
// surface. This is in DIP.
diff --git a/content/browser/renderer_host/render_widget_host_view_child_frame.cc b/content/browser/renderer_host/render_widget_host_view_child_frame.cc
index aadc80f..5142d903 100644
--- a/content/browser/renderer_host/render_widget_host_view_child_frame.cc
+++ b/content/browser/renderer_host/render_widget_host_view_child_frame.cc
@@ -396,7 +396,7 @@
}
void RenderWidgetHostViewChildFrame::SetTooltipText(
- const base::string16& tooltip_text) {
+ const std::u16string& tooltip_text) {
if (!frame_connector_)
return;
diff --git a/content/browser/renderer_host/render_widget_host_view_child_frame.h b/content/browser/renderer_host/render_widget_host_view_child_frame.h
index ce88e0d..a92c2fa 100644
--- a/content/browser/renderer_host/render_widget_host_view_child_frame.h
+++ b/content/browser/renderer_host/render_widget_host_view_child_frame.h
@@ -101,7 +101,7 @@
void SetIsLoading(bool is_loading) override;
void RenderProcessGone() override;
void Destroy() override;
- void SetTooltipText(const base::string16& tooltip_text) override;
+ void SetTooltipText(const std::u16string& tooltip_text) override;
void GestureEventAck(const blink::WebGestureEvent& event,
blink::mojom::InputEventResultState ack_result) override;
// Since the URL of content rendered by this class is not displayed in
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.h b/content/browser/renderer_host/render_widget_host_view_mac.h
index 9997e703..dee1fd0 100644
--- a/content/browser/renderer_host/render_widget_host_view_mac.h
+++ b/content/browser/renderer_host/render_widget_host_view_mac.h
@@ -129,8 +129,8 @@
void SetIsLoading(bool is_loading) override;
void RenderProcessGone() override;
void Destroy() override;
- void SetTooltipText(const base::string16& tooltip_text) override;
- void DisplayTooltipText(const base::string16& tooltip_text) override;
+ void SetTooltipText(const std::u16string& tooltip_text) override;
+ void DisplayTooltipText(const std::u16string& tooltip_text) override;
gfx::Size GetRequestedRendererSize() override;
uint32_t GetCaptureSequenceNumber() const override;
bool IsSurfaceAvailableForCopy() override;
@@ -359,12 +359,12 @@
std::unique_ptr<blink::WebCoalescedInputEvent> event) override;
void SmartMagnify(
std::unique_ptr<blink::WebCoalescedInputEvent> event) override;
- void ImeSetComposition(const base::string16& text,
+ void ImeSetComposition(const std::u16string& text,
const std::vector<ui::ImeTextSpan>& ime_text_spans,
const gfx::Range& replacement_range,
int selection_start,
int selection_end) override;
- void ImeCommitText(const base::string16& text,
+ void ImeCommitText(const std::u16string& text,
const gfx::Range& replacement_range) override;
void ImeFinishComposingText() override;
void ImeCancelCompositionFromCocoa() override;
@@ -517,7 +517,7 @@
// Gets a textual view of the page's contents, and passes it to the callback
// provided.
- using SpeechCallback = base::OnceCallback<void(const base::string16&)>;
+ using SpeechCallback = base::OnceCallback<void(const std::u16string&)>;
void GetPageTextForSpeech(SpeechCallback callback);
// Interface through which the NSView is to be manipulated. This points either
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm
index 44a682e..dcde5665 100644
--- a/content/browser/renderer_host/render_widget_host_view_mac.mm
+++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
@@ -730,12 +730,12 @@
}
void RenderWidgetHostViewMac::SetTooltipText(
- const base::string16& tooltip_text) {
+ const std::u16string& tooltip_text) {
GetCursorManager()->SetTooltipTextForView(this, tooltip_text);
}
void RenderWidgetHostViewMac::DisplayTooltipText(
- const base::string16& tooltip_text) {
+ const std::u16string& tooltip_text) {
ns_view_->SetTooltipText(tooltip_text);
}
@@ -765,7 +765,7 @@
// and needs to be recursive, and that's crazy difficult to do with a lambda.
// TODO(avi): Move this to be a lambda when P0839R0 lands in C++.
void AddTextNodesToVector(const ui::AXNode* node,
- std::vector<base::string16>* strings) {
+ std::vector<std::u16string>* strings) {
const ui::AXNodeData& node_data = node->data();
if (node_data.role == ax::mojom::Role::kStaticText) {
@@ -780,10 +780,10 @@
AddTextNodesToVector(child, strings);
}
-using SpeechCallback = base::OnceCallback<void(const base::string16&)>;
+using SpeechCallback = base::OnceCallback<void(const std::u16string&)>;
void CombineTextNodesAndMakeCallback(SpeechCallback callback,
const ui::AXTreeUpdate& update) {
- std::vector<base::string16> text_node_contents;
+ std::vector<std::u16string> text_node_contents;
text_node_contents.reserve(update.nodes.size());
ui::AXTree tree(update);
@@ -1117,7 +1117,7 @@
ns_view_->SetCursorLocked(true);
// Clear the tooltip window.
- ns_view_->SetTooltipText(base::string16());
+ ns_view_->SetTooltipText(std::u16string());
return blink::mojom::PointerLockResult::kSuccess;
}
@@ -1611,7 +1611,7 @@
host()->ForwardMouseEvent(web_event);
if (web_event.GetType() == WebInputEvent::Type::kMouseLeave)
- ns_view_->SetTooltipText(base::string16());
+ ns_view_->SetTooltipText(std::u16string());
}
void RenderWidgetHostViewMac::ForwardWheelEvent(
@@ -1683,7 +1683,7 @@
}
void RenderWidgetHostViewMac::ImeSetComposition(
- const base::string16& text,
+ const std::u16string& text,
const std::vector<ui::ImeTextSpan>& ime_text_spans,
const gfx::Range& replacement_range,
int selection_start,
@@ -1695,7 +1695,7 @@
}
void RenderWidgetHostViewMac::ImeCommitText(
- const base::string16& text,
+ const std::u16string& text,
const gfx::Range& replacement_range) {
if (auto* widget_host = GetWidgetForIme()) {
widget_host->ImeCommitText(text, std::vector<ui::ImeTextSpan>(),
@@ -2082,7 +2082,7 @@
// selected.
// https://crbug.com/830906
if (auto* selection = GetTextSelection()) {
- const base::string16& selected_text = selection->selected_text();
+ const std::u16string& selected_text = selection->selected_text();
NSString* ns_selected_text = base::SysUTF16ToNSString(selected_text);
if ([ns_selected_text length] == 0)
return;
diff --git a/content/browser/renderer_host/render_widget_host_view_mac_browsertest.mm b/content/browser/renderer_host/render_widget_host_view_mac_browsertest.mm
index c6913619..fb7eeb52 100644
--- a/content/browser/renderer_host/render_widget_host_view_mac_browsertest.mm
+++ b/content/browser/renderer_host/render_widget_host_view_mac_browsertest.mm
@@ -75,15 +75,15 @@
void Wait() { run_loop_.Run(); }
- const base::string16& text() const { return text_; }
+ const std::u16string& text() const { return text_; }
- void GetText(const base::string16& text) {
+ void GetText(const std::u16string& text) {
text_ = text;
run_loop_.Quit();
}
private:
- base::string16 text_;
+ std::u16string text_;
base::RunLoop run_loop_;
DISALLOW_COPY_AND_ASSIGN(TextCallbackWaiter);
diff --git a/content/browser/renderer_host/render_widget_host_view_mac_editcommand_helper_unittest.mm b/content/browser/renderer_host/render_widget_host_view_mac_editcommand_helper_unittest.mm
index fbf0507..f1fb41b3 100644
--- a/content/browser/renderer_host/render_widget_host_view_mac_editcommand_helper_unittest.mm
+++ b/content/browser/renderer_host/render_widget_host_view_mac_editcommand_helper_unittest.mm
@@ -88,7 +88,7 @@
private:
void ExecuteEditCommand(
const std::string& command,
- const base::Optional<base::string16>& value) override {
+ const base::Optional<std::u16string>& value) override {
edit_command_message_count_++;
}
void Undo() override {}
diff --git a/content/browser/renderer_host/render_widget_host_view_mac_unittest.mm b/content/browser/renderer_host/render_widget_host_view_mac_unittest.mm
index f0e8204..650aa00 100644
--- a/content/browser/renderer_host/render_widget_host_view_mac_unittest.mm
+++ b/content/browser/renderer_host/render_widget_host_view_mac_unittest.mm
@@ -649,7 +649,7 @@
}
TEST_F(RenderWidgetHostViewMacTest, GetFirstRectForCharacterRangeCaretCase) {
- const base::string16 kDummyString = base::UTF8ToUTF16("hogehoge");
+ const std::u16string kDummyString = base::UTF8ToUTF16("hogehoge");
const size_t kDummyOffset = 0;
gfx::Rect caret_rect(10, 11, 0, 10);
@@ -1714,7 +1714,7 @@
// This test verifies that |selected_text_| is updated accordingly with
// different variations of RWHVMac::SelectChanged updates.
TEST_F(RenderWidgetHostViewMacTest, SelectedText) {
- base::string16 sample_text;
+ std::u16string sample_text;
base::UTF8ToUTF16("hello world!", 12, &sample_text);
gfx::Range range(6, 11);
@@ -2092,7 +2092,7 @@
[FakeTextCheckingResult resultWithRange:NSMakeRange(0, 3)
replacementString:@"foo"];
- const base::string16 kOriginalString = base::UTF8ToUTF16("abcxxxghi");
+ const std::u16string kOriginalString = base::UTF8ToUTF16("abcxxxghi");
// Change the selection once; requests completions from the spell checker.
tab_view()->SelectionChanged(kOriginalString, 3, gfx::Range(3, 3));
@@ -2148,7 +2148,7 @@
EXPECT_NSNE(nil, candidate_list_item());
candidate_list_item().allowsCollapsing = NO;
- const base::string16 kOriginalString = base::UTF8ToUTF16("abcxxxghi");
+ const std::u16string kOriginalString = base::UTF8ToUTF16("abcxxxghi");
// Change the selection once; completions should *not* be requested.
tab_view()->SelectionChanged(kOriginalString, 3, gfx::Range(3, 3));
@@ -2180,7 +2180,7 @@
[FakeTextCheckingResult resultWithRange:NSMakeRange(0, 3)
replacementString:@"foo"];
- const base::string16 kOriginalString = base::UTF8ToUTF16("abcxxxghi");
+ const std::u16string kOriginalString = base::UTF8ToUTF16("abcxxxghi");
tab_view()->SelectionChanged(kOriginalString, 3,
gfx::Range::InvalidRange());
diff --git a/content/browser/renderer_host/text_input_manager.cc b/content/browser/renderer_host/text_input_manager.cc
index 26bc56f..e593ab5a 100644
--- a/content/browser/renderer_host/text_input_manager.cc
+++ b/content/browser/renderer_host/text_input_manager.cc
@@ -282,7 +282,7 @@
}
void TextInputManager::SelectionChanged(RenderWidgetHostViewBase* view,
- const base::string16& text,
+ const std::u16string& text,
size_t offset,
const gfx::Range& range) {
DCHECK(IsRegistered(view));
@@ -373,7 +373,7 @@
TextInputManager::TextSelection::~TextSelection() {}
-void TextInputManager::TextSelection::SetSelection(const base::string16& text,
+void TextInputManager::TextSelection::SetSelection(const std::u16string& text,
size_t offset,
const gfx::Range& range) {
text_ = text;
diff --git a/content/browser/renderer_host/text_input_manager.h b/content/browser/renderer_host/text_input_manager.h
index 11949b3..c3de53c 100644
--- a/content/browser/renderer_host/text_input_manager.h
+++ b/content/browser/renderer_host/text_input_manager.h
@@ -103,14 +103,14 @@
TextSelection(const TextSelection& other);
~TextSelection();
- void SetSelection(const base::string16& text,
+ void SetSelection(const std::u16string& text,
size_t offset,
const gfx::Range& range);
- const base::string16& selected_text() const { return selected_text_; }
+ const std::u16string& selected_text() const { return selected_text_; }
size_t offset() const { return offset_; }
const gfx::Range& range() const { return range_; }
- const base::string16& text() const { return text_; }
+ const std::u16string& text() const { return text_; }
private:
// The offset of the text stored in |text| relative to the start of the web
@@ -124,11 +124,11 @@
// and |range_|. It will be an empty string if either |text_| or |range_|
// are empty of this selection information is invalid (i.e., |range_| does
// not cover any of |text_|.
- base::string16 selected_text_;
+ std::u16string selected_text_;
// Part of the text on the page which includes the highlighted text plus
// possibly several characters before and after it.
- base::string16 text_;
+ std::u16string text_;
};
explicit TextInputManager(bool should_do_learning);
@@ -204,7 +204,7 @@
// Updates the new text selection information for the |view|.
void SelectionChanged(RenderWidgetHostViewBase* view,
- const base::string16& text,
+ const std::u16string& text,
size_t offset,
const gfx::Range& range);
diff --git a/content/browser/sandbox_support_mac_impl.h b/content/browser/sandbox_support_mac_impl.h
index dbc293f..ada813b 100644
--- a/content/browser/sandbox_support_mac_impl.h
+++ b/content/browser/sandbox_support_mac_impl.h
@@ -26,7 +26,7 @@
// content::mojom::SandboxSupportMac:
void GetSystemColors(GetSystemColorsCallback callback) override;
- void LoadFont(const base::string16& font_name,
+ void LoadFont(const std::u16string& font_name,
float font_point_size,
LoadFontCallback callback) override;
diff --git a/content/browser/sandbox_support_mac_impl.mm b/content/browser/sandbox_support_mac_impl.mm
index bd7940b..b2c9466 100644
--- a/content/browser/sandbox_support_mac_impl.mm
+++ b/content/browser/sandbox_support_mac_impl.mm
@@ -32,7 +32,7 @@
std::move(callback));
}
-void SandboxSupportMacImpl::LoadFont(const base::string16& font_name,
+void SandboxSupportMacImpl::LoadFont(const std::u16string& font_name,
float font_point_size,
LoadFontCallback callback) {
FontLoader::LoadFont(font_name, font_point_size, std::move(callback));
diff --git a/content/browser/security_exploit_browsertest.cc b/content/browser/security_exploit_browsertest.cc
index b243a30..2ba54e4f 100644
--- a/content/browser/security_exploit_browsertest.cc
+++ b/content/browser/security_exploit_browsertest.cc
@@ -236,7 +236,7 @@
public:
void Choose(const base::FilePath& file) {
auto file_info = blink::mojom::FileChooserFileInfo::NewNativeFile(
- blink::mojom::NativeFileInfo::New(file, base::string16()));
+ blink::mojom::NativeFileInfo::New(file, std::u16string()));
std::vector<blink::mojom::FileChooserFileInfoPtr> files;
files.push_back(std::move(file_info));
listener_->FileSelected(std::move(files), base::FilePath(),
@@ -806,7 +806,7 @@
public:
explicit RouteMessageEventInterceptor(
RenderFrameProxyHost* render_frame_proxy_host,
- const base::string16& evil_origin)
+ const std::u16string& evil_origin)
: render_frame_proxy_host_(render_frame_proxy_host),
evil_origin_(evil_origin) {
render_frame_proxy_host_->frame_host_receiver_for_testing()
@@ -819,8 +819,8 @@
void RouteMessageEvent(
const base::Optional<blink::LocalFrameToken>& source_frame_token,
- const base::string16& source_origin,
- const base::string16& target_origin,
+ const std::u16string& source_origin,
+ const std::u16string& target_origin,
blink::TransferableMessage message) override {
// Forward the message to the actual RFPH replacing |source_origin| with the
// "evil origin" as especified in SetEvilSourceOriginAndWaitForMessage().
@@ -831,7 +831,7 @@
private:
RenderFrameProxyHost* render_frame_proxy_host_;
- base::string16 evil_origin_;
+ std::u16string evil_origin_;
};
// Test verifying that a compromised renderer can't lie about the source_origin
@@ -870,7 +870,7 @@
// from the subframe process.
url::Origin invalid_origin =
web_contents->GetMainFrame()->GetLastCommittedOrigin();
- base::string16 evil_source_origin =
+ std::u16string evil_source_origin =
base::UTF8ToUTF16(invalid_origin.Serialize());
RouteMessageEventInterceptor mojo_interceptor(main_frame_proxy_host,
evil_source_origin);
diff --git a/content/browser/service_process_host_impl.cc b/content/browser/service_process_host_impl.cc
index 328c2b51..2af4b49b 100644
--- a/content/browser/service_process_host_impl.cc
+++ b/content/browser/service_process_host_impl.cc
@@ -213,7 +213,7 @@
void LaunchUtilityProcessServiceDeprecated(
const std::string& service_name,
- const base::string16& display_name,
+ const std::u16string& display_name,
sandbox::policy::SandboxType sandbox_type,
mojo::ScopedMessagePipeHandle service_pipe,
base::OnceCallback<void(base::ProcessId)> callback) {
diff --git a/content/browser/service_worker/embedded_worker_instance.cc b/content/browser/service_worker/embedded_worker_instance.cc
index bab292c..d773bcd9 100644
--- a/content/browser/service_worker/embedded_worker_instance.cc
+++ b/content/browser/service_worker/embedded_worker_instance.cc
@@ -925,7 +925,7 @@
}
void EmbeddedWorkerInstance::OnReportException(
- const base::string16& error_message,
+ const std::u16string& error_message,
int line_number,
int column_number,
const GURL& source_url) {
@@ -938,7 +938,7 @@
void EmbeddedWorkerInstance::OnReportConsoleMessage(
blink::mojom::ConsoleMessageSource source,
blink::mojom::ConsoleMessageLevel message_level,
- const base::string16& message,
+ const std::u16string& message,
int line_number,
const GURL& source_url) {
for (auto& observer : listener_list_) {
diff --git a/content/browser/service_worker/embedded_worker_instance.h b/content/browser/service_worker/embedded_worker_instance.h
index e8cd661..e5f4188 100644
--- a/content/browser/service_worker/embedded_worker_instance.h
+++ b/content/browser/service_worker/embedded_worker_instance.h
@@ -115,14 +115,14 @@
// worker died. When this is called, status is STOPPED.
virtual void OnDetached(EmbeddedWorkerStatus old_status) {}
- virtual void OnReportException(const base::string16& error_message,
+ virtual void OnReportException(const std::u16string& error_message,
int line_number,
int column_number,
const GURL& source_url) {}
virtual void OnReportConsoleMessage(
blink::mojom::ConsoleMessageSource source,
blink::mojom::ConsoleMessageLevel message_level,
- const base::string16& message,
+ const std::u16string& message,
int line_number,
const GURL& source_url) {}
};
@@ -300,13 +300,13 @@
// Resets the embedded worker instance to the initial state. Changes
// the internal status from STARTING or RUNNING to STOPPED.
void OnStopped() override;
- void OnReportException(const base::string16& error_message,
+ void OnReportException(const std::u16string& error_message,
int line_number,
int column_number,
const GURL& source_url) override;
void OnReportConsoleMessage(blink::mojom::ConsoleMessageSource source,
blink::mojom::ConsoleMessageLevel message_level,
- const base::string16& message,
+ const std::u16string& message,
int line_number,
const GURL& source_url) override;
diff --git a/content/browser/service_worker/fake_service_worker.cc b/content/browser/service_worker/fake_service_worker.cc
index 16380df..4e4ede30 100644
--- a/content/browser/service_worker/fake_service_worker.cc
+++ b/content/browser/service_worker/fake_service_worker.cc
@@ -139,7 +139,7 @@
const std::string& notification_id,
const blink::PlatformNotificationData& notification_data,
int action_index,
- const base::Optional<base::string16>& reply,
+ const base::Optional<std::u16string>& reply,
DispatchNotificationClickEventCallback callback) {
std::move(callback).Run(blink::mojom::ServiceWorkerEventStatus::COMPLETED);
}
diff --git a/content/browser/service_worker/fake_service_worker.h b/content/browser/service_worker/fake_service_worker.h
index b75536df..c63ded7a 100644
--- a/content/browser/service_worker/fake_service_worker.h
+++ b/content/browser/service_worker/fake_service_worker.h
@@ -89,7 +89,7 @@
const std::string& notification_id,
const blink::PlatformNotificationData& notification_data,
int action_index,
- const base::Optional<base::string16>& reply,
+ const base::Optional<std::u16string>& reply,
DispatchNotificationClickEventCallback callback) override;
void DispatchNotificationCloseEvent(
const std::string& notification_id,
diff --git a/content/browser/service_worker/service_worker_browsertest.cc b/content/browser/service_worker/service_worker_browsertest.cc
index d7f80a9..fd3808a 100644
--- a/content/browser/service_worker/service_worker_browsertest.cc
+++ b/content/browser/service_worker/service_worker_browsertest.cc
@@ -544,7 +544,7 @@
blink::ServiceWorkerStatusCode::kOk, base::DoNothing()));
observer->Wait();
- const base::string16 title1 = base::ASCIIToUTF16("save-data=on");
+ const std::u16string title1 = base::ASCIIToUTF16("save-data=on");
TitleWatcher title_watcher1(shell()->web_contents(), title1);
EXPECT_TRUE(NavigateToURL(shell(), embedded_test_server()->GetURL(kPageUrl)));
EXPECT_EQ(title1, title_watcher1.WaitAndGetTitle());
@@ -591,7 +591,7 @@
blink::ServiceWorkerStatusCode::kOk, base::DoNothing()));
observer->Wait();
- const base::string16 title = base::ASCIIToUTF16("PASS");
+ const std::u16string title = base::ASCIIToUTF16("PASS");
TitleWatcher title_watcher(shell()->web_contents(), title);
EXPECT_TRUE(NavigateToURL(
shell(), embedded_test_server()->GetURL(base::StringPrintf(
@@ -670,12 +670,12 @@
blink::ServiceWorkerStatusCode::kOk, base::DoNothing()));
observer->Wait();
- const base::string16 title1 = base::ASCIIToUTF16("reload=false");
+ const std::u16string title1 = base::ASCIIToUTF16("reload=false");
TitleWatcher title_watcher1(shell()->web_contents(), title1);
EXPECT_TRUE(NavigateToURL(shell(), embedded_test_server()->GetURL(kPageUrl)));
EXPECT_EQ(title1, title_watcher1.WaitAndGetTitle());
- const base::string16 title2 = base::ASCIIToUTF16("reload=true");
+ const std::u16string title2 = base::ASCIIToUTF16("reload=true");
TitleWatcher title_watcher2(shell()->web_contents(), title2);
ReloadBlockUntilNavigationsComplete(shell(), 1);
EXPECT_EQ(title2, title_watcher2.WaitAndGetTitle());
@@ -814,7 +814,7 @@
}
// Wait until the page is appropriately served by the service worker.
- const base::string16 title = base::ASCIIToUTF16("Title");
+ const std::u16string title = base::ASCIIToUTF16("Title");
TitleWatcher title_watcher(shell()->web_contents(), title);
EXPECT_TRUE(NavigateToURL(shell(), https_server.GetURL(kPageUrl)));
EXPECT_EQ(title, title_watcher.WaitAndGetTitle());
@@ -836,7 +836,7 @@
observer->Wait();
// Wait until the page is appropriately served by the service worker.
- const base::string16 title = base::ASCIIToUTF16("Title");
+ const std::u16string title = base::ASCIIToUTF16("Title");
TitleWatcher title_watcher(shell()->web_contents(), title);
EXPECT_TRUE(NavigateToURL(shell(), https_server.GetURL(kPageUrl)));
EXPECT_EQ(title, title_watcher.WaitAndGetTitle());
@@ -873,7 +873,7 @@
blink::ServiceWorkerStatusCode::kOk, base::DoNothing()));
observer->Wait();
- const base::string16 title = base::ASCIIToUTF16("Title");
+ const std::u16string title = base::ASCIIToUTF16("Title");
TitleWatcher title_watcher(shell()->web_contents(), title);
EXPECT_TRUE(NavigateToURL(shell(), embedded_test_server()->GetURL(kPageUrl)));
EXPECT_EQ(title, title_watcher.WaitAndGetTitle());
@@ -898,13 +898,13 @@
StartServerAndNavigateToSetup();
const char kScopeUrl[] = "/service_worker/imports_bust_memcache_scope/";
const char kPageUrl[] = "/service_worker/imports_bust_memcache.html";
- const base::string16 kOKTitle(base::ASCIIToUTF16("OK"));
- const base::string16 kFailTitle(base::ASCIIToUTF16("FAIL"));
+ const std::u16string kOKTitle(base::ASCIIToUTF16("OK"));
+ const std::u16string kFailTitle(base::ASCIIToUTF16("FAIL"));
TitleWatcher title_watcher(shell()->web_contents(), kOKTitle);
title_watcher.AlsoWaitForTitle(kFailTitle);
EXPECT_TRUE(NavigateToURL(shell(), embedded_test_server()->GetURL(kPageUrl)));
- base::string16 title = title_watcher.WaitAndGetTitle();
+ std::u16string title = title_watcher.WaitAndGetTitle();
EXPECT_EQ(kOKTitle, title);
// Verify the number of resources in the implicit script cache is correct.
@@ -1196,7 +1196,7 @@
observer->Wait();
// Navigation should succeed.
- const base::string16 title =
+ const std::u16string title =
base::ASCIIToUTF16("ServiceWorker test - empty page");
TitleWatcher title_watcher(shell()->web_contents(), title);
EXPECT_TRUE(NavigateToURL(
@@ -1257,7 +1257,7 @@
StartServerAndNavigateToSetup();
SetupForNavigationPreloadTest(page_url, worker_url);
- const base::string16 title = base::ASCIIToUTF16("PASS");
+ const std::u16string title = base::ASCIIToUTF16("PASS");
TitleWatcher title_watcher(shell()->web_contents(), title);
title_watcher.AlsoWaitForTitle(base::ASCIIToUTF16("ERROR"));
title_watcher.AlsoWaitForTitle(base::ASCIIToUTF16("REJECTED"));
@@ -1518,7 +1518,7 @@
SetupForNavigationPreloadTest(page_url, worker_url);
const std::string kPageUrl1 = kPageUrl + "?enable";
- const base::string16 title1 = base::ASCIIToUTF16("ENABLED");
+ const std::u16string title1 = base::ASCIIToUTF16("ENABLED");
TitleWatcher title_watcher1(shell()->web_contents(), title1);
title_watcher1.AlsoWaitForTitle(base::ASCIIToUTF16("FROM_SERVER"));
EXPECT_TRUE(
@@ -1529,7 +1529,7 @@
ASSERT_EQ(0, GetRequestCount(kPageUrl1));
const std::string kPageUrl2 = kPageUrl + "?change";
- const base::string16 title2 = base::ASCIIToUTF16("CHANGED");
+ const std::u16string title2 = base::ASCIIToUTF16("CHANGED");
TitleWatcher title_watcher2(shell()->web_contents(), title2);
title_watcher2.AlsoWaitForTitle(base::ASCIIToUTF16("FROM_SERVER"));
EXPECT_TRUE(
@@ -1543,7 +1543,7 @@
EXPECT_EQ("true", GetNavigationPreloadHeader(request_log_[kPageUrl2][0]));
const std::string kPageUrl3 = kPageUrl + "?disable";
- const base::string16 title3 = base::ASCIIToUTF16("DISABLED");
+ const std::u16string title3 = base::ASCIIToUTF16("DISABLED");
TitleWatcher title_watcher3(shell()->web_contents(), title3);
title_watcher3.AlsoWaitForTitle(base::ASCIIToUTF16("FROM_SERVER"));
EXPECT_TRUE(
@@ -1556,7 +1556,7 @@
EXPECT_EQ("Hello", GetNavigationPreloadHeader(request_log_[kPageUrl3][0]));
const std::string kPageUrl4 = kPageUrl + "?test";
- const base::string16 title4 = base::ASCIIToUTF16("TEST");
+ const std::u16string title4 = base::ASCIIToUTF16("TEST");
TitleWatcher title_watcher4(shell()->web_contents(), title4);
title_watcher4.AlsoWaitForTitle(base::ASCIIToUTF16("FROM_SERVER"));
EXPECT_TRUE(
@@ -1765,7 +1765,7 @@
EXPECT_TRUE(embedded_test_server()->ShutdownAndWaitUntilComplete());
- const base::string16 title = base::ASCIIToUTF16("REJECTED");
+ const std::u16string title = base::ASCIIToUTF16("REJECTED");
TitleWatcher title_watcher(shell()->web_contents(), title);
title_watcher.AlsoWaitForTitle(base::ASCIIToUTF16("RESOLVED"));
EXPECT_TRUE(NavigateToURL(shell(), page_url));
@@ -1971,7 +1971,7 @@
// Navigate to a same-origin, out of scope URL that redirects to the target
// URL. The navigation preload request should be the single request to the
// target URL.
- const base::string16 title1 = base::ASCIIToUTF16("?1");
+ const std::u16string title1 = base::ASCIIToUTF16("?1");
TitleWatcher title_watcher1(shell()->web_contents(), title1);
GURL expected_commit_url1(embedded_test_server()->GetURL(kPageUrl + "?1"));
EXPECT_TRUE(NavigateToURL(shell(), redirect_page_url, expected_commit_url1));
@@ -1981,7 +1981,7 @@
// Navigate to a same-origin, in-scope URL that redirects to the target URL.
// The navigation preload request should be the single request to the target
// URL.
- const base::string16 title2 = base::ASCIIToUTF16("?2");
+ const std::u16string title2 = base::ASCIIToUTF16("?2");
TitleWatcher title_watcher2(shell()->web_contents(), title2);
GURL expected_commit_url2(embedded_test_server()->GetURL(kPageUrl + "?2"));
EXPECT_TRUE(
@@ -1991,7 +1991,7 @@
// Navigate to a cross-origin URL that redirects to the target URL. The
// navigation preload request should be the single request to the target URL.
- const base::string16 title3 = base::ASCIIToUTF16("?3");
+ const std::u16string title3 = base::ASCIIToUTF16("?3");
TitleWatcher title_watcher3(shell()->web_contents(), title3);
GURL expected_commit_url3(embedded_test_server()->GetURL(kPageUrl + "?3"));
EXPECT_TRUE(NavigateToURL(shell(), cross_origin_redirect_page_url,
@@ -2257,7 +2257,7 @@
}
void NavigateToTestPage() {
- const base::string16 title =
+ const std::u16string title =
base::ASCIIToUTF16("Title was changed by the script.");
TitleWatcher title_watcher(shell()->web_contents(), title);
EXPECT_TRUE(
@@ -2609,7 +2609,7 @@
void RunTestWithCrossOriginURL(const std::string& test_page,
const std::string& cross_origin_url) {
- const base::string16 title = base::ASCIIToUTF16("PASS");
+ const std::u16string title = base::ASCIIToUTF16("PASS");
TitleWatcher title_watcher(shell()->web_contents(), title);
EXPECT_TRUE(NavigateToURL(
shell(), embedded_test_server()->GetURL(
diff --git a/content/browser/service_worker/service_worker_clients_api_browsertest.cc b/content/browser/service_worker/service_worker_clients_api_browsertest.cc
index 0a22917e..5faad6f 100644
--- a/content/browser/service_worker/service_worker_clients_api_browsertest.cc
+++ b/content/browser/service_worker/service_worker_clients_api_browsertest.cc
@@ -93,7 +93,7 @@
EXPECT_EQ(true, EvalJs(shell(), navigate_script));
// The page should be navigated to empty.html.
- const base::string16 title =
+ const std::u16string title =
base::ASCIIToUTF16("ServiceWorker test - empty page");
TitleWatcher title_watcher(shell()->web_contents(), title);
EXPECT_EQ(title, title_watcher.WaitAndGetTitle());
diff --git a/content/browser/service_worker/service_worker_context_core.cc b/content/browser/service_worker/service_worker_context_core.cc
index 66fc8a6e..5a10246 100644
--- a/content/browser/service_worker/service_worker_context_core.cc
+++ b/content/browser/service_worker/service_worker_context_core.cc
@@ -1029,7 +1029,7 @@
void ServiceWorkerContextCore::OnErrorReported(
ServiceWorkerVersion* version,
- const base::string16& error_message,
+ const std::u16string& error_message,
int line_number,
int column_number,
const GURL& source_url) {
@@ -1045,7 +1045,7 @@
ServiceWorkerVersion* version,
blink::mojom::ConsoleMessageSource source,
blink::mojom::ConsoleMessageLevel message_level,
- const base::string16& message,
+ const std::u16string& message,
int line_number,
const GURL& source_url) {
DCHECK_CURRENTLY_ON(ServiceWorkerContext::GetCoreThreadId());
diff --git a/content/browser/service_worker/service_worker_context_core.h b/content/browser/service_worker/service_worker_context_core.h
index 40b1e315..75bd1130 100644
--- a/content/browser/service_worker/service_worker_context_core.h
+++ b/content/browser/service_worker/service_worker_context_core.h
@@ -154,14 +154,14 @@
void OnVersionStateChanged(ServiceWorkerVersion* version) override;
void OnDevToolsRoutingIdChanged(ServiceWorkerVersion* version) override;
void OnErrorReported(ServiceWorkerVersion* version,
- const base::string16& error_message,
+ const std::u16string& error_message,
int line_number,
int column_number,
const GURL& source_url) override;
void OnReportConsoleMessage(ServiceWorkerVersion* version,
blink::mojom::ConsoleMessageSource source,
blink::mojom::ConsoleMessageLevel message_level,
- const base::string16& message,
+ const std::u16string& message,
int line_number,
const GURL& source_url) override;
diff --git a/content/browser/service_worker/service_worker_context_watcher_unittest.cc b/content/browser/service_worker/service_worker_context_watcher_unittest.cc
index d989587..75d6e96 100644
--- a/content/browser/service_worker/service_worker_context_watcher_unittest.cc
+++ b/content/browser/service_worker/service_worker_context_watcher_unittest.cc
@@ -330,7 +330,7 @@
watcher_callback.versions().at(registration_id).begin()->first;
EXPECT_EQ(0u, watcher_callback.errors().size());
- base::string16 message(base::ASCIIToUTF16("HELLO"));
+ std::u16string message(base::ASCIIToUTF16("HELLO"));
ReportError(watcher, version_id, scope,
ServiceWorkerContextObserver::ErrorInfo(message, 0, 0, script));
base::RunLoop().RunUntilIdle();
@@ -381,7 +381,7 @@
watcher->Stop();
int callback_count = watcher_callback.callback_count();
- base::string16 message(base::ASCIIToUTF16("HELLO"));
+ std::u16string message(base::ASCIIToUTF16("HELLO"));
ReportError(watcher, 0 /*version_id*/, scope,
ServiceWorkerContextObserver::ErrorInfo(message, 0, 0, script));
base::RunLoop().RunUntilIdle();
diff --git a/content/browser/service_worker/service_worker_version.cc b/content/browser/service_worker/service_worker_version.cc
index e394eb76..3846db6f 100644
--- a/content/browser/service_worker/service_worker_version.cc
+++ b/content/browser/service_worker/service_worker_version.cc
@@ -1267,7 +1267,7 @@
}
void ServiceWorkerVersion::OnReportException(
- const base::string16& error_message,
+ const std::u16string& error_message,
int line_number,
int column_number,
const GURL& source_url) {
@@ -1280,7 +1280,7 @@
void ServiceWorkerVersion::OnReportConsoleMessage(
blink::mojom::ConsoleMessageSource source,
blink::mojom::ConsoleMessageLevel message_level,
- const base::string16& message,
+ const std::u16string& message,
int line_number,
const GURL& source_url) {
for (auto& observer : observers_) {
diff --git a/content/browser/service_worker/service_worker_version.h b/content/browser/service_worker/service_worker_version.h
index f802afb..1db322a 100644
--- a/content/browser/service_worker/service_worker_version.h
+++ b/content/browser/service_worker/service_worker_version.h
@@ -171,7 +171,7 @@
virtual void OnVersionStateChanged(ServiceWorkerVersion* version) {}
virtual void OnDevToolsRoutingIdChanged(ServiceWorkerVersion* version) {}
virtual void OnErrorReported(ServiceWorkerVersion* version,
- const base::string16& error_message,
+ const std::u16string& error_message,
int line_number,
int column_number,
const GURL& source_url) {}
@@ -179,7 +179,7 @@
ServiceWorkerVersion* version,
blink::mojom::ConsoleMessageSource source,
blink::mojom::ConsoleMessageLevel message_level,
- const base::string16& message,
+ const std::u16string& message,
int line_number,
const GURL& source_url) {}
virtual void OnCachedMetadataUpdated(ServiceWorkerVersion* version,
@@ -756,13 +756,13 @@
void OnStopped(EmbeddedWorkerStatus old_status) override;
void OnDetached(EmbeddedWorkerStatus old_status) override;
void OnRegisteredToDevToolsManager() override;
- void OnReportException(const base::string16& error_message,
+ void OnReportException(const std::u16string& error_message,
int line_number,
int column_number,
const GURL& source_url) override;
void OnReportConsoleMessage(blink::mojom::ConsoleMessageSource source,
blink::mojom::ConsoleMessageLevel message_level,
- const base::string16& message,
+ const std::u16string& message,
int line_number,
const GURL& source_url) override;
diff --git a/content/browser/service_worker/service_worker_version_browsertest.cc b/content/browser/service_worker/service_worker_version_browsertest.cc
index 4ff2ca43..ecbeea7 100644
--- a/content/browser/service_worker/service_worker_version_browsertest.cc
+++ b/content/browser/service_worker/service_worker_version_browsertest.cc
@@ -305,7 +305,7 @@
public:
void OnReportConsoleMessage(blink::mojom::ConsoleMessageSource source,
blink::mojom::ConsoleMessageLevel message_level,
- const base::string16& message,
+ const std::u16string& message,
int line_number,
const GURL& source_url) override {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
@@ -329,10 +329,10 @@
ASSERT_EQ(messages_.size(), expected_message_count);
}
- const std::vector<base::string16>& messages() const { return messages_; }
+ const std::vector<std::u16string>& messages() const { return messages_; }
private:
- std::vector<base::string16> messages_;
+ std::vector<std::u16string> messages_;
size_t expected_message_count_ = 0;
base::OnceClosure quit_;
};
@@ -1009,10 +1009,10 @@
ASSERT_EQ(blink::ServiceWorkerStatusCode::kErrorEventWaitUntilRejected,
status.value());
- const base::string16 expected =
+ const std::u16string expected =
base::ASCIIToUTF16("Rejecting oninstall event");
console_listener.WaitForConsoleMessages(1);
- ASSERT_NE(base::string16::npos,
+ ASSERT_NE(std::u16string::npos,
console_listener.messages()[0].find(expected));
version_->embedded_worker()->RemoveObserver(&console_listener);
}
@@ -1213,12 +1213,12 @@
version_->embedded_worker()->AddObserver(&console_listener);
FetchOnRegisteredWorker("/service_worker/empty.html", &result, &response);
- const base::string16 expected1 = base::ASCIIToUTF16(
+ const std::u16string expected1 = base::ASCIIToUTF16(
"resulted in a network error response: the promise was rejected.");
- const base::string16 expected2 =
+ const std::u16string expected2 =
base::ASCIIToUTF16("Uncaught (in promise) Rejecting respondWith promise");
console_listener.WaitForConsoleMessages(2);
- ASSERT_NE(base::string16::npos,
+ ASSERT_NE(std::u16string::npos,
console_listener.messages()[0].find(expected1));
ASSERT_EQ(0u, console_listener.messages()[1].find(expected2));
version_->embedded_worker()->RemoveObserver(&console_listener);
diff --git a/content/browser/session_history_browsertest.cc b/content/browser/session_history_browsertest.cc
index 80fb07c..635107e 100644
--- a/content/browser/session_history_browsertest.cc
+++ b/content/browser/session_history_browsertest.cc
@@ -109,7 +109,7 @@
void NavigateAndCheckTitle(const char* filename,
const std::string& expected_title) {
- base::string16 expected_title16(base::ASCIIToUTF16(expected_title));
+ std::u16string expected_title16(base::ASCIIToUTF16(expected_title));
TitleWatcher title_watcher(shell()->web_contents(), expected_title16);
EXPECT_TRUE(NavigateToURL(shell(), GetURL(filename)));
ASSERT_EQ(expected_title16, title_watcher.WaitAndGetTitle());
@@ -459,7 +459,7 @@
IN_PROC_BROWSER_TEST_F(SessionHistoryTest, LocationReplace) {
// Test that using location.replace doesn't leave the title of the old page
// visible.
- base::string16 expected_title16(base::ASCIIToUTF16("bot1"));
+ std::u16string expected_title16(base::ASCIIToUTF16("bot1"));
TitleWatcher title_watcher(shell()->web_contents(), expected_title16);
EXPECT_TRUE(NavigateToURL(shell(), GetURL("replace.html?bot1.html"),
GetURL("bot1.html") /* expected_commit_url */));
diff --git a/content/browser/site_instance_impl_unittest.cc b/content/browser/site_instance_impl_unittest.cc
index 59dd30a..4bdcecb 100644
--- a/content/browser/site_instance_impl_unittest.cc
+++ b/content/browser/site_instance_impl_unittest.cc
@@ -389,7 +389,7 @@
EXPECT_EQ(0, browser_client()->GetAndClearSiteInstanceDeleteCount());
NavigationEntryImpl* e1 = new NavigationEntryImpl(
- instance, url, Referrer(), base::nullopt, base::string16(),
+ instance, url, Referrer(), base::nullopt, std::u16string(),
ui::PAGE_TRANSITION_LINK, false, nullptr /* blob_url_loader_factory */);
// Redundantly setting e1's SiteInstance shouldn't affect the ref count.
@@ -399,7 +399,7 @@
// Add a second reference
NavigationEntryImpl* e2 = new NavigationEntryImpl(
- instance, url, Referrer(), base::nullopt, base::string16(),
+ instance, url, Referrer(), base::nullopt, std::u16string(),
ui::PAGE_TRANSITION_LINK, false, nullptr /* blob_url_loader_factory */);
instance = nullptr;
diff --git a/content/browser/site_per_process_browsertest.cc b/content/browser/site_per_process_browsertest.cc
index 3fd4370..f0d59a04 100644
--- a/content/browser/site_per_process_browsertest.cc
+++ b/content/browser/site_per_process_browsertest.cc
@@ -1464,7 +1464,7 @@
" function() { document.title = 'loaded'; };"));
EXPECT_TRUE(
ExecuteScript(shell()->web_contents(), "document.title = 'not loaded';"));
- base::string16 expected_title(base::UTF8ToUTF16("loaded"));
+ std::u16string expected_title(base::UTF8ToUTF16("loaded"));
TitleWatcher title_watcher(shell()->web_contents(), expected_title);
// Navigate the iframe cross-site.
@@ -5027,7 +5027,7 @@
{
GURL main_url(
embedded_test_server()->GetURL("/frame_with_load_event.html"));
- base::string16 expected_title(base::UTF8ToUTF16("LOADED"));
+ std::u16string expected_title(base::UTF8ToUTF16("LOADED"));
TitleWatcher title_watcher(shell()->web_contents(), expected_title);
EXPECT_TRUE(NavigateToURL(shell(), main_url));
EXPECT_EQ(title_watcher.WaitAndGetTitle(), expected_title);
@@ -5040,7 +5040,7 @@
// is fired.
{
GURL foo_url(embedded_test_server()->GetURL("foo.com", "/title1.html"));
- base::string16 expected_title(base::UTF8ToUTF16("LOADEDLOADED"));
+ std::u16string expected_title(base::UTF8ToUTF16("LOADEDLOADED"));
TitleWatcher title_watcher(shell()->web_contents(), expected_title);
TestNavigationObserver observer(shell()->web_contents());
EXPECT_TRUE(NavigateToURLFromRenderer(root->child_at(0), foo_url));
@@ -5078,7 +5078,7 @@
// Send a postMessage from second, cross-site frame to its parent. Expect
// parent to send a reply to the frame.
- base::string16 expected_title(base::ASCIIToUTF16("subframe-msg"));
+ std::u16string expected_title(base::ASCIIToUTF16("subframe-msg"));
TitleWatcher title_watcher(shell()->web_contents(), expected_title);
PostMessageAndWaitForReply(root->child_at(1), "postToParent('subframe-msg')",
"\"done-subframe2\"");
@@ -5615,7 +5615,7 @@
// parent by sending a postMessage to subframe's parent.opener.
EXPECT_EQ(true, EvalJs(popup_root->child_at(0), "!!parent.opener;"));
- base::string16 expected_title = base::ASCIIToUTF16("msg");
+ std::u16string expected_title = base::ASCIIToUTF16("msg");
TitleWatcher title_watcher(shell()->web_contents(), expected_title);
EXPECT_EQ(true, EvalJs(popup_root->child_at(0),
"postToOpenerOfParent('msg','*');"));
@@ -5720,7 +5720,7 @@
"parent.frames['subframe2'].opener && "
" parent.frames['subframe2'].opener === parent.opener;"));
- base::string16 expected_title = base::ASCIIToUTF16("msg");
+ std::u16string expected_title = base::ASCIIToUTF16("msg");
TitleWatcher title_watcher(shell()->web_contents(), expected_title);
EXPECT_EQ(true, EvalJs(popup_root->child_at(0),
"postToOpenerOfSibling('subframe2', 'msg', '*');"));
@@ -7351,7 +7351,7 @@
for (const auto& test : kTestCases) {
GURL blocked_url = embedded_test_server()->GetURL("b.com", test.url);
EXPECT_TRUE(ExecuteScript(shell(), "document.title = 'not loaded';"));
- base::string16 expected_title(base::UTF8ToUTF16("loaded"));
+ std::u16string expected_title(base::UTF8ToUTF16("loaded"));
TitleWatcher title_watcher(shell()->web_contents(), expected_title);
WebContentsConsoleObserver console_observer(shell()->web_contents());
@@ -7437,7 +7437,7 @@
"document.querySelector('iframe').>
" function() { document.title = 'loaded'; };"));
EXPECT_TRUE(ExecuteScript(shell(), "document.title = 'not loaded';"));
- base::string16 expected_title(base::UTF8ToUTF16("loaded"));
+ std::u16string expected_title(base::UTF8ToUTF16("loaded"));
TitleWatcher title_watcher(shell()->web_contents(), expected_title);
// Try to navigate the subframe to a blocked URL.
@@ -7511,7 +7511,7 @@
"document.querySelector('iframe').>
" function() { document.title = 'loaded'; };"));
EXPECT_TRUE(ExecJs(shell(), "document.title = 'not loaded';"));
- base::string16 expected_title(base::UTF8ToUTF16("loaded"));
+ std::u16string expected_title(base::UTF8ToUTF16("loaded"));
TitleWatcher title_watcher(shell()->web_contents(), expected_title);
// Try to navigate the subframe to a blocked URL.
@@ -7583,7 +7583,7 @@
"document.querySelector('iframe').>
" function() { window.top.postMessage('loaded', '*'); };"));
EXPECT_TRUE(ExecJs(shell(), "document.title = 'not loaded';"));
- base::string16 expected_title(base::UTF8ToUTF16("loaded"));
+ std::u16string expected_title(base::UTF8ToUTF16("loaded"));
TitleWatcher title_watcher(shell()->web_contents(), expected_title);
// Try to navigate the subframe to a blocked URL.
@@ -8753,7 +8753,7 @@
// Send a postMessage from the child to its parent. This verifies that the
// parent's proxy in the child's SiteInstance was also restored.
- base::string16 expected_title(base::UTF8ToUTF16("I am alive!"));
+ std::u16string expected_title(base::UTF8ToUTF16("I am alive!"));
TitleWatcher title_watcher(shell()->web_contents(), expected_title);
EXPECT_TRUE(ExecuteScript(child->current_frame_host(),
"parent.postMessage('I am alive!', '*');"));
@@ -9105,7 +9105,7 @@
// |popup2|. This is allowed since the main tab is |popup2|'s opener.
EXPECT_TRUE(NavigateToURLFromRenderer(shell(), b_url));
- base::string16 expected_title(base::UTF8ToUTF16("foo"));
+ std::u16string expected_title(base::UTF8ToUTF16("foo"));
TitleWatcher title_watcher(popup2->web_contents(), expected_title);
EXPECT_TRUE(ExecuteScript(
shell(), "window.open('','popup2').postMessage('foo', '*');"));
@@ -16756,7 +16756,7 @@
GURL main_url(https_server()->GetURL(
"foo.test", "/web_bundle/frame_parent.html?wbn=" + bundle_url.spec()));
EXPECT_TRUE(NavigateToURL(shell(), main_url));
- base::string16 expected_title(base::UTF8ToUTF16("OK"));
+ std::u16string expected_title(base::UTF8ToUTF16("OK"));
TitleWatcher title_watcher(shell()->web_contents(), expected_title);
EXPECT_EQ(expected_title, title_watcher.WaitAndGetTitle());
@@ -16777,7 +16777,7 @@
GURL main_url(https_server()->GetURL(
"foo.test", "/web_bundle/frame_parent.html?wbn=" + bundle_url.spec()));
EXPECT_TRUE(NavigateToURL(shell(), main_url));
- base::string16 expected_title(base::UTF8ToUTF16("OK"));
+ std::u16string expected_title(base::UTF8ToUTF16("OK"));
TitleWatcher title_watcher(shell()->web_contents(), expected_title);
EXPECT_EQ(expected_title, title_watcher.WaitAndGetTitle());
diff --git a/content/browser/site_per_process_hit_test_browsertest.cc b/content/browser/site_per_process_hit_test_browsertest.cc
index 1abc9f1..432aba22 100644
--- a/content/browser/site_per_process_hit_test_browsertest.cc
+++ b/content/browser/site_per_process_hit_test_browsertest.cc
@@ -3167,13 +3167,13 @@
}
void OnSetTooltipTextForView(const RenderWidgetHostViewBase* view,
- const base::string16& tooltip_text) override {
+ const std::u16string& tooltip_text) override {
tooltips_received_.push_back(tooltip_text);
if (tooltip_text == tooltip_text_wanted_ && run_loop_->running())
run_loop_->Quit();
}
- void WaitUntil(const base::string16& tooltip_text) {
+ void WaitUntil(const std::u16string& tooltip_text) {
tooltip_text_wanted_ = tooltip_text;
if (base::Contains(tooltips_received_, tooltip_text))
return;
@@ -3182,8 +3182,8 @@
private:
std::unique_ptr<base::RunLoop> run_loop_;
- base::string16 tooltip_text_wanted_;
- std::vector<base::string16> tooltips_received_;
+ std::u16string tooltip_text_wanted_;
+ std::vector<std::u16string> tooltips_received_;
DISALLOW_COPY_AND_ASSIGN(TooltipMonitor);
}; // class TooltipMonitor
@@ -3277,7 +3277,7 @@
a_frame_monitor.ResetEventReceived();
EXPECT_TRUE(b_frame_monitor.EventWasReceived());
b_frame_monitor.ResetEventReceived();
- tooltip_monitor.WaitUntil(base::string16());
+ tooltip_monitor.WaitUntil(std::u16string());
tooltip_monitor.Reset();
}
diff --git a/content/browser/site_per_process_unload_browsertest.cc b/content/browser/site_per_process_unload_browsertest.cc
index e2f0a5c..cdfb56d7 100644
--- a/content/browser/site_per_process_unload_browsertest.cc
+++ b/content/browser/site_per_process_unload_browsertest.cc
@@ -357,7 +357,7 @@
// the page a gesture to allow dialogs.
web_contents->GetMainFrame()->DisableBeforeUnloadHangMonitorForTesting();
web_contents->GetMainFrame()->ExecuteJavaScriptWithUserGestureForTests(
- base::string16());
+ std::u16string());
// Hang the first contents in a beforeunload dialog.
BeforeUnloadBlockingDelegate test_delegate(web_contents);
@@ -993,7 +993,7 @@
// This performs window.open() and waits for the title of the original
// document to change to signal that the unload handler has been registered.
{
- base::string16 title_when_loaded = base::UTF8ToUTF16("loaded");
+ std::u16string title_when_loaded = base::UTF8ToUTF16("loaded");
TitleWatcher title_watcher(shell()->web_contents(), title_when_loaded);
EXPECT_TRUE(
ExecuteScript(root, JsReplace("var w = window.open($1)", open_url)));
@@ -1003,7 +1003,7 @@
// The closes the window and waits for the title of the original document to
// change again to signal that the unload handler has run.
{
- base::string16 title_when_done = base::UTF8ToUTF16("unloaded");
+ std::u16string title_when_done = base::UTF8ToUTF16("unloaded");
TitleWatcher title_watcher(shell()->web_contents(), title_when_done);
EXPECT_TRUE(ExecuteScript(root, "w.close()"));
EXPECT_EQ(title_watcher.WaitAndGetTitle(), title_when_done);
diff --git a/content/browser/snapshot_browsertest.cc b/content/browser/snapshot_browsertest.cc
index 26b84821..c41e784 100644
--- a/content/browser/snapshot_browsertest.cc
+++ b/content/browser/snapshot_browsertest.cc
@@ -110,13 +110,13 @@
}
void WaitForAllWindowsToBeReady() {
- const base::string16 expected_title = base::UTF8ToUTF16("Ready");
+ const std::u16string expected_title = base::UTF8ToUTF16("Ready");
// The subordinate windows may load asynchronously. Wait for all of
// them to execute their script before proceeding.
auto browser_list = Shell::windows();
for (Shell* browser : browser_list) {
TitleWatcher watcher(GetWebContents(browser), expected_title);
- const base::string16& actual_title = watcher.WaitAndGetTitle();
+ const std::u16string& actual_title = watcher.WaitAndGetTitle();
EXPECT_EQ(expected_title, actual_title);
}
}
diff --git a/content/browser/speech/speech_recognizer_impl_android.cc b/content/browser/speech/speech_recognizer_impl_android.cc
index 49ff8496d4..25a788c2 100644
--- a/content/browser/speech/speech_recognizer_impl_android.cc
+++ b/content/browser/speech/speech_recognizer_impl_android.cc
@@ -166,7 +166,7 @@
const JavaParamRef<jfloatArray>& floats,
jboolean provisional) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
- std::vector<base::string16> options;
+ std::vector<std::u16string> options;
AppendJavaStringArrayToStringVector(env, strings, &options);
std::vector<float> scores(options.size(), 0.0);
if (floats != NULL)
diff --git a/content/browser/utility_process_host.cc b/content/browser/utility_process_host.cc
index c94748a..e26b312 100644
--- a/content/browser/utility_process_host.cc
+++ b/content/browser/utility_process_host.cc
@@ -133,7 +133,7 @@
metrics_name_ = metrics_name;
}
-void UtilityProcessHost::SetName(const base::string16& name) {
+void UtilityProcessHost::SetName(const std::u16string& name) {
name_ = name;
}
diff --git a/content/browser/utility_process_host.h b/content/browser/utility_process_host.h
index 85e50be..15d5ed0 100644
--- a/content/browser/utility_process_host.h
+++ b/content/browser/utility_process_host.h
@@ -97,7 +97,7 @@
RunServiceDeprecatedCallback callback);
// Sets the name of the process to appear in the task manager.
- void SetName(const base::string16& name);
+ void SetName(const std::u16string& name);
// Sets the name used for metrics reporting. This should not be a localized
// name. This is recorded to metrics, so update UtilityProcessNameHash enum in
@@ -140,7 +140,7 @@
bool started_;
// The process name used to identify the process in task manager.
- base::string16 name_;
+ std::u16string name_;
// The non-localized name used for metrics reporting.
std::string metrics_name_;
diff --git a/content/browser/web_contents/web_contents_android.cc b/content/browser/web_contents/web_contents_android.cc
index 7c454b2..09fc72f 100644
--- a/content/browser/web_contents/web_contents_android.cc
+++ b/content/browser/web_contents/web_contents_android.cc
@@ -76,8 +76,8 @@
}
void SmartClipCallback(const ScopedJavaGlobalRef<jobject>& callback,
- const base::string16& text,
- const base::string16& html,
+ const std::u16string& text,
+ const std::u16string& html,
const gfx::Rect& clip_rect) {
JNIEnv* env = base::android::AttachCurrentThread();
ScopedJavaLocalRef<jstring> j_text = ConvertUTF16ToJavaString(env, text);
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 8f642af..4fcf0a7 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -278,14 +278,14 @@
: public base::RefCountedThreadSafe<CloseDialogCallbackWrapper> {
public:
using CloseCallback =
- base::OnceCallback<void(bool, bool, const base::string16&)>;
+ base::OnceCallback<void(bool, bool, const std::u16string&)>;
explicit CloseDialogCallbackWrapper(CloseCallback callback)
: callback_(std::move(callback)) {}
void Run(bool dialog_was_suppressed,
bool success,
- const base::string16& user_input) {
+ const std::u16string& user_input) {
if (callback_.is_null())
return;
std::move(callback_).Run(dialog_was_suppressed, success, user_input);
@@ -830,7 +830,7 @@
main_frame_process_status_(base::TERMINATION_STATUS_STILL_RUNNING),
main_frame_process_error_code_(0),
waiting_for_response_(false),
- load_state_(net::LOAD_STATE_IDLE, base::string16()),
+ load_state_(net::LOAD_STATE_IDLE, std::u16string()),
upload_size_(0),
upload_position_(0),
is_resume_pending_(false),
@@ -1697,7 +1697,7 @@
#endif
-const base::string16& WebContentsImpl::GetTitle() {
+const std::u16string& WebContentsImpl::GetTitle() {
WebUI* our_web_ui =
GetRenderManager()->speculative_frame_host()
? GetRenderManager()->speculative_frame_host()->web_ui()
@@ -1707,7 +1707,7 @@
NavigationEntry* entry = GetController().GetVisibleEntry();
if (!(entry && entry->IsViewSourceMode())) {
// Give the Web UI the chance to override our title.
- const base::string16& title = our_web_ui->GetOverriddenTitle();
+ const std::u16string& title = our_web_ui->GetOverriddenTitle();
if (!title.empty())
return title;
}
@@ -1775,7 +1775,7 @@
return load_state_;
}
-const base::string16& WebContentsImpl::GetLoadStateHost() {
+const std::u16string& WebContentsImpl::GetLoadStateHost() {
return load_state_host_;
}
@@ -4200,7 +4200,7 @@
void WebContentsImpl::ExecuteEditCommand(
const std::string& command,
- const base::Optional<base::string16>& value) {
+ const base::Optional<std::u16string>& value) {
OPTIONAL_TRACE_EVENT0("content", "WebContentsImpl::ExecuteEditCommand");
auto* input_handler = GetFocusedFrameWidgetInputHandler();
if (!input_handler)
@@ -4442,7 +4442,7 @@
input_handler->CollapseSelection();
}
-void WebContentsImpl::Replace(const base::string16& word) {
+void WebContentsImpl::Replace(const std::u16string& word) {
OPTIONAL_TRACE_EVENT0("content", "WebContentsImpl::Replace");
auto* input_handler = GetFocusedFrameWidgetInputHandler();
if (!input_handler)
@@ -4451,7 +4451,7 @@
input_handler->Replace(word);
}
-void WebContentsImpl::ReplaceMisspelling(const base::string16& word) {
+void WebContentsImpl::ReplaceMisspelling(const std::u16string& word) {
OPTIONAL_TRACE_EVENT0("content", "WebContentsImpl::ReplaceMisspelling");
auto* input_handler = GetFocusedFrameWidgetInputHandler();
if (!input_handler)
@@ -4585,14 +4585,14 @@
const Referrer& referrer,
RenderFrameHost* rfh) {
OPTIONAL_TRACE_EVENT0("content", "WebContentsImpl::SaveFrame");
- SaveFrameWithHeaders(url, referrer, std::string(), base::string16(), rfh);
+ SaveFrameWithHeaders(url, referrer, std::string(), std::u16string(), rfh);
}
void WebContentsImpl::SaveFrameWithHeaders(
const GURL& url,
const Referrer& referrer,
const std::string& headers,
- const base::string16& suggested_filename,
+ const std::u16string& suggested_filename,
RenderFrameHost* rfh) {
DCHECK(rfh);
@@ -4757,7 +4757,7 @@
}
load_info_timestamp_ = load_info->timestamp;
- base::string16 host16 = url_formatter::IDNToUnicode(load_info->host);
+ std::u16string host16 = url_formatter::IDNToUnicode(load_info->host);
// Drop no-op updates.
if (load_state_.state == load_info->load_state &&
load_state_.param == load_info->state_param &&
@@ -4989,7 +4989,7 @@
}
void WebContentsImpl::Find(int request_id,
- const base::string16& search_text,
+ const std::u16string& search_text,
blink::mojom::FindOptionsPtr options) {
OPTIONAL_TRACE_EVENT0("content", "WebContentsImpl::Find");
// Cowardly refuse to search for no text.
@@ -5547,7 +5547,7 @@
Referrer referrer_for_view_source;
base::Optional<url::Origin> initiator_for_view_source = base::nullopt;
// Do not restore title, derive it from the url.
- base::string16 title_for_view_source;
+ std::u16string title_for_view_source;
auto navigation_entry = std::make_unique<NavigationEntryImpl>(
site_instance_for_view_source, frame_entry->url(),
referrer_for_view_source, initiator_for_view_source,
@@ -6100,10 +6100,10 @@
}
void WebContentsImpl::UpdateTitleForEntry(NavigationEntry* entry,
- const base::string16& title) {
+ const std::u16string& title) {
OPTIONAL_TRACE_EVENT1("content", "WebContentsImpl::UpdateTitleForEntry",
"title", base::trace_event::ValueToString(title));
- base::string16 final_title;
+ std::u16string final_title;
base::TrimWhitespace(title, base::TRIM_ALL, &final_title);
// If a page is created via window.open and never navigated,
@@ -6160,8 +6160,8 @@
"is_loading", is_loading);
if (!is_loading) {
- load_state_ = net::LoadStateWithParam(net::LOAD_STATE_IDLE,
- base::string16());
+ load_state_ =
+ net::LoadStateWithParam(net::LOAD_STATE_IDLE, std::u16string());
load_state_host_.clear();
upload_size_ = 0;
upload_position_ = 0;
@@ -6415,12 +6415,12 @@
namespace {
// Normalizes the line endings: \r\n -> \n, lone \r -> \n.
-base::string16 NormalizeLineBreaks(const base::string16& source) {
- static const base::NoDestructor<base::string16> kReturnNewline(
+std::u16string NormalizeLineBreaks(const std::u16string& source) {
+ static const base::NoDestructor<std::u16string> kReturnNewline(
base::ASCIIToUTF16("\r\n"));
- static const base::NoDestructor<base::string16> kReturn(
+ static const base::NoDestructor<std::u16string> kReturn(
base::ASCIIToUTF16("\r"));
- static const base::NoDestructor<base::string16> kNewline(
+ static const base::NoDestructor<std::u16string> kNewline(
base::ASCIIToUTF16("\n"));
std::vector<base::StringPiece16> pieces;
@@ -6440,8 +6440,8 @@
void WebContentsImpl::RunJavaScriptDialog(
RenderFrameHostImpl* render_frame_host,
- const base::string16& message,
- const base::string16& default_prompt,
+ const std::u16string& message,
+ const std::u16string& default_prompt,
JavaScriptDialogType dialog_type,
JavaScriptDialogCallback response_callback) {
OPTIONAL_TRACE_EVENT1("content", "WebContentsImpl::RunJavaScriptDialog",
@@ -6490,7 +6490,7 @@
}
if (suppress_this_message) {
- std::move(callback).Run(true, false, base::string16());
+ std::move(callback).Run(true, false, std::u16string());
return;
}
@@ -6499,7 +6499,7 @@
is_showing_javascript_dialog_ = true;
- base::string16 normalized_message = NormalizeLineBreaks(message);
+ std::u16string normalized_message = NormalizeLineBreaks(message);
for (auto* handler : page_handlers) {
handler->DidRunJavaScriptDialog(
@@ -6519,7 +6519,7 @@
if (suppress_this_message) {
// If we are suppressing messages, just reply as if the user immediately
// pressed "Cancel", passing true to |dialog_was_suppressed|.
- wrapper->Run(true, false, base::string16());
+ wrapper->Run(true, false, std::u16string());
}
}
@@ -6568,7 +6568,7 @@
bool has_non_devtools_handlers = delegate_ && dialog_manager_;
bool has_handlers = page_handlers.size() || has_non_devtools_handlers;
if (should_suppress || !has_handlers) {
- std::move(callback).Run(false, true, base::string16());
+ std::move(callback).Run(false, true, std::u16string());
return;
}
@@ -7154,7 +7154,7 @@
}
void WebContentsImpl::UpdateTitle(RenderFrameHostImpl* render_frame_host,
- const base::string16& title,
+ const std::u16string& title,
base::i18n::TextDirection title_direction) {
OPTIONAL_TRACE_EVENT2("content", "WebContentsImpl::UpdateTitle",
"render_frame_host",
@@ -7388,10 +7388,10 @@
bool WebContentsImpl::DidAddMessageToConsole(
RenderFrameHostImpl* source_frame,
blink::mojom::ConsoleMessageLevel log_level,
- const base::string16& message,
+ const std::u16string& message,
int32_t line_no,
- const base::string16& source_id,
- const base::Optional<base::string16>& untrusted_stack_trace) {
+ const std::u16string& source_id,
+ const base::Optional<std::u16string>& untrusted_stack_trace) {
OPTIONAL_TRACE_EVENT1("content", "WebContentsImpl::DidAddMessageToConsole",
"message", base::trace_event::ValueToString(message));
@@ -7764,7 +7764,7 @@
base::ScopedClosureRunner fullscreen_block,
bool dialog_was_suppressed,
bool success,
- const base::string16& user_input) {
+ const std::u16string& user_input) {
RenderFrameHostImpl* rfh = RenderFrameHostImpl::FromID(render_process_id,
render_frame_id);
OPTIONAL_TRACE_EVENT1("content", "WebContentsImpl::OnDialogClosed",
diff --git a/content/browser/web_contents/web_contents_impl.h b/content/browser/web_contents/web_contents_impl.h
index 91c7bb1..a809a38 100644
--- a/content/browser/web_contents/web_contents_impl.h
+++ b/content/browser/web_contents/web_contents_impl.h
@@ -370,9 +370,9 @@
void EnableWebContentsOnlyAccessibilityMode() override;
bool IsWebContentsOnlyAccessibilityModeForTesting() override;
bool IsFullAccessibilityModeForTesting() override;
- const base::string16& GetTitle() override;
+ const std::u16string& GetTitle() override;
void UpdateTitleForEntry(NavigationEntry* entry,
- const base::string16& title) override;
+ const std::u16string& title) override;
SiteInstanceImpl* GetSiteInstance() override;
bool IsLoading() override;
double GetLoadProgress() override;
@@ -380,7 +380,7 @@
bool IsDocumentOnLoadCompletedInMainFrame() override;
bool IsWaitingForResponse() override;
const net::LoadStateWithParam& GetLoadState() override;
- const base::string16& GetLoadStateHost() override;
+ const std::u16string& GetLoadStateHost() override;
void RequestAXTreeSnapshot(AXTreeSnapshotCallback callback,
ui::AXMode ax_mode,
bool exclude_offscreen,
@@ -445,8 +445,8 @@
void Delete() override;
void SelectAll() override;
void CollapseSelection() override;
- void Replace(const base::string16& word) override;
- void ReplaceMisspelling(const base::string16& word) override;
+ void Replace(const std::u16string& word) override;
+ void ReplaceMisspelling(const std::u16string& word) override;
void NotifyContextMenuClosed(const GURL& link_followed) override;
void ExecuteCustomContextMenuCommand(int action,
const GURL& link_followed) override;
@@ -472,7 +472,7 @@
void SaveFrameWithHeaders(const GURL& url,
const Referrer& referrer,
const std::string& headers,
- const base::string16& suggested_filename,
+ const std::u16string& suggested_filename,
RenderFrameHost* rfh) override;
void GenerateMHTML(const MHTMLGenerationParams& params,
base::OnceCallback<void(int64_t)> callback) override;
@@ -518,7 +518,7 @@
bool bypass_cache,
WebContents::ImageDownloadCallback callback) override;
void Find(int request_id,
- const base::string16& search_text,
+ const std::u16string& search_text,
blink::mojom::FindOptionsPtr options) override;
void StopFinding(StopFindAction action) override;
bool WasEverAudible() override;
@@ -591,8 +591,8 @@
context_menu_client,
const ContextMenuParams& params) override;
void RunJavaScriptDialog(RenderFrameHostImpl* render_frame_host,
- const base::string16& message,
- const base::string16& default_prompt,
+ const std::u16string& message,
+ const std::u16string& default_prompt,
JavaScriptDialogType dialog_type,
JavaScriptDialogCallback response_callback) override;
void RunBeforeUnloadConfirm(
@@ -610,7 +610,7 @@
void DOMContentLoaded(RenderFrameHostImpl* render_frame_host) override;
void DocumentOnLoadCompleted(RenderFrameHostImpl* render_frame_host) override;
void UpdateTitle(RenderFrameHostImpl* render_frame_host,
- const base::string16& title,
+ const std::u16string& title,
base::i18n::TextDirection title_direction) override;
void UpdateTargetURL(RenderFrameHostImpl* render_frame_host,
const GURL& url) override;
@@ -811,10 +811,10 @@
bool DidAddMessageToConsole(
RenderFrameHostImpl* source_frame,
blink::mojom::ConsoleMessageLevel log_level,
- const base::string16& message,
+ const std::u16string& message,
int32_t line_no,
- const base::string16& source_id,
- const base::Optional<base::string16>& untrusted_stack_trace) override;
+ const std::u16string& source_id,
+ const base::Optional<std::u16string>& untrusted_stack_trace) override;
const blink::RendererPreferences& GetRendererPrefs() const override;
void DidReceiveInputEvent(RenderWidgetHostImpl* render_widget_host,
const blink::WebInputEvent& event) override;
@@ -921,7 +921,7 @@
// void Paste() override;
// void SelectAll() override;
void ExecuteEditCommand(const std::string& command,
- const base::Optional<base::string16>& value) override;
+ const base::Optional<std::u16string>& value) override;
void MoveRangeSelectionExtent(const gfx::Point& extent) override;
void SelectRange(const gfx::Point& base, const gfx::Point& extent) override;
void MoveCaret(const gfx::Point& extent) override;
@@ -1513,7 +1513,7 @@
base::ScopedClosureRunner fullscreen_block,
bool dialog_was_suppressed,
bool success,
- const base::string16& user_input);
+ const std::u16string& user_input);
// IPC message handlers.
void OnUpdateZoomLimits(RenderViewHostImpl* source,
@@ -1521,8 +1521,8 @@
int maximum_percent);
void OnShowValidationMessage(RenderViewHostImpl* source,
const gfx::Rect& anchor_in_root_view,
- const base::string16& main_text,
- const base::string16& sub_text);
+ const std::u16string& main_text,
+ const std::u16string& sub_text);
void OnHideValidationMessage(RenderViewHostImpl* source);
void OnMoveValidationMessage(RenderViewHostImpl* source,
const gfx::Rect& anchor_in_root_view);
@@ -1798,7 +1798,7 @@
// The current load state and the URL associated with it.
net::LoadStateWithParam load_state_;
- base::string16 load_state_host_;
+ std::u16string load_state_host_;
base::TimeTicks load_info_timestamp_;
base::TimeTicks loading_last_progress_update_;
@@ -1815,7 +1815,7 @@
// Data for current page -----------------------------------------------------
// When a title cannot be taken from any entry, this title will be used.
- base::string16 page_title_when_no_navigation_entry_;
+ std::u16string page_title_when_no_navigation_entry_;
// The last published theme color.
base::Optional<SkColor> last_sent_theme_color_;
diff --git a/content/browser/web_contents/web_contents_impl_browsertest.cc b/content/browser/web_contents/web_contents_impl_browsertest.cc
index d152594e..343f9b5 100644
--- a/content/browser/web_contents/web_contents_impl_browsertest.cc
+++ b/content/browser/web_contents/web_contents_impl_browsertest.cc
@@ -653,7 +653,7 @@
EXPECT_TRUE(NavigateToURL(
shell(), embedded_test_server()->GetURL("/push_state.html")));
load_observer.Wait();
- base::string16 title = title_watcher.WaitAndGetTitle();
+ std::u16string title = title_watcher.WaitAndGetTitle();
ASSERT_EQ(title, base::ASCIIToUTF16("pushState"));
// LoadingStateChanged should be called 5 times: start and stop for the
@@ -1703,8 +1703,8 @@
void RunJavaScriptDialog(WebContents* web_contents,
RenderFrameHost* render_frame_host,
JavaScriptDialogType dialog_type,
- const base::string16& message_text,
- const base::string16& default_prompt_text,
+ const std::u16string& message_text,
+ const std::u16string& default_prompt_text,
DialogClosedCallback callback,
bool* did_suppress_message) override {
last_message_ = base::UTF16ToUTF8(message_text);
@@ -1720,7 +1720,7 @@
RenderFrameHost* render_frame_host,
bool is_reload,
DialogClosedCallback callback) override {
- std::move(callback).Run(true, base::string16());
+ std::move(callback).Run(true, std::u16string());
if (waiting_for_ == kDialog) {
waiting_for_ = kNothing;
@@ -1730,7 +1730,7 @@
bool HandleJavaScriptDialog(WebContents* web_contents,
bool accept,
- const base::string16* prompt_override) override {
+ const std::u16string* prompt_override) override {
return true;
}
@@ -2562,7 +2562,7 @@
// gesture to allow dialogs.
wc->GetMainFrame()->DisableBeforeUnloadHangMonitorForTesting();
wc->GetMainFrame()->ExecuteJavaScriptWithUserGestureForTests(
- base::string16());
+ std::u16string());
script = "window. return 'x' };";
EXPECT_TRUE(content::ExecuteScript(wc, script));
test_delegate.WillWaitForDialog();
@@ -2752,7 +2752,7 @@
shell()->web_contents()->Copy();
TitleWatcher title_watcher(web_contents, base::ASCIIToUTF16("done"));
- base::string16 title = title_watcher.WaitAndGetTitle();
+ std::u16string title = title_watcher.WaitAndGetTitle();
ASSERT_EQ(title, base::ASCIIToUTF16("done"));
}
@@ -2819,7 +2819,7 @@
~LoadStateWaiter() override = default;
// Waits until the WebContents changes its LoadStateHost to |host|.
- void Wait(net::LoadState load_state, const base::string16& host) {
+ void Wait(net::LoadState load_state, const std::u16string& host) {
waiting_host_ = host;
waiting_state_ = load_state;
if (!LoadStateMatches(web_contents_)) {
@@ -2849,7 +2849,7 @@
}
base::OnceClosure quit_closure_;
content::WebContents* web_contents_ = nullptr;
- base::string16 waiting_host_;
+ std::u16string waiting_host_;
net::LoadState waiting_state_;
DISALLOW_COPY_AND_ASSIGN(LoadStateWaiter);
@@ -2860,9 +2860,9 @@
// TODO(csharrison,mmenke): Beef up testing of LoadState a little. In
// particular, check upload progress and check the LoadState param.
IN_PROC_BROWSER_TEST_F(WebContentsImplBrowserTest, DISABLED_UpdateLoadState) {
- base::string16 a_host = url_formatter::IDNToUnicode("a.com");
- base::string16 b_host = url_formatter::IDNToUnicode("b.com");
- base::string16 paused_host = url_formatter::IDNToUnicode("paused.com");
+ std::u16string a_host = url_formatter::IDNToUnicode("a.com");
+ std::u16string b_host = url_formatter::IDNToUnicode("b.com");
+ std::u16string paused_host = url_formatter::IDNToUnicode("paused.com");
// Controlled responses for image requests made in the test. They will
// alternate being the "most interesting" for the purposes of notifying the
@@ -2897,7 +2897,7 @@
};
// There should be no outgoing requests, so the load state should be empty.
- waiter.Wait(net::LOAD_STATE_IDLE, base::string16());
+ waiter.Wait(net::LOAD_STATE_IDLE, std::u16string());
// The |frame_pauser| pauses the navigation after every step. It will only
// finish by calling WaitForNavigationFinished or ResumeNavigation.
@@ -2917,7 +2917,7 @@
EXPECT_FALSE(frame_pauser.was_successful());
// Note: the pausing only works for the non-network service path because of
// http://crbug.com/791049.
- waiter.Wait(net::LOAD_STATE_IDLE, base::string16());
+ waiter.Wait(net::LOAD_STATE_IDLE, std::u16string());
load_resource(a_frame, "/a_img");
a_response->WaitForRequest();
@@ -3309,7 +3309,7 @@
EXPECT_TRUE(ExecuteScript(main_frame, "document.body.requestFullscreen();"));
- base::string16 title = title_watcher.WaitAndGetTitle();
+ std::u16string title = title_watcher.WaitAndGetTitle();
ASSERT_EQ(title, base::ASCIIToUTF16("onfullscreenerror"));
}
@@ -3476,7 +3476,7 @@
"document.body.requestFullscreen({ navigationUI: 'show' }).then(() => "
"{document.title = 'main_fullscreen_fulfilled'});"));
- base::string16 title = title_watcher.WaitAndGetTitle();
+ std::u16string title = title_watcher.WaitAndGetTitle();
ASSERT_EQ(title, base::ASCIIToUTF16("main_fullscreen_fulfilled"));
}
@@ -3493,7 +3493,7 @@
"document.body.requestFullscreen({ navigationUI: 'hide' }).then(() => "
"{parent.document.title = 'child_fullscreen_fulfilled'});"));
- base::string16 title = title_watcher.WaitAndGetTitle();
+ std::u16string title = title_watcher.WaitAndGetTitle();
ASSERT_EQ(title, base::ASCIIToUTF16("child_fullscreen_fulfilled"));
}
@@ -3509,7 +3509,7 @@
TitleWatcher title_watcher(web_contents,
base::ASCIIToUTF16("main_in_fullscreen_again"));
EXPECT_TRUE(ExecuteScript(child_frame, "document.exitFullscreen();"));
- base::string16 title = title_watcher.WaitAndGetTitle();
+ std::u16string title = title_watcher.WaitAndGetTitle();
ASSERT_EQ(title, base::ASCIIToUTF16("main_in_fullscreen_again"));
}
diff --git a/content/browser/web_contents/web_contents_impl_unittest.cc b/content/browser/web_contents/web_contents_impl_unittest.cc
index 0f39c20..fcbbfb3b 100644
--- a/content/browser/web_contents/web_contents_impl_unittest.cc
+++ b/content/browser/web_contents/web_contents_impl_unittest.cc
@@ -290,7 +290,7 @@
TEST_F(WebContentsImplTest, UpdateTitleBeforeFirstNavigation) {
ASSERT_TRUE(controller().IsInitialNavigation());
- const base::string16 title = base::ASCIIToUTF16("Initial Entry Title");
+ const std::u16string title = base::ASCIIToUTF16("Initial Entry Title");
contents()->UpdateTitle(main_test_rfh(), title, base::i18n::LEFT_TO_RIGHT);
EXPECT_EQ(title, contents()->GetTitle());
}
@@ -308,17 +308,17 @@
const GURL kGURL(GetWebUIURL("blah"));
controller().LoadURL(
kGURL, Referrer(), ui::PAGE_TRANSITION_TYPED, std::string());
- EXPECT_EQ(base::string16(), contents()->GetTitle());
+ EXPECT_EQ(std::u16string(), contents()->GetTitle());
// Also test setting title while the first navigation is still pending.
- const base::string16 title = base::ASCIIToUTF16("Initial Entry Title");
+ const std::u16string title = base::ASCIIToUTF16("Initial Entry Title");
contents()->UpdateTitle(main_test_rfh(), title, base::i18n::LEFT_TO_RIGHT);
EXPECT_EQ(title, contents()->GetTitle());
}
TEST_F(WebContentsImplTest, UseTitleFromPendingEntryIfSet) {
const GURL kGURL(GetWebUIURL("blah"));
- const base::string16 title = base::ASCIIToUTF16("My Title");
+ const std::u16string title = base::ASCIIToUTF16("My Title");
controller().LoadURL(
kGURL, Referrer(), ui::PAGE_TRANSITION_TYPED, std::string());
@@ -2471,8 +2471,8 @@
void RunJavaScriptDialog(WebContents* web_contents,
RenderFrameHost* render_frame_host,
JavaScriptDialogType dialog_type,
- const base::string16& message_text,
- const base::string16& default_prompt_text,
+ const std::u16string& message_text,
+ const std::u16string& default_prompt_text,
DialogClosedCallback callback,
bool* did_suppress_message) override {
*did_suppress_message = true;
@@ -2485,7 +2485,7 @@
bool HandleJavaScriptDialog(WebContents* web_contents,
bool accept,
- const base::string16* prompt_override) override {
+ const std::u16string* prompt_override) override {
return true;
}
diff --git a/content/browser/web_contents/web_contents_view.h b/content/browser/web_contents/web_contents_view.h
index 954e32c..d2b9fa12 100644
--- a/content/browser/web_contents/web_contents_view.h
+++ b/content/browser/web_contents/web_contents_view.h
@@ -85,7 +85,7 @@
// is not strictly necessary and isn't expected to be displayed anywhere, but
// can aid certain debugging tools such as Spy++ on Windows where you are
// trying to find a specific window.
- virtual void SetPageTitle(const base::string16& title) = 0;
+ virtual void SetPageTitle(const std::u16string& title) = 0;
// Invoked when the WebContents is notified that the RenderView is ready.
virtual void RenderViewReady() = 0;
diff --git a/content/browser/web_contents/web_contents_view_android.cc b/content/browser/web_contents/web_contents_view_android.cc
index 0812428..eb5d430 100644
--- a/content/browser/web_contents/web_contents_view_android.cc
+++ b/content/browser/web_contents/web_contents_view_android.cc
@@ -151,7 +151,7 @@
return GetViewBounds();
}
-void WebContentsViewAndroid::SetPageTitle(const base::string16& title) {
+void WebContentsViewAndroid::SetPageTitle(const std::u16string& title) {
// Do nothing.
}
@@ -356,7 +356,7 @@
switch (event.action()) {
case JNI_DragEvent::ACTION_DRAG_ENTERED: {
std::vector<DropData::Metadata> metadata;
- for (const base::string16& mime_type : event.mime_types()) {
+ for (const std::u16string& mime_type : event.mime_types()) {
metadata.push_back(DropData::Metadata::CreateForMimeType(
DropData::Kind::STRING, mime_type));
}
@@ -370,9 +370,9 @@
DropData drop_data;
drop_data.did_originate_from_renderer = false;
JNIEnv* env = AttachCurrentThread();
- base::string16 drop_content =
+ std::u16string drop_content =
ConvertJavaStringToUTF16(env, event.GetJavaContent());
- for (const base::string16& mime_type : event.mime_types()) {
+ for (const std::u16string& mime_type : event.mime_types()) {
if (base::EqualsASCII(mime_type, ui::kMimeTypeURIList)) {
drop_data.url = GURL(drop_content);
} else if (base::EqualsASCII(mime_type, ui::kMimeTypeText)) {
diff --git a/content/browser/web_contents/web_contents_view_android.h b/content/browser/web_contents/web_contents_view_android.h
index 78aafdce2..291b0713 100644
--- a/content/browser/web_contents/web_contents_view_android.h
+++ b/content/browser/web_contents/web_contents_view_android.h
@@ -73,7 +73,7 @@
RenderWidgetHost* render_widget_host) override;
RenderWidgetHostViewBase* CreateViewForChildWidget(
RenderWidgetHost* render_widget_host) override;
- void SetPageTitle(const base::string16& title) override;
+ void SetPageTitle(const std::u16string& title) override;
void RenderViewReady() override;
void RenderViewHostChanged(RenderViewHost* old_host,
RenderViewHost* new_host) override;
diff --git a/content/browser/web_contents/web_contents_view_aura.cc b/content/browser/web_contents/web_contents_view_aura.cc
index 81dab588..d8d434d3 100644
--- a/content/browser/web_contents/web_contents_view_aura.cc
+++ b/content/browser/web_contents/web_contents_view_aura.cc
@@ -171,7 +171,7 @@
const std::string& page_encoding = web_contents->GetEncoding();
// Parse the download metadata.
- base::string16 mime_type;
+ std::u16string mime_type;
base::FilePath file_name;
GURL download_url;
if (!ParseDownloadMetadata(drop_data.download_metadata,
@@ -303,13 +303,13 @@
void PrepareDropData(DropData* drop_data, const ui::OSExchangeData& data) {
drop_data->did_originate_from_renderer = data.DidOriginateFromRenderer();
- base::string16 plain_text;
+ std::u16string plain_text;
data.GetString(&plain_text);
if (!plain_text.empty())
drop_data->text = plain_text;
GURL url;
- base::string16 url_title;
+ std::u16string url_title;
data.GetURLAndTitle(ui::FilenameToURLPolicy::DO_NOT_CONVERT_FILENAMES, &url,
&url_title);
if (url.is_valid()) {
@@ -317,7 +317,7 @@
drop_data->url_title = url_title;
}
- base::string16 html;
+ std::u16string html;
GURL html_base_url;
data.GetHtml(&html, &html_base_url);
if (!html.empty())
@@ -968,7 +968,7 @@
return new RenderWidgetHostViewAura(render_widget_host);
}
-void WebContentsViewAura::SetPageTitle(const base::string16& title) {
+void WebContentsViewAura::SetPageTitle(const std::u16string& title) {
window_->SetTitle(title);
aura::Window* child_window = GetContentNativeView();
if (child_window)
diff --git a/content/browser/web_contents/web_contents_view_aura.h b/content/browser/web_contents/web_contents_view_aura.h
index 7e9b113..e13ccf1 100644
--- a/content/browser/web_contents/web_contents_view_aura.h
+++ b/content/browser/web_contents/web_contents_view_aura.h
@@ -152,7 +152,7 @@
RenderWidgetHost* render_widget_host) override;
RenderWidgetHostViewBase* CreateViewForChildWidget(
RenderWidgetHost* render_widget_host) override;
- void SetPageTitle(const base::string16& title) override;
+ void SetPageTitle(const std::u16string& title) override;
void RenderViewReady() override;
void RenderViewHostChanged(RenderViewHost* old_host,
RenderViewHost* new_host) override;
diff --git a/content/browser/web_contents/web_contents_view_aura_browsertest.cc b/content/browser/web_contents/web_contents_view_aura_browsertest.cc
index 112a6ac8..d4cdb638 100644
--- a/content/browser/web_contents/web_contents_view_aura_browsertest.cc
+++ b/content/browser/web_contents/web_contents_view_aura_browsertest.cc
@@ -164,14 +164,14 @@
{
// Do a swipe-right now. That should navigate backwards.
- base::string16 expected_title = base::ASCIIToUTF16("Title: #1");
+ std::u16string expected_title = base::ASCIIToUTF16("Title: #1");
content::TitleWatcher title_watcher(web_contents, expected_title);
generator.GestureScrollSequence(
gfx::Point(bounds.x() + 2, bounds.y() + 10),
gfx::Point(bounds.right() - 10, bounds.y() + 10),
base::TimeDelta::FromMilliseconds(kScrollDurationMs),
kScrollSteps);
- base::string16 actual_title = title_watcher.WaitAndGetTitle();
+ std::u16string actual_title = title_watcher.WaitAndGetTitle();
EXPECT_EQ(expected_title, actual_title);
value = ExecuteScriptAndGetValue(main_frame, "get_current()");
index = value.GetInt();
@@ -182,14 +182,14 @@
{
// Do a fling-right now. That should navigate backwards.
- base::string16 expected_title = base::ASCIIToUTF16("Title:");
+ std::u16string expected_title = base::ASCIIToUTF16("Title:");
content::TitleWatcher title_watcher(web_contents, expected_title);
generator.GestureScrollSequence(
gfx::Point(bounds.x() + 2, bounds.y() + 10),
gfx::Point(bounds.right() - 10, bounds.y() + 10),
base::TimeDelta::FromMilliseconds(kScrollDurationMs),
kScrollSteps);
- base::string16 actual_title = title_watcher.WaitAndGetTitle();
+ std::u16string actual_title = title_watcher.WaitAndGetTitle();
EXPECT_EQ(expected_title, actual_title);
value = ExecuteScriptAndGetValue(main_frame, "get_current()");
index = value.GetInt();
@@ -200,14 +200,14 @@
{
// Do a swipe-left now. That should navigate forward.
- base::string16 expected_title = base::ASCIIToUTF16("Title: #1");
+ std::u16string expected_title = base::ASCIIToUTF16("Title: #1");
content::TitleWatcher title_watcher(web_contents, expected_title);
generator.GestureScrollSequence(
gfx::Point(bounds.right() - 10, bounds.y() + 10),
gfx::Point(bounds.x() + 2, bounds.y() + 10),
base::TimeDelta::FromMilliseconds(kScrollDurationMs),
kScrollSteps);
- base::string16 actual_title = title_watcher.WaitAndGetTitle();
+ std::u16string actual_title = title_watcher.WaitAndGetTitle();
EXPECT_EQ(expected_title, actual_title);
value = ExecuteScriptAndGetValue(main_frame, "get_current()");
index = value.GetInt();
@@ -799,7 +799,7 @@
// Do a swipe left to start a forward navigation. Then quickly do a swipe
// right.
- base::string16 expected_title = base::ASCIIToUTF16("Title: #2");
+ std::u16string expected_title = base::ASCIIToUTF16("Title: #2");
content::TitleWatcher title_watcher(web_contents, expected_title);
TestNavigationManager nav_watcher(web_contents,
embedded_test_server()->GetURL("/overscroll_navigation.html#2"));
@@ -816,7 +816,7 @@
gfx::Point(bounds.right() - 10, bounds.y() + 10),
base::TimeDelta::FromMilliseconds(2000),
10);
- base::string16 actual_title = title_watcher.WaitAndGetTitle();
+ std::u16string actual_title = title_watcher.WaitAndGetTitle();
EXPECT_EQ(expected_title, actual_title);
EXPECT_EQ(2, GetCurrentIndex());
diff --git a/content/browser/web_contents/web_contents_view_aura_unittest.cc b/content/browser/web_contents/web_contents_view_aura_unittest.cc
index b33e58b..0dd80e71 100644
--- a/content/browser/web_contents/web_contents_view_aura_unittest.cc
+++ b/content/browser/web_contents/web_contents_view_aura_unittest.cc
@@ -236,7 +236,7 @@
WebContentsViewAura* view = GetView();
auto data = std::make_unique<ui::OSExchangeData>();
- const base::string16 string_data = base::ASCIIToUTF16("Some string data");
+ const std::u16string string_data = base::ASCIIToUTF16("Some string data");
data->SetString(string_data);
#if defined(OS_WIN)
@@ -324,7 +324,7 @@
WebContentsViewAura* view = GetView();
auto data = std::make_unique<ui::OSExchangeData>();
- const base::string16 string_data = base::ASCIIToUTF16("Some string data");
+ const std::u16string string_data = base::ASCIIToUTF16("Some string data");
data->SetString(string_data);
#if defined(OS_WIN)
@@ -406,7 +406,7 @@
WebContentsViewAura* view = GetView();
auto data = std::make_unique<ui::OSExchangeData>();
- const base::string16 string_data = base::ASCIIToUTF16("Some string data");
+ const std::u16string string_data = base::ASCIIToUTF16("Some string data");
data->SetString(string_data);
const std::vector<std::pair<base::FilePath, std::string>>
@@ -485,7 +485,7 @@
WebContentsViewAura* view = GetView();
auto data = std::make_unique<ui::OSExchangeData>();
- const base::string16 string_data = base::ASCIIToUTF16("Some string data");
+ const std::u16string string_data = base::ASCIIToUTF16("Some string data");
data->SetString(string_data);
const std::vector<std::pair<base::FilePath, std::string>>
@@ -542,7 +542,7 @@
const std::string url_spec = "https://www.wikipedia.org/";
const GURL url(url_spec);
- const base::string16 url_title = base::ASCIIToUTF16("Wikipedia");
+ const std::u16string url_title = base::ASCIIToUTF16("Wikipedia");
data->SetURL(url, url_title);
// SetUrl should also add a virtual .url (internet shortcut) file.
diff --git a/content/browser/web_contents/web_contents_view_child_frame.cc b/content/browser/web_contents/web_contents_view_child_frame.cc
index ecc85a7..26f6aeb 100644
--- a/content/browser/web_contents/web_contents_view_child_frame.cc
+++ b/content/browser/web_contents/web_contents_view_child_frame.cc
@@ -93,7 +93,7 @@
return GetOuterView()->CreateViewForChildWidget(render_widget_host);
}
-void WebContentsViewChildFrame::SetPageTitle(const base::string16& title) {
+void WebContentsViewChildFrame::SetPageTitle(const std::u16string& title) {
// The title is ignored for the WebContentsViewChildFrame.
}
diff --git a/content/browser/web_contents/web_contents_view_child_frame.h b/content/browser/web_contents/web_contents_view_child_frame.h
index 479277c..39936b6d 100644
--- a/content/browser/web_contents/web_contents_view_child_frame.h
+++ b/content/browser/web_contents/web_contents_view_child_frame.h
@@ -40,7 +40,7 @@
RenderWidgetHost* render_widget_host) override;
RenderWidgetHostViewBase* CreateViewForChildWidget(
RenderWidgetHost* render_widget_host) override;
- void SetPageTitle(const base::string16& title) override;
+ void SetPageTitle(const std::u16string& title) override;
void RenderViewReady() override;
void RenderViewHostChanged(RenderViewHost* old_host,
RenderViewHost* new_host) override;
diff --git a/content/browser/web_contents/web_contents_view_mac.h b/content/browser/web_contents/web_contents_view_mac.h
index ac2a35d0..34e4e21 100644
--- a/content/browser/web_contents/web_contents_view_mac.h
+++ b/content/browser/web_contents/web_contents_view_mac.h
@@ -78,7 +78,7 @@
RenderWidgetHost* render_widget_host) override;
RenderWidgetHostViewBase* CreateViewForChildWidget(
RenderWidgetHost* render_widget_host) override;
- void SetPageTitle(const base::string16& title) override;
+ void SetPageTitle(const std::u16string& title) override;
void RenderViewReady() override;
void RenderViewHostChanged(RenderViewHost* old_host,
RenderViewHost* new_host) override;
diff --git a/content/browser/web_contents/web_contents_view_mac.mm b/content/browser/web_contents/web_contents_view_mac.mm
index 93f71fb..61ca09d 100644
--- a/content/browser/web_contents/web_contents_view_mac.mm
+++ b/content/browser/web_contents/web_contents_view_mac.mm
@@ -376,11 +376,10 @@
return view;
}
-void WebContentsViewMac::SetPageTitle(const base::string16& title) {
+void WebContentsViewMac::SetPageTitle(const std::u16string& title) {
// Meaningless on the Mac; widgets don't have a "title" attribute
}
-
void WebContentsViewMac::RenderViewReady() {}
void WebContentsViewMac::RenderViewHostChanged(RenderViewHost* old_host,
diff --git a/content/browser/web_contents/web_drag_dest_mac_unittest.mm b/content/browser/web_contents/web_drag_dest_mac_unittest.mm
index 7034271..e0adada 100644
--- a/content/browser/web_contents/web_drag_dest_mac_unittest.mm
+++ b/content/browser/web_contents/web_drag_dest_mac_unittest.mm
@@ -70,7 +70,7 @@
NSString* url = nil;
NSString* title = nil;
GURL result_url;
- base::string16 result_title;
+ std::u16string result_title;
// Put a URL on the pasteboard and check it.
scoped_refptr<ui::UniquePasteboard> pboard = new ui::UniquePasteboard;
diff --git a/content/browser/web_database/web_database_host_impl.cc b/content/browser/web_database/web_database_host_impl.cc
index c1f8cc3c..c51dc58 100644
--- a/content/browser/web_database/web_database_host_impl.cc
+++ b/content/browser/web_database/web_database_host_impl.cc
@@ -95,7 +95,7 @@
std::move(receiver));
}
-void WebDatabaseHostImpl::OpenFile(const base::string16& vfs_file_name,
+void WebDatabaseHostImpl::OpenFile(const std::u16string& vfs_file_name,
int32_t desired_flags,
OpenFileCallback callback) {
DCHECK(db_tracker_->task_runner()->RunsTasksInCurrentSequence());
@@ -105,7 +105,7 @@
desired_flags, std::move(callback)));
}
-void WebDatabaseHostImpl::OpenFileValidated(const base::string16& vfs_file_name,
+void WebDatabaseHostImpl::OpenFileValidated(const std::u16string& vfs_file_name,
int32_t desired_flags,
OpenFileCallback callback) {
DCHECK(db_tracker_->task_runner()->RunsTasksInCurrentSequence());
@@ -113,7 +113,7 @@
base::File file;
const base::File* tracked_file = nullptr;
std::string origin_identifier;
- base::string16 database_name;
+ std::u16string database_name;
// When in Incognito mode, we want to make sure that all DB files are
// removed when the Incognito browser context goes away, so we add the
@@ -156,7 +156,7 @@
std::move(callback).Run(std::move(result));
}
-void WebDatabaseHostImpl::DeleteFile(const base::string16& vfs_file_name,
+void WebDatabaseHostImpl::DeleteFile(const std::u16string& vfs_file_name,
bool sync_dir,
DeleteFileCallback callback) {
DCHECK(db_tracker_->task_runner()->RunsTasksInCurrentSequence());
@@ -168,7 +168,7 @@
}
void WebDatabaseHostImpl::GetFileAttributes(
- const base::string16& vfs_file_name,
+ const std::u16string& vfs_file_name,
GetFileAttributesCallback callback) {
DCHECK(db_tracker_->task_runner()->RunsTasksInCurrentSequence());
ValidateOrigin(
@@ -179,7 +179,7 @@
}
void WebDatabaseHostImpl::GetFileAttributesValidated(
- const base::string16& vfs_file_name,
+ const std::u16string& vfs_file_name,
GetFileAttributesCallback callback) {
DCHECK(db_tracker_->task_runner()->RunsTasksInCurrentSequence());
@@ -192,7 +192,7 @@
std::move(callback).Run(attributes);
}
-void WebDatabaseHostImpl::GetFileSize(const base::string16& vfs_file_name,
+void WebDatabaseHostImpl::GetFileSize(const std::u16string& vfs_file_name,
GetFileSizeCallback callback) {
DCHECK(db_tracker_->task_runner()->RunsTasksInCurrentSequence());
ValidateOrigin(vfs_file_name,
@@ -202,7 +202,7 @@
}
void WebDatabaseHostImpl::GetFileSizeValidated(
- const base::string16& vfs_file_name,
+ const std::u16string& vfs_file_name,
GetFileSizeCallback callback) {
DCHECK(db_tracker_->task_runner()->RunsTasksInCurrentSequence());
@@ -215,7 +215,7 @@
std::move(callback).Run(size);
}
-void WebDatabaseHostImpl::SetFileSize(const base::string16& vfs_file_name,
+void WebDatabaseHostImpl::SetFileSize(const std::u16string& vfs_file_name,
int64_t expected_size,
SetFileSizeCallback callback) {
DCHECK(db_tracker_->task_runner()->RunsTasksInCurrentSequence());
@@ -226,7 +226,7 @@
}
void WebDatabaseHostImpl::SetFileSizeValidated(
- const base::string16& vfs_file_name,
+ const std::u16string& vfs_file_name,
int64_t expected_size,
SetFileSizeCallback callback) {
DCHECK(db_tracker_->task_runner()->RunsTasksInCurrentSequence());
@@ -275,7 +275,7 @@
}
void WebDatabaseHostImpl::DatabaseDeleteFile(
- const base::string16& vfs_file_name,
+ const std::u16string& vfs_file_name,
bool sync_dir,
DeleteFileCallback callback,
int reschedule_count) {
@@ -290,8 +290,8 @@
// In order to delete a journal file in Incognito mode, we only need to
// close the open handle to it that's stored in the database tracker.
if (db_tracker_->IsIncognitoProfile()) {
- const base::string16 wal_suffix(base::ASCIIToUTF16("-wal"));
- base::string16 sqlite_suffix;
+ const std::u16string wal_suffix(base::ASCIIToUTF16("-wal"));
+ std::u16string sqlite_suffix;
// WAL files can be deleted without having previously been opened.
if (!db_tracker_->HasSavedIncognitoFileHandle(vfs_file_name) &&
@@ -323,8 +323,8 @@
}
void WebDatabaseHostImpl::Opened(const url::Origin& origin,
- const base::string16& database_name,
- const base::string16& database_description,
+ const std::u16string& database_name,
+ const std::u16string& database_description,
int64_t estimated_size) {
DCHECK(db_tracker_->task_runner()->RunsTasksInCurrentSequence());
@@ -341,8 +341,8 @@
void WebDatabaseHostImpl::OpenedValidated(
const url::Origin& origin,
- const base::string16& database_name,
- const base::string16& database_description,
+ const std::u16string& database_name,
+ const std::u16string& database_description,
int64_t estimated_size) {
DCHECK(db_tracker_->task_runner()->RunsTasksInCurrentSequence());
@@ -362,7 +362,7 @@
}
void WebDatabaseHostImpl::Modified(const url::Origin& origin,
- const base::string16& database_name) {
+ const std::u16string& database_name) {
DCHECK(db_tracker_->task_runner()->RunsTasksInCurrentSequence());
ValidateOrigin(origin, base::BindOnce(&WebDatabaseHostImpl::ModifiedValidated,
@@ -372,7 +372,7 @@
void WebDatabaseHostImpl::ModifiedValidated(
const url::Origin& origin,
- const base::string16& database_name) {
+ const std::u16string& database_name) {
DCHECK(db_tracker_->task_runner()->RunsTasksInCurrentSequence());
std::string origin_identifier(storage::GetIdentifierFromOrigin(origin));
if (!database_connections_.IsDatabaseOpened(origin_identifier,
@@ -385,7 +385,7 @@
}
void WebDatabaseHostImpl::Closed(const url::Origin& origin,
- const base::string16& database_name) {
+ const std::u16string& database_name) {
DCHECK(db_tracker_->task_runner()->RunsTasksInCurrentSequence());
ValidateOrigin(origin, base::BindOnce(&WebDatabaseHostImpl::ClosedValidated,
@@ -394,7 +394,7 @@
}
void WebDatabaseHostImpl::ClosedValidated(const url::Origin& origin,
- const base::string16& database_name) {
+ const std::u16string& database_name) {
DCHECK(db_tracker_->task_runner()->RunsTasksInCurrentSequence());
std::string origin_identifier(storage::GetIdentifierFromOrigin(origin));
@@ -409,7 +409,7 @@
}
void WebDatabaseHostImpl::HandleSqliteError(const url::Origin& origin,
- const base::string16& database_name,
+ const std::u16string& database_name,
int32_t error) {
DCHECK(db_tracker_->task_runner()->RunsTasksInCurrentSequence());
ValidateOrigin(
@@ -421,7 +421,7 @@
void WebDatabaseHostImpl::OnDatabaseSizeChanged(
const std::string& origin_identifier,
- const base::string16& database_name,
+ const std::u16string& database_name,
int64_t database_size) {
DCHECK(db_tracker_->task_runner()->RunsTasksInCurrentSequence());
if (!database_connections_.IsOriginUsed(origin_identifier)) {
@@ -435,7 +435,7 @@
void WebDatabaseHostImpl::OnDatabaseScheduledForDeletion(
const std::string& origin_identifier,
- const base::string16& database_name) {
+ const std::u16string& database_name) {
DCHECK(db_tracker_->task_runner()->RunsTasksInCurrentSequence());
GetWebDatabase().CloseImmediately(
@@ -475,7 +475,7 @@
std::move(callback), mojo::GetBadMessageCallback()));
}
-void WebDatabaseHostImpl::ValidateOrigin(const base::string16& vfs_file_name,
+void WebDatabaseHostImpl::ValidateOrigin(const std::u16string& vfs_file_name,
base::OnceClosure callback) {
std::string origin_identifier;
if (vfs_file_name.empty()) {
diff --git a/content/browser/web_database/web_database_host_impl.h b/content/browser/web_database/web_database_host_impl.h
index 29d52aaa..4c3c112 100644
--- a/content/browser/web_database/web_database_host_impl.h
+++ b/content/browser/web_database/web_database_host_impl.h
@@ -41,21 +41,21 @@
FRIEND_TEST_ALL_PREFIXES(WebDatabaseHostImplTest, ProcessShutdown);
// blink::mojom::WebDatabaseHost:
- void OpenFile(const base::string16& vfs_file_name,
+ void OpenFile(const std::u16string& vfs_file_name,
int32_t desired_flags,
OpenFileCallback callback) override;
- void DeleteFile(const base::string16& vfs_file_name,
+ void DeleteFile(const std::u16string& vfs_file_name,
bool sync_dir,
DeleteFileCallback callback) override;
- void GetFileAttributes(const base::string16& vfs_file_name,
+ void GetFileAttributes(const std::u16string& vfs_file_name,
GetFileAttributesCallback callback) override;
- void GetFileSize(const base::string16& vfs_file_name,
+ void GetFileSize(const std::u16string& vfs_file_name,
GetFileSizeCallback callback) override;
- void SetFileSize(const base::string16& vfs_file_name,
+ void SetFileSize(const std::u16string& vfs_file_name,
int64_t expected_size,
SetFileSizeCallback callback) override;
@@ -63,29 +63,29 @@
GetSpaceAvailableCallback callback) override;
void Opened(const url::Origin& origin,
- const base::string16& database_name,
- const base::string16& database_description,
+ const std::u16string& database_name,
+ const std::u16string& database_description,
int64_t estimated_size) override;
void Modified(const url::Origin& origin,
- const base::string16& database_name) override;
+ const std::u16string& database_name) override;
void Closed(const url::Origin& origin,
- const base::string16& database_name) override;
+ const std::u16string& database_name) override;
void HandleSqliteError(const url::Origin& origin,
- const base::string16& database_name,
+ const std::u16string& database_name,
int32_t error) override;
// DatabaseTracker::Observer callbacks (tracker sequence)
void OnDatabaseSizeChanged(const std::string& origin_identifier,
- const base::string16& database_name,
+ const std::u16string& database_name,
int64_t database_size) override;
void OnDatabaseScheduledForDeletion(
const std::string& origin_identifier,
- const base::string16& database_name) override;
+ const std::u16string& database_name) override;
- void DatabaseDeleteFile(const base::string16& vfs_file_name,
+ void DatabaseDeleteFile(const std::u16string& vfs_file_name,
bool sync_dir,
DeleteFileCallback callback,
int reschedule_count);
@@ -97,17 +97,17 @@
// blink::mojom::WebDatabaseHost methods called after ValidateOrigin()
// successfully validates the origin.
- void OpenFileValidated(const base::string16& vfs_file_name,
+ void OpenFileValidated(const std::u16string& vfs_file_name,
int32_t desired_flags,
OpenFileCallback callback);
- void GetFileAttributesValidated(const base::string16& vfs_file_name,
+ void GetFileAttributesValidated(const std::u16string& vfs_file_name,
GetFileAttributesCallback callback);
- void GetFileSizeValidated(const base::string16& vfs_file_name,
+ void GetFileSizeValidated(const std::u16string& vfs_file_name,
GetFileSizeCallback callback);
- void SetFileSizeValidated(const base::string16& vfs_file_name,
+ void SetFileSizeValidated(const std::u16string& vfs_file_name,
int64_t expected_size,
SetFileSizeCallback callback);
@@ -115,18 +115,18 @@
GetSpaceAvailableCallback callback);
void OpenedValidated(const url::Origin& origin,
- const base::string16& database_name,
- const base::string16& database_description,
+ const std::u16string& database_name,
+ const std::u16string& database_description,
int64_t estimated_size);
void ModifiedValidated(const url::Origin& origin,
- const base::string16& database_name);
+ const std::u16string& database_name);
void ClosedValidated(const url::Origin& origin,
- const base::string16& database_name);
+ const std::u16string& database_name);
void HandleSqliteErrorValidated(const url::Origin& origin,
- const base::string16& database_name,
+ const std::u16string& database_name,
int32_t error);
// Asynchronously calls |callback| but only if |process_id_| has permission to
@@ -137,7 +137,7 @@
// As above, but for calls where the origin is embedded in a VFS filename.
// Empty filenames signalling a temp file are permitted.
- void ValidateOrigin(const base::string16& vfs_file_name,
+ void ValidateOrigin(const std::u16string& vfs_file_name,
base::OnceClosure callback);
// Our render process host ID, used to bind to the correct render process.
const int process_id_;
diff --git a/content/browser/web_database/web_database_host_impl_unittest.cc b/content/browser/web_database/web_database_host_impl_unittest.cc
index 0828185..08706c4 100644
--- a/content/browser/web_database/web_database_host_impl_unittest.cc
+++ b/content/browser/web_database/web_database_host_impl_unittest.cc
@@ -24,9 +24,9 @@
namespace {
-base::string16 ConstructVfsFileName(const url::Origin& origin,
- const base::string16& name,
- const base::string16& suffix) {
+std::u16string ConstructVfsFileName(const url::Origin& origin,
+ const std::u16string& name,
+ const std::u16string& suffix) {
std::string identifier = storage::GetIdentifierFromOrigin(origin);
return base::UTF8ToUTF16(identifier) + base::ASCIIToUTF16("/") + name +
base::ASCIIToUTF16("#") + suffix;
@@ -119,9 +119,9 @@
const url::Origin correct_origin = url::Origin::Create(correct_url);
const url::Origin incorrect_origin =
url::Origin::Create(GURL("http://incorrect.net"));
- const base::string16 db_name(base::ASCIIToUTF16("db_name"));
- const base::string16 suffix(base::ASCIIToUTF16("suffix"));
- const base::string16 bad_vfs_file_name =
+ const std::u16string db_name(base::ASCIIToUTF16("db_name"));
+ const std::u16string suffix(base::ASCIIToUTF16("suffix"));
+ const std::u16string bad_vfs_file_name =
ConstructVfsFileName(incorrect_origin, db_name, suffix);
auto* security_policy = ChildProcessSecurityPolicyImpl::GetInstance();
@@ -178,7 +178,7 @@
TEST_F(WebDatabaseHostImplTest, BadMessagesInvalid) {
const url::Origin opaque_origin;
- const base::string16 db_name(base::ASCIIToUTF16("db_name"));
+ const std::u16string db_name(base::ASCIIToUTF16("db_name"));
CheckInvalidOrigin(
[&]() { host()->GetSpaceAvailable(opaque_origin, base::DoNothing()); });
@@ -202,9 +202,9 @@
const url::Origin correct_origin = url::Origin::Create(correct_url);
const url::Origin incorrect_origin =
url::Origin::Create(GURL("http://incorrect.net"));
- const base::string16 db_name(base::ASCIIToUTF16("db_name"));
- const base::string16 suffix(base::ASCIIToUTF16("suffix"));
- const base::string16 bad_vfs_file_name =
+ const std::u16string db_name(base::ASCIIToUTF16("db_name"));
+ const std::u16string suffix(base::ASCIIToUTF16("suffix"));
+ const std::u16string bad_vfs_file_name =
ConstructVfsFileName(incorrect_origin, db_name, suffix);
auto* security_policy = ChildProcessSecurityPolicyImpl::GetInstance();
diff --git a/content/browser/web_package/link_web_bundle_browsertest.cc b/content/browser/web_package/link_web_bundle_browsertest.cc
index 2ac3f0d2..fa1d0531 100644
--- a/content/browser/web_package/link_web_bundle_browsertest.cc
+++ b/content/browser/web_package/link_web_bundle_browsertest.cc
@@ -328,7 +328,7 @@
GURL page_url(https_server()->GetURL(
"page.test", "/web_bundle/frame_parent.html?wbn=" + bundle_url.spec()));
EXPECT_TRUE(NavigateToURL(shell(), page_url));
- base::string16 expected_title(base::UTF8ToUTF16("OK"));
+ std::u16string expected_title(base::UTF8ToUTF16("OK"));
TitleWatcher title_watcher(shell()->web_contents(), expected_title);
EXPECT_EQ(expected_title, title_watcher.WaitAndGetTitle());
diff --git a/content/browser/web_package/signed_exchange_request_handler_browsertest.cc b/content/browser/web_package/signed_exchange_request_handler_browsertest.cc
index b47b019..21a983e 100644
--- a/content/browser/web_package/signed_exchange_request_handler_browsertest.cc
+++ b/content/browser/web_package/signed_exchange_request_handler_browsertest.cc
@@ -312,7 +312,7 @@
return;
const GURL prefetch_html_url = embedded_test_server()->GetURL(
std::string("/sxg/prefetch.html#") + url.spec());
- base::string16 expected_title =
+ std::u16string expected_title =
base::ASCIIToUTF16(expect_success ? "OK" : "FAIL");
TitleWatcher title_watcher(shell()->web_contents(), expected_title);
EXPECT_TRUE(NavigateToURL(shell(), prefetch_html_url));
@@ -386,7 +386,7 @@
NavigateToURL(shell(), embedded_test_server()->GetURL("/empty.html")));
}
- base::string16 title = base::ASCIIToUTF16("https://test.example.org/test/");
+ std::u16string title = base::ASCIIToUTF16("https://test.example.org/test/");
TitleWatcher title_watcher(shell()->web_contents(), title);
RedirectObserver redirect_observer(shell()->web_contents());
AssertNavigationHandleFlagObserver assert_navigation_handle_flag_observer(
@@ -466,7 +466,7 @@
NavigateToURL(shell(), embedded_test_server()->GetURL("/empty.html")));
}
- base::string16 title = base::ASCIIToUTF16("https://test.example.org/test/");
+ std::u16string title = base::ASCIIToUTF16("https://test.example.org/test/");
TitleWatcher title_watcher(shell()->web_contents(), title);
// PrefetchedSignedExchangeCache is used only for renderer initiated
// navigation. So use JavaScript to trigger renderer initiated navigation.
@@ -501,7 +501,7 @@
embedded_test_server()->GetURL("/sxg/test.example.org_fr_variant.sxg");
MaybeTriggerPrefetchSXG(url, false);
- base::string16 title = base::ASCIIToUTF16("Fallback URL response");
+ std::u16string title = base::ASCIIToUTF16("Fallback URL response");
TitleWatcher title_watcher(shell()->web_contents(), title);
GURL expected_commit_url = GURL("https://test.example.org/test/");
EXPECT_TRUE(NavigateToURL(shell(), url, expected_commit_url));
@@ -523,7 +523,7 @@
"/sxg/test.example.org_test_missing_nosniff.sxg");
MaybeTriggerPrefetchSXG(url, false);
- base::string16 title = base::ASCIIToUTF16("Fallback URL response");
+ std::u16string title = base::ASCIIToUTF16("Fallback URL response");
TitleWatcher title_watcher(shell()->web_contents(), title);
RedirectObserver redirect_observer(shell()->web_contents());
GURL expected_commit_url = GURL("https://test.example.org/test/");
@@ -548,7 +548,7 @@
"/sxg/test.example.org_test_invalid_content_type.sxg");
MaybeTriggerPrefetchSXG(url, false);
- base::string16 title = base::ASCIIToUTF16("Fallback URL response");
+ std::u16string title = base::ASCIIToUTF16("Fallback URL response");
TitleWatcher title_watcher(shell()->web_contents(), title);
RedirectObserver redirect_observer(shell()->web_contents());
GURL expected_commit_url = GURL("https://test.example.org/test/");
@@ -575,7 +575,7 @@
ASSERT_TRUE(embedded_test_server()->Start());
GURL url = embedded_test_server()->GetURL("/sxg/test.example.org_test.sxg");
- base::string16 title = base::ASCIIToUTF16("Fallback URL response");
+ std::u16string title = base::ASCIIToUTF16("Fallback URL response");
TitleWatcher title_watcher(shell()->web_contents(), title);
RedirectObserver redirect_observer(shell()->web_contents());
GURL expected_commit_url = GURL("https://test.example.org/test/");
@@ -611,7 +611,7 @@
MaybeTriggerPrefetchSXG(url, false);
- base::string16 title = base::ASCIIToUTF16("Fallback URL response");
+ std::u16string title = base::ASCIIToUTF16("Fallback URL response");
TitleWatcher title_watcher(shell()->web_contents(), title);
GURL expected_commit_url = GURL("https://test.example.org/test/");
EXPECT_TRUE(NavigateToURL(shell(), url, expected_commit_url));
@@ -645,8 +645,8 @@
MaybeTriggerPrefetchSXG(url, false);
- const base::string16 title_good = base::ASCIIToUTF16("Reached End: false");
- const base::string16 title_bad = base::ASCIIToUTF16("Reached End: true");
+ const std::u16string title_good = base::ASCIIToUTF16("Reached End: false");
+ const std::u16string title_bad = base::ASCIIToUTF16("Reached End: true");
TitleWatcher title_watcher(shell()->web_contents(), title_good);
title_watcher.AlsoWaitForTitle(title_bad);
GURL expected_commit_url = GURL("https://test.example.org/test/");
@@ -704,7 +704,7 @@
MaybeTriggerPrefetchSXG(url, false);
- base::string16 title = base::ASCIIToUTF16("Fallback URL response");
+ std::u16string title = base::ASCIIToUTF16("Fallback URL response");
TitleWatcher title_watcher(shell()->web_contents(), title);
GURL expected_commit_url = GURL("https://test.example.org/test/");
EXPECT_TRUE(NavigateToURL(shell(), url, expected_commit_url));
@@ -885,7 +885,7 @@
// TODO(https://crbug.com/815024): Make this test pass the OCSP check. We'll
// need to either generate an OCSP response on the fly, or override the OCSP
// verification time.
- base::string16 title = base::ASCIIToUTF16("Fallback URL response");
+ std::u16string title = base::ASCIIToUTF16("Fallback URL response");
TitleWatcher title_watcher(shell()->web_contents(), title);
GURL expected_commit_url = GURL("https://test.example.org/test/");
EXPECT_TRUE(NavigateToURL(shell(), url, expected_commit_url));
@@ -912,7 +912,7 @@
GURL("https://test.example.org/test/publisher-service-worker.js"),
"content/test/data/sxg/publisher-service-worker.js");
{
- base::string16 title = base::ASCIIToUTF16("Done");
+ std::u16string title = base::ASCIIToUTF16("Done");
TitleWatcher title_watcher(shell()->web_contents(), title);
EXPECT_TRUE(NavigateToURL(shell(), install_sw_url));
EXPECT_EQ(title, title_watcher.WaitAndGetTitle());
@@ -922,7 +922,7 @@
GURL url = embedded_test_server()->GetURL("/sxg/test.example.org_test.sxg");
- base::string16 title = base::ASCIIToUTF16("https://test.example.org/test/");
+ std::u16string title = base::ASCIIToUTF16("https://test.example.org/test/");
TitleWatcher title_watcher(shell()->web_contents(), title);
title_watcher.AlsoWaitForTitle(base::ASCIIToUTF16("Generated"));
GURL expected_commit_url = GURL("https://test.example.org/test/");
@@ -945,13 +945,13 @@
"/sxg/no-respond-with-service-worker.html");
{
- base::string16 title = base::ASCIIToUTF16("Done");
+ std::u16string title = base::ASCIIToUTF16("Done");
TitleWatcher title_watcher(shell()->web_contents(), title);
EXPECT_TRUE(NavigateToURL(shell(), install_sw_url));
EXPECT_EQ(title, title_watcher.WaitAndGetTitle());
}
- base::string16 title = base::ASCIIToUTF16("https://test.example.org/test/");
+ std::u16string title = base::ASCIIToUTF16("https://test.example.org/test/");
TitleWatcher title_watcher(shell()->web_contents(), title);
EXPECT_TRUE(NavigateToURL(
shell(), embedded_test_server()->GetURL("/sxg/test.example.org_test.sxg"),
@@ -984,13 +984,13 @@
"content/test/data/sxg/no-respond-with-service-worker.js");
{
- base::string16 title = base::ASCIIToUTF16("Done");
+ std::u16string title = base::ASCIIToUTF16("Done");
TitleWatcher title_watcher(shell()->web_contents(), title);
EXPECT_TRUE(NavigateToURL(shell(), install_sw_url));
EXPECT_EQ(title, title_watcher.WaitAndGetTitle());
}
- base::string16 title = base::ASCIIToUTF16("https://test.example.org/test/");
+ std::u16string title = base::ASCIIToUTF16("https://test.example.org/test/");
TitleWatcher title_watcher(shell()->web_contents(), title);
EXPECT_TRUE(NavigateToURL(
shell(), GURL("https://test.example.org/scope/test.sxg"),
@@ -1019,7 +1019,7 @@
GURL expected_commit_url = GURL("https://test.example.org/test/");
{
- base::string16 title = base::ASCIIToUTF16("https://test.example.org/test/");
+ std::u16string title = base::ASCIIToUTF16("https://test.example.org/test/");
TitleWatcher title_watcher(shell()->web_contents(), title);
EXPECT_TRUE(NavigateToURL(shell(), url, expected_commit_url));
EXPECT_EQ(title, title_watcher.WaitAndGetTitle());
@@ -1073,7 +1073,7 @@
}
void NavigateAndWaitForTitle(const GURL& url, const std::string title) {
- base::string16 expected_title = base::ASCIIToUTF16(title);
+ std::u16string expected_title = base::ASCIIToUTF16(title);
TitleWatcher title_watcher(shell()->web_contents(), expected_title);
EXPECT_TRUE(NavigateToURL(shell(), url));
EXPECT_EQ(expected_title, title_watcher.WaitAndGetTitle());
@@ -1082,7 +1082,7 @@
void NavigateWithRedirectAndWaitForTitle(const GURL& url,
const GURL& expected_commit_url,
const std::string& title) {
- base::string16 expected_title = base::ASCIIToUTF16(title);
+ std::u16string expected_title = base::ASCIIToUTF16(title);
TitleWatcher title_watcher(shell()->web_contents(), expected_title);
EXPECT_TRUE(NavigateToURL(shell(), url, expected_commit_url));
EXPECT_EQ(expected_title, title_watcher.WaitAndGetTitle());
@@ -1620,7 +1620,7 @@
const GURL prefetch_html_url = embedded_test_server()->GetURL(
kPrefetcherHost,
std::string("/sxg/prefetch-document.html#") + sxg_url().spec());
- base::string16 expected_title = base::ASCIIToUTF16("FAIL");
+ std::u16string expected_title = base::ASCIIToUTF16("FAIL");
TitleWatcher title_watcher(shell()->web_contents(), expected_title);
EXPECT_TRUE(NavigateToURL(shell(), prefetch_html_url));
EXPECT_EQ(expected_title, title_watcher.WaitAndGetTitle());
@@ -1754,7 +1754,7 @@
// embedded_test_server().
const GURL prefetch_html_url = ssl_server_.GetURL(
std::string("/sxg/prefetch.html#") + sxg_url().spec());
- base::string16 expected_title = base::ASCIIToUTF16("FAIL");
+ std::u16string expected_title = base::ASCIIToUTF16("FAIL");
TitleWatcher title_watcher(shell()->web_contents(), expected_title);
EXPECT_TRUE(NavigateToURL(shell(), prefetch_html_url));
EXPECT_EQ(expected_title, title_watcher.WaitAndGetTitle());
diff --git a/content/browser/web_package/web_bundle_browsertest.cc b/content/browser/web_package/web_bundle_browsertest.cc
index 3f8bb99d9..a933f20a 100644
--- a/content/browser/web_package/web_bundle_browsertest.cc
+++ b/content/browser/web_package/web_bundle_browsertest.cc
@@ -109,7 +109,7 @@
const GURL& test_data_url,
const GURL& expected_commit_url,
base::StringPiece ascii_title) {
- base::string16 expected_title = base::ASCIIToUTF16(ascii_title);
+ std::u16string expected_title = base::ASCIIToUTF16(ascii_title);
TitleWatcher title_watcher(web_contents, expected_title);
EXPECT_TRUE(NavigateToURL(web_contents, test_data_url, expected_commit_url));
EXPECT_EQ(expected_title, title_watcher.WaitAndGetTitle());
@@ -349,7 +349,7 @@
void RunTestScript(const std::string& script) {
EXPECT_TRUE(ExecuteScript(shell()->web_contents(),
"loadScript('" + script + "');"));
- base::string16 ok = base::ASCIIToUTF16("OK");
+ std::u16string ok = base::ASCIIToUTF16("OK");
TitleWatcher title_watcher(shell()->web_contents(), ok);
title_watcher.AlsoWaitForTitle(base::ASCIIToUTF16("FAIL"));
EXPECT_EQ(ok, title_watcher.WaitAndGetTitle());
@@ -357,7 +357,7 @@
void ExecuteScriptAndWaitForTitle(const std::string& script,
const std::string& title) {
- base::string16 title16 = base::ASCIIToUTF16(title);
+ std::u16string title16 = base::ASCIIToUTF16(title);
TitleWatcher title_watcher(shell()->web_contents(), title16);
EXPECT_TRUE(ExecuteScript(shell()->web_contents(), script));
EXPECT_EQ(title16, title_watcher.WaitAndGetTitle());
diff --git a/content/browser/webauth/authenticator_impl_unittest.cc b/content/browser/webauth/authenticator_impl_unittest.cc
index 7f58385..697519c 100644
--- a/content/browser/webauth/authenticator_impl_unittest.cc
+++ b/content/browser/webauth/authenticator_impl_unittest.cc
@@ -3807,7 +3807,7 @@
void CollectPIN(
CollectPINOptions options,
- base::OnceCallback<void(base::string16)> provide_pin_cb) override {
+ base::OnceCallback<void(std::u16string)> provide_pin_cb) override {
*collected_pin_ = true;
*min_pin_length_ = options.min_pin_length;
base::SequencedTaskRunnerHandle::Get()->PostTask(
@@ -3963,7 +3963,7 @@
void CollectPIN(
CollectPINOptions options,
- base::OnceCallback<void(base::string16)> provide_pin_cb) override {
+ base::OnceCallback<void(std::u16string)> provide_pin_cb) override {
DCHECK(supports_pin_);
DCHECK(!expected_.empty());
if (expected_.front().reason == PINReason::kChallenge) {
@@ -5308,7 +5308,7 @@
void CollectPIN(
CollectPINOptions options,
- base::OnceCallback<void(base::string16)> provide_pin_cb) override {
+ base::OnceCallback<void(std::u16string)> provide_pin_cb) override {
base::SequencedTaskRunnerHandle::Get()->PostTask(
FROM_HERE,
base::BindOnce(std::move(provide_pin_cb), base::UTF8ToUTF16(kTestPIN)));
diff --git a/content/browser/webrtc/webrtc_internals.cc b/content/browser/webrtc/webrtc_internals.cc
index 493ce07..01a68bd 100644
--- a/content/browser/webrtc/webrtc_internals.cc
+++ b/content/browser/webrtc/webrtc_internals.cc
@@ -371,7 +371,7 @@
this,
GetContentClient()->browser()->CreateSelectFilePolicy(web_contents));
select_file_dialog_->SelectFile(
- ui::SelectFileDialog::SELECT_SAVEAS_FILE, base::string16(),
+ ui::SelectFileDialog::SELECT_SAVEAS_FILE, std::u16string(),
audio_debug_recordings_file_path_, nullptr, 0,
base::FilePath::StringType(), web_contents->GetTopLevelNativeWindow(),
nullptr);
@@ -423,7 +423,7 @@
this,
GetContentClient()->browser()->CreateSelectFilePolicy(web_contents));
select_file_dialog_->SelectFile(
- ui::SelectFileDialog::SELECT_SAVEAS_FILE, base::string16(),
+ ui::SelectFileDialog::SELECT_SAVEAS_FILE, std::u16string(),
event_log_recordings_file_path_, nullptr, 0, FILE_PATH_LITERAL(""),
web_contents->GetTopLevelNativeWindow(), nullptr);
#endif
diff --git a/content/browser/webrtc/webrtc_internals_browsertest.cc b/content/browser/webrtc/webrtc_internals_browsertest.cc
index 47f22367a..702472d 100644
--- a/content/browser/webrtc/webrtc_internals_browsertest.cc
+++ b/content/browser/webrtc/webrtc_internals_browsertest.cc
@@ -171,7 +171,7 @@
}
void ExpectTitle(const std::string& expected_title) const {
- base::string16 expected_title16(base::ASCIIToUTF16(expected_title));
+ std::u16string expected_title16(base::ASCIIToUTF16(expected_title));
TitleWatcher title_watcher(shell()->web_contents(), expected_title16);
EXPECT_EQ(expected_title16, title_watcher.WaitAndGetTitle());
}
diff --git a/content/browser/webui/web_ui_data_source_impl.cc b/content/browser/webui/web_ui_data_source_impl.cc
index d98942af..e64a282 100644
--- a/content/browser/webui/web_ui_data_source_impl.cc
+++ b/content/browser/webui/web_ui_data_source_impl.cc
@@ -126,7 +126,7 @@
WebUIDataSourceImpl::~WebUIDataSourceImpl() = default;
void WebUIDataSourceImpl::AddString(base::StringPiece name,
- const base::string16& value) {
+ const std::u16string& value) {
// TODO(dschuyler): Share only one copy of these strings.
localized_strings_.SetKey(name, base::Value(value));
replacements_[name.as_string()] = base::UTF16ToUTF8(value);
diff --git a/content/browser/webui/web_ui_data_source_impl.h b/content/browser/webui/web_ui_data_source_impl.h
index 935fc68..0c46862 100644
--- a/content/browser/webui/web_ui_data_source_impl.h
+++ b/content/browser/webui/web_ui_data_source_impl.h
@@ -30,7 +30,7 @@
public WebUIDataSource {
public:
// WebUIDataSource:
- void AddString(base::StringPiece name, const base::string16& value) override;
+ void AddString(base::StringPiece name, const std::u16string& value) override;
void AddString(base::StringPiece name, const std::string& value) override;
void AddLocalizedString(base::StringPiece name, int ids) override;
void AddLocalizedStrings(
diff --git a/content/browser/webui/web_ui_data_source_unittest.cc b/content/browser/webui/web_ui_data_source_unittest.cc
index 11a7a6b..cc70da36 100644
--- a/content/browser/webui/web_ui_data_source_unittest.cc
+++ b/content/browser/webui/web_ui_data_source_unittest.cc
@@ -29,10 +29,10 @@
public:
~TestClient() override {}
- base::string16 GetLocalizedString(int message_id) override {
+ std::u16string GetLocalizedString(int message_id) override {
if (message_id == kDummyStringId)
return base::UTF8ToUTF16(kDummyString);
- return base::string16();
+ return std::u16string();
}
base::RefCountedMemory* GetDataResourceBytes(int resource_id) override {
diff --git a/content/browser/webui/web_ui_impl.cc b/content/browser/webui/web_ui_impl.cc
index 59d9e46..2350d78 100644
--- a/content/browser/webui/web_ui_impl.cc
+++ b/content/browser/webui/web_ui_impl.cc
@@ -42,10 +42,10 @@
const WebUI::TypeID WebUI::kNoWebUI = nullptr;
// static
-base::string16 WebUI::GetJavascriptCall(
+std::u16string WebUI::GetJavascriptCall(
const std::string& function_name,
const std::vector<const base::Value*>& arg_list) {
- base::string16 result(base::ASCIIToUTF16(function_name));
+ std::u16string result(base::ASCIIToUTF16(function_name));
result.push_back('(');
std::string json;
@@ -152,11 +152,11 @@
return GetScaleFactorForView(web_contents_->GetRenderWidgetHostView());
}
-const base::string16& WebUIImpl::GetOverriddenTitle() {
+const std::u16string& WebUIImpl::GetOverriddenTitle() {
return overridden_title_;
}
-void WebUIImpl::OverrideTitle(const base::string16& title) {
+void WebUIImpl::OverrideTitle(const std::u16string& title) {
overridden_title_ = title;
}
@@ -195,7 +195,7 @@
void WebUIImpl::CallJavascriptFunctionUnsafe(const std::string& function_name) {
DCHECK(base::IsStringASCII(function_name));
- base::string16 javascript = base::ASCIIToUTF16(function_name + "();");
+ std::u16string javascript = base::ASCIIToUTF16(function_name + "();");
ExecuteJavascript(javascript);
}
@@ -286,7 +286,7 @@
handlers_.push_back(std::move(handler));
}
-void WebUIImpl::ExecuteJavascript(const base::string16& javascript) {
+void WebUIImpl::ExecuteJavascript(const std::u16string& javascript) {
// Silently ignore the request. Would be nice to clean-up WebUI so we
// could turn this into a CHECK(). http://crbug.com/516690.
if (!CanCallJavascript())
diff --git a/content/browser/webui/web_ui_impl.h b/content/browser/webui/web_ui_impl.h
index fb34385..2da74fe 100644
--- a/content/browser/webui/web_ui_impl.h
+++ b/content/browser/webui/web_ui_impl.h
@@ -64,8 +64,8 @@
WebUIController* GetController() override;
void SetController(std::unique_ptr<WebUIController> controller) override;
float GetDeviceScaleFactor() override;
- const base::string16& GetOverriddenTitle() override;
- void OverrideTitle(const base::string16& title) override;
+ const std::u16string& GetOverriddenTitle() override;
+ void OverrideTitle(const std::u16string& title) override;
int GetBindings() override;
void SetBindings(int bindings) override;
const std::vector<std::string>& GetRequestableSchemes() override;
@@ -114,7 +114,7 @@
void Send(const std::string& message, base::Value args) override;
// Execute a string of raw JavaScript on the page.
- void ExecuteJavascript(const base::string16& javascript);
+ void ExecuteJavascript(const std::u16string& javascript);
// Called internally and by the owned WebUIMainFrameObserver.
void DisallowJavascriptOnAllHandlers();
@@ -124,7 +124,7 @@
// Options that may be overridden by individual Web UI implementations. The
// bool options default to false. See the public getters for more information.
- base::string16 overridden_title_; // Defaults to empty string.
+ std::u16string overridden_title_; // Defaults to empty string.
int bindings_; // The bindings from BindingsPolicy that should be enabled for
// this page.
diff --git a/content/browser/webui/web_ui_main_frame_observer.cc b/content/browser/webui/web_ui_main_frame_observer.cc
index 79a422a..3a43991 100644
--- a/content/browser/webui/web_ui_main_frame_observer.cc
+++ b/content/browser/webui/web_ui_main_frame_observer.cc
@@ -71,10 +71,10 @@
void WebUIMainFrameObserver::OnDidAddMessageToConsole(
RenderFrameHost* source_frame,
blink::mojom::ConsoleMessageLevel log_level,
- const base::string16& message,
+ const std::u16string& message,
int32_t line_no,
- const base::string16& source_id,
- const base::Optional<base::string16>& untrusted_stack_trace) {
+ const std::u16string& source_id,
+ const base::Optional<std::u16string>& untrusted_stack_trace) {
// TODO(iby) Change all VLOGs to DVLOGs once tast tests are stable.
DVLOG(3) << "OnDidAddMessageToConsole called for " << message;
if (untrusted_stack_trace) {
diff --git a/content/browser/webui/web_ui_main_frame_observer.h b/content/browser/webui/web_ui_main_frame_observer.h
index 45112ee..5066ae7 100644
--- a/content/browser/webui/web_ui_main_frame_observer.h
+++ b/content/browser/webui/web_ui_main_frame_observer.h
@@ -51,10 +51,10 @@
void OnDidAddMessageToConsole(
RenderFrameHost* source_frame,
blink::mojom::ConsoleMessageLevel log_level,
- const base::string16& message,
+ const std::u16string& message,
int32_t line_no,
- const base::string16& source_id,
- const base::Optional<base::string16>& untrusted_stack_trace) override;
+ const std::u16string& source_id,
+ const base::Optional<std::u16string>& untrusted_stack_trace) override;
void ReadyToCommitNavigation(NavigationHandle* navigation_handle) override;
#endif // defined(OS_LINUX) || defined(OS_CHROMEOS)
diff --git a/content/browser/webui/web_ui_main_frame_observer_unittest.cc b/content/browser/webui/web_ui_main_frame_observer_unittest.cc
index 35b939d4..d19c47e 100644
--- a/content/browser/webui/web_ui_main_frame_observer_unittest.cc
+++ b/content/browser/webui/web_ui_main_frame_observer_unittest.cc
@@ -150,10 +150,10 @@
void CallOnDidAddMessageToConsole(
RenderFrameHost* source_frame,
blink::mojom::ConsoleMessageLevel log_level,
- const base::string16& message,
+ const std::u16string& message,
int32_t line_no,
- const base::string16& source_id,
- const base::Optional<base::string16>& stack_trace) {
+ const std::u16string& source_id,
+ const base::Optional<std::u16string>& stack_trace) {
web_ui_->GetWebUIMainFrameObserverForTest()->OnDidAddMessageToConsole(
source_frame, log_level, message, line_no, source_id, stack_trace);
}
@@ -166,14 +166,14 @@
scoped_refptr<JsErrorReportProcessor> previous_processor_;
static constexpr char kMessage8[] = "An Error Is Me";
- const base::string16 kMessage16 = base::UTF8ToUTF16(kMessage8);
+ const std::u16string kMessage16 = base::UTF8ToUTF16(kMessage8);
static constexpr char kSourceURL8[] = "chrome://here.is.error/bad.js";
- const base::string16 kSourceId16 = base::UTF8ToUTF16(kSourceURL8);
+ const std::u16string kSourceId16 = base::UTF8ToUTF16(kSourceURL8);
static constexpr char kPageURL8[] = "chrome://here.is.error/index.html";
static constexpr char kStackTrace8[] =
"at badFunction (chrome://page/my.js:20:30)\n"
"at poorCaller (chrome://page/my.js:50:10)\n";
- const base::string16 kStackTrace16 = base::UTF8ToUTF16(kStackTrace8);
+ const std::u16string kStackTrace16 = base::UTF8ToUTF16(kStackTrace8);
};
constexpr char WebUIMainFrameObserverTest::kMessage8[];
diff --git a/content/browser/webui/web_ui_message_handler.cc b/content/browser/webui/web_ui_message_handler.cc
index fc0ef4e8..6e6a47f 100644
--- a/content/browser/webui/web_ui_message_handler.cc
+++ b/content/browser/webui/web_ui_message_handler.cc
@@ -65,13 +65,13 @@
return false;
}
-base::string16 WebUIMessageHandler::ExtractStringValue(
+std::u16string WebUIMessageHandler::ExtractStringValue(
const base::ListValue* value) {
- base::string16 string16_value;
+ std::u16string string16_value;
if (value->GetString(0, &string16_value))
return string16_value;
NOTREACHED();
- return base::string16();
+ return std::u16string();
}
void WebUIMessageHandler::ResolveJavascriptCallback(
diff --git a/content/browser/webui/web_ui_message_handler_unittest.cc b/content/browser/webui/web_ui_message_handler_unittest.cc
index eec6779b..e7fbcf9 100644
--- a/content/browser/webui/web_ui_message_handler_unittest.cc
+++ b/content/browser/webui/web_ui_message_handler_unittest.cc
@@ -99,7 +99,7 @@
static const char in_string[] =
"The facts, though interesting, are irrelevant.";
list.AppendString(in_string);
- base::string16 out_string = WebUIMessageHandler::ExtractStringValue(&list);
+ std::u16string out_string = WebUIMessageHandler::ExtractStringValue(&list);
EXPECT_EQ(base::ASCIIToUTF16(in_string), out_string);
}
diff --git a/content/browser/worker_host/worker_browsertest.cc b/content/browser/worker_host/worker_browsertest.cc
index 9e0ca78..f32cdd2 100644
--- a/content/browser/worker_host/worker_browsertest.cc
+++ b/content/browser/worker_host/worker_browsertest.cc
@@ -123,12 +123,12 @@
}
void RunTest(Shell* window, const GURL& url, bool expect_failure = false) {
- const base::string16 ok_title = base::ASCIIToUTF16("OK");
- const base::string16 fail_title = base::ASCIIToUTF16("FAIL");
+ const std::u16string ok_title = base::ASCIIToUTF16("OK");
+ const std::u16string fail_title = base::ASCIIToUTF16("FAIL");
TitleWatcher title_watcher(window->web_contents(), ok_title);
title_watcher.AlsoWaitForTitle(fail_title);
EXPECT_TRUE(NavigateToURL(window, url));
- base::string16 final_title = title_watcher.WaitAndGetTitle();
+ std::u16string final_title = title_watcher.WaitAndGetTitle();
EXPECT_EQ(expect_failure ? fail_title : ok_title, final_title);
}
@@ -461,10 +461,10 @@
// Run test.
Shell* window = shell();
- const base::string16 expected_title = base::ASCIIToUTF16("OK");
+ const std::u16string expected_title = base::ASCIIToUTF16("OK");
TitleWatcher title_watcher(window->web_contents(), expected_title);
EXPECT_TRUE(NavigateToURL(window, url));
- base::string16 final_title = title_watcher.WaitAndGetTitle();
+ std::u16string final_title = title_watcher.WaitAndGetTitle();
EXPECT_EQ(expected_title, final_title);
}
diff --git a/content/child/blink_platform_impl.cc b/content/child/blink_platform_impl.cc
index d300553a..93016b45 100644
--- a/content/child/blink_platform_impl.cc
+++ b/content/child/blink_platform_impl.cc
@@ -200,7 +200,7 @@
if (resource_id < 0)
return WebString();
- base::string16 format_string =
+ std::u16string format_string =
GetContentClient()->GetLocalizedString(resource_id);
// If the ContentClient returned an empty string, e.g. because it's using the
@@ -222,7 +222,7 @@
const WebString& value2) {
if (resource_id < 0)
return WebString();
- std::vector<base::string16> values;
+ std::vector<std::u16string> values;
values.reserve(2);
values.push_back(value1.Utf16());
values.push_back(value2.Utf16());
diff --git a/content/child/browser_font_resource_trusted.cc b/content/child/browser_font_resource_trusted.cc
index db8badd9..e26b7ad4 100644
--- a/content/child/browser_font_resource_trusted.cc
+++ b/content/child/browser_font_resource_trusted.cc
@@ -41,12 +41,12 @@
// undefined reference linker error.
const char kCommonScript[] = "Zyyy";
-base::string16 GetFontFromMap(const blink::web_pref::ScriptFontFamilyMap& map,
+std::u16string GetFontFromMap(const blink::web_pref::ScriptFontFamilyMap& map,
const std::string& script) {
blink::web_pref::ScriptFontFamilyMap::const_iterator it = map.find(script);
if (it != map.end())
return it->second;
- return base::string16();
+ return std::u16string();
}
// Splits a PP_BrowserFont_Trusted_TextRun into a sequence or LTR and RTL
@@ -82,7 +82,7 @@
ubidi_close(bidi_);
}
- const base::string16& text() const { return text_; }
+ const std::u16string& text() const { return text_; }
int num_runs() const { return num_runs_; }
// Returns a WebTextRun with the info for the run at the given index.
@@ -92,7 +92,7 @@
if (bidi_) {
bool run_rtl = !!ubidi_getVisualRun(bidi_, index, run_start, run_len);
return WebTextRun(blink::WebString::FromUTF16(
- base::string16(&text_[*run_start], *run_len)),
+ std::u16string(&text_[*run_start], *run_len)),
run_rtl, true);
}
@@ -108,7 +108,7 @@
UBiDi* bidi_;
// Text of all the runs.
- base::string16 text_;
+ std::u16string text_;
int num_runs_;
@@ -168,7 +168,7 @@
StringVar* face_name = StringVar::FromPPVar(font.face); // Possibly null.
WebFontDescription result;
- base::string16 resolved_family;
+ std::u16string resolved_family;
if (!face_name || face_name->value().empty()) {
// Resolve the generic family.
switch (font.family) {
diff --git a/content/child/child_process_sandbox_support_impl_mac.cc b/content/child/child_process_sandbox_support_impl_mac.cc
index fbf3a1d..ddbfaf12 100644
--- a/content/child/child_process_sandbox_support_impl_mac.cc
+++ b/content/child/child_process_sandbox_support_impl_mac.cc
@@ -35,7 +35,7 @@
if (!sandbox_support_)
return false;
base::ScopedCFTypeRef<CFStringRef> name_ref(CTFontCopyPostScriptName(font));
- base::string16 font_name = SysCFStringRefToUTF16(name_ref);
+ std::u16string font_name = SysCFStringRefToUTF16(name_ref);
float font_point_size = CTFontGetSize(font);
mojo::ScopedSharedBufferHandle font_data;
bool success = sandbox_support_->LoadFont(font_name, font_point_size,
diff --git a/content/child/dwrite_font_proxy/dwrite_font_proxy_win.cc b/content/child/dwrite_font_proxy/dwrite_font_proxy_win.cc
index 3db5fab0..0aea845 100644
--- a/content/child/dwrite_font_proxy/dwrite_font_proxy_win.cc
+++ b/content/child/dwrite_font_proxy/dwrite_font_proxy_win.cc
@@ -338,7 +338,7 @@
}
bool DWriteFontCollectionProxy::GetFontFamily(UINT32 family_index,
- const base::string16& family_name,
+ const std::u16string& family_name,
IDWriteFontFamily** font_family) {
DCHECK(font_family);
DCHECK(!family_name.empty());
diff --git a/content/child/dwrite_font_proxy/dwrite_font_proxy_win.h b/content/child/dwrite_font_proxy/dwrite_font_proxy_win.h
index f8a8b2d..a0a6d11 100644
--- a/content/child/dwrite_font_proxy/dwrite_font_proxy_win.h
+++ b/content/child/dwrite_font_proxy/dwrite_font_proxy_win.h
@@ -93,7 +93,7 @@
// Gets the family at the specified index with the expected name. This can be
// used to avoid an IPC call when both the index and family name are known.
bool GetFontFamily(UINT32 family_index,
- const base::string16& family_name,
+ const std::u16string& family_name,
IDWriteFontFamily** font_family);
bool LoadFamilyNames(UINT32 family_index, IDWriteLocalizedStrings** strings);
diff --git a/content/child/dwrite_font_proxy/font_fallback_win.cc b/content/child/dwrite_font_proxy/font_fallback_win.cc
index 58e7d29..45cefdc8 100644
--- a/content/child/dwrite_font_proxy/font_fallback_win.cc
+++ b/content/child/dwrite_font_proxy/font_fallback_win.cc
@@ -79,7 +79,7 @@
DCHECK(false);
return E_FAIL;
}
- base::string16 text_chunk;
+ std::u16string text_chunk;
base::WideToUTF16(text, std::min(chunk_length, text_length), &text_chunk);
if (text_chunk.size() == 0) {
@@ -166,7 +166,7 @@
return S_OK;
}
-bool FontFallback::GetCachedFont(const base::string16& text,
+bool FontFallback::GetCachedFont(const std::u16string& text,
const wchar_t* base_family_name,
const wchar_t* locale,
DWRITE_FONT_WEIGHT base_weight,
diff --git a/content/child/dwrite_font_proxy/font_fallback_win.h b/content/child/dwrite_font_proxy/font_fallback_win.h
index 623f76f1..e90edf8 100644
--- a/content/child/dwrite_font_proxy/font_fallback_win.h
+++ b/content/child/dwrite_font_proxy/font_fallback_win.h
@@ -53,7 +53,7 @@
protected:
~FontFallback() override;
- bool GetCachedFont(const base::string16& text,
+ bool GetCachedFont(const std::u16string& text,
const wchar_t* base_family_name,
const wchar_t* locale,
DWRITE_FONT_WEIGHT base_weight,
diff --git a/content/common/mac/attributed_string_type_converters.mm b/content/common/mac/attributed_string_type_converters.mm
index e57c621c..a03d086 100644
--- a/content/common/mac/attributed_string_type_converters.mm
+++ b/content/common/mac/attributed_string_type_converters.mm
@@ -16,7 +16,7 @@
namespace {
-NSDictionary* ToAttributesDictionary(base::string16 name, float font_size) {
+NSDictionary* ToAttributesDictionary(std::u16string name, float font_size) {
DCHECK(!name.empty());
NSString* font_name_ns = base::SysUTF16ToNSString(name);
NSFont* font = [NSFont fontWithName:font_name_ns size:font_size];
@@ -73,7 +73,7 @@
effectiveRange:&effective_range];
NSFont* font = [ns_attributes objectForKey:NSFontAttributeName];
- base::string16 font_name;
+ std::u16string font_name;
float font_point_size;
// Only encode the attributes if the filtered set contains font information.
if (font) {
diff --git a/content/common/mac/attributed_string_type_converters_unittest.mm b/content/common/mac/attributed_string_type_converters_unittest.mm
index 38485ff..bcf21c5 100644
--- a/content/common/mac/attributed_string_type_converters_unittest.mm
+++ b/content/common/mac/attributed_string_type_converters_unittest.mm
@@ -109,7 +109,7 @@
TEST_F(AttributedStringConverterTest, OutOfRange) {
NSFont* system_font = [NSFont systemFontOfSize:10];
- base::string16 font_name = base::SysNSStringToUTF16([system_font fontName]);
+ std::u16string font_name = base::SysNSStringToUTF16([system_font fontName]);
ui::mojom::AttributedStringPtr attributed_string =
ui::mojom::AttributedString::New();
attributed_string->string = base::ASCIIToUTF16("Hello World");
diff --git a/content/common/mac/font_loader.h b/content/common/mac/font_loader.h
index a5c72df5..af82523 100644
--- a/content/common/mac/font_loader.h
+++ b/content/common/mac/font_loader.h
@@ -47,7 +47,7 @@
// sending over IPC. On failure, zeroes and an invalid handle are reported
// to the callback.
CONTENT_EXPORT
- static void LoadFont(const base::string16& font_name,
+ static void LoadFont(const std::u16string& font_name,
float font_point_size,
LoadedCallback callback);
@@ -69,7 +69,7 @@
CONTENT_EXPORT
static std::unique_ptr<ResultInternal> LoadFontForTesting(
- const base::string16& font_name,
+ const std::u16string& font_name,
float font_point_size);
};
diff --git a/content/common/mac/font_loader.mm b/content/common/mac/font_loader.mm
index 5f87b91..51ce47d 100644
--- a/content/common/mac/font_loader.mm
+++ b/content/common/mac/font_loader.mm
@@ -28,7 +28,7 @@
namespace {
std::unique_ptr<FontLoader::ResultInternal> LoadFontOnFileThread(
- const base::string16& font_name,
+ const std::u16string& font_name,
const float font_point_size) {
base::ScopedBlockingCall scoped_blocking_call(FROM_HERE,
base::BlockingType::MAY_BLOCK);
@@ -128,7 +128,7 @@
FontLoader::ResultInternal::~ResultInternal() = default;
// static
-void FontLoader::LoadFont(const base::string16& font_name,
+void FontLoader::LoadFont(const std::u16string& font_name,
const float font_point_size,
LoadedCallback callback) {
// Tasks are triggered when font loading in the sandbox fails. Usually due to
@@ -166,7 +166,7 @@
// static
std::unique_ptr<FontLoader::ResultInternal> FontLoader::LoadFontForTesting(
- const base::string16& font_name,
+ const std::u16string& font_name,
const float font_point_size) {
return LoadFontOnFileThread(font_name, font_point_size);
}
diff --git a/content/public/browser/authenticator_request_client_delegate.cc b/content/public/browser/authenticator_request_client_delegate.cc
index 44c9ae32..c58dee9 100644
--- a/content/public/browser/authenticator_request_client_delegate.cc
+++ b/content/public/browser/authenticator_request_client_delegate.cc
@@ -134,7 +134,7 @@
void AuthenticatorRequestClientDelegate::CollectPIN(
CollectPINOptions options,
- base::OnceCallback<void(base::string16)> provide_pin_cb) {
+ base::OnceCallback<void(std::u16string)> provide_pin_cb) {
NOTREACHED();
}
diff --git a/content/public/browser/authenticator_request_client_delegate.h b/content/public/browser/authenticator_request_client_delegate.h
index 15d8a65..8733b9e 100644
--- a/content/public/browser/authenticator_request_client_delegate.h
+++ b/content/public/browser/authenticator_request_client_delegate.h
@@ -238,7 +238,7 @@
bool SupportsPIN() const override;
void CollectPIN(
CollectPINOptions options,
- base::OnceCallback<void(base::string16)> provide_pin_cb) override;
+ base::OnceCallback<void(std::u16string)> provide_pin_cb) override;
void StartBioEnrollment(base::OnceClosure next_callback) override;
void OnSampleCollected(int bio_samples_remaining) override;
void FinishCollectToken() override;
diff --git a/content/public/browser/bluetooth_chooser.h b/content/public/browser/bluetooth_chooser.h
index 31697e91..0bf515c 100644
--- a/content/public/browser/bluetooth_chooser.h
+++ b/content/public/browser/bluetooth_chooser.h
@@ -72,7 +72,7 @@
// is already connected.
virtual void AddOrUpdateDevice(const std::string& device_id,
bool should_update_name,
- const base::string16& device_name,
+ const std::u16string& device_name,
bool is_gatt_connected,
bool is_paired,
int signal_strength_level) {}
diff --git a/content/public/browser/bluetooth_scanning_prompt.h b/content/public/browser/bluetooth_scanning_prompt.h
index 933625f..80a7bc0 100644
--- a/content/public/browser/bluetooth_scanning_prompt.h
+++ b/content/public/browser/bluetooth_scanning_prompt.h
@@ -48,7 +48,7 @@
// false.
virtual void AddOrUpdateDevice(const std::string& device_id,
bool should_update_name,
- const base::string16& device_name) {}
+ const std::u16string& device_name) {}
};
} // namespace content
diff --git a/content/public/browser/browser_child_process_host.h b/content/public/browser/browser_child_process_host.h
index 5ce6935..277b7c7 100644
--- a/content/public/browser/browser_child_process_host.h
+++ b/content/public/browser/browser_child_process_host.h
@@ -88,7 +88,7 @@
TakeMetricsAllocator() = 0;
// Sets the user-visible name of the process.
- virtual void SetName(const base::string16& name) = 0;
+ virtual void SetName(const std::u16string& name) = 0;
// Sets the name of the process used for metrics reporting.
virtual void SetMetricsName(const std::string& metrics_name) = 0;
diff --git a/content/public/browser/child_process_data.h b/content/public/browser/child_process_data.h
index 4bf7ae6..a4fdf17 100644
--- a/content/public/browser/child_process_data.h
+++ b/content/public/browser/child_process_data.h
@@ -22,7 +22,7 @@
// The name of the process. i.e. for plugins it might be Flash, while for
// for workers it might be the domain that it's from.
- base::string16 name;
+ std::u16string name;
// The non-localized name of the process used for metrics reporting.
std::string metrics_name;
diff --git a/content/public/browser/console_message.h b/content/public/browser/console_message.h
index c21afc2..9c17d5d 100644
--- a/content/public/browser/console_message.h
+++ b/content/public/browser/console_message.h
@@ -18,7 +18,7 @@
struct ConsoleMessage {
ConsoleMessage(blink::mojom::ConsoleMessageSource source,
blink::mojom::ConsoleMessageLevel message_level,
- const base::string16& message,
+ const std::u16string& message,
int line_number,
const GURL& source_url)
: source(source),
@@ -32,7 +32,7 @@
// The severity of the console message.
const blink::mojom::ConsoleMessageLevel message_level;
// The message that was logged to the console.
- const base::string16 message;
+ const std::u16string message;
// The line in the script file that the log was emitted at.
const int line_number;
// The URL that emitted the log.
diff --git a/content/public/browser/javascript_dialog_manager.cc b/content/public/browser/javascript_dialog_manager.cc
index ccc1f16..8817420 100644
--- a/content/public/browser/javascript_dialog_manager.cc
+++ b/content/public/browser/javascript_dialog_manager.cc
@@ -9,7 +9,7 @@
bool JavaScriptDialogManager::HandleJavaScriptDialog(
WebContents* web_contents,
bool accept,
- const base::string16* prompt_override) {
+ const std::u16string* prompt_override) {
return false;
}
diff --git a/content/public/browser/javascript_dialog_manager.h b/content/public/browser/javascript_dialog_manager.h
index 1aec6b2..32c30109 100644
--- a/content/public/browser/javascript_dialog_manager.h
+++ b/content/public/browser/javascript_dialog_manager.h
@@ -25,15 +25,15 @@
public:
using DialogClosedCallback =
base::OnceCallback<void(bool /* success */,
- const base::string16& /* user_input */)>;
+ const std::u16string& /* user_input */)>;
// Displays a JavaScript dialog. |did_suppress_message| will not be nil; if
// |true| is returned in it, the caller will handle faking the reply.
virtual void RunJavaScriptDialog(WebContents* web_contents,
RenderFrameHost* render_frame_host,
JavaScriptDialogType dialog_type,
- const base::string16& message_text,
- const base::string16& default_prompt_text,
+ const std::u16string& message_text,
+ const std::u16string& default_prompt_text,
DialogClosedCallback callback,
bool* did_suppress_message) = 0;
@@ -49,7 +49,7 @@
// dialog was handled.
virtual bool HandleJavaScriptDialog(WebContents* web_contents,
bool accept,
- const base::string16* prompt_override);
+ const std::u16string* prompt_override);
// Cancels all active and pending dialogs for the given WebContents. If
// |reset_state| is true, resets any saved state tied to |web_contents|.
diff --git a/content/public/browser/message_port_provider.h b/content/public/browser/message_port_provider.h
index 6403f443..6749b08 100644
--- a/content/public/browser/message_port_provider.h
+++ b/content/public/browser/message_port_provider.h
@@ -36,11 +36,10 @@
// See https://html.spec.whatwg.org/multipage/comms.html#messageevent for
// further information on message events.
// Should be called on UI thread.
- static void PostMessageToFrame(
- WebContents* web_contents,
- const base::string16& source_origin,
- const base::string16& target_origin,
- const base::string16& data);
+ static void PostMessageToFrame(WebContents* web_contents,
+ const std::u16string& source_origin,
+ const std::u16string& target_origin,
+ const std::u16string& data);
#if defined(OS_ANDROID)
static void PostMessageToFrame(
@@ -56,9 +55,9 @@
// If |target_origin| is unset, then no origin scoping is applied.
static void PostMessageToFrame(
WebContents* web_contents,
- const base::string16& source_origin,
- const base::Optional<base::string16>& target_origin,
- const base::string16& data,
+ const std::u16string& source_origin,
+ const base::Optional<std::u16string>& target_origin,
+ const std::u16string& data,
std::vector<blink::WebMessagePort> ports);
#endif // OS_FUCHSIA || BUILDFLAG(IS_CHROMECAST)
diff --git a/content/public/browser/navigation_entry.h b/content/public/browser/navigation_entry.h
index de3d800b..b5db899 100644
--- a/content/public/browser/navigation_entry.h
+++ b/content/public/browser/navigation_entry.h
@@ -97,8 +97,8 @@
// observers when the visible title changes. Only call
// NavigationEntry::SetTitle() below directly when this entry is known not to
// be visible.
- virtual void SetTitle(const base::string16& title) = 0;
- virtual const base::string16& GetTitle() = 0;
+ virtual void SetTitle(const std::u16string& title) = 0;
+ virtual const std::u16string& GetTitle() = 0;
// Page state is an opaque blob created by Blink that represents the state of
// the page. This includes form entries and scroll position for each frame.
@@ -115,7 +115,7 @@
// Returns the title to be displayed on the tab. This could be the title of
// the page if it is available or the URL.
- virtual const base::string16& GetTitleForDisplay() = 0;
+ virtual const std::u16string& GetTitleForDisplay() = 0;
// Returns true if the current tab is in view source mode. This will be false
// if there is no navigation.
diff --git a/content/public/browser/notification_event_dispatcher.h b/content/public/browser/notification_event_dispatcher.h
index 9015b09..a65ba3c2 100644
--- a/content/public/browser/notification_event_dispatcher.h
+++ b/content/public/browser/notification_event_dispatcher.h
@@ -41,7 +41,7 @@
const std::string& notification_id,
const GURL& origin,
const base::Optional<int>& action_index,
- const base::Optional<base::string16>& reply,
+ const base::Optional<std::u16string>& reply,
NotificationDispatchCompleteCallback dispatch_complete_callback) = 0;
// Dispatches the "notificationclose" event on the Service Worker associated
diff --git a/content/public/browser/plugin_service.h b/content/public/browser/plugin_service.h
index dcfd3ff3..934c7f0 100644
--- a/content/public/browser/plugin_service.h
+++ b/content/public/browser/plugin_service.h
@@ -92,7 +92,7 @@
// the path doesn't identify a plugin, or the plugin has no display name,
// this will attempt to generate a display name from the path.
// This can be called from any thread.
- virtual base::string16 GetPluginDisplayNameByPath(
+ virtual std::u16string GetPluginDisplayNameByPath(
const base::FilePath& plugin_path) = 0;
// Asynchronously loads plugins if necessary and then calls back to the
diff --git a/content/public/browser/render_frame_host.h b/content/public/browser/render_frame_host.h
index b715a8f..dd52e159 100644
--- a/content/public/browser/render_frame_host.h
+++ b/content/public/browser/render_frame_host.h
@@ -392,26 +392,26 @@
// is semantically equivalent to
//
// ExecuteJavaScript("obj.foo(1, true)", callback)
- virtual void ExecuteJavaScriptMethod(const base::string16& object_name,
- const base::string16& method_name,
+ virtual void ExecuteJavaScriptMethod(const std::u16string& object_name,
+ const std::u16string& method_name,
base::Value arguments,
JavaScriptResultCallback callback) = 0;
// This is the default API to run JavaScript in this frame. This API can only
// be called on chrome:// or devtools:// URLs.
- virtual void ExecuteJavaScript(const base::string16& javascript,
+ virtual void ExecuteJavaScript(const std::u16string& javascript,
JavaScriptResultCallback callback) = 0;
// This runs the JavaScript in an isolated world of the top of this frame's
// context.
virtual void ExecuteJavaScriptInIsolatedWorld(
- const base::string16& javascript,
+ const std::u16string& javascript,
JavaScriptResultCallback callback,
int32_t world_id) = 0;
// This runs the JavaScript, but without restrictions. THIS IS ONLY FOR TESTS.
virtual void ExecuteJavaScriptForTests(
- const base::string16& javascript,
+ const std::u16string& javascript,
JavaScriptResultCallback callback,
int32_t world_id = ISOLATED_WORLD_ID_GLOBAL) = 0;
@@ -420,7 +420,7 @@
// notification to test functionalities that are gated by user
// activation.
virtual void ExecuteJavaScriptWithUserGestureForTests(
- const base::string16& javascript,
+ const std::u16string& javascript,
int32_t world_id = ISOLATED_WORLD_ID_GLOBAL) = 0;
// Send a message to the RenderFrame to trigger an action on an
diff --git a/content/public/browser/render_widget_host.h b/content/public/browser/render_widget_host.h
index 8a915d5..8eec86b 100644
--- a/content/public/browser/render_widget_host.h
+++ b/content/public/browser/render_widget_host.h
@@ -253,11 +253,11 @@
// InputEvents are only triggered when user typed in through number bar on
// Android keyboard. This function is triggered when text is committed in
// input form.
- virtual void OnImeTextCommittedEvent(const base::string16& text_str) {}
+ virtual void OnImeTextCommittedEvent(const std::u16string& text_str) {}
// This function is triggered when composing text is updated. Note that
// text_str contains all text that is currently under composition rather
// than updated text only.
- virtual void OnImeSetComposingTextEvent(const base::string16& text_str) {}
+ virtual void OnImeSetComposingTextEvent(const std::u16string& text_str) {}
// This function is triggered when composing text is filled into the input
// form.
virtual void OnImeFinishComposingTextEvent() {}
diff --git a/content/public/browser/render_widget_host_view.h b/content/public/browser/render_widget_host_view.h
index 12d89a1..295b10d 100644
--- a/content/public/browser/render_widget_host_view.h
+++ b/content/public/browser/render_widget_host_view.h
@@ -142,7 +142,7 @@
// Returns the currently selected text in both of editable text fields and
// non-editable texts.
- virtual base::string16 GetSelectedText() = 0;
+ virtual std::u16string GetSelectedText() = 0;
// This only returns non-null on platforms that implement touch
// selection editing (TSE), currently Aura and Android.
diff --git a/content/public/browser/service_process_host.cc b/content/public/browser/service_process_host.cc
index 842b7af..a34cc7f4 100644
--- a/content/public/browser/service_process_host.cc
+++ b/content/public/browser/service_process_host.cc
@@ -22,7 +22,7 @@
}
ServiceProcessHost::Options& ServiceProcessHost::Options::WithDisplayName(
- const base::string16& name) {
+ const std::u16string& name) {
display_name = name;
return *this;
}
diff --git a/content/public/browser/service_process_host.h b/content/public/browser/service_process_host.h
index f9d9b91..2600c0a 100644
--- a/content/public/browser/service_process_host.h
+++ b/content/public/browser/service_process_host.h
@@ -66,7 +66,7 @@
// be a human readable and meaningful application or service name and will
// appear in places like the system task viewer.
Options& WithDisplayName(const std::string& name);
- Options& WithDisplayName(const base::string16& name);
+ Options& WithDisplayName(const std::u16string& name);
Options& WithDisplayName(int resource_id);
// Specifies additional flags to configure the launched process. See
@@ -83,7 +83,7 @@
sandbox::policy::SandboxType sandbox_type =
sandbox::policy::SandboxType::kUtility;
- base::string16 display_name;
+ std::u16string display_name;
base::Optional<int> child_flags;
std::vector<std::string> extra_switches;
};
@@ -165,7 +165,7 @@
// process. All new code must use ServiceProcessHost instead of this API.
void CONTENT_EXPORT LaunchUtilityProcessServiceDeprecated(
const std::string& service_name,
- const base::string16& display_name,
+ const std::u16string& display_name,
sandbox::policy::SandboxType sandbox_type,
mojo::ScopedMessagePipeHandle service_pipe,
base::OnceCallback<void(base::ProcessId)> callback);
diff --git a/content/public/browser/service_worker_context_observer.h b/content/public/browser/service_worker_context_observer.h
index 6f61d0a..302e1bd 100644
--- a/content/public/browser/service_worker_context_observer.h
+++ b/content/public/browser/service_worker_context_observer.h
@@ -19,7 +19,7 @@
class ServiceWorkerContextObserver {
public:
struct ErrorInfo {
- ErrorInfo(const base::string16& message,
+ ErrorInfo(const std::u16string& message,
int line,
int column,
const GURL& url)
@@ -28,7 +28,7 @@
column_number(column),
source_url(url) {}
ErrorInfo(const ErrorInfo& info) = default;
- const base::string16 error_message;
+ const std::u16string error_message;
const int line_number;
const int column_number;
const GURL source_url;
diff --git a/content/public/browser/web_contents.h b/content/public/browser/web_contents.h
index f7c4564..7336c88 100644
--- a/content/public/browser/web_contents.h
+++ b/content/public/browser/web_contents.h
@@ -468,13 +468,13 @@
// Returns the current navigation properties, which if a navigation is
// pending may be provisional (e.g., the navigation could result in a
// download, in which case the URL would revert to what it was previously).
- virtual const base::string16& GetTitle() = 0;
+ virtual const std::u16string& GetTitle() = 0;
// Saves the given title to the navigation entry and does associated work. It
// will update history and the view with the new title, and also synthesize
// titles for file URLs that have none. Thus |entry| must have a URL set.
virtual void UpdateTitleForEntry(NavigationEntry* entry,
- const base::string16& title) = 0;
+ const std::u16string& title) = 0;
// Returns the SiteInstance associated with the current page.
virtual SiteInstance* GetSiteInstance() = 0;
@@ -503,7 +503,7 @@
// Returns the current load state and the URL associated with it.
// The load state is only updated while IsLoading() is true.
virtual const net::LoadStateWithParam& GetLoadState() = 0;
- virtual const base::string16& GetLoadStateHost() = 0;
+ virtual const std::u16string& GetLoadStateHost() = 0;
// Returns the upload progress.
virtual uint64_t GetUploadSize() = 0;
@@ -755,10 +755,10 @@
bool show_selection_menu) = 0;
// Replaces the currently selected word or a word around the cursor.
- virtual void Replace(const base::string16& word) = 0;
+ virtual void Replace(const std::u16string& word) = 0;
// Replaces the misspelling in the current selection.
- virtual void ReplaceMisspelling(const base::string16& word) = 0;
+ virtual void ReplaceMisspelling(const std::u16string& word) = 0;
// Let the renderer know that the menu has been closed.
virtual void NotifyContextMenuClosed(const GURL& link_followed) = 0;
@@ -848,7 +848,7 @@
virtual void SaveFrameWithHeaders(const GURL& url,
const Referrer& referrer,
const std::string& headers,
- const base::string16& suggested_filename,
+ const std::u16string& suggested_filename,
RenderFrameHost* rfh) = 0;
// Generate an MHTML representation of the current page conforming to the
@@ -1004,7 +1004,7 @@
// Finds text on a page. |search_text| should not be empty.
virtual void Find(int request_id,
- const base::string16& search_text,
+ const std::u16string& search_text,
blink::mojom::FindOptionsPtr options) = 0;
// Notifies the renderer that the user has closed the FindInPage window
diff --git a/content/public/browser/web_contents_delegate.cc b/content/public/browser/web_contents_delegate.cc
index dc7ea61..ba416ae 100644
--- a/content/public/browser/web_contents_delegate.cc
+++ b/content/public/browser/web_contents_delegate.cc
@@ -52,9 +52,9 @@
bool WebContentsDelegate::DidAddMessageToConsole(
WebContents* source,
blink::mojom::ConsoleMessageLevel log_level,
- const base::string16& message,
+ const std::u16string& message,
int32_t line_no,
- const base::string16& source_id) {
+ const std::u16string& source_id) {
return false;
}
diff --git a/content/public/browser/web_contents_delegate.h b/content/public/browser/web_contents_delegate.h
index 55af8831..164d5d1 100644
--- a/content/public/browser/web_contents_delegate.h
+++ b/content/public/browser/web_contents_delegate.h
@@ -222,9 +222,9 @@
virtual bool DidAddMessageToConsole(
WebContents* source,
blink::mojom::ConsoleMessageLevel log_level,
- const base::string16& message,
+ const std::u16string& message,
int32_t line_no,
- const base::string16& source_id);
+ const std::u16string& source_id);
// Tells us that we've finished firing this tab's beforeunload event.
// The proceed bool tells us whether the user chose to proceed closing the
diff --git a/content/public/browser/web_contents_observer.h b/content/public/browser/web_contents_observer.h
index ecc02ba..ada26a7d 100644
--- a/content/public/browser/web_contents_observer.h
+++ b/content/public/browser/web_contents_observer.h
@@ -547,10 +547,10 @@
virtual void OnDidAddMessageToConsole(
RenderFrameHost* source_frame,
blink::mojom::ConsoleMessageLevel log_level,
- const base::string16& message,
+ const std::u16string& message,
int32_t line_no,
- const base::string16& source_id,
- const base::Optional<base::string16>& untrusted_stack_trace) {}
+ const std::u16string& source_id,
+ const base::Optional<std::u16string>& untrusted_stack_trace) {}
// Invoked when media is playing or paused. |id| is unique per player and per
// RenderFrameHost. There may be multiple players within a RenderFrameHost
diff --git a/content/public/browser/web_ui.h b/content/public/browser/web_ui.h
index fa6f10c..23de3e83 100644
--- a/content/public/browser/web_ui.h
+++ b/content/public/browser/web_ui.h
@@ -40,7 +40,7 @@
// Returns JavaScript code that, when executed, calls the function specified
// by |function_name| with the arguments specified in |arg_list|.
- static base::string16 GetJavascriptCall(
+ static std::u16string GetJavascriptCall(
const std::string& function_name,
const std::vector<const base::Value*>& arg_list);
@@ -59,8 +59,8 @@
// Gets a custom tab title provided by the Web UI. If there is no title
// override, the string will be empty which should trigger the default title
// behavior for the tab.
- virtual const base::string16& GetOverriddenTitle() = 0;
- virtual void OverrideTitle(const base::string16& title) = 0;
+ virtual const std::u16string& GetOverriddenTitle() = 0;
+ virtual void OverrideTitle(const std::u16string& title) = 0;
// Allows a controller to override the BindingsPolicy that should be enabled
// for this page.
diff --git a/content/public/browser/web_ui_data_source.h b/content/public/browser/web_ui_data_source.h
index bc10af3..d13e25c7c 100644
--- a/content/public/browser/web_ui_data_source.h
+++ b/content/public/browser/web_ui_data_source.h
@@ -55,7 +55,7 @@
// Adds a string keyed to its name to our dictionary.
virtual void AddString(base::StringPiece name,
- const base::string16& value) = 0;
+ const std::u16string& value) = 0;
// Adds a string keyed to its name to our dictionary.
virtual void AddString(base::StringPiece name, const std::string& value) = 0;
diff --git a/content/public/browser/web_ui_message_handler.h b/content/public/browser/web_ui_message_handler.h
index 363af12..448bf09 100644
--- a/content/public/browser/web_ui_message_handler.h
+++ b/content/public/browser/web_ui_message_handler.h
@@ -75,7 +75,7 @@
double* out_value);
// Extract a string value from a list Value.
- static base::string16 ExtractStringValue(const base::ListValue* value);
+ static std::u16string ExtractStringValue(const base::ListValue* value);
// This is where subclasses specify which messages they'd like to handle and
// perform any additional initialization.. At this point web_ui() will return
diff --git a/content/public/common/content_client.cc b/content/public/common/content_client.cc
index 0dd4b7d..ef6b93cd 100644
--- a/content/public/common/content_client.cc
+++ b/content/public/common/content_client.cc
@@ -68,14 +68,14 @@
ContentClient::~ContentClient() {
}
-base::string16 ContentClient::GetLocalizedString(int message_id) {
- return base::string16();
+std::u16string ContentClient::GetLocalizedString(int message_id) {
+ return std::u16string();
}
-base::string16 ContentClient::GetLocalizedString(
+std::u16string ContentClient::GetLocalizedString(
int message_id,
- const base::string16& replacement) {
- return base::string16();
+ const std::u16string& replacement) {
+ return std::u16string();
}
base::StringPiece ContentClient::GetDataResource(int resource_id,
diff --git a/content/public/common/content_client.h b/content/public/common/content_client.h
index 04f7c282..9b0d80a 100644
--- a/content/public/common/content_client.h
+++ b/content/public/common/content_client.h
@@ -150,12 +150,12 @@
virtual void AddAdditionalSchemes(Schemes* schemes) {}
// Returns a string resource given its id.
- virtual base::string16 GetLocalizedString(int message_id);
+ virtual std::u16string GetLocalizedString(int message_id);
// Returns a string resource given its id and replace $1 with the given
// replacement.
- virtual base::string16 GetLocalizedString(int message_id,
- const base::string16& replacement);
+ virtual std::u16string GetLocalizedString(int message_id,
+ const std::u16string& replacement);
// Return the contents of a resource in a StringPiece given the resource id.
virtual base::StringPiece GetDataResource(int resource_id,
diff --git a/content/public/common/drop_data.cc b/content/public/common/drop_data.cc
index 3262a0c..26f7897 100644
--- a/content/public/common/drop_data.cc
+++ b/content/public/common/drop_data.cc
@@ -15,7 +15,7 @@
// static
DropData::Metadata DropData::Metadata::CreateForMimeType(
const Kind& kind,
- const base::string16& mime_type) {
+ const std::u16string& mime_type) {
Metadata metadata;
metadata.kind = kind;
metadata.mime_type = mime_type;
diff --git a/content/public/common/drop_data.h b/content/public/common/drop_data.h
index 285e8f1..f91a9d3c 100644
--- a/content/public/common/drop_data.h
+++ b/content/public/common/drop_data.h
@@ -53,14 +53,14 @@
struct Metadata {
Metadata();
static Metadata CreateForMimeType(const Kind& kind,
- const base::string16& mime_type);
+ const std::u16string& mime_type);
static Metadata CreateForFilePath(const base::FilePath& filename);
static Metadata CreateForFileSystemUrl(const GURL& file_system_url);
Metadata(const Metadata& other);
~Metadata();
Kind kind;
- base::string16 mime_type;
+ std::u16string mime_type;
base::FilePath filename;
GURL file_system_url;
};
@@ -80,10 +80,10 @@
// User is dragging a link or image.
GURL url;
- base::string16 url_title; // The title associated with |url|.
+ std::u16string url_title; // The title associated with |url|.
// User is dragging a link out-of the webview.
- base::string16 download_metadata;
+ std::u16string download_metadata;
// Referrer policy to use when dragging a link out of the webview results in
// a download.
@@ -94,21 +94,21 @@
// from web content.
std::vector<ui::FileInfo> filenames;
// The mime types of dragged files.
- std::vector<base::string16> file_mime_types;
+ std::vector<std::u16string> file_mime_types;
// Isolated filesystem ID for the files being dragged on the webview.
- base::string16 filesystem_id;
+ std::u16string filesystem_id;
// User is dragging files specified with filesystem: URLs.
std::vector<FileSystemFileInfo> file_system_files;
// User is dragging plain text into the webview.
- base::Optional<base::string16> text;
+ base::Optional<std::u16string> text;
// User is dragging text/html into the webview (e.g., out of Firefox).
// |html_base_url| is the URL that the html fragment is taken from (used to
// resolve relative links). It's ok for |html_base_url| to be empty.
- base::Optional<base::string16> html;
+ base::Optional<std::u16string> html;
GURL html_base_url;
// User is dragging an image out of the WebView.
@@ -117,7 +117,7 @@
base::FilePath::StringType file_contents_filename_extension;
std::string file_contents_content_disposition;
- std::unordered_map<base::string16, base::string16> custom_data;
+ std::unordered_map<std::u16string, std::u16string> custom_data;
};
} // namespace content
diff --git a/content/public/common/webplugininfo.cc b/content/public/common/webplugininfo.cc
index c3892c6..6a4cdfd 100644
--- a/content/public/common/webplugininfo.cc
+++ b/content/public/common/webplugininfo.cc
@@ -41,21 +41,20 @@
WebPluginInfo& WebPluginInfo::operator=(const WebPluginInfo& rhs) = default;
-WebPluginInfo::WebPluginInfo(const base::string16& fake_name,
+WebPluginInfo::WebPluginInfo(const std::u16string& fake_name,
const base::FilePath& fake_path,
- const base::string16& fake_version,
- const base::string16& fake_desc)
+ const std::u16string& fake_version,
+ const std::u16string& fake_desc)
: name(fake_name),
path(fake_path),
version(fake_version),
desc(fake_desc),
mime_types(),
type(PLUGIN_TYPE_PEPPER_OUT_OF_PROCESS),
- pepper_permissions(0) {
-}
+ pepper_permissions(0) {}
void WebPluginInfo::CreateVersionFromString(
- const base::string16& version_string,
+ const std::u16string& version_string,
base::Version* parsed_version) {
// Remove spaces and ')' from the version string,
// Replace any instances of 'r', ',' or '(' with a dot.
diff --git a/content/public/common/webplugininfo.h b/content/public/common/webplugininfo.h
index 2735b5d4..081169d 100644
--- a/content/public/common/webplugininfo.h
+++ b/content/public/common/webplugininfo.h
@@ -37,15 +37,15 @@
std::vector<std::string> file_extensions;
// Description of the mime type.
- base::string16 description;
+ std::u16string description;
// Extra parameters to include when instantiating the plugin.
struct Param {
Param() = default;
- Param(base::string16 n, base::string16 v)
+ Param(std::u16string n, std::u16string v)
: name(std::move(n)), value(std::move(v)) {}
- base::string16 name;
- base::string16 value;
+ std::u16string name;
+ std::u16string value;
};
std::vector<Param> additional_params;
};
@@ -66,10 +66,10 @@
WebPluginInfo& operator=(const WebPluginInfo& rhs);
// Special constructor only used during unit testing:
- WebPluginInfo(const base::string16& fake_name,
+ WebPluginInfo(const std::u16string& fake_name,
const base::FilePath& fake_path,
- const base::string16& fake_version,
- const base::string16& fake_desc);
+ const std::u16string& fake_version,
+ const std::u16string& fake_desc);
bool is_pepper_plugin() const {
return ((type == PLUGIN_TYPE_PEPPER_IN_PROCESS ) ||
@@ -78,20 +78,20 @@
// Parse a version string as used by a plugin. This method is more lenient
// in accepting weird version strings than base::Version::GetFromString()
- static void CreateVersionFromString(const base::string16& version_string,
+ static void CreateVersionFromString(const std::u16string& version_string,
base::Version* parsed_version);
// The name of the plugin (i.e. Flash).
- base::string16 name;
+ std::u16string name;
// The path to the plugin file (DLL/bundle/library).
base::FilePath path;
// The version number of the plugin file (may be OS-specific)
- base::string16 version;
+ std::u16string version;
// A description of the plugin that we get from its version info.
- base::string16 desc;
+ std::u16string desc;
// A list of all the mime types that this plugin supports.
std::vector<WebPluginMimeType> mime_types;
diff --git a/content/public/renderer/content_renderer_client.cc b/content/public/renderer/content_renderer_client.cc
index 227b7ce..9745f32 100644
--- a/content/public/renderer/content_renderer_client.cc
+++ b/content/public/renderer/content_renderer_client.cc
@@ -182,7 +182,7 @@
}
bool ContentRendererClient::ShouldReportDetailedMessageForSource(
- const base::string16& source) {
+ const std::u16string& source) {
return false;
}
diff --git a/content/public/renderer/content_renderer_client.h b/content/public/renderer/content_renderer_client.h
index 278a6308..bf03da5 100644
--- a/content/public/renderer/content_renderer_client.h
+++ b/content/public/renderer/content_renderer_client.h
@@ -269,7 +269,7 @@
// reported source for the error; this can point to a page or a script,
// and can be external or internal.
virtual bool ShouldReportDetailedMessageForSource(
- const base::string16& source);
+ const std::u16string& source);
// Creates a permission client for in-renderer worker.
virtual std::unique_ptr<blink::WebContentSettingsClient>
diff --git a/content/public/renderer/pepper_plugin_instance.h b/content/public/renderer/pepper_plugin_instance.h
index c1dc7df..c8ff3323 100644
--- a/content/public/renderer/pepper_plugin_instance.h
+++ b/content/public/renderer/pepper_plugin_instance.h
@@ -101,7 +101,7 @@
virtual void SetEmbedProperty(PP_Var key, PP_Var value) = 0;
// Sets the selected text for this plugin.
- virtual void SetSelectedText(const base::string16& selected_text) = 0;
+ virtual void SetSelectedText(const std::u16string& selected_text) = 0;
// Sets the link currently under the cursor.
virtual void SetLinkUnderCursor(const std::string& url) = 0;
diff --git a/content/public/renderer/render_frame.h b/content/public/renderer/render_frame.h
index 93fecf2..1b19f94 100644
--- a/content/public/renderer/render_frame.h
+++ b/content/public/renderer/render_frame.h
@@ -168,7 +168,7 @@
const blink::WebPluginParams& params) = 0;
// Execute a string of JavaScript in this frame's context.
- virtual void ExecuteJavaScript(const base::string16& javascript) = 0;
+ virtual void ExecuteJavaScript(const std::u16string& javascript) = 0;
// Returns true if this is the main (top-level) frame.
virtual bool IsMainFrame() = 0;
@@ -208,7 +208,7 @@
virtual bool IsFTPDirectoryListing() = 0;
// Notifies the browser of text selection changes made.
- virtual void SetSelectedText(const base::string16& selection_text,
+ virtual void SetSelectedText(const std::u16string& selection_text,
size_t offset,
const gfx::Range& range) = 0;
diff --git a/content/public/renderer/render_frame_observer.h b/content/public/renderer/render_frame_observer.h
index 2d751ca..3a9683c 100644
--- a/content/public/renderer/render_frame_observer.h
+++ b/content/public/renderer/render_frame_observer.h
@@ -163,9 +163,9 @@
// internal), and |stack_trace| is the stack trace of the error in a
// human-readable format (each frame is formatted as
// "\n at function_name (source:line_number:column_number)").
- virtual void DetailedConsoleMessageAdded(const base::string16& message,
- const base::string16& source,
- const base::string16& stack_trace,
+ virtual void DetailedConsoleMessageAdded(const std::u16string& message,
+ const std::u16string& source,
+ const std::u16string& stack_trace,
uint32_t line_number,
int32_t severity_level) {}
diff --git a/content/public/test/android/render_frame_host_test_ext.cc b/content/public/test/android/render_frame_host_test_ext.cc
index bcd7ab5..782a408 100644
--- a/content/public/test/android/render_frame_host_test_ext.cc
+++ b/content/public/test/android/render_frame_host_test_ext.cc
@@ -55,7 +55,7 @@
const JavaParamRef<jobject>& obj,
const JavaParamRef<jstring>& jscript,
const JavaParamRef<jobject>& jcallback) {
- base::string16 script(ConvertJavaStringToUTF16(env, jscript));
+ std::u16string script(ConvertJavaStringToUTF16(env, jscript));
auto callback = base::BindOnce(
&OnExecuteJavaScriptResult,
base::android::ScopedJavaGlobalRef<jobject>(env, jcallback));
diff --git a/content/public/test/browser_test_utils.cc b/content/public/test/browser_test_utils.cc
index a0e89d4..dbe9cc7 100644
--- a/content/public/test/browser_test_utils.cc
+++ b/content/public/test/browser_test_utils.cc
@@ -166,7 +166,7 @@
// TODO(lukasza): Only get messages from the specific |render_frame_host|.
DOMMessageQueue dom_message_queue(render_frame_host);
- base::string16 script16 = base::UTF8ToUTF16(script);
+ std::u16string script16 = base::UTF8ToUTF16(script);
if (world_id == ISOLATED_WORLD_ID_GLOBAL && user_gesture) {
render_frame_host->ExecuteJavaScriptWithUserGestureForTests(script16,
world_id);
@@ -814,7 +814,7 @@
bool trigger_user_activation) {
for (auto* frame : web_contents->GetAllFrames()) {
if (trigger_user_activation)
- frame->ExecuteJavaScriptWithUserGestureForTests(base::string16());
+ frame->ExecuteJavaScriptWithUserGestureForTests(std::u16string());
// Disable the hang monitor, otherwise there will be a race between the
// beforeunload dialog and the beforeunload hang timer.
@@ -2316,18 +2316,18 @@
} // namespace
TitleWatcher::TitleWatcher(WebContents* web_contents,
- const base::string16& expected_title)
+ const std::u16string& expected_title)
: WebContentsObserver(web_contents) {
expected_titles_.push_back(expected_title);
}
-void TitleWatcher::AlsoWaitForTitle(const base::string16& expected_title) {
+void TitleWatcher::AlsoWaitForTitle(const std::u16string& expected_title) {
expected_titles_.push_back(expected_title);
}
TitleWatcher::~TitleWatcher() = default;
-const base::string16& TitleWatcher::WaitAndGetTitle() {
+const std::u16string& TitleWatcher::WaitAndGetTitle() {
TestTitle();
run_loop_.Run();
return observed_title_;
@@ -2346,7 +2346,7 @@
}
void TitleWatcher::TestTitle() {
- const base::string16& current_title = web_contents()->GetTitle();
+ const std::u16string& current_title = web_contents()->GetTitle();
if (base::Contains(expected_titles_, current_title)) {
observed_title_ = current_title;
run_loop_.Quit();
@@ -3114,10 +3114,10 @@
void WebContentsConsoleObserver::OnDidAddMessageToConsole(
RenderFrameHost* source_frame,
blink::mojom::ConsoleMessageLevel log_level,
- const base::string16& message_contents,
+ const std::u16string& message_contents,
int32_t line_no,
- const base::string16& source_id,
- const base::Optional<base::string16>& untrusted_stack_trace) {
+ const std::u16string& source_id,
+ const base::Optional<std::u16string>& untrusted_stack_trace) {
Message message(
{source_frame, log_level, message_contents, line_no, source_id});
if (filter_ && !filter_.Run(message))
diff --git a/content/public/test/browser_test_utils.h b/content/public/test/browser_test_utils.h
index 8932b3c..426b57d 100644
--- a/content/public/test/browser_test_utils.h
+++ b/content/public/test/browser_test_utils.h
@@ -1063,17 +1063,16 @@
// |web_contents| must be non-NULL and needs to stay alive for the
// entire lifetime of |this|. |expected_title| is the title that |this|
// will wait for.
- TitleWatcher(WebContents* web_contents,
- const base::string16& expected_title);
+ TitleWatcher(WebContents* web_contents, const std::u16string& expected_title);
~TitleWatcher() override;
// Adds another title to watch for.
- void AlsoWaitForTitle(const base::string16& expected_title);
+ void AlsoWaitForTitle(const std::u16string& expected_title);
// Waits until the title matches either expected_title or one of the titles
// added with AlsoWaitForTitle. Returns the value of the most recently
// observed matching title.
- const base::string16& WaitAndGetTitle() WARN_UNUSED_RESULT;
+ const std::u16string& WaitAndGetTitle() WARN_UNUSED_RESULT;
private:
// Overridden WebContentsObserver methods.
@@ -1082,11 +1081,11 @@
void TestTitle();
- std::vector<base::string16> expected_titles_;
+ std::vector<std::u16string> expected_titles_;
base::RunLoop run_loop_;
// The most recently observed expected title, if any.
- base::string16 observed_title_;
+ std::u16string observed_title_;
DISALLOW_COPY_AND_ASSIGN(TitleWatcher);
};
@@ -1640,9 +1639,9 @@
struct Message {
RenderFrameHost* source_frame;
blink::mojom::ConsoleMessageLevel log_level;
- base::string16 message;
+ std::u16string message;
int32_t line_no;
- base::string16 source_id;
+ std::u16string source_id;
};
// A filter to apply to incoming console messages to determine whether to
@@ -1676,10 +1675,10 @@
void OnDidAddMessageToConsole(
RenderFrameHost* source_frame,
blink::mojom::ConsoleMessageLevel log_level,
- const base::string16& message,
+ const std::u16string& message,
int32_t line_no,
- const base::string16& source_id,
- const base::Optional<base::string16>& untrusted_stack_trace) override;
+ const std::u16string& source_id,
+ const base::Optional<std::u16string>& untrusted_stack_trace) override;
Filter filter_;
std::string pattern_;
diff --git a/content/public/test/fake_local_frame.cc b/content/public/test/fake_local_frame.cc
index 9055d85..2d07325d 100644
--- a/content/public/test/fake_local_frame.cc
+++ b/content/public/test/fake_local_frame.cc
@@ -23,7 +23,7 @@
void FakeLocalFrame::GetTextSurroundingSelection(
uint32_t max_length,
GetTextSurroundingSelectionCallback callback) {
- std::move(callback).Run(base::string16(), 0, 0);
+ std::move(callback).Run(std::u16string(), 0, 0);
}
void FakeLocalFrame::SendInterventionReport(const std::string& id,
@@ -98,8 +98,8 @@
void FakeLocalFrame::PostMessageEvent(
const base::Optional<blink::RemoteFrameToken>& source_frame_token,
- const base::string16& source_origin,
- const base::string16& target_origin,
+ const std::u16string& source_origin,
+ const std::u16string& target_origin,
blink::TransferableMessage message) {}
void FakeLocalFrame::GetSavableResourceLinks(
diff --git a/content/public/test/fake_local_frame.h b/content/public/test/fake_local_frame.h
index 8db1a8a..2fecf96 100644
--- a/content/public/test/fake_local_frame.h
+++ b/content/public/test/fake_local_frame.h
@@ -76,8 +76,8 @@
void OnScreensChange() override;
void PostMessageEvent(
const base::Optional<blink::RemoteFrameToken>& source_frame_token,
- const base::string16& source_origin,
- const base::string16& target_origin,
+ const std::u16string& source_origin,
+ const std::u16string& target_origin,
blink::TransferableMessage message) override;
void GetSavableResourceLinks(
GetSavableResourceLinksCallback callback) override;
diff --git a/content/public/test/fake_pepper_plugin_instance.cc b/content/public/test/fake_pepper_plugin_instance.cc
index 3e4ccc7..4f5c6da 100644
--- a/content/public/test/fake_pepper_plugin_instance.cc
+++ b/content/public/test/fake_pepper_plugin_instance.cc
@@ -67,7 +67,7 @@
void FakePepperPluginInstance::SetEmbedProperty(PP_Var key, PP_Var value) {}
void FakePepperPluginInstance::SetSelectedText(
- const base::string16& selected_text) {}
+ const std::u16string& selected_text) {}
void FakePepperPluginInstance::SetLinkUnderCursor(const std::string& url) {}
void FakePepperPluginInstance::SetTextInputType(ui::TextInputType type) {}
diff --git a/content/public/test/fake_pepper_plugin_instance.h b/content/public/test/fake_pepper_plugin_instance.h
index 84ac65af..aa0d737 100644
--- a/content/public/test/fake_pepper_plugin_instance.h
+++ b/content/public/test/fake_pepper_plugin_instance.h
@@ -37,7 +37,7 @@
bool IsRectTopmost(const gfx::Rect& rect) override;
int MakePendingFileRefRendererHost(const base::FilePath& path) override;
void SetEmbedProperty(PP_Var key, PP_Var value) override;
- void SetSelectedText(const base::string16& selected_text) override;
+ void SetSelectedText(const std::u16string& selected_text) override;
void SetLinkUnderCursor(const std::string& url) override;
void SetTextInputType(ui::TextInputType type) override;
void PostMessageToJavaScript(PP_Var message) override;
diff --git a/content/public/test/fake_render_widget_host.cc b/content/public/test/fake_render_widget_host.cc
index 56e517a..27d72d2 100644
--- a/content/public/test/fake_render_widget_host.cc
+++ b/content/public/test/fake_render_widget_host.cc
@@ -49,7 +49,7 @@
void FakeRenderWidgetHost::SetCursor(const ui::Cursor& cursor) {}
void FakeRenderWidgetHost::SetToolTipText(
- const base::string16& tooltip_text,
+ const std::u16string& tooltip_text,
base::i18n::TextDirection text_direction_hint) {}
void FakeRenderWidgetHost::TextInputStateChanged(
diff --git a/content/public/test/fake_render_widget_host.h b/content/public/test/fake_render_widget_host.h
index 45d2edb7..a5919ea 100644
--- a/content/public/test/fake_render_widget_host.h
+++ b/content/public/test/fake_render_widget_host.h
@@ -54,7 +54,7 @@
// blink::mojom::WidgetHost overrides.
void SetCursor(const ui::Cursor& cursor) override;
- void SetToolTipText(const base::string16& tooltip_text,
+ void SetToolTipText(const std::u16string& tooltip_text,
base::i18n::TextDirection text_direction_hint) override;
void TextInputStateChanged(ui::mojom::TextInputStatePtr state) override;
void SelectionBoundsChanged(const gfx::Rect& anchor_rect,
diff --git a/content/public/test/mock_render_process_host.cc b/content/public/test/mock_render_process_host.cc
index 65fa5cd..c1cde93 100644
--- a/content/public/test/mock_render_process_host.cc
+++ b/content/public/test/mock_render_process_host.cc
@@ -191,8 +191,7 @@
return BrowserContext::GetDefaultStoragePartition(browser_context_);
}
-void MockRenderProcessHost::AddWord(const base::string16& word) {
-}
+void MockRenderProcessHost::AddWord(const std::u16string& word) {}
bool MockRenderProcessHost::Shutdown(int exit_code) {
shutdown_requested_ = true;
diff --git a/content/public/test/mock_render_process_host.h b/content/public/test/mock_render_process_host.h
index ed83f74..c4be1f7 100644
--- a/content/public/test/mock_render_process_host.h
+++ b/content/public/test/mock_render_process_host.h
@@ -97,7 +97,7 @@
void OnForegroundServiceWorkerAdded() override;
void OnForegroundServiceWorkerRemoved() override;
StoragePartition* GetStoragePartition() override;
- virtual void AddWord(const base::string16& word);
+ virtual void AddWord(const std::u16string& word);
bool Shutdown(int exit_code) override;
bool ShutdownRequested() override;
bool FastShutdownIfPossible(size_t page_count,
diff --git a/content/public/test/render_view_test.cc b/content/public/test/render_view_test.cc
index ba32eb43..756214e 100644
--- a/content/public/test/render_view_test.cc
+++ b/content/public/test/render_view_test.cc
@@ -326,7 +326,7 @@
}
bool RenderViewTest::ExecuteJavaScriptAndReturnIntValue(
- const base::string16& script,
+ const std::u16string& script,
int* int_result) {
v8::HandleScope handle_scope(v8::Isolate::GetCurrent());
v8::Local<v8::Value> result = GetMainFrame()->ExecuteScriptAndReturnValue(
@@ -341,7 +341,7 @@
}
bool RenderViewTest::ExecuteJavaScriptAndReturnNumberValue(
- const base::string16& script,
+ const std::u16string& script,
double* number_result) {
v8::HandleScope handle_scope(v8::Isolate::GetCurrent());
v8::Local<v8::Value> result = GetMainFrame()->ExecuteScriptAndReturnValue(
diff --git a/content/public/test/render_view_test.h b/content/public/test/render_view_test.h
index f6c1fdf..1fc92b1 100644
--- a/content/public/test/render_view_test.h
+++ b/content/public/test/render_view_test.h
@@ -96,14 +96,14 @@
// |result|.
// Returns true if the JavaScript was evaluated correctly to an int value,
// false otherwise.
- bool ExecuteJavaScriptAndReturnIntValue(const base::string16& script,
+ bool ExecuteJavaScriptAndReturnIntValue(const std::u16string& script,
int* result);
// Executes the given JavaScript and sets the number value it evaluates to in
// |result|.
// Returns true if the JavaScript was evaluated correctly to an number value,
// false otherwise.
- bool ExecuteJavaScriptAndReturnNumberValue(const base::string16& script,
+ bool ExecuteJavaScriptAndReturnNumberValue(const std::u16string& script,
double* result);
// Loads |html| into the main frame as a data: URL and blocks until the
diff --git a/content/public/test/test_web_ui.cc b/content/public/test/test_web_ui.cc
index f8de9ec1..0f7b47b 100644
--- a/content/public/test/test_web_ui.cc
+++ b/content/public/test/test_web_ui.cc
@@ -56,7 +56,7 @@
return 1.0f;
}
-const base::string16& TestWebUI::GetOverriddenTitle() {
+const std::u16string& TestWebUI::GetOverriddenTitle() {
return temp_string_;
}
diff --git a/content/public/test/test_web_ui.h b/content/public/test/test_web_ui.h
index 6808185..6e3de90 100644
--- a/content/public/test/test_web_ui.h
+++ b/content/public/test/test_web_ui.h
@@ -35,8 +35,8 @@
WebUIController* GetController() override;
void SetController(std::unique_ptr<WebUIController> controller) override;
float GetDeviceScaleFactor() override;
- const base::string16& GetOverriddenTitle() override;
- void OverrideTitle(const base::string16& title) override {}
+ const std::u16string& GetOverriddenTitle() override;
+ void OverrideTitle(const std::u16string& title) override {}
int GetBindings() override;
void SetBindings(int bindings) override;
const std::vector<std::string>& GetRequestableSchemes() override;
@@ -118,7 +118,7 @@
std::vector<std::unique_ptr<CallData>> call_data_;
std::vector<std::unique_ptr<WebUIMessageHandler>> handlers_;
int bindings_ = 0;
- base::string16 temp_string_;
+ std::u16string temp_string_;
WebContents* web_contents_;
std::unique_ptr<WebUIController> controller_;
diff --git a/content/public/test/text_input_test_utils.cc b/content/public/test/text_input_test_utils.cc
index d744699..995ba6a 100644
--- a/content/public/test/text_input_test_utils.cc
+++ b/content/public/test/text_input_test_utils.cc
@@ -273,7 +273,7 @@
void SendImeCommitTextToWidget(
RenderWidgetHost* rwh,
- const base::string16& text,
+ const std::u16string& text,
const std::vector<ui::ImeTextSpan>& ime_text_spans,
const gfx::Range& replacement_range,
int relative_cursor_pos) {
@@ -283,7 +283,7 @@
void SendImeSetCompositionTextToWidget(
RenderWidgetHost* rwh,
- const base::string16& text,
+ const std::u16string& text,
const std::vector<ui::ImeTextSpan>& ime_text_spans,
const gfx::Range& replacement_range,
int selection_start,
diff --git a/content/public/test/text_input_test_utils.h b/content/public/test/text_input_test_utils.h
index a0d0a0dc..701a3e7 100644
--- a/content/public/test/text_input_test_utils.h
+++ b/content/public/test/text_input_test_utils.h
@@ -75,7 +75,7 @@
// given |text|.
void SendImeCommitTextToWidget(
RenderWidgetHost* rwh,
- const base::string16& text,
+ const std::u16string& text,
const std::vector<ui::ImeTextSpan>& ime_text_spans,
const gfx::Range& replacement_range,
int relative_cursor_pos);
@@ -84,7 +84,7 @@
// composition text and update the corresponding IME params.
void SendImeSetCompositionTextToWidget(
RenderWidgetHost* rwh,
- const base::string16& text,
+ const std::u16string& text,
const std::vector<ui::ImeTextSpan>& ime_text_spans,
const gfx::Range& replacement_range,
int selection_start,
diff --git a/content/public/test/text_input_test_utils_mac.mm b/content/public/test/text_input_test_utils_mac.mm
index cba2e8b8..337ec7a 100644
--- a/content/public/test/text_input_test_utils_mac.mm
+++ b/content/public/test/text_input_test_utils_mac.mm
@@ -54,7 +54,7 @@
// Updates the string from the range and calls |callback|.
frame->SetStringFromRange(
base::UTF16ToUTF8(attributed_string ? attributed_string->string
- : base::string16()));
+ : std::u16string()));
std::move(callback).Run(std::move(attributed_string), gfx::Point());
// Calls |quit_closure_|.
diff --git a/content/public/test/web_contents_tester.h b/content/public/test/web_contents_tester.h
index 95885c0..54c09c26 100644
--- a/content/public/test/web_contents_tester.h
+++ b/content/public/test/web_contents_tester.h
@@ -104,7 +104,7 @@
virtual const std::string& GetSaveFrameHeaders() = 0;
// Returns the suggested file name passed in the SaveFrameWithHeaders call.
- virtual const base::string16& GetSuggestedFileName() = 0;
+ virtual const std::u16string& GetSuggestedFileName() = 0;
// Returns whether a download request triggered via DownloadImage() is in
// progress for |url|.
@@ -123,7 +123,7 @@
// Sets the return value of GetTitle() of TestWebContents. Once set, the real
// title will never be returned.
- virtual void SetTitle(const base::string16& new_title) = 0;
+ virtual void SetTitle(const std::u16string& new_title) = 0;
// Sets the return value of GetContentsMimeType().
virtual void SetMainFrameMimeType(const std::string& mime_type) = 0;
diff --git a/content/renderer/accessibility/ax_image_stopwords.cc b/content/renderer/accessibility/ax_image_stopwords.cc
index e3b45a8..f2805ee 100644
--- a/content/renderer/accessibility/ax_image_stopwords.cc
+++ b/content/renderer/accessibility/ax_image_stopwords.cc
@@ -519,7 +519,7 @@
AXImageStopwords::~AXImageStopwords() = default;
bool AXImageStopwords::IsImageStopword(const char* word_utf8) const {
- base::string16 word_utf16 = base::UTF8ToUTF16(word_utf8);
+ std::u16string word_utf16 = base::UTF8ToUTF16(word_utf8);
// It's not really meaningful, but since short words are stopwords, for
// simplicity we define the empty string to be a stopword too.
diff --git a/content/renderer/pepper/event_conversion.cc b/content/renderer/pepper/event_conversion.cc
index 7216e73..ecf3efdd 100644
--- a/content/renderer/pepper/event_conversion.cc
+++ b/content/renderer/pepper/event_conversion.cc
@@ -449,7 +449,7 @@
// Make sure to not read beyond the buffer in case some bad code doesn't
// NULL-terminate it (this is called from plugins).
size_t text_length_cap = WebKeyboardEvent::kTextLengthCap;
- base::string16 text16 = base::UTF8ToUTF16(event.character_text);
+ std::u16string text16 = base::UTF8ToUTF16(event.character_text);
std::fill_n(key_event->text, text_length_cap, 0);
std::fill_n(key_event->unmodified_text, text_length_cap, 0);
@@ -589,7 +589,7 @@
}
}
if (!vk_code) {
- base::string16 char_text16 = base::UTF8ToUTF16(char_text);
+ std::u16string char_text16 = base::UTF8ToUTF16(char_text);
DCHECK_EQ(char_text16.size(), 1U);
vk_text = vk_code = char_text16[0];
*needs_shift_modifier = base::IsAsciiUpper(vk_code & 0xFF);
diff --git a/content/renderer/pepper/pepper_file_chooser_host_unittest.cc b/content/renderer/pepper/pepper_file_chooser_host_unittest.cc
index a0347d74..1ab4ce0 100644
--- a/content/renderer/pepper/pepper_file_chooser_host_unittest.cc
+++ b/content/renderer/pepper/pepper_file_chooser_host_unittest.cc
@@ -169,7 +169,7 @@
// Send a chooser reply to the render view. Note our reply path has to have a
// path separator so we include both a Unix and a Windows one.
std::vector<blink::mojom::FileChooserFileInfoPtr> selected_info_vector;
- base::string16 display_name = base::ASCIIToUTF16("Hello, world");
+ std::u16string display_name = base::ASCIIToUTF16("Hello, world");
selected_info_vector.push_back(
blink::mojom::FileChooserFileInfo::NewNativeFile(
blink::mojom::NativeFileInfo::New(
diff --git a/content/renderer/pepper/pepper_plugin_instance_impl.cc b/content/renderer/pepper/pepper_plugin_instance_impl.cc
index 78210ada..8e5a8a3 100644
--- a/content/renderer/pepper/pepper_plugin_instance_impl.cc
+++ b/content/renderer/pepper/pepper_plugin_instance_impl.cc
@@ -888,7 +888,7 @@
bool PepperPluginInstanceImpl::SendCompositionEventToPlugin(
PP_InputEvent_Type type,
- const base::string16& text) {
+ const std::u16string& text) {
std::vector<ui::ImeTextSpan> empty;
return SendCompositionEventWithImeTextSpanInformationToPlugin(
type, text, empty, static_cast<int>(text.size()),
@@ -898,7 +898,7 @@
bool PepperPluginInstanceImpl::
SendCompositionEventWithImeTextSpanInformationToPlugin(
PP_InputEvent_Type type,
- const base::string16& text,
+ const std::u16string& text,
const std::vector<ui::ImeTextSpan>& ime_text_spans,
int selection_start,
int selection_end) {
@@ -982,13 +982,13 @@
}
bool PepperPluginInstanceImpl::HandleCompositionStart(
- const base::string16& text) {
+ const std::u16string& text) {
return SendCompositionEventToPlugin(PP_INPUTEVENT_TYPE_IME_COMPOSITION_START,
text);
}
bool PepperPluginInstanceImpl::HandleCompositionUpdate(
- const base::string16& text,
+ const std::u16string& text,
const std::vector<ui::ImeTextSpan>& ime_text_spans,
int selection_start,
int selection_end) {
@@ -998,24 +998,24 @@
}
bool PepperPluginInstanceImpl::HandleCompositionEnd(
- const base::string16& text) {
+ const std::u16string& text) {
return SendCompositionEventToPlugin(PP_INPUTEVENT_TYPE_IME_COMPOSITION_END,
text);
}
-bool PepperPluginInstanceImpl::HandleTextInput(const base::string16& text) {
+bool PepperPluginInstanceImpl::HandleTextInput(const std::u16string& text) {
return SendCompositionEventToPlugin(PP_INPUTEVENT_TYPE_IME_TEXT, text);
}
-void PepperPluginInstanceImpl::GetSurroundingText(base::string16* text,
+void PepperPluginInstanceImpl::GetSurroundingText(std::u16string* text,
gfx::Range* range) const {
std::vector<size_t> offsets;
offsets.push_back(selection_anchor_);
offsets.push_back(selection_caret_);
*text = base::UTF8ToUTF16AndAdjustOffsets(surrounding_text_, &offsets);
- range->set_start(offsets[0] == base::string16::npos ? text->size()
+ range->set_start(offsets[0] == std::u16string::npos ? text->size()
: offsets[0]);
- range->set_end(offsets[1] == base::string16::npos ? text->size()
+ range->set_end(offsets[1] == std::u16string::npos ? text->size()
: offsets[1]);
}
@@ -1293,7 +1293,7 @@
}
void PepperPluginInstanceImpl::SetSelectedText(
- const base::string16& selected_text) {
+ const std::u16string& selected_text) {
if (!render_frame_)
return;
@@ -1334,11 +1334,11 @@
NOTIMPLEMENTED();
}
-base::string16 PepperPluginInstanceImpl::GetSelectedText(bool html) {
+std::u16string PepperPluginInstanceImpl::GetSelectedText(bool html) {
return selected_text_;
}
-base::string16 PepperPluginInstanceImpl::GetLinkAtPosition(
+std::u16string PepperPluginInstanceImpl::GetLinkAtPosition(
const gfx::Point& point) {
// Keep a reference on the stack. See NOTE above.
scoped_refptr<PepperPluginInstanceImpl> ref(this);
@@ -1358,7 +1358,7 @@
if (rv.type == PP_VARTYPE_UNDEFINED)
return link_under_cursor_;
StringVar* string = StringVar::FromPPVar(rv);
- base::string16 link;
+ std::u16string link;
if (string)
link = base::UTF8ToUTF16(string->value());
// Release the ref the plugin transfered to us.
@@ -2192,7 +2192,7 @@
input_event.composition_segment_offsets.begin(),
input_event.composition_segment_offsets.end());
- base::string16 utf16_text =
+ std::u16string utf16_text =
base::UTF8ToUTF16AndAdjustOffsets(input_event.character_text, &offsets);
std::vector<ui::ImeTextSpan> ime_text_spans;
@@ -3100,7 +3100,7 @@
}
void PepperPluginInstanceImpl::OnImeSetComposition(
- const base::string16& text,
+ const std::u16string& text,
const std::vector<ui::ImeTextSpan>& ime_text_spans,
int selection_start,
int selection_end) {
@@ -3116,11 +3116,11 @@
// Empty -> nonempty: composition started.
if (composition_text_.empty() && !text.empty()) {
- HandleCompositionStart(base::string16());
+ HandleCompositionStart(std::u16string());
}
// Nonempty -> empty: composition canceled.
if (!composition_text_.empty() && text.empty()) {
- HandleCompositionEnd(base::string16());
+ HandleCompositionEnd(std::u16string());
}
composition_text_ = text;
// Nonempty: composition is ongoing.
@@ -3132,19 +3132,19 @@
}
void PepperPluginInstanceImpl::OnImeCommitText(
- const base::string16& text,
+ const std::u16string& text,
const gfx::Range& replacement_range,
int relative_cursor_pos) {
HandlePepperImeCommit(text);
}
void PepperPluginInstanceImpl::OnImeFinishComposingText(bool keep_selection) {
- const base::string16& text = composition_text_;
+ const std::u16string& text = composition_text_;
HandlePepperImeCommit(text);
}
void PepperPluginInstanceImpl::HandlePepperImeCommit(
- const base::string16& text) {
+ const std::u16string& text) {
if (text.empty())
return;
diff --git a/content/renderer/pepper/pepper_plugin_instance_impl.h b/content/renderer/pepper/pepper_plugin_instance_impl.h
index c9d08a2..bb69bfb 100644
--- a/content/renderer/pepper/pepper_plugin_instance_impl.h
+++ b/content/renderer/pepper/pepper_plugin_instance_impl.h
@@ -234,29 +234,29 @@
const gfx::Rect& unobscured);
// Handlers for composition events.
- void OnImeSetComposition(const base::string16& text,
+ void OnImeSetComposition(const std::u16string& text,
const std::vector<ui::ImeTextSpan>& ime_text_spans,
int selection_start,
int selection_end);
- void OnImeCommitText(const base::string16& text,
+ void OnImeCommitText(const std::u16string& text,
const gfx::Range& replacement_range,
int relative_cursor_pos);
void OnImeFinishComposingText(bool keep_selection);
- void HandlePepperImeCommit(const base::string16& text);
- bool HandleCompositionStart(const base::string16& text);
+ void HandlePepperImeCommit(const std::u16string& text);
+ bool HandleCompositionStart(const std::u16string& text);
bool HandleCompositionUpdate(
- const base::string16& text,
+ const std::u16string& text,
const std::vector<ui::ImeTextSpan>& ime_text_spans,
int selection_start,
int selection_end);
- bool HandleCompositionEnd(const base::string16& text);
- bool HandleTextInput(const base::string16& text);
+ bool HandleCompositionEnd(const std::u16string& text);
+ bool HandleTextInput(const std::u16string& text);
// Gets the current text input status.
ui::TextInputType text_input_type() const { return text_input_type_; }
gfx::Rect GetCaretBounds() const;
bool IsPluginAcceptingCompositionEvents() const;
- void GetSurroundingText(base::string16* text, gfx::Range* range) const;
+ void GetSurroundingText(std::u16string* text, gfx::Range* range) const;
// Notifications about focus changes, see has_webkit_focus_ below.
void SetWebKitFocus(bool has_focus);
@@ -272,8 +272,8 @@
void AddPluginObject(PluginObject* plugin_object);
void RemovePluginObject(PluginObject* plugin_object);
- base::string16 GetSelectedText(bool html);
- base::string16 GetLinkAtPosition(const gfx::Point& point);
+ std::u16string GetSelectedText(bool html);
+ std::u16string GetLinkAtPosition(const gfx::Point& point);
void RequestSurroundingText(size_t desired_number_of_characters);
bool StartFind(const std::string& search_text,
bool case_sensitive,
@@ -373,7 +373,7 @@
bool IsRectTopmost(const gfx::Rect& rect) override;
int MakePendingFileRefRendererHost(const base::FilePath& path) override;
void SetEmbedProperty(PP_Var key, PP_Var value) override;
- void SetSelectedText(const base::string16& selected_text) override;
+ void SetSelectedText(const std::u16string& selected_text) override;
void SetLinkUnderCursor(const std::string& url) override;
void SetTextInputType(ui::TextInputType type) override;
void PostMessageToJavaScript(PP_Var message) override;
@@ -594,10 +594,10 @@
// Internal helper functions for HandleCompositionXXX().
bool SendCompositionEventToPlugin(PP_InputEvent_Type type,
- const base::string16& text);
+ const std::u16string& text);
bool SendCompositionEventWithImeTextSpanInformationToPlugin(
PP_InputEvent_Type type,
- const base::string16& text,
+ const std::u16string& text,
const std::vector<ui::ImeTextSpan>& ime_text_spans,
int selection_start,
int selection_end);
@@ -822,7 +822,7 @@
bool external_document_load_;
// The link currently under the cursor.
- base::string16 link_under_cursor_;
+ std::u16string link_under_cursor_;
// We store the isolate at construction so that we can be sure to use the
// Isolate in which this Instance was created when interacting with v8.
@@ -831,7 +831,7 @@
bool is_deleted_;
// The text that is currently selected in the plugin.
- base::string16 selected_text_;
+ std::u16string selected_text_;
// The most recently committed texture. This is kept around in case the layer
// needs to be regenerated.
@@ -857,7 +857,7 @@
// Current text input composition text. Empty if no composition is in
// progress.
- base::string16 composition_text_;
+ std::u16string composition_text_;
mojo::AssociatedRemote<mojom::PepperPluginInstanceHost> pepper_host_remote_;
mojo::AssociatedReceiver<mojom::PepperPluginInstance> pepper_receiver_{this};
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index da8ee1c1..f22e3d5 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -1077,7 +1077,7 @@
v8::MaybeLocal<v8::Value> GetProperty(v8::Local<v8::Context> context,
v8::Local<v8::Value> object,
- const base::string16& name) {
+ const std::u16string& name) {
v8::Isolate* isolate = context->GetIsolate();
v8::Local<v8::String> name_str =
gin::ConvertToV8(isolate, name).As<v8::String>();
@@ -1089,8 +1089,8 @@
}
v8::MaybeLocal<v8::Value> CallMethodOnFrame(blink::WebNavigationControl* frame,
- const base::string16& object_name,
- const base::string16& method_name,
+ const std::u16string& object_name,
+ const std::u16string& method_name,
base::Value arguments) {
v8::Local<v8::Context> context = frame->MainWorldScriptContext();
@@ -2409,8 +2409,8 @@
}
void RenderFrameImpl::JavaScriptMethodExecuteRequest(
- const base::string16& object_name,
- const base::string16& method_name,
+ const std::u16string& object_name,
+ const std::u16string& method_name,
base::Value arguments,
bool wants_result,
JavaScriptMethodExecuteRequestCallback callback) {
@@ -2438,7 +2438,7 @@
}
void RenderFrameImpl::JavaScriptExecuteRequest(
- const base::string16& javascript,
+ const std::u16string& javascript,
bool wants_result,
JavaScriptExecuteRequestCallback callback) {
TRACE_EVENT_INSTANT0("test_tracing", "JavaScriptExecuteRequest",
@@ -2461,7 +2461,7 @@
}
void RenderFrameImpl::JavaScriptExecuteRequestForTests(
- const base::string16& javascript,
+ const std::u16string& javascript,
bool wants_result,
bool has_user_gesture,
int32_t world_id,
@@ -2498,7 +2498,7 @@
}
void RenderFrameImpl::JavaScriptExecuteRequestInIsolatedWorld(
- const base::string16& javascript,
+ const std::u16string& javascript,
bool wants_result,
int32_t world_id,
JavaScriptExecuteRequestInIsolatedWorldCallback callback) {
@@ -2705,7 +2705,7 @@
return nullptr;
}
-void RenderFrameImpl::ExecuteJavaScript(const base::string16& javascript) {
+void RenderFrameImpl::ExecuteJavaScript(const std::u16string& javascript) {
JavaScriptExecuteRequest(javascript, false, base::DoNothing());
}
@@ -2750,7 +2750,7 @@
return frame_->GetDocumentLoader()->IsListingFtpDirectory();
}
-void RenderFrameImpl::SetSelectedText(const base::string16& selection_text,
+void RenderFrameImpl::SetSelectedText(const std::u16string& selection_text,
size_t offset,
const gfx::Range& range) {
GetWebFrame()->TextSelectionChanged(WebString::FromUTF16(selection_text),
@@ -5658,7 +5658,7 @@
}
void RenderFrameImpl::SyncSelectionIfRequired() {
- base::string16 text;
+ std::u16string text;
size_t offset;
gfx::Range range;
#if BUILDFLAG(ENABLE_PLUGINS)
diff --git a/content/renderer/render_frame_impl.h b/content/renderer/render_frame_impl.h
index 6190d201..0820913e 100644
--- a/content/renderer/render_frame_impl.h
+++ b/content/renderer/render_frame_impl.h
@@ -358,7 +358,7 @@
void ShowVirtualKeyboard() override;
blink::WebPlugin* CreatePlugin(const WebPluginInfo& info,
const blink::WebPluginParams& params) override;
- void ExecuteJavaScript(const base::string16& javascript) override;
+ void ExecuteJavaScript(const std::u16string& javascript) override;
bool IsMainFrame() override;
bool IsHidden() override;
void BindLocalInterface(
@@ -371,7 +371,7 @@
void PluginDidStopLoading() override;
#endif
bool IsFTPDirectoryListing() override;
- void SetSelectedText(const base::string16& selection_text,
+ void SetSelectedText(const std::u16string& selection_text,
size_t offset,
const gfx::Range& range) override;
void AddMessageToConsole(blink::mojom::ConsoleMessageLevel level,
@@ -826,23 +826,23 @@
mojo::PendingAssociatedReceiver<blink::mojom::DevToolsAgent> receiver)
override;
void JavaScriptMethodExecuteRequest(
- const base::string16& object_name,
- const base::string16& method_name,
+ const std::u16string& object_name,
+ const std::u16string& method_name,
base::Value arguments,
bool wants_result,
JavaScriptMethodExecuteRequestCallback callback) override;
void JavaScriptExecuteRequest(
- const base::string16& javascript,
+ const std::u16string& javascript,
bool wants_result,
JavaScriptExecuteRequestCallback callback) override;
void JavaScriptExecuteRequestForTests(
- const base::string16& javascript,
+ const std::u16string& javascript,
bool wants_result,
bool has_user_gesture,
int32_t world_id,
JavaScriptExecuteRequestForTestsCallback callback) override;
void JavaScriptExecuteRequestInIsolatedWorld(
- const base::string16& javascript,
+ const std::u16string& javascript,
bool wants_result,
int32_t world_id,
JavaScriptExecuteRequestInIsolatedWorldCallback callback) override;
@@ -1212,7 +1212,7 @@
// portion of this string that is the actual selected text starts at index
// |selection_range_.GetMin() - selection_text_offset_| and has length
// |selection_range_.length()|.
- base::string16 selection_text_;
+ std::u16string selection_text_;
// The offset corresponding to the start of |selection_text_| in the document.
size_t selection_text_offset_;
// Range over the document corresponding to the actual selected text (which
diff --git a/content/renderer/render_frame_impl_browsertest.cc b/content/renderer/render_frame_impl_browsertest.cc
index 1fb3f10484..d72c01a3 100644
--- a/content/renderer/render_frame_impl_browsertest.cc
+++ b/content/renderer/render_frame_impl_browsertest.cc
@@ -286,7 +286,7 @@
: LocalFrameHostInterceptor(provider) {}
MOCK_METHOD2(RunModalAlertDialog,
- void(const base::string16& alert_message,
+ void(const std::u16string& alert_message,
RunModalAlertDialogCallback callback));
MOCK_METHOD1(DownloadURL, void(blink::mojom::DownloadURLParamsPtr params));
};
diff --git a/content/renderer/render_view_browsertest.cc b/content/renderer/render_view_browsertest.cc
index fa142a4..c7c529a6 100644
--- a/content/renderer/render_view_browsertest.cc
+++ b/content/renderer/render_view_browsertest.cc
@@ -366,7 +366,7 @@
int SendKeyEventX11(MockKeyboard::Layout layout,
int key_code,
MockKeyboard::Modifiers modifiers,
- base::string16* output) {
+ std::u16string* output) {
// We ignore |layout|, which means we are only testing the layout of the
// current locale. TODO(mazda): fix this to respect |layout|.
CHECK(output);
@@ -409,7 +409,7 @@
int SendKeyEventOzone(MockKeyboard::Layout layout,
int key_code,
MockKeyboard::Modifiers modifiers,
- base::string16* output) {
+ std::u16string* output) {
int flags = ConvertMockKeyboardModifier(modifiers);
ui::KeyEvent keydown_event(ui::ET_KEY_PRESSED,
@@ -440,7 +440,7 @@
int SendKeyEvent(MockKeyboard::Layout layout,
int key_code,
MockKeyboard::Modifiers modifiers,
- base::string16* output) {
+ std::u16string* output) {
#if defined(OS_WIN)
// Retrieve the Unicode character for the given tuple (keyboard-layout,
// key-code, and modifiers).
@@ -572,11 +572,11 @@
}
void TestEmulatedSizeDprDsf(int width, int height, float dpr, float dsf) {
- static base::string16 get_width =
+ static std::u16string get_width =
base::ASCIIToUTF16("Number(window.innerWidth)");
- static base::string16 get_height =
+ static std::u16string get_height =
base::ASCIIToUTF16("Number(window.innerHeight)");
- static base::string16 get_dpr =
+ static std::u16string get_dpr =
base::ASCIIToUTF16("Number(window.devicePixelRatio * 10)");
int emulated_width, emulated_height;
@@ -865,7 +865,7 @@
: LocalFrameHostInterceptor(provider) {}
MOCK_METHOD2(UpdateTitle,
- void(const base::Optional<::base::string16>& title,
+ void(const base::Optional<::std::u16string>& title,
base::i18n::TextDirection title_direction));
};
} // namespace
@@ -906,11 +906,11 @@
waiter.Wait();
// While LocalFrame is initialized, it's called with an empty title.
- const base::Optional<::base::string16> null_title;
+ const base::Optional<::std::u16string> null_title;
EXPECT_CALL(*title_mock_frame_host(), UpdateTitle(null_title, testing::_))
.Times(1);
- const base::Optional<::base::string16>& title =
+ const base::Optional<::std::u16string>& title =
base::make_optional(base::ASCIIToUTF16("Data page"));
EXPECT_CALL(*title_mock_frame_host(), UpdateTitle(title, testing::_))
.Times(1);
@@ -1294,14 +1294,14 @@
view()->GetWebView()->ZoomFactorForDeviceScaleFactor());
double device_pixel_ratio;
- base::string16 get_dpr =
+ std::u16string get_dpr =
base::ASCIIToUTF16("Number(window.devicePixelRatio)");
EXPECT_TRUE(
ExecuteJavaScriptAndReturnNumberValue(get_dpr, &device_pixel_ratio));
EXPECT_EQ(device_scale, device_pixel_ratio);
int width;
- base::string16 get_width =
+ std::u16string get_width =
base::ASCIIToUTF16("Number(document.documentElement.clientWidth)");
EXPECT_TRUE(ExecuteJavaScriptAndReturnIntValue(get_width, &width));
EXPECT_EQ(view()->GetWebView()->MainFrameWidget()->Size().width(),
@@ -2061,7 +2061,7 @@
case IME_CANCELCOMPOSITION:
GetWidgetInputHandler()->ImeSetComposition(
- base::string16(), std::vector<ui::ImeTextSpan>(),
+ std::u16string(), std::vector<ui::ImeTextSpan>(),
gfx::Range::InvalidRange(), 0, 0);
break;
}
@@ -2076,7 +2076,7 @@
// Retrieve the content of this page and compare it with the expected
// result.
const int kMaxOutputCharacters = 128;
- base::string16 output = TestWebFrameContentDumper::DumpWebViewAsText(
+ std::u16string output = TestWebFrameContentDumper::DumpWebViewAsText(
view()->GetWebView(), kMaxOutputCharacters)
.Utf16();
EXPECT_EQ(base::WideToUTF16(ime_message->result), output);
@@ -2127,7 +2127,7 @@
// Copy the document content to std::wstring and compare with the
// expected result.
const int kMaxOutputCharacters = 16;
- base::string16 output = TestWebFrameContentDumper::DumpWebViewAsText(
+ std::u16string output = TestWebFrameContentDumper::DumpWebViewAsText(
view()->GetWebView(), kMaxOutputCharacters)
.Utf16();
EXPECT_EQ(base::WideToUTF16(test_case.expected_result), output);
@@ -2251,7 +2251,7 @@
message_loop_runner->Run();
int did_select = -1;
- base::string16 check_did_select = base::ASCIIToUTF16(
+ std::u16string check_did_select = base::ASCIIToUTF16(
"Number(document.getElementById('result').innerHTML == 'Selected')");
EXPECT_TRUE(
ExecuteJavaScriptAndReturnIntValue(check_did_select, &did_select));
@@ -2263,14 +2263,14 @@
LoadHTML("<div id=pagename>Page A</div>");
blink::PageState page_a_state = GetCurrentPageState();
int was_page_a = -1;
- base::string16 check_page_a = base::ASCIIToUTF16(
+ std::u16string check_page_a = base::ASCIIToUTF16(
"Number(document.getElementById('pagename').innerHTML == 'Page A')");
EXPECT_TRUE(ExecuteJavaScriptAndReturnIntValue(check_page_a, &was_page_a));
EXPECT_EQ(1, was_page_a);
LoadHTML("<div id=pagename>Page B</div>");
int was_page_b = -1;
- base::string16 check_page_b = base::ASCIIToUTF16(
+ std::u16string check_page_b = base::ASCIIToUTF16(
"Number(document.getElementById('pagename').innerHTML == 'Page B')");
EXPECT_TRUE(ExecuteJavaScriptAndReturnIntValue(check_page_b, &was_page_b));
EXPECT_EQ(1, was_page_b);
@@ -2279,7 +2279,7 @@
LoadHTML("<div id=pagename>Page C</div>");
int was_page_c = -1;
- base::string16 check_page_c = base::ASCIIToUTF16(
+ std::u16string check_page_c = base::ASCIIToUTF16(
"Number(document.getElementById('pagename').innerHTML == 'Page C')");
EXPECT_TRUE(ExecuteJavaScriptAndReturnIntValue(check_page_c, &was_page_c));
EXPECT_EQ(1, was_page_c);
@@ -2327,13 +2327,13 @@
ExecuteJavaScriptForTests("document.getElementById('test').focus();");
auto* widget_input_handler = GetWidgetInputHandler();
- const base::string16 empty_string;
+ const std::u16string empty_string;
const std::vector<ui::ImeTextSpan> empty_ime_text_span;
std::vector<gfx::Rect> bounds;
widget_input_handler->SetFocus(true);
// ASCII composition
- const base::string16 ascii_composition = base::UTF8ToUTF16("aiueo");
+ const std::u16string ascii_composition = base::UTF8ToUTF16("aiueo");
widget_input_handler->ImeSetComposition(
ascii_composition, empty_ime_text_span, gfx::Range::InvalidRange(), 0, 0);
bounds = LastCompositionBounds();
@@ -2346,7 +2346,7 @@
0, base::DoNothing());
// Non surrogate pair unicode character.
- const base::string16 unicode_composition = base::UTF8ToUTF16(
+ const std::u16string unicode_composition = base::UTF8ToUTF16(
"\xE3\x81\x82\xE3\x81\x84\xE3\x81\x86\xE3\x81\x88\xE3\x81\x8A");
widget_input_handler->ImeSetComposition(unicode_composition,
empty_ime_text_span,
@@ -2360,7 +2360,7 @@
base::DoNothing());
// Surrogate pair character.
- const base::string16 surrogate_pair_char =
+ const std::u16string surrogate_pair_char =
base::UTF8ToUTF16("\xF0\xA0\xAE\x9F");
widget_input_handler->ImeSetComposition(surrogate_pair_char,
empty_ime_text_span,
@@ -2374,7 +2374,7 @@
base::DoNothing());
// Mixed string.
- const base::string16 surrogate_pair_mixed_composition =
+ const std::u16string surrogate_pair_mixed_composition =
surrogate_pair_char + base::UTF8ToUTF16("\xE3\x81\x82") +
surrogate_pair_char + base::UTF8ToUTF16("b") + surrogate_pair_char;
const size_t utf16_length = 8UL;
@@ -2600,7 +2600,7 @@
blink::AssociatedInterfaceProvider* provider)
: LocalFrameHostInterceptor(provider) {}
MOCK_METHOD3(TextSelectionChanged,
- void(const base::string16& text,
+ void(const std::u16string& text,
uint32_t offset,
const gfx::Range& range));
};
@@ -3008,22 +3008,22 @@
void DidAddMessageToConsole(
blink::mojom::ConsoleMessageLevel log_level,
- const base::string16& msg,
+ const std::u16string& msg,
int32_t line_number,
- const base::Optional<base::string16>& source_id,
- const base::Optional<base::string16>& untrusted_stack_trace) override {
+ const base::Optional<std::u16string>& source_id,
+ const base::Optional<std::u16string>& untrusted_stack_trace) override {
if (did_add_message_to_console_callback_) {
std::move(did_add_message_to_console_callback_).Run(msg);
}
}
void SetDidAddMessageToConsoleCallback(
- base::OnceCallback<void(const base::string16& msg)> callback) {
+ base::OnceCallback<void(const std::u16string& msg)> callback) {
did_add_message_to_console_callback_ = std::move(callback);
}
private:
- base::OnceCallback<void(const base::string16& msg)>
+ base::OnceCallback<void(const std::u16string& msg)>
did_add_message_to_console_callback_;
};
} // namespace
@@ -3055,7 +3055,7 @@
base::RunLoop run_loop;
bool was_callback_run = false;
message_mock_frame_host()->SetDidAddMessageToConsoleCallback(
- base::BindOnce(base::BindLambdaForTesting([&](const base::string16& msg) {
+ base::BindOnce(base::BindLambdaForTesting([&](const std::u16string& msg) {
// Makes sure this happens during the beforeunload handler.
EXPECT_EQ(base::UTF8ToUTF16("OnBeforeUnload called"), msg);
@@ -3083,7 +3083,7 @@
: LocalFrameHostInterceptor(provider) {}
MOCK_METHOD2(RunModalAlertDialog,
- void(const base::string16& alert_message,
+ void(const std::u16string& alert_message,
RunModalAlertDialogCallback callback));
};
} // namespace
@@ -3105,7 +3105,7 @@
// Test that invoking one of the modal dialogs doesn't crash.
TEST_F(RenderViewImplModalDialogTest, ModalDialogs) {
LoadHTML("<body></body>");
- base::string16 alert_message = base::UTF8ToUTF16("Please don't crash");
+ std::u16string alert_message = base::UTF8ToUTF16("Please don't crash");
EXPECT_CALL(*alert_mock_frame_host(),
RunModalAlertDialog(alert_message, testing::_))
.WillOnce(base::test::RunOnceCallback<1>());
@@ -3253,13 +3253,13 @@
ExecuteJavaScriptForTests("document.getElementById('test').focus();");
auto* widget_input_handler = GetWidgetInputHandler();
- const base::string16 empty_string;
+ const std::u16string empty_string;
const std::vector<ui::ImeTextSpan> empty_ime_text_span;
std::vector<gfx::Rect> bounds_at_1x;
widget_input_handler->SetFocus(true);
// ASCII composition
- const base::string16 ascii_composition = base::UTF8ToUTF16("aiueo");
+ const std::u16string ascii_composition = base::UTF8ToUTF16("aiueo");
widget_input_handler->ImeSetComposition(
ascii_composition, empty_ime_text_span, gfx::Range::InvalidRange(), 0, 0);
bounds_at_1x = LastCompositionBounds();
diff --git a/content/renderer/webclipboard_impl_browsertest.cc b/content/renderer/webclipboard_impl_browsertest.cc
index c7deb2a4..f1446e78 100644
--- a/content/renderer/webclipboard_impl_browsertest.cc
+++ b/content/renderer/webclipboard_impl_browsertest.cc
@@ -34,7 +34,7 @@
EXPECT_TRUE(NavigateToURL(shell(), GetTestUrl(".", "paste_listener.html")));
focus_observer.Wait();
- const base::string16 expected_title = base::UTF8ToUTF16(rtf_content);
+ const std::u16string expected_title = base::UTF8ToUTF16(rtf_content);
TitleWatcher title_watcher(shell()->web_contents(), expected_title);
shell()->web_contents()->Paste();
EXPECT_EQ(expected_title, title_watcher.WaitAndGetTitle());
diff --git a/content/shell/browser/shell.cc b/content/shell/browser/shell.cc
index 4b15411..bee02d50 100644
--- a/content/shell/browser/shell.cc
+++ b/content/shell/browser/shell.cc
@@ -558,9 +558,9 @@
bool Shell::DidAddMessageToConsole(WebContents* source,
blink::mojom::ConsoleMessageLevel log_level,
- const base::string16& message,
+ const std::u16string& message,
int32_t line_no,
- const base::string16& source_id) {
+ const std::u16string& source_id) {
return switches::IsRunWebTestsSwitchPresent();
}
diff --git a/content/shell/browser/shell.h b/content/shell/browser/shell.h
index 1542442..c46cfd7 100644
--- a/content/shell/browser/shell.h
+++ b/content/shell/browser/shell.h
@@ -146,9 +146,9 @@
#endif
bool DidAddMessageToConsole(WebContents* source,
blink::mojom::ConsoleMessageLevel log_level,
- const base::string16& message,
+ const std::u16string& message,
int32_t line_no,
- const base::string16& source_id) override;
+ const std::u16string& source_id) override;
void PortalWebContentsCreated(WebContents* portal_web_contents) override;
void RendererUnresponsive(
WebContents* source,
diff --git a/content/shell/browser/shell_content_browser_client.cc b/content/shell/browser/shell_content_browser_client.cc
index 3da08a3a..72c21676 100644
--- a/content/shell/browser/shell_content_browser_client.cc
+++ b/content/shell/browser/shell_content_browser_client.cc
@@ -119,7 +119,7 @@
std::move(callback).Run(base::nullopt);
}
- void ExecuteJavaScript(const base::string16& script,
+ void ExecuteJavaScript(const std::u16string& script,
ExecuteJavaScriptCallback callback) override {
CHECK(!Shell::windows().empty());
WebContents* contents = Shell::windows()[0]->web_contents();
diff --git a/content/shell/browser/shell_javascript_dialog.h b/content/shell/browser/shell_javascript_dialog.h
index 2a8b40f..1c1e4e7 100644
--- a/content/shell/browser/shell_javascript_dialog.h
+++ b/content/shell/browser/shell_javascript_dialog.h
@@ -27,8 +27,8 @@
ShellJavaScriptDialog(ShellJavaScriptDialogManager* manager,
gfx::NativeWindow parent_window,
JavaScriptDialogType dialog_type,
- const base::string16& message_text,
- const base::string16& default_prompt_text,
+ const std::u16string& message_text,
+ const std::u16string& default_prompt_text,
JavaScriptDialogManager::DialogClosedCallback callback);
~ShellJavaScriptDialog();
@@ -43,8 +43,8 @@
ShellJavaScriptDialogManager* manager_;
JavaScriptDialogType dialog_type_;
HWND dialog_win_;
- base::string16 message_text_;
- base::string16 default_prompt_text_;
+ std::u16string message_text_;
+ std::u16string default_prompt_text_;
static INT_PTR CALLBACK DialogProc(HWND dialog, UINT message, WPARAM wparam,
LPARAM lparam);
#endif
diff --git a/content/shell/browser/shell_javascript_dialog_mac.mm b/content/shell/browser/shell_javascript_dialog_mac.mm
index 980da0d1..0e71638 100644
--- a/content/shell/browser/shell_javascript_dialog_mac.mm
+++ b/content/shell/browser/shell_javascript_dialog_mac.mm
@@ -65,7 +65,7 @@
return;
bool success = returnCode == NSAlertFirstButtonReturn;
- base::string16 input;
+ std::u16string input;
if (_textField)
input = base::SysNSStringToUTF16([_textField stringValue]);
@@ -77,7 +77,7 @@
[NSApp endSheet:[_alert window]];
_alert.reset();
if (_callback)
- std::move(_callback).Run(false, base::string16());
+ std::move(_callback).Run(false, std::u16string());
}
@end
@@ -88,8 +88,8 @@
ShellJavaScriptDialogManager* manager,
gfx::NativeWindow parent_window,
JavaScriptDialogType dialog_type,
- const base::string16& message_text,
- const base::string16& default_prompt_text,
+ const std::u16string& message_text,
+ const std::u16string& default_prompt_text,
JavaScriptDialogManager::DialogClosedCallback callback) {
bool text_field = dialog_type == JAVASCRIPT_DIALOG_TYPE_PROMPT;
bool one_button = dialog_type == JAVASCRIPT_DIALOG_TYPE_ALERT;
diff --git a/content/shell/browser/shell_javascript_dialog_manager.cc b/content/shell/browser/shell_javascript_dialog_manager.cc
index aeca57a..0a2a23cf 100644
--- a/content/shell/browser/shell_javascript_dialog_manager.cc
+++ b/content/shell/browser/shell_javascript_dialog_manager.cc
@@ -26,13 +26,13 @@
WebContents* web_contents,
RenderFrameHost* render_frame_host,
JavaScriptDialogType dialog_type,
- const base::string16& message_text,
- const base::string16& default_prompt_text,
+ const std::u16string& message_text,
+ const std::u16string& default_prompt_text,
DialogClosedCallback callback,
bool* did_suppress_message) {
if (dialog_request_callback_) {
std::move(dialog_request_callback_).Run();
- std::move(callback).Run(true, base::string16());
+ std::move(callback).Run(true, std::u16string());
return;
}
@@ -45,7 +45,7 @@
return;
}
- base::string16 new_message_text =
+ std::u16string new_message_text =
url_formatter::FormatUrl(render_frame_host->GetLastCommittedURL()) +
base::ASCIIToUTF16("\n\n") + message_text;
gfx::NativeWindow parent_window = web_contents->GetTopLevelNativeWindow();
@@ -71,7 +71,7 @@
std::move(dialog_request_callback_).Run();
if (should_proceed_on_beforeunload_)
- std::move(callback).Run(beforeunload_success_, base::string16());
+ std::move(callback).Run(beforeunload_success_, std::u16string());
else
before_unload_callback_ = std::move(callback);
return;
@@ -80,22 +80,22 @@
#if defined(OS_MAC) || defined(OS_WIN)
if (dialog_) {
// Seriously!?
- std::move(callback).Run(true, base::string16());
+ std::move(callback).Run(true, std::u16string());
return;
}
- base::string16 message_text =
+ std::u16string message_text =
base::ASCIIToUTF16("Is it OK to leave/reload this page?");
gfx::NativeWindow parent_window = web_contents->GetTopLevelNativeWindow();
dialog_.reset(new ShellJavaScriptDialog(
this, parent_window, JAVASCRIPT_DIALOG_TYPE_CONFIRM, message_text,
- base::string16(), // default
+ std::u16string(), // default
std::move(callback)));
#else
// TODO: implement ShellJavaScriptDialog for other platforms, drop this #if
- std::move(callback).Run(true, base::string16());
+ std::move(callback).Run(true, std::u16string());
return;
#endif
}
@@ -115,7 +115,7 @@
return;
if (reset_state)
- std::move(before_unload_callback_).Run(false, base::string16());
+ std::move(before_unload_callback_).Run(false, std::u16string());
}
void ShellJavaScriptDialogManager::DialogClosed(ShellJavaScriptDialog* dialog) {
diff --git a/content/shell/browser/shell_javascript_dialog_manager.h b/content/shell/browser/shell_javascript_dialog_manager.h
index 5e46782..0c55410a 100644
--- a/content/shell/browser/shell_javascript_dialog_manager.h
+++ b/content/shell/browser/shell_javascript_dialog_manager.h
@@ -26,8 +26,8 @@
void RunJavaScriptDialog(WebContents* web_contents,
RenderFrameHost* render_frame_host,
JavaScriptDialogType dialog_type,
- const base::string16& message_text,
- const base::string16& default_prompt_text,
+ const std::u16string& message_text,
+ const std::u16string& default_prompt_text,
DialogClosedCallback callback,
bool* did_suppress_message) override;
diff --git a/content/shell/browser/shell_javascript_dialog_win.cc b/content/shell/browser/shell_javascript_dialog_win.cc
index 2d80ff7..5ded67c 100644
--- a/content/shell/browser/shell_javascript_dialog_win.cc
+++ b/content/shell/browser/shell_javascript_dialog_win.cc
@@ -38,7 +38,7 @@
GetWindowLongPtr(dialog, DWLP_USER));
if (owner->dialog_win_) {
owner->dialog_win_ = 0;
- std::move(owner->callback_).Run(false, base::string16());
+ std::move(owner->callback_).Run(false, std::u16string());
owner->manager_->DialogClosed(owner);
}
break;
@@ -83,8 +83,8 @@
ShellJavaScriptDialogManager* manager,
gfx::NativeWindow parent_window,
JavaScriptDialogType dialog_type,
- const base::string16& message_text,
- const base::string16& default_prompt_text,
+ const std::u16string& message_text,
+ const std::u16string& default_prompt_text,
JavaScriptDialogManager::DialogClosedCallback callback)
: callback_(std::move(callback)),
manager_(manager),
@@ -114,7 +114,7 @@
DestroyWindow(dialog_win_);
dialog_win_ = 0;
if (callback_)
- std::move(callback_).Run(false, base::string16());
+ std::move(callback_).Run(false, std::u16string());
}
} // namespace content
diff --git a/content/shell/browser/shell_platform_delegate.h b/content/shell/browser/shell_platform_delegate.h
index a8be9b3..c35d53ba 100644
--- a/content/shell/browser/shell_platform_delegate.h
+++ b/content/shell/browser/shell_platform_delegate.h
@@ -67,7 +67,7 @@
virtual void SetIsLoading(Shell* shell, bool loading);
// Set the title of shell window
- virtual void SetTitle(Shell* shell, const base::string16& title);
+ virtual void SetTitle(Shell* shell, const std::u16string& title);
// Called when the main frame is created in the renderer process; forwarded
// from WebContentsObserver. If navigation creates a new main frame, this may
diff --git a/content/shell/browser/shell_platform_delegate_android.cc b/content/shell/browser/shell_platform_delegate_android.cc
index e00a178..4ca23d0 100644
--- a/content/shell/browser/shell_platform_delegate_android.cc
+++ b/content/shell/browser/shell_platform_delegate_android.cc
@@ -107,7 +107,7 @@
}
void ShellPlatformDelegate::SetTitle(Shell* shell,
- const base::string16& title) {}
+ const std::u16string& title) {}
void ShellPlatformDelegate::MainFrameCreated(Shell* shell) {}
diff --git a/content/shell/browser/shell_platform_delegate_aura.cc b/content/shell/browser/shell_platform_delegate_aura.cc
index 61006b9..13ee15e 100644
--- a/content/shell/browser/shell_platform_delegate_aura.cc
+++ b/content/shell/browser/shell_platform_delegate_aura.cc
@@ -80,7 +80,7 @@
void ShellPlatformDelegate::SetIsLoading(Shell* shell, bool loading) {}
void ShellPlatformDelegate::SetTitle(Shell* shell,
- const base::string16& title) {}
+ const std::u16string& title) {}
void ShellPlatformDelegate::MainFrameCreated(Shell* shell) {}
diff --git a/content/shell/browser/shell_platform_delegate_mac.mm b/content/shell/browser/shell_platform_delegate_mac.mm
index 0a1ec51..b2c5f9b 100644
--- a/content/shell/browser/shell_platform_delegate_mac.mm
+++ b/content/shell/browser/shell_platform_delegate_mac.mm
@@ -296,7 +296,7 @@
void ShellPlatformDelegate::SetIsLoading(Shell* shell, bool loading) {}
void ShellPlatformDelegate::SetTitle(Shell* shell,
- const base::string16& title) {
+ const std::u16string& title) {
DCHECK(base::Contains(shell_data_map_, shell));
ShellData& shell_data = shell_data_map_[shell];
diff --git a/content/shell/browser/shell_platform_delegate_views.cc b/content/shell/browser/shell_platform_delegate_views.cc
index e6fe779..7f95d60 100644
--- a/content/shell/browser/shell_platform_delegate_views.cc
+++ b/content/shell/browser/shell_platform_delegate_views.cc
@@ -246,7 +246,7 @@
}
// Overridden from TextfieldController
void ContentsChanged(views::Textfield* sender,
- const base::string16& new_contents) override {}
+ const std::u16string& new_contents) override {}
bool HandleKeyEvent(views::Textfield* sender,
const ui::KeyEvent& key_event) override {
if (key_event.type() == ui::ET_KEY_PRESSED && sender == url_entry_ &&
@@ -292,7 +292,7 @@
std::unique_ptr<Shell> shell_;
// Window title
- base::string16 title_;
+ std::u16string title_;
// Toolbar view contains forward/backward/reload button and URL entry
View* toolbar_view_ = nullptr;
@@ -431,7 +431,7 @@
void ShellPlatformDelegate::SetIsLoading(Shell* shell, bool loading) {}
void ShellPlatformDelegate::SetTitle(Shell* shell,
- const base::string16& title) {
+ const std::u16string& title) {
DCHECK(base::Contains(shell_data_map_, shell));
ShellData& shell_data = shell_data_map_[shell];
diff --git a/content/shell/common/shell_content_client.cc b/content/shell/common/shell_content_client.cc
index 38df755..adc15f3c 100644
--- a/content/shell/common/shell_content_client.cc
+++ b/content/shell/common/shell_content_client.cc
@@ -23,7 +23,7 @@
ShellContentClient::~ShellContentClient() {}
-base::string16 ShellContentClient::GetLocalizedString(int message_id) {
+std::u16string ShellContentClient::GetLocalizedString(int message_id) {
if (switches::IsRunWebTestsSwitchPresent()) {
switch (message_id) {
case IDS_FORM_OTHER_DATE_LABEL:
diff --git a/content/shell/common/shell_content_client.h b/content/shell/common/shell_content_client.h
index c261c09..e743d0de 100644
--- a/content/shell/common/shell_content_client.h
+++ b/content/shell/common/shell_content_client.h
@@ -19,7 +19,7 @@
ShellContentClient();
~ShellContentClient() override;
- base::string16 GetLocalizedString(int message_id) override;
+ std::u16string GetLocalizedString(int message_id) override;
base::StringPiece GetDataResource(int resource_id,
ui::ScaleFactor scale_factor) override;
base::RefCountedMemory* GetDataResourceBytes(int resource_id) override;
diff --git a/content/test/content_browser_test_test.cc b/content/test/content_browser_test_test.cc
index 22975e72..d16ed08 100644
--- a/content/test/content_browser_test_test.cc
+++ b/content/test/content_browser_test_test.cc
@@ -277,10 +277,10 @@
void Test() {
GURL url = GetTestUrl(".", "simple_page.html");
- base::string16 expected_title(base::ASCIIToUTF16("OK"));
+ std::u16string expected_title(base::ASCIIToUTF16("OK"));
TitleWatcher title_watcher(shell()->web_contents(), expected_title);
EXPECT_TRUE(NavigateToURL(shell(), url));
- base::string16 title = title_watcher.WaitAndGetTitle();
+ std::u16string title = title_watcher.WaitAndGetTitle();
EXPECT_EQ(expected_title, title);
}
};
diff --git a/content/test/content_browser_test_utils_internal.cc b/content/test/content_browser_test_utils_internal.cc
index f1549e7..cc0b595 100644
--- a/content/test/content_browser_test_utils_internal.cc
+++ b/content/test/content_browser_test_utils_internal.cc
@@ -372,7 +372,7 @@
const blink::mojom::FileChooserParams& params) {
// Send the selected file to the renderer process.
auto file_info = blink::mojom::FileChooserFileInfo::NewNativeFile(
- blink::mojom::NativeFileInfo::New(file_, base::string16()));
+ blink::mojom::NativeFileInfo::New(file_, std::u16string()));
std::vector<blink::mojom::FileChooserFileInfoPtr> files;
files.push_back(std::move(file_info));
listener->FileSelected(std::move(files), base::FilePath(),
@@ -562,7 +562,7 @@
BeforeUnloadBlockingDelegate::~BeforeUnloadBlockingDelegate() {
if (!callback_.is_null())
- std::move(callback_).Run(true, base::string16());
+ std::move(callback_).Run(true, std::u16string());
web_contents_->SetDelegate(nullptr);
web_contents_->SetJavaScriptDialogManagerForTesting(nullptr);
@@ -582,8 +582,8 @@
WebContents* web_contents,
RenderFrameHost* render_frame_host,
JavaScriptDialogType dialog_type,
- const base::string16& message_text,
- const base::string16& default_prompt_text,
+ const std::u16string& message_text,
+ const std::u16string& default_prompt_text,
DialogClosedCallback callback,
bool* did_suppress_message) {
NOTREACHED();
@@ -601,7 +601,7 @@
bool BeforeUnloadBlockingDelegate::HandleJavaScriptDialog(
WebContents* web_contents,
bool accept,
- const base::string16* prompt_override) {
+ const std::u16string* prompt_override) {
NOTREACHED();
return true;
}
diff --git a/content/test/content_browser_test_utils_internal.h b/content/test/content_browser_test_utils_internal.h
index 6f527428..1dd2783 100644
--- a/content/test/content_browser_test_utils_internal.h
+++ b/content/test/content_browser_test_utils_internal.h
@@ -355,8 +355,8 @@
void RunJavaScriptDialog(WebContents* web_contents,
RenderFrameHost* render_frame_host,
JavaScriptDialogType dialog_type,
- const base::string16& message_text,
- const base::string16& default_prompt_text,
+ const std::u16string& message_text,
+ const std::u16string& default_prompt_text,
DialogClosedCallback callback,
bool* did_suppress_message) override;
@@ -367,7 +367,7 @@
bool HandleJavaScriptDialog(WebContents* web_contents,
bool accept,
- const base::string16* prompt_override) override;
+ const std::u16string* prompt_override) override;
void CancelDialogs(WebContents* web_contents, bool reset_state) override {}
diff --git a/content/test/dwrite_font_fake_sender_win.cc b/content/test/dwrite_font_fake_sender_win.cc
index 53e3250..fde56d9 100644
--- a/content/test/dwrite_font_fake_sender_win.cc
+++ b/content/test/dwrite_font_fake_sender_win.cc
@@ -15,7 +15,7 @@
namespace content {
void AddFamily(const base::FilePath& font_path,
- const base::string16& family_name,
+ const std::u16string& family_name,
const std::wstring& base_family_name,
FakeFontCollection* collection) {
collection->AddFont(family_name)
@@ -49,7 +49,7 @@
std::move(fake_collection));
}
-FakeFont::FakeFont(const base::string16& name) : font_name_(name) {}
+FakeFont::FakeFont(const std::u16string& name) : font_name_(name) {}
FakeFont::FakeFont(FakeFont&& other) = default;
@@ -57,7 +57,7 @@
FakeFontCollection::FakeFontCollection() = default;
-FakeFont& FakeFontCollection::AddFont(const base::string16& font_name) {
+FakeFont& FakeFontCollection::AddFont(const std::u16string& font_name) {
fonts_.emplace_back(font_name);
return fonts_.back();
}
@@ -77,7 +77,7 @@
return message_types_[id];
}
-void FakeFontCollection::FindFamily(const base::string16& family_name,
+void FakeFontCollection::FindFamily(const std::u16string& family_name,
FindFamilyCallback callback) {
message_types_.push_back(MessageType::kFindFamily);
for (size_t n = 0; n < fonts_.size(); n++) {
@@ -121,11 +121,11 @@
}
void FakeFontCollection::MapCharacters(
- const base::string16& text,
+ const std::u16string& text,
blink::mojom::DWriteFontStylePtr font_style,
- const base::string16& locale_name,
+ const std::u16string& locale_name,
uint32_t reading_direction,
- const base::string16& base_family_name,
+ const std::u16string& base_family_name,
MapCharactersCallback callback) {
message_types_.push_back(MessageType::kMapCharacters);
std::move(callback).Run(blink::mojom::MapCharactersResult::New(
@@ -135,7 +135,7 @@
DWRITE_FONT_STRETCH_NORMAL)));
}
-void FakeFontCollection::MatchUniqueFont(const base::string16& unique_font_name,
+void FakeFontCollection::MatchUniqueFont(const std::u16string& unique_font_name,
MatchUniqueFontCallback callback) {}
void FakeFontCollection::GetUniqueFontLookupMode(
diff --git a/content/test/dwrite_font_fake_sender_win.h b/content/test/dwrite_font_fake_sender_win.h
index ad41cc3e..a4ece45 100644
--- a/content/test/dwrite_font_fake_sender_win.h
+++ b/content/test/dwrite_font_fake_sender_win.h
@@ -33,7 +33,7 @@
// Helper class for describing a font object. Use FakeFontCollection instead.
class FakeFont {
public:
- explicit FakeFont(const base::string16& name);
+ explicit FakeFont(const std::u16string& name);
FakeFont(FakeFont&& other);
@@ -49,20 +49,20 @@
return *this;
}
- FakeFont& AddFamilyName(const base::string16& locale,
- const base::string16& family_name) {
+ FakeFont& AddFamilyName(const std::u16string& locale,
+ const std::u16string& family_name) {
family_names_.emplace_back(locale, family_name);
return *this;
}
- const base::string16& font_name() { return font_name_; }
+ const std::u16string& font_name() { return font_name_; }
private:
friend FakeFontCollection;
- base::string16 font_name_;
+ std::u16string font_name_;
std::vector<base::FilePath> file_paths_;
std::vector<base::File> file_handles_;
- std::vector<std::pair<base::string16, base::string16>> family_names_;
+ std::vector<std::pair<std::u16string, std::u16string>> family_names_;
DISALLOW_ASSIGN(FakeFont);
};
@@ -99,7 +99,7 @@
FakeFontCollection();
~FakeFontCollection() override;
- FakeFont& AddFont(const base::string16& font_name);
+ FakeFont& AddFont(const std::u16string& font_name);
size_t MessageCount();
MessageType GetMessageType(size_t id);
@@ -108,20 +108,20 @@
protected:
// blink::mojom::DWriteFontProxy:
- void FindFamily(const base::string16& family_name,
+ void FindFamily(const std::u16string& family_name,
FindFamilyCallback callback) override;
void GetFamilyCount(GetFamilyCountCallback callback) override;
void GetFamilyNames(uint32_t family_index,
GetFamilyNamesCallback callback) override;
void GetFontFiles(uint32_t family_index,
GetFontFilesCallback callback) override;
- void MapCharacters(const base::string16& text,
+ void MapCharacters(const std::u16string& text,
blink::mojom::DWriteFontStylePtr font_style,
- const base::string16& locale_name,
+ const std::u16string& locale_name,
uint32_t reading_direction,
- const base::string16& base_family_name,
+ const std::u16string& base_family_name,
MapCharactersCallback callback) override;
- void MatchUniqueFont(const base::string16& unique_font_name,
+ void MatchUniqueFont(const std::u16string& unique_font_name,
MatchUniqueFontCallback callback) override;
void GetUniqueFontLookupMode(
GetUniqueFontLookupModeCallback callback) override;
diff --git a/content/test/fake_plugin_service.cc b/content/test/fake_plugin_service.cc
index eb280cd..f816fe5 100644
--- a/content/test/fake_plugin_service.cc
+++ b/content/test/fake_plugin_service.cc
@@ -43,9 +43,9 @@
return false;
}
-base::string16 FakePluginService::GetPluginDisplayNameByPath(
+std::u16string FakePluginService::GetPluginDisplayNameByPath(
const base::FilePath& path) {
- return base::string16();
+ return std::u16string();
}
void FakePluginService::GetPlugins(GetPluginsCallback callback) {}
diff --git a/content/test/fake_plugin_service.h b/content/test/fake_plugin_service.h
index df49da7c..e5f53ee 100644
--- a/content/test/fake_plugin_service.h
+++ b/content/test/fake_plugin_service.h
@@ -37,7 +37,7 @@
std::string* actual_mime_type) override;
bool GetPluginInfoByPath(const base::FilePath& plugin_path,
WebPluginInfo* info) override;
- base::string16 GetPluginDisplayNameByPath(
+ std::u16string GetPluginDisplayNameByPath(
const base::FilePath& path) override;
void GetPlugins(GetPluginsCallback callback) override;
const PepperPluginInfo* GetRegisteredPpapiPluginInfo(
diff --git a/content/test/mock_clipboard_host.cc b/content/test/mock_clipboard_host.cc
index cbb7c65b..45130782 100644
--- a/content/test/mock_clipboard_host.cc
+++ b/content/test/mock_clipboard_host.cc
@@ -19,9 +19,9 @@
}
void MockClipboardHost::Reset() {
- plain_text_ = base::string16();
- html_text_ = base::string16();
- svg_text_ = base::string16();
+ plain_text_ = std::u16string();
+ html_text_ = std::u16string();
+ svg_text_ = std::u16string();
url_ = GURL();
image_.reset();
custom_data_.clear();
@@ -37,7 +37,7 @@
void MockClipboardHost::ReadAvailableTypes(
ui::ClipboardBuffer clipboard_buffer,
ReadAvailableTypesCallback callback) {
- std::vector<base::string16> types;
+ std::vector<std::u16string> types;
if (!plain_text_.empty())
types.push_back(base::ASCIIToUTF16("text/plain"));
if (!html_text_.empty())
@@ -105,20 +105,20 @@
}
void MockClipboardHost::ReadCustomData(ui::ClipboardBuffer clipboard_buffer,
- const base::string16& type,
+ const std::u16string& type,
ReadCustomDataCallback callback) {
auto it = custom_data_.find(type);
std::move(callback).Run(it != custom_data_.end() ? it->second
- : base::string16());
+ : std::u16string());
}
-void MockClipboardHost::WriteText(const base::string16& text) {
+void MockClipboardHost::WriteText(const std::u16string& text) {
if (needs_reset_)
Reset();
plain_text_ = text;
}
-void MockClipboardHost::WriteHtml(const base::string16& markup,
+void MockClipboardHost::WriteHtml(const std::u16string& markup,
const GURL& url) {
if (needs_reset_)
Reset();
@@ -126,7 +126,7 @@
url_ = url;
}
-void MockClipboardHost::WriteSvg(const base::string16& markup) {
+void MockClipboardHost::WriteSvg(const std::u16string& markup) {
if (needs_reset_)
Reset();
svg_text_ = markup;
@@ -139,7 +139,7 @@
}
void MockClipboardHost::WriteCustomData(
- const base::flat_map<base::string16, base::string16>& data) {
+ const base::flat_map<std::u16string, std::u16string>& data) {
if (needs_reset_)
Reset();
for (auto& it : data)
@@ -147,7 +147,7 @@
}
void MockClipboardHost::WriteBookmark(const std::string& url,
- const base::string16& title) {}
+ const std::u16string& title) {}
void MockClipboardHost::WriteImage(const SkBitmap& bitmap) {
if (needs_reset_)
@@ -161,7 +161,7 @@
}
#if defined(OS_MAC)
-void MockClipboardHost::WriteStringToFindPboard(const base::string16& text) {}
+void MockClipboardHost::WriteStringToFindPboard(const std::u16string& text) {}
#endif
} // namespace content
diff --git a/content/test/mock_clipboard_host.h b/content/test/mock_clipboard_host.h
index cfcb22b..2dad939 100644
--- a/content/test/mock_clipboard_host.h
+++ b/content/test/mock_clipboard_host.h
@@ -46,30 +46,30 @@
void ReadFiles(ui::ClipboardBuffer clipboard_buffer,
ReadFilesCallback callback) override;
void ReadCustomData(ui::ClipboardBuffer clipboard_buffer,
- const base::string16& type,
+ const std::u16string& type,
ReadCustomDataCallback callback) override;
- void WriteText(const base::string16& text) override;
- void WriteHtml(const base::string16& markup, const GURL& url) override;
- void WriteSvg(const base::string16& markup) override;
+ void WriteText(const std::u16string& text) override;
+ void WriteHtml(const std::u16string& markup, const GURL& url) override;
+ void WriteSvg(const std::u16string& markup) override;
void WriteSmartPasteMarker() override;
void WriteCustomData(
- const base::flat_map<base::string16, base::string16>& data) override;
+ const base::flat_map<std::u16string, std::u16string>& data) override;
void WriteBookmark(const std::string& url,
- const base::string16& title) override;
+ const std::u16string& title) override;
void WriteImage(const SkBitmap& bitmap) override;
void CommitWrite() override;
#if defined(OS_MAC)
- void WriteStringToFindPboard(const base::string16& text) override;
+ void WriteStringToFindPboard(const std::u16string& text) override;
#endif
private:
mojo::ReceiverSet<blink::mojom::ClipboardHost> receivers_;
uint64_t sequence_number_ = 0;
- base::string16 plain_text_;
- base::string16 html_text_;
- base::string16 svg_text_;
+ std::u16string plain_text_;
+ std::u16string html_text_;
+ std::u16string svg_text_;
GURL url_;
SkBitmap image_;
- std::map<base::string16, base::string16> custom_data_;
+ std::map<std::u16string, std::u16string> custom_data_;
bool write_smart_paste_ = false;
bool needs_reset_ = false;
diff --git a/content/test/mock_keyboard.cc b/content/test/mock_keyboard.cc
index ce43f7a..ccd987f0 100644
--- a/content/test/mock_keyboard.cc
+++ b/content/test/mock_keyboard.cc
@@ -19,7 +19,7 @@
int MockKeyboard::GetCharacters(Layout layout,
int key_code,
Modifiers modifiers,
- base::string16* output) {
+ std::u16string* output) {
#if defined(OS_WIN)
CHECK(output);
// Change the keyboard layout only when we have to because it takes a lot of
diff --git a/content/test/mock_keyboard.h b/content/test/mock_keyboard.h
index eb85d2b..ccf0cb9 100644
--- a/content/test/mock_keyboard.h
+++ b/content/test/mock_keyboard.h
@@ -94,7 +94,7 @@
int GetCharacters(Layout layout,
int key_code,
Modifiers modifiers,
- base::string16* output);
+ std::u16string* output);
private:
#if defined(OS_WIN)
diff --git a/content/test/mock_platform_notification_service.cc b/content/test/mock_platform_notification_service.cc
index 2f5b8be2..1d8a0687 100644
--- a/content/test/mock_platform_notification_service.cc
+++ b/content/test/mock_platform_notification_service.cc
@@ -121,7 +121,7 @@
void MockPlatformNotificationService::SimulateClick(
const std::string& title,
const base::Optional<int>& action_index,
- const base::Optional<base::string16>& reply) {
+ const base::Optional<std::u16string>& reply) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
const auto notification_id_iter = notification_id_map_.find(title);
if (notification_id_iter == notification_id_map_.end())
diff --git a/content/test/mock_platform_notification_service.h b/content/test/mock_platform_notification_service.h
index 6d108f98..caf6118 100644
--- a/content/test/mock_platform_notification_service.h
+++ b/content/test/mock_platform_notification_service.h
@@ -39,7 +39,7 @@
// Must be called on the UI thread.
void SimulateClick(const std::string& title,
const base::Optional<int>& action_index,
- const base::Optional<base::string16>& reply);
+ const base::Optional<std::u16string>& reply);
// Simulates the closing a notification titled |title|. Must be called on
// the UI thread.
diff --git a/content/test/mock_raw_clipboard_host.cc b/content/test/mock_raw_clipboard_host.cc
index 9817523..47d37e7 100644
--- a/content/test/mock_raw_clipboard_host.cc
+++ b/content/test/mock_raw_clipboard_host.cc
@@ -41,13 +41,13 @@
void MockRawClipboardHost::ReadAvailableFormatNames(
ReadAvailableFormatNamesCallback callback) {
- std::vector<base::string16> format_names;
+ std::vector<std::u16string> format_names;
for (const auto& item : raw_data_map_)
format_names.emplace_back(item.first);
std::move(callback).Run(format_names);
}
-void MockRawClipboardHost::Read(const base::string16& format,
+void MockRawClipboardHost::Read(const std::u16string& format,
ReadCallback callback) {
const auto it = raw_data_map_.find(format);
if (it == raw_data_map_.end())
@@ -58,7 +58,7 @@
std::move(callback).Run(std::move(buffer));
}
-void MockRawClipboardHost::Write(const base::string16& format,
+void MockRawClipboardHost::Write(const std::u16string& format,
mojo_base::BigBuffer data) {
if (needs_reset_)
Reset();
@@ -80,7 +80,7 @@
if (format == base::ASCIIToUTF16(kPlatformTextFormat)) {
EXPECT_TRUE(mock_clipboard_host_);
- base::string16 text = base::UTF8ToUTF16(base::StringPiece(
+ std::u16string text = base::UTF8ToUTF16(base::StringPiece(
reinterpret_cast<const char*>(data_copy.data()), data_copy.size()));
mock_clipboard_host_->WriteText(text);
}
diff --git a/content/test/mock_raw_clipboard_host.h b/content/test/mock_raw_clipboard_host.h
index 476a4633..c7ea774 100644
--- a/content/test/mock_raw_clipboard_host.h
+++ b/content/test/mock_raw_clipboard_host.h
@@ -32,8 +32,8 @@
// blink::mojom::RawClipboardHost
void ReadAvailableFormatNames(
ReadAvailableFormatNamesCallback callback) override;
- void Read(const base::string16& format, ReadCallback callback) override;
- void Write(const base::string16& format, mojo_base::BigBuffer data) override;
+ void Read(const std::u16string& format, ReadCallback callback) override;
+ void Write(const std::u16string& format, mojo_base::BigBuffer data) override;
void CommitWrite() override;
private:
@@ -41,7 +41,7 @@
// The associated sanitized clipboard, for emulating platform-specific
// clipboard type conversions. Owned by WebTestContentBrowserClient.
MockClipboardHost* const mock_clipboard_host_;
- std::map<base::string16, std::vector<uint8_t>> raw_data_map_;
+ std::map<std::u16string, std::vector<uint8_t>> raw_data_map_;
// Tracks whether a commit has happened since the last write. After a
// sequence of writes are committed, future writes should clear the clipboard
// before continuing to write.
diff --git a/content/test/mock_render_widget_host_delegate.cc b/content/test/mock_render_widget_host_delegate.cc
index b633dfd..c94814e 100644
--- a/content/test/mock_render_widget_host_delegate.cc
+++ b/content/test/mock_render_widget_host_delegate.cc
@@ -29,7 +29,7 @@
void MockRenderWidgetHostDelegate::ExecuteEditCommand(
const std::string& command,
- const base::Optional<base::string16>& value) {}
+ const base::Optional<std::u16string>& value) {}
void MockRenderWidgetHostDelegate::Undo() {}
diff --git a/content/test/mock_render_widget_host_delegate.h b/content/test/mock_render_widget_host_delegate.h
index ecc26fb..616af39 100644
--- a/content/test/mock_render_widget_host_delegate.h
+++ b/content/test/mock_render_widget_host_delegate.h
@@ -44,7 +44,7 @@
KeyboardEventProcessingResult PreHandleKeyboardEvent(
const NativeWebKeyboardEvent& event) override;
void ExecuteEditCommand(const std::string& command,
- const base::Optional<base::string16>& value) override;
+ const base::Optional<std::u16string>& value) override;
void Undo() override;
void Redo() override;
void Cut() override;
diff --git a/content/test/mock_widget_input_handler.cc b/content/test/mock_widget_input_handler.cc
index 5684e77..8240dd4 100644
--- a/content/test/mock_widget_input_handler.cc
+++ b/content/test/mock_widget_input_handler.cc
@@ -57,7 +57,7 @@
}
void MockWidgetInputHandler::ImeSetComposition(
- const base::string16& text,
+ const std::u16string& text,
const std::vector<ui::ImeTextSpan>& ime_text_spans,
const gfx::Range& range,
int32_t start,
@@ -67,7 +67,7 @@
}
void MockWidgetInputHandler::ImeCommitText(
- const base::string16& text,
+ const std::u16string& text,
const std::vector<ui::ImeTextSpan>& ime_text_spans,
const gfx::Range& range,
int32_t relative_cursor_position,
@@ -169,7 +169,7 @@
MockWidgetInputHandler::DispatchedIMEMessage::DispatchedIMEMessage(
const std::string& name,
- const base::string16& text,
+ const std::u16string& text,
const std::vector<ui::ImeTextSpan>& text_spans,
const gfx::Range& range,
int32_t start,
@@ -189,7 +189,7 @@
}
bool MockWidgetInputHandler::DispatchedIMEMessage::Matches(
- const base::string16& text,
+ const std::u16string& text,
const std::vector<ui::ImeTextSpan>& ime_text_spans,
const gfx::Range& range,
int32_t start,
diff --git a/content/test/mock_widget_input_handler.h b/content/test/mock_widget_input_handler.h
index 0a58dc7..af9c3a6 100644
--- a/content/test/mock_widget_input_handler.h
+++ b/content/test/mock_widget_input_handler.h
@@ -77,7 +77,7 @@
class DispatchedIMEMessage : public DispatchedMessage {
public:
DispatchedIMEMessage(const std::string& name,
- const base::string16& text,
+ const std::u16string& text,
const std::vector<ui::ImeTextSpan>& ime_text_spans,
const gfx::Range& range,
int32_t start,
@@ -88,14 +88,14 @@
DispatchedIMEMessage* ToIME() override;
// Returns if this message matches the parameters passed in.
- bool Matches(const base::string16& text,
+ bool Matches(const std::u16string& text,
const std::vector<ui::ImeTextSpan>& ime_text_spans,
const gfx::Range& range,
int32_t start,
int32_t end) const;
private:
- base::string16 text_;
+ std::u16string text_;
std::vector<ui::ImeTextSpan> text_spans_;
gfx::Range range_;
int32_t start_;
@@ -224,12 +224,12 @@
void SetEditCommandsForNextKeyEvent(
std::vector<blink::mojom::EditCommandPtr> commands) override;
void CursorVisibilityChanged(bool visible) override;
- void ImeSetComposition(const base::string16& text,
+ void ImeSetComposition(const std::u16string& text,
const std::vector<ui::ImeTextSpan>& ime_text_spans,
const gfx::Range& range,
int32_t start,
int32_t end) override;
- void ImeCommitText(const base::string16& text,
+ void ImeCommitText(const std::u16string& text,
const std::vector<ui::ImeTextSpan>& ime_text_spans,
const gfx::Range& range,
int32_t relative_cursor_position,
diff --git a/content/test/test_render_view_host.h b/content/test/test_render_view_host.h
index 9442179..004306d8 100644
--- a/content/test/test_render_view_host.h
+++ b/content/test/test_render_view_host.h
@@ -96,7 +96,7 @@
void UpdateCursor(const WebCursor& cursor) override;
void RenderProcessGone() override;
void Destroy() override;
- void SetTooltipText(const base::string16& tooltip_text) override {}
+ void SetTooltipText(const std::u16string& tooltip_text) override {}
gfx::Rect GetBoundsInRootWindow() override;
blink::mojom::PointerLockResult LockMouse(bool) override;
blink::mojom::PointerLockResult ChangeMouseLock(bool) override;
diff --git a/content/test/test_web_contents.cc b/content/test/test_web_contents.cc
index 1882667..2ed1cf7 100644
--- a/content/test/test_web_contents.cc
+++ b/content/test/test_web_contents.cc
@@ -120,7 +120,7 @@
return WebContentsImpl::GetLastCommittedURL();
}
-const base::string16& TestWebContents::GetTitle() {
+const std::u16string& TestWebContents::GetTitle() {
if (title_)
return title_.value();
@@ -131,7 +131,7 @@
return save_frame_headers_;
}
-const base::string16& TestWebContents::GetSuggestedFileName() {
+const std::u16string& TestWebContents::GetSuggestedFileName() {
return suggested_filename_;
}
@@ -170,7 +170,7 @@
last_committed_url_ = url;
}
-void TestWebContents::SetTitle(const base::string16& title) {
+void TestWebContents::SetTitle(const std::u16string& title) {
title_ = title;
}
@@ -351,7 +351,7 @@
const GURL& url,
const Referrer& referrer,
const std::string& headers,
- const base::string16& suggested_filename,
+ const std::u16string& suggested_filename,
RenderFrameHost* rfh) {
save_frame_headers_ = headers;
suggested_filename_ = suggested_filename;
diff --git a/content/test/test_web_contents.h b/content/test/test_web_contents.h
index d056210..36b6d42 100644
--- a/content/test/test_web_contents.h
+++ b/content/test/test_web_contents.h
@@ -62,7 +62,7 @@
bool bypass_cache,
ImageDownloadCallback callback) override;
const GURL& GetLastCommittedURL() override;
- const base::string16& GetTitle() override;
+ const std::u16string& GetTitle() override;
// WebContentsTester implementation.
void CommitPendingNavigation() override;
@@ -76,7 +76,7 @@
void SetOpener(WebContents* opener) override;
void SetIsCrashed(base::TerminationStatus status, int error_code) override;
const std::string& GetSaveFrameHeaders() override;
- const base::string16& GetSuggestedFileName() override;
+ const std::u16string& GetSuggestedFileName() override;
bool HasPendingDownloadImage(const GURL& url) override;
bool TestDidDownloadImage(
const GURL& url,
@@ -84,7 +84,7 @@
const std::vector<SkBitmap>& bitmaps,
const std::vector<gfx::Size>& original_bitmap_sizes) override;
void SetLastCommittedURL(const GURL& url) override;
- void SetTitle(const base::string16& new_title) override;
+ void SetTitle(const std::u16string& new_title) override;
void SetMainFrameMimeType(const std::string& mime_type) override;
const std::string& GetContentsMimeType() override;
void SetIsCurrentlyAudible(bool audible) override;
@@ -174,7 +174,7 @@
void SaveFrameWithHeaders(const GURL& url,
const Referrer& referrer,
const std::string& headers,
- const base::string16& suggested_filename,
+ const std::u16string& suggested_filename,
RenderFrameHost* rfh) override;
void ReattachToOuterWebContentsFrame() override {}
void SetPageFrozen(bool frozen) override;
@@ -184,12 +184,12 @@
// See set_web_preferences_changed_counter() above. May be nullptr.
int* web_preferences_changed_counter_;
std::string save_frame_headers_;
- base::string16 suggested_filename_;
+ std::u16string suggested_filename_;
// Map keyed by image URL. Values are <id, callback> pairs.
std::map<GURL, std::list<std::pair<int, ImageDownloadCallback>>>
pending_image_downloads_;
GURL last_committed_url_;
- base::Optional<base::string16> title_;
+ base::Optional<std::u16string> title_;
bool pause_subresource_loading_called_;
base::UnguessableToken audio_group_id_;
bool is_page_frozen_;
diff --git a/content/web_test/browser/devtools_protocol_test_bindings.cc b/content/web_test/browser/devtools_protocol_test_bindings.cc
index 2f130eb..b191fa2 100644
--- a/content/web_test/browser/devtools_protocol_test_bindings.cc
+++ b/content/web_test/browser/devtools_protocol_test_bindings.cc
@@ -125,7 +125,7 @@
std::string param;
base::EscapeJSONString(str_message, true, ¶m);
std::string code = "DevToolsAPI.dispatchMessage(" + param + ");";
- base::string16 javascript = base::UTF8ToUTF16(code);
+ std::u16string javascript = base::UTF8ToUTF16(code);
web_contents()->GetMainFrame()->ExecuteJavaScriptForTests(
javascript, base::NullCallback());
return;
@@ -139,7 +139,7 @@
true, ¶m);
std::string code = "DevToolsAPI.dispatchMessageChunk(" + param + "," +
base::NumberToString(pos ? 0 : total_size) + ");";
- base::string16 javascript = base::UTF8ToUTF16(code);
+ std::u16string javascript = base::UTF8ToUTF16(code);
web_contents()->GetMainFrame()->ExecuteJavaScriptForTests(
javascript, base::NullCallback());
}
diff --git a/content/web_test/browser/fake_bluetooth_chooser.cc b/content/web_test/browser/fake_bluetooth_chooser.cc
index 7e65ead2..438789b3 100644
--- a/content/web_test/browser/fake_bluetooth_chooser.cc
+++ b/content/web_test/browser/fake_bluetooth_chooser.cc
@@ -104,7 +104,7 @@
void FakeBluetoothChooser::AddOrUpdateDevice(const std::string& device_id,
bool should_update_name,
- const base::string16& device_name,
+ const std::u16string& device_name,
bool is_gatt_connected,
bool is_paired,
int signal_strength_level) {
diff --git a/content/web_test/browser/fake_bluetooth_chooser.h b/content/web_test/browser/fake_bluetooth_chooser.h
index d7367cd..0fab8938 100644
--- a/content/web_test/browser/fake_bluetooth_chooser.h
+++ b/content/web_test/browser/fake_bluetooth_chooser.h
@@ -61,7 +61,7 @@
void ShowDiscoveryState(DiscoveryState state) override;
void AddOrUpdateDevice(const std::string& device_id,
bool should_update_name,
- const base::string16& device_name,
+ const std::u16string& device_name,
bool is_gatt_connected,
bool is_paired,
int signal_strength_level) override;
diff --git a/content/web_test/browser/web_test_bluetooth_chooser_factory.cc b/content/web_test/browser/web_test_bluetooth_chooser_factory.cc
index 3170090..fbd8150e 100644
--- a/content/web_test/browser/web_test_bluetooth_chooser_factory.cc
+++ b/content/web_test/browser/web_test_bluetooth_chooser_factory.cc
@@ -65,7 +65,7 @@
void AddOrUpdateDevice(const std::string& device_id,
bool should_update_name,
- const base::string16& device_name,
+ const std::u16string& device_name,
bool is_gatt_connected,
bool is_paired,
int signal_strength_level) override {
diff --git a/content/web_test/browser/web_test_control_host.cc b/content/web_test/browser/web_test_control_host.cc
index 6f570aed..eceda87 100644
--- a/content/web_test/browser/web_test_control_host.cc
+++ b/content/web_test/browser/web_test_control_host.cc
@@ -119,7 +119,7 @@
}
std::string url = web_test_string_util::NormalizeWebTestURL(
- base::UTF16ToUTF8(frame_state.url_string.value_or(base::string16())));
+ base::UTF16ToUTF8(frame_state.url_string.value_or(std::u16string())));
result.append(url);
DCHECK(frame_state.target);
if (!frame_state.target->empty()) {
@@ -1506,7 +1506,7 @@
~FakeSelectFileDialog() override = default;
void SelectFileImpl(Type type,
- const base::string16& title,
+ const std::u16string& title,
const base::FilePath& default_path,
const FileTypeInfo* file_types,
int file_type_index,
@@ -1626,7 +1626,7 @@
void WebTestControlHost::SimulateWebNotificationClick(
const std::string& title,
int32_t action_index,
- const base::Optional<base::string16>& reply) {
+ const base::Optional<std::u16string>& reply) {
auto* client = WebTestContentBrowserClient::Get();
auto* context = client->GetWebTestBrowserContext();
auto* service = client->GetPlatformNotificationService(context);
diff --git a/content/web_test/browser/web_test_control_host.h b/content/web_test/browser/web_test_control_host.h
index 7180133..b4f5bb3 100644
--- a/content/web_test/browser/web_test_control_host.h
+++ b/content/web_test/browser/web_test_control_host.h
@@ -236,7 +236,7 @@
void SimulateWebNotificationClick(
const std::string& title,
int32_t action_index,
- const base::Optional<base::string16>& reply) override;
+ const base::Optional<std::u16string>& reply) override;
void SimulateWebNotificationClose(const std::string& title,
bool by_user) override;
void SimulateWebContentIndexDelete(const std::string& id) override;
diff --git a/content/web_test/browser/web_test_first_device_bluetooth_chooser.cc b/content/web_test/browser/web_test_first_device_bluetooth_chooser.cc
index 1516ebc..16efafa4 100644
--- a/content/web_test/browser/web_test_first_device_bluetooth_chooser.cc
+++ b/content/web_test/browser/web_test_first_device_bluetooth_chooser.cc
@@ -48,7 +48,7 @@
void WebTestFirstDeviceBluetoothChooser::AddOrUpdateDevice(
const std::string& device_id,
bool should_update_name,
- const base::string16& deviceName,
+ const std::u16string& deviceName,
bool is_gatt_connected,
bool is_paired,
int signal_strength_level) {
diff --git a/content/web_test/browser/web_test_first_device_bluetooth_chooser.h b/content/web_test/browser/web_test_first_device_bluetooth_chooser.h
index 5179c81..20f0402 100644
--- a/content/web_test/browser/web_test_first_device_bluetooth_chooser.h
+++ b/content/web_test/browser/web_test_first_device_bluetooth_chooser.h
@@ -28,7 +28,7 @@
void ShowDiscoveryState(DiscoveryState state) override;
void AddOrUpdateDevice(const std::string& device_id,
bool should_update_name,
- const base::string16& device_name,
+ const std::u16string& device_name,
bool is_gatt_connected,
bool is_paired,
int signal_strength_level) override;
diff --git a/content/web_test/browser/web_test_javascript_dialog_manager.cc b/content/web_test/browser/web_test_javascript_dialog_manager.cc
index 59f336cee..b933c5b 100644
--- a/content/web_test/browser/web_test_javascript_dialog_manager.cc
+++ b/content/web_test/browser/web_test_javascript_dialog_manager.cc
@@ -39,8 +39,8 @@
WebContents* web_contents,
RenderFrameHost* render_frame_host,
JavaScriptDialogType dialog_type,
- const base::string16& message_text,
- const base::string16& default_prompt_text,
+ const std::u16string& message_text,
+ const std::u16string& default_prompt_text,
DialogClosedCallback callback,
bool* did_suppress_message) {
if (DumpJavascriptDialog()) {
@@ -62,7 +62,7 @@
}
WebTestControlHost::Get()->printer()->AddMessageRaw(message);
}
- std::move(callback).Run(true, base::string16());
+ std::move(callback).Run(true, std::u16string());
}
void WebTestJavaScriptDialogManager::RunBeforeUnloadDialog(
@@ -73,7 +73,7 @@
if (DumpJavascriptDialog())
WebTestControlHost::Get()->printer()->AddMessageRaw("CONFIRM NAVIGATION\n");
std::move(callback).Run(!ShouldStayOnPageAfterHandlingBeforeUnload(),
- base::string16());
+ std::u16string());
}
} // namespace content
diff --git a/content/web_test/browser/web_test_javascript_dialog_manager.h b/content/web_test/browser/web_test_javascript_dialog_manager.h
index 05adb7de..640c2c9 100644
--- a/content/web_test/browser/web_test_javascript_dialog_manager.h
+++ b/content/web_test/browser/web_test_javascript_dialog_manager.h
@@ -23,8 +23,8 @@
void RunJavaScriptDialog(WebContents* web_contents,
RenderFrameHost* render_frame_host,
JavaScriptDialogType dialog_type,
- const base::string16& message_text,
- const base::string16& default_prompt_text,
+ const std::u16string& message_text,
+ const std::u16string& default_prompt_text,
DialogClosedCallback callback,
bool* did_suppress_message) override;
diff --git a/content/web_test/browser/web_test_shell_platform_delegate.h b/content/web_test/browser/web_test_shell_platform_delegate.h
index 198795b..9919dd2 100644
--- a/content/web_test/browser/web_test_shell_platform_delegate.h
+++ b/content/web_test/browser/web_test_shell_platform_delegate.h
@@ -28,7 +28,7 @@
UIControl control,
bool is_enabled) override;
void SetAddressBarURL(Shell* shell, const GURL& url) override;
- void SetTitle(Shell* shell, const base::string16& title) override;
+ void SetTitle(Shell* shell, const std::u16string& title) override;
void MainFrameCreated(Shell* shell) override;
std::unique_ptr<JavaScriptDialogManager> CreateJavaScriptDialogManager(
Shell* shell) override;
diff --git a/content/web_test/browser/web_test_shell_platform_delegate_aura.cc b/content/web_test/browser/web_test_shell_platform_delegate_aura.cc
index ca258f6..c70e9fc 100644
--- a/content/web_test/browser/web_test_shell_platform_delegate_aura.cc
+++ b/content/web_test/browser/web_test_shell_platform_delegate_aura.cc
@@ -53,7 +53,7 @@
}
void WebTestShellPlatformDelegate::SetTitle(Shell* shell,
- const base::string16& title) {
+ const std::u16string& title) {
ShellPlatformDelegate::SetTitle(shell, title);
}
diff --git a/content/web_test/browser/web_test_shell_platform_delegate_mac.mm b/content/web_test/browser/web_test_shell_platform_delegate_mac.mm
index d29751b..1f415ac 100644
--- a/content/web_test/browser/web_test_shell_platform_delegate_mac.mm
+++ b/content/web_test/browser/web_test_shell_platform_delegate_mac.mm
@@ -89,7 +89,7 @@
}
void WebTestShellPlatformDelegate::SetTitle(Shell* shell,
- const base::string16& title) {
+ const std::u16string& title) {
if (!IsHeadless()) {
ShellPlatformDelegate::SetTitle(shell, title);
return;
diff --git a/content/web_test/browser/web_test_shell_platform_delegate_views.cc b/content/web_test/browser/web_test_shell_platform_delegate_views.cc
index ca73d086..bfca5af 100644
--- a/content/web_test/browser/web_test_shell_platform_delegate_views.cc
+++ b/content/web_test/browser/web_test_shell_platform_delegate_views.cc
@@ -110,7 +110,7 @@
}
void WebTestShellPlatformDelegate::SetTitle(Shell* shell,
- const base::string16& title) {
+ const std::u16string& title) {
if (!IsHeadless())
ShellPlatformDelegate::SetTitle(shell, title);
// Nothing in headless mode.
diff --git a/content/web_test/renderer/event_sender.cc b/content/web_test/renderer/event_sender.cc
index bbbd0d7..3371710 100644
--- a/content/web_test/renderer/event_sender.cc
+++ b/content/web_test/renderer/event_sender.cc
@@ -1573,7 +1573,7 @@
}
}
if (!code) {
- base::string16 code_str16 = base::UTF8ToUTF16(code_str);
+ std::u16string code_str16 = base::UTF8ToUTF16(code_str);
if (code_str16.size() != 1u) {
v8::Isolate* isolate = blink::MainThreadIsolate();
isolate->ThrowException(v8::Exception::TypeError(
diff --git a/content/web_test/renderer/spell_check_client.cc b/content/web_test/renderer/spell_check_client.cc
index 5be4146..c19b48f 100644
--- a/content/web_test/renderer/spell_check_client.cc
+++ b/content/web_test/renderer/spell_check_client.cc
@@ -91,7 +91,7 @@
size_t offset = 0;
if (!spell_checker_.IsMultiWordMisspelling(last_requested_text_check_string_,
&results)) {
- base::string16 text = last_requested_text_check_string_.Utf16();
+ std::u16string text = last_requested_text_check_string_.Utf16();
while (text.length()) {
size_t misspelled_position = 0;
size_t misspelled_length = 0;
diff --git a/content/web_test/renderer/test_runner.cc b/content/web_test/renderer/test_runner.cc
index bae2d01..f0ce8736 100644
--- a/content/web_test/renderer/test_runner.cc
+++ b/content/web_test/renderer/test_runner.cc
@@ -1786,7 +1786,7 @@
std::string title;
int action_index = std::numeric_limits<int32_t>::min();
- base::Optional<base::string16> reply;
+ base::Optional<std::u16string> reply;
if (!args->GetNext(&title)) {
args->ThrowError();
diff --git a/content/web_test/renderer/web_test_grammar_checker.cc b/content/web_test/renderer/web_test_grammar_checker.cc
index fa07de6..c9f30a3 100644
--- a/content/web_test/renderer/web_test_grammar_checker.cc
+++ b/content/web_test/renderer/web_test_grammar_checker.cc
@@ -28,7 +28,7 @@
const blink::WebString& text,
std::vector<blink::WebTextCheckingResult>* results) {
DCHECK(results);
- base::string16 string_text = text.Utf16();
+ std::u16string string_text = text.Utf16();
if (std::find_if(string_text.begin(), string_text.end(), IsASCIIAlpha) ==
string_text.end())
return true;
@@ -56,10 +56,10 @@
};
for (size_t i = 0; i < base::size(kGrammarErrors); ++i) {
size_t offset = 0;
- base::string16 error(
+ std::u16string error(
kGrammarErrors[i].text,
kGrammarErrors[i].text + strlen(kGrammarErrors[i].text));
- while ((offset = string_text.find(error, offset)) != base::string16::npos) {
+ while ((offset = string_text.find(error, offset)) != std::u16string::npos) {
results->push_back(blink::WebTextCheckingResult(
blink::kWebTextDecorationTypeGrammar,
offset + kGrammarErrors[i].location, kGrammarErrors[i].length));
diff --git a/content/web_test/renderer/web_test_spell_checker.cc b/content/web_test/renderer/web_test_spell_checker.cc
index 7d0cad2..45783c4 100644
--- a/content/web_test/renderer/web_test_spell_checker.cc
+++ b/content/web_test/renderer/web_test_spell_checker.cc
@@ -51,9 +51,9 @@
*misspelled_offset = 0;
*misspelled_length = 0;
- // Convert to a base::string16 because we store base::string16 instances in
+ // Convert to a std::u16string because we store std::u16string instances in
// misspelled_words_ and blink::WebString has no find().
- base::string16 string_text = text.Utf16();
+ std::u16string string_text = text.Utf16();
int skipped_length = 0;
while (!string_text.empty()) {
@@ -64,14 +64,14 @@
// (This is a simple version of our SpellCheckWordIterator class.)
// If the given string doesn't include any ASCII characters, we can treat
// the string as valid one.
- base::string16::iterator first_char =
+ std::u16string::iterator first_char =
std::find_if(string_text.begin(), string_text.end(), IsASCIIAlpha);
if (first_char == string_text.end())
return true;
int word_offset = std::distance(string_text.begin(), first_char);
int max_word_length = static_cast<int>(string_text.length()) - word_offset;
int word_length;
- base::string16 word;
+ std::u16string word;
// Look up our misspelled-word table to check if the extracted word is a
// known misspelled word, and return the offset and the length of the
@@ -97,7 +97,7 @@
if (*misspelled_length > 0)
break;
- base::string16::iterator last_char = std::find_if(
+ std::u16string::iterator last_char = std::find_if(
string_text.begin() + word_offset, string_text.end(), IsNotASCIIAlpha);
if (last_char == string_text.end())
word_length = static_cast<int>(string_text.length()) - word_offset;
@@ -167,7 +167,7 @@
misspelled_words_.clear();
for (size_t i = 0; i < base::size(misspelled_words); ++i)
misspelled_words_.push_back(
- base::string16(misspelled_words[i],
+ std::u16string(misspelled_words[i],
misspelled_words[i] + strlen(misspelled_words[i])));
// Mark as initialized to prevent this object from being initialized twice
diff --git a/content/web_test/renderer/web_test_spell_checker.h b/content/web_test/renderer/web_test_spell_checker.h
index 4a896b22..47d8c2ca 100644
--- a/content/web_test/renderer/web_test_spell_checker.h
+++ b/content/web_test/renderer/web_test_spell_checker.h
@@ -64,7 +64,7 @@
bool InitializeIfNeeded();
// A table that consists of misspelled words.
- std::vector<base::string16> misspelled_words_;
+ std::vector<std::u16string> misspelled_words_;
// A flag representing whether or not this object is initialized.
bool initialized_ = false;
diff --git a/content/zygote/zygote_linux.cc b/content/zygote/zygote_linux.cc
index f2512d63..f539436a 100644
--- a/content/zygote/zygote_linux.cc
+++ b/content/zygote/zygote_linux.cc
@@ -554,7 +554,7 @@
// timezone_id is obtained from ICU in zygote host so that it can't be
// invalid. For an unknown reason, if an invalid ID is passed down here, the
// worst result would be that timezone would be set to Etc/Unknown.
- base::string16 timezone_id;
+ std::u16string timezone_id;
if (!iter.ReadString16(&timezone_id))
return -1;
icu::TimeZone::adoptDefault(icu::TimeZone::createTimeZone(