diff options
Diffstat (limited to 'chrome/browser/ui/webui')
21 files changed, 173 insertions, 110 deletions
diff --git a/chrome/browser/ui/webui/about_ui.cc b/chrome/browser/ui/webui/about_ui.cc index 861d2be..b2dc2ae 100644 --- a/chrome/browser/ui/webui/about_ui.cc +++ b/chrome/browser/ui/webui/about_ui.cc @@ -785,15 +785,21 @@ std::string AboutSandbox() { data.append("<table>"); - AboutSandboxRow(&data, "", IDS_ABOUT_SANDBOX_SUID_SANDBOX, + AboutSandboxRow(&data, + std::string(), + IDS_ABOUT_SANDBOX_SUID_SANDBOX, status & content::kSandboxLinuxSUID); AboutSandboxRow(&data, " ", IDS_ABOUT_SANDBOX_PID_NAMESPACES, status & content::kSandboxLinuxPIDNS); AboutSandboxRow(&data, " ", IDS_ABOUT_SANDBOX_NET_NAMESPACES, status & content::kSandboxLinuxNetNS); - AboutSandboxRow(&data, "", IDS_ABOUT_SANDBOX_SECCOMP_LEGACY_SANDBOX, + AboutSandboxRow(&data, + std::string(), + IDS_ABOUT_SANDBOX_SECCOMP_LEGACY_SANDBOX, status & content::kSandboxLinuxSeccompLegacy); - AboutSandboxRow(&data, "", IDS_ABOUT_SANDBOX_SECCOMP_BPF_SANDBOX, + AboutSandboxRow(&data, + std::string(), + IDS_ABOUT_SANDBOX_SECCOMP_BPF_SANDBOX, status & content::kSandboxLinuxSeccompBpf); data.append("</table>"); diff --git a/chrome/browser/ui/webui/downloads_dom_handler_browsertest.cc b/chrome/browser/ui/webui/downloads_dom_handler_browsertest.cc index 0bfa286..19e6404 100644 --- a/chrome/browser/ui/webui/downloads_dom_handler_browsertest.cc +++ b/chrome/browser/ui/webui/downloads_dom_handler_browsertest.cc @@ -147,7 +147,7 @@ IN_PROC_BROWSER_TEST_F(DownloadsDOMHandlerTest, base::FilePath(FILE_PATH_LITERAL("/path/to/file")), base::FilePath(FILE_PATH_LITERAL("/path/to/file")), url_chain, - GURL(""), + GURL(std::string()), current, current, 128, diff --git a/chrome/browser/ui/webui/extensions/extension_settings_handler.cc b/chrome/browser/ui/webui/extensions/extension_settings_handler.cc index bd3bc6f..11ea684 100644 --- a/chrome/browser/ui/webui/extensions/extension_settings_handler.cc +++ b/chrome/browser/ui/webui/extensions/extension_settings_handler.cc @@ -930,9 +930,14 @@ void ExtensionSettingsHandler::HandleLoadUnpackedExtensionMessage( load_extension_dialog_ = ui::SelectFileDialog::Create( this, new ChromeSelectFilePolicy(web_ui()->GetWebContents())); load_extension_dialog_->SelectFile( - kSelectType, select_title, last_unpacked_directory_, NULL, - kFileTypeIndex, FILE_PATH_LITERAL(""), - web_ui()->GetWebContents()->GetView()->GetTopLevelNativeWindow(), NULL); + kSelectType, + select_title, + last_unpacked_directory_, + NULL, + kFileTypeIndex, + base::FilePath::StringType(), + web_ui()->GetWebContents()->GetView()->GetTopLevelNativeWindow(), + NULL); } void ExtensionSettingsHandler::ShowAlert(const std::string& message) { diff --git a/chrome/browser/ui/webui/extensions/pack_extension_handler.cc b/chrome/browser/ui/webui/extensions/pack_extension_handler.cc index a69cd4d..d201c91 100644 --- a/chrome/browser/ui/webui/extensions/pack_extension_handler.cc +++ b/chrome/browser/ui/webui/extensions/pack_extension_handler.cc @@ -184,8 +184,12 @@ void PackExtensionHandler::HandleSelectFilePathMessage( load_extension_dialog_ = ui::SelectFileDialog::Create( this, new ChromeSelectFilePolicy(web_ui()->GetWebContents())); load_extension_dialog_->SelectFile( - type, select_title, base::FilePath(), &info, file_type_index, - FILE_PATH_LITERAL(""), + type, + select_title, + base::FilePath(), + &info, + file_type_index, + base::FilePath::StringType(), web_ui()->GetWebContents()->GetView()->GetTopLevelNativeWindow(), NULL); } diff --git a/chrome/browser/ui/webui/favicon_source.cc b/chrome/browser/ui/webui/favicon_source.cc index 6864120..232b6eb 100644 --- a/chrome/browser/ui/webui/favicon_source.cc +++ b/chrome/browser/ui/webui/favicon_source.cc @@ -253,10 +253,8 @@ void FaviconSource::OnFaviconDataAvailable( void FaviconSource::SendDefaultResponse( const content::URLDataSource::GotDataCallback& callback) { - SendDefaultResponse(IconRequest(callback, - "", - 16, - ui::SCALE_FACTOR_100P)); + SendDefaultResponse( + IconRequest(callback, std::string(), 16, ui::SCALE_FACTOR_100P)); } void FaviconSource::SendDefaultResponse(const IconRequest& icon_request) { diff --git a/chrome/browser/ui/webui/feedback_ui.cc b/chrome/browser/ui/webui/feedback_ui.cc index 3cb20bf..b28e065 100644 --- a/chrome/browser/ui/webui/feedback_ui.cc +++ b/chrome/browser/ui/webui/feedback_ui.cc @@ -409,23 +409,23 @@ bool FeedbackHandler::Init() { std::string query_str = *it; if (StartsWithASCII(query_str, std::string(kSessionIDParameter), true)) { ReplaceFirstSubstringAfterOffset( - &query_str, 0, kSessionIDParameter, ""); + &query_str, 0, kSessionIDParameter, std::string()); if (!base::StringToInt(query_str, &session_id)) return false; } else if (StartsWithASCII(*it, std::string(kTabIndexParameter), true)) { ReplaceFirstSubstringAfterOffset( - &query_str, 0, kTabIndexParameter, ""); + &query_str, 0, kTabIndexParameter, std::string()); if (!base::StringToInt(query_str, &index)) return false; } else if (StartsWithASCII(*it, std::string(kCustomPageUrlParameter), true)) { ReplaceFirstSubstringAfterOffset( - &query_str, 0, kCustomPageUrlParameter, ""); + &query_str, 0, kCustomPageUrlParameter, std::string()); custom_page_url = query_str; } else if (StartsWithASCII(*it, std::string(kCategoryTagParameter), true)) { ReplaceFirstSubstringAfterOffset( - &query_str, 0, kCategoryTagParameter, ""); + &query_str, 0, kCategoryTagParameter, std::string()); category_tag_ = query_str; #if defined(OS_CHROMEOS) } else if (StartsWithASCII(*it, std::string(kTimestampParameter), true)) { diff --git a/chrome/browser/ui/webui/inspect_ui.cc b/chrome/browser/ui/webui/inspect_ui.cc index b0b67c3..b98ea9e 100644 --- a/chrome/browser/ui/webui/inspect_ui.cc +++ b/chrome/browser/ui/webui/inspect_ui.cc @@ -462,7 +462,7 @@ void InspectUI::OnAdbPages( targets.Append(target_data); } - std::string json_string = ""; + std::string json_string; base::JSONWriter::Write(&targets, &json_string); callback.Run(base::RefCountedString::TakeString(&json_string)); } diff --git a/chrome/browser/ui/webui/instant_ui.cc b/chrome/browser/ui/webui/instant_ui.cc index f84bf9a..23a255c 100644 --- a/chrome/browser/ui/webui/instant_ui.cc +++ b/chrome/browser/ui/webui/instant_ui.cc @@ -169,6 +169,7 @@ InstantUI::InstantUI(content::WebUI* web_ui) : WebUIController(web_ui) { // static void InstantUI::RegisterUserPrefs(PrefRegistrySyncable* registry) { - registry->RegisterStringPref(prefs::kInstantUIZeroSuggestUrlPrefix, "", + registry->RegisterStringPref(prefs::kInstantUIZeroSuggestUrlPrefix, + std::string(), PrefRegistrySyncable::UNSYNCABLE_PREF); } diff --git a/chrome/browser/ui/webui/net_internals/net_internals_ui.cc b/chrome/browser/ui/webui/net_internals/net_internals_ui.cc index cea9824..0ac1324 100644 --- a/chrome/browser/ui/webui/net_internals/net_internals_ui.cc +++ b/chrome/browser/ui/webui/net_internals/net_internals_ui.cc @@ -1409,7 +1409,7 @@ void NetInternalsMessageHandler::IOThreadImpl::OnGetSpdyStatus( next_protos_value = Value::CreateStringValue( JoinString(net::HttpStreamFactory::next_protos(), ',')); } else { - next_protos_value = Value::CreateStringValue(""); + next_protos_value = Value::CreateStringValue(std::string()); } status_dict->Set("next_protos", next_protos_value); diff --git a/chrome/browser/ui/webui/options/browser_options_handler.cc b/chrome/browser/ui/webui/options/browser_options_handler.cc index 48f4f60..54c5c31 100644 --- a/chrome/browser/ui/webui/options/browser_options_handler.cc +++ b/chrome/browser/ui/webui/options/browser_options_handler.cc @@ -1194,8 +1194,11 @@ void BrowserOptionsHandler::HandleSelectDownloadLocation( ui::SelectFileDialog::SELECT_FOLDER, l10n_util::GetStringUTF16(IDS_OPTIONS_DOWNLOADLOCATION_BROWSE_TITLE), pref_service->GetFilePath(prefs::kDownloadDefaultDirectory), - &info, 0, FILE_PATH_LITERAL(""), - web_ui()->GetWebContents()->GetView()->GetTopLevelNativeWindow(), NULL); + &info, + 0, + base::FilePath::StringType(), + web_ui()->GetWebContents()->GetView()->GetTopLevelNativeWindow(), + NULL); } void BrowserOptionsHandler::FileSelected(const base::FilePath& path, int index, diff --git a/chrome/browser/ui/webui/options/certificate_manager_handler.cc b/chrome/browser/ui/webui/options/certificate_manager_handler.cc index c1e18da..f30eaec 100644 --- a/chrome/browser/ui/webui/options/certificate_manager_handler.cc +++ b/chrome/browser/ui/webui/options/certificate_manager_handler.cc @@ -326,7 +326,7 @@ void CertificateManagerHandler::GetLocalizedValues( l10n_util::GetStringUTF16(IDS_CERT_MANAGER_DELETE_CA_DESCRIPTION)); localized_strings->SetString("unknownCertsTabDeleteConfirm", l10n_util::GetStringUTF16(IDS_CERT_MANAGER_DELETE_UNKNOWN_FORMAT)); - localized_strings->SetString("unknownCertsTabDeleteImpact", ""); + localized_strings->SetString("unknownCertsTabDeleteImpact", std::string()); // Certificate Restore overlay strings. localized_strings->SetString("certificateRestorePasswordDescription", @@ -614,7 +614,7 @@ void CertificateManagerHandler::ExportPersonalPasswordSelected( chrome::UnlockCertSlotIfNecessary( selected_cert_list_[0].get(), chrome::kCryptoModulePasswordCertExport, - "", // unused. + std::string(), // unused. base::Bind(&CertificateManagerHandler::ExportPersonalSlotsUnlocked, base::Unretained(this))); } @@ -723,7 +723,7 @@ void CertificateManagerHandler::ImportPersonalFileRead( chrome::UnlockSlotsIfNecessary( modules, chrome::kCryptoModulePasswordCertImport, - "", // unused. + std::string(), // unused. base::Bind(&CertificateManagerHandler::ImportPersonalSlotUnlocked, base::Unretained(this))); } diff --git a/chrome/browser/ui/webui/options/content_settings_handler.cc b/chrome/browser/ui/webui/options/content_settings_handler.cc index 85249bc..549856b 100644 --- a/chrome/browser/ui/webui/options/content_settings_handler.cc +++ b/chrome/browser/ui/webui/options/content_settings_handler.cc @@ -123,7 +123,7 @@ std::string ContentSettingToString(ContentSetting setting) { NOTREACHED(); } - return ""; + return std::string(); } ContentSetting ContentSettingFromString(const std::string& name) { @@ -151,8 +151,9 @@ DictionaryValue* GetExceptionForPage( DictionaryValue* exception = new DictionaryValue(); exception->SetString(kOrigin, pattern.ToString()); exception->SetString(kEmbeddingOrigin, - secondary_pattern == ContentSettingsPattern::Wildcard() ? "" : - secondary_pattern.ToString()); + secondary_pattern == ContentSettingsPattern::Wildcard() + ? std::string() + : secondary_pattern.ToString()); exception->SetString(kSetting, ContentSettingToString(setting)); exception->SetString(kSource, provider_name); return exception; @@ -604,7 +605,7 @@ void ContentSettingsHandler::UpdateMediaSettingsView() { media_ui_settings.SetString("askText", "mediaStreamAsk"); media_ui_settings.SetString("blockText", "mediaStreamBlock"); media_ui_settings.SetBoolean("showBubble", false); - media_ui_settings.SetString("bubbleText", ""); + media_ui_settings.SetString("bubbleText", std::string()); web_ui()->CallJavascriptFunction("ContentSettings.updateMediaUI", media_ui_settings); @@ -1052,18 +1053,16 @@ void ContentSettingsHandler::RemoveMediaException( mode == "normal" ? GetContentSettingsMap() : GetOTRContentSettingsMap(); if (settings_map) { - settings_map->SetWebsiteSetting( - ContentSettingsPattern::FromString(pattern), - ContentSettingsPattern::Wildcard(), - CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC, - "", - NULL); - settings_map->SetWebsiteSetting( - ContentSettingsPattern::FromString(pattern), - ContentSettingsPattern::Wildcard(), - CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA, - "", - NULL); + settings_map->SetWebsiteSetting(ContentSettingsPattern::FromString(pattern), + ContentSettingsPattern::Wildcard(), + CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC, + std::string(), + NULL); + settings_map->SetWebsiteSetting(ContentSettingsPattern::FromString(pattern), + ContentSettingsPattern::Wildcard(), + CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA, + std::string(), + NULL); } } @@ -1088,10 +1087,11 @@ void ContentSettingsHandler::RemoveExceptionFromHostContentSettingsMap( if (settings_map) { settings_map->SetWebsiteSetting( ContentSettingsPattern::FromString(pattern), - secondary_pattern.empty() ? ContentSettingsPattern::Wildcard() : - ContentSettingsPattern::FromString(secondary_pattern), + secondary_pattern.empty() + ? ContentSettingsPattern::Wildcard() + : ContentSettingsPattern::FromString(secondary_pattern), type, - "", + std::string(), NULL); } } @@ -1259,7 +1259,7 @@ void ContentSettingsHandler::SetException(const ListValue* args) { settings_map->SetContentSetting(ContentSettingsPattern::FromString(pattern), ContentSettingsPattern::Wildcard(), type, - "", + std::string(), ContentSettingFromString(setting)); } } diff --git a/chrome/browser/ui/webui/options/font_settings_handler.cc b/chrome/browser/ui/webui/options/font_settings_handler.cc index 61f1524..558effc 100644 --- a/chrome/browser/ui/webui/options/font_settings_handler.cc +++ b/chrome/browser/ui/webui/options/font_settings_handler.cc @@ -188,8 +188,8 @@ void FontSettingsHandler::FontsListHasLoaded( option->Append(new base::StringValue(has_rtl_chars ? "rtl" : "ltr")); } else { // Add empty name/value to indicate a separator item. - option->Append(new base::StringValue("")); - option->Append(new base::StringValue("")); + option->Append(new base::StringValue(std::string())); + option->Append(new base::StringValue(std::string())); } encoding_list.Append(option); } diff --git a/chrome/browser/ui/webui/options/managed_user_passphrase_handler.cc b/chrome/browser/ui/webui/options/managed_user_passphrase_handler.cc index 2090137..f3aac91 100644 --- a/chrome/browser/ui/webui/options/managed_user_passphrase_handler.cc +++ b/chrome/browser/ui/webui/options/managed_user_passphrase_handler.cc @@ -110,8 +110,8 @@ void ManagedUserPassphraseHandler::IsPassphraseSet( void ManagedUserPassphraseHandler::ResetPassphrase( const base::ListValue* args) { PrefService* pref_service = Profile::FromWebUI(web_ui())->GetPrefs(); - pref_service->SetString(prefs::kManagedModeLocalPassphrase, ""); - pref_service->SetString(prefs::kManagedModeLocalSalt, ""); + pref_service->SetString(prefs::kManagedModeLocalPassphrase, std::string()); + pref_service->SetString(prefs::kManagedModeLocalSalt, std::string()); } void ManagedUserPassphraseHandler::SetLocalPassphrase( diff --git a/chrome/browser/ui/webui/options/preferences_browsertest.cc b/chrome/browser/ui/webui/options/preferences_browsertest.cc index 5839538..8dbc971 100644 --- a/chrome/browser/ui/webui/options/preferences_browsertest.cc +++ b/chrome/browser/ui/webui/options/preferences_browsertest.cc @@ -343,7 +343,7 @@ void PreferencesBrowserTest::VerifySetPref(const std::string& name, std::string observed_json; ASSERT_TRUE(content::ExecuteScriptAndExtractString( render_view_host_, javascript.str(), &observed_json)); - VerifyObservedPref(observed_json, name, value, "", false, !commit); + VerifyObservedPref(observed_json, name, value, std::string(), false, !commit); VerifyAndClearExpectations(); } @@ -385,7 +385,7 @@ void PreferencesBrowserTest::VerifyCommit(const std::string& name, void PreferencesBrowserTest::VerifySetCommit(const std::string& name, const base::Value* value) { ExpectSetCommit(name, value); - VerifyCommit(name, value, ""); + VerifyCommit(name, value, std::string()); VerifyAndClearExpectations(); } @@ -476,8 +476,8 @@ IN_PROC_BROWSER_TEST_F(PreferencesBrowserTest, FetchPrefs) { // Verify notifications when default values are in effect. SetupJavaScriptTestEnvironment(pref_names_, &observed_json); - VerifyObservedPrefs(observed_json, pref_names_, default_values_, - "", false, false); + VerifyObservedPrefs( + observed_json, pref_names_, default_values_, std::string(), false, false); // Verify notifications when recommended values are in effect. SetUserPolicies(policy_names_, non_default_values_, @@ -497,8 +497,12 @@ IN_PROC_BROWSER_TEST_F(PreferencesBrowserTest, FetchPrefs) { ClearUserPolicies(); SetUserValues(pref_names_, non_default_values_); SetupJavaScriptTestEnvironment(pref_names_, &observed_json); - VerifyObservedPrefs(observed_json, pref_names_, non_default_values_, - "", false, false); + VerifyObservedPrefs(observed_json, + pref_names_, + non_default_values_, + std::string(), + false, + false); } // Verifies that setting a user-modified pref value through the JavaScript @@ -550,7 +554,7 @@ IN_PROC_BROWSER_TEST_F(PreferencesBrowserTest, DialogPrefsSetRollback) { ASSERT_NO_FATAL_FAILURE(SetupJavaScriptTestEnvironment(pref_names_, NULL)); for (size_t i = 0; i < pref_names_.size(); ++i) { VerifySetPref(pref_names_[i], types_[i], non_default_values_[i], false); - VerifyRollback(pref_names_[i], default_values_[i], ""); + VerifyRollback(pref_names_[i], default_values_[i], std::string()); } // Verify behavior when recommended values are in effect. @@ -592,7 +596,7 @@ IN_PROC_BROWSER_TEST_F(PreferencesBrowserTest, DialogPrefsClearRollback) { ASSERT_NO_FATAL_FAILURE(SetupJavaScriptTestEnvironment(pref_names_, NULL)); for (size_t i = 0; i < pref_names_.size(); ++i) { VerifyClearPref(pref_names_[i], default_values_[i], false); - VerifyRollback(pref_names_[i], non_default_values_[i], ""); + VerifyRollback(pref_names_[i], non_default_values_[i], std::string()); } } @@ -624,15 +628,19 @@ IN_PROC_BROWSER_TEST_F(PreferencesBrowserTest, NotificationsOnBackendChanges) { StartObserving(); ClearUserPolicies(); FinishObserving(&observed_json); - VerifyObservedPrefs(observed_json, pref_names_, default_values_, - "", false, false); + VerifyObservedPrefs( + observed_json, pref_names_, default_values_, std::string(), false, false); // Verify notifications when user-modified values come into effect. StartObserving(); SetUserValues(pref_names_, non_default_values_); FinishObserving(&observed_json); - VerifyObservedPrefs(observed_json, pref_names_, non_default_values_, - "", false, false); + VerifyObservedPrefs(observed_json, + pref_names_, + non_default_values_, + std::string(), + false, + false); } #if defined(OS_CHROMEOS) diff --git a/chrome/browser/ui/webui/policy_ui_browsertest.cc b/chrome/browser/ui/webui/policy_ui_browsertest.cc index 6af1613..6293fef 100644 --- a/chrome/browser/ui/webui/policy_ui_browsertest.cc +++ b/chrome/browser/ui/webui/policy_ui_browsertest.cc @@ -43,7 +43,7 @@ std::vector<std::string> PopulateExpectedPolicy( metadata->scope == policy::POLICY_SCOPE_MACHINE ? IDS_POLICY_SCOPE_DEVICE : IDS_POLICY_SCOPE_USER)); } else { - expected_policy.push_back(""); + expected_policy.push_back(std::string()); } // Populate expected level. @@ -52,7 +52,7 @@ std::vector<std::string> PopulateExpectedPolicy( metadata->level == policy::POLICY_LEVEL_RECOMMENDED ? IDS_POLICY_LEVEL_RECOMMENDED : IDS_POLICY_LEVEL_MANDATORY)); } else { - expected_policy.push_back(""); + expected_policy.push_back(std::string()); } // Populate expected policy name. @@ -178,7 +178,7 @@ IN_PROC_BROWSER_TEST_F(PolicyUITest, SendPolicyNames) { for (const policy::PolicyDefinitionList::Entry* policy = policies->begin; policy != policies->end; ++policy) { expected_policies.push_back( - PopulateExpectedPolicy(policy->name, "", NULL, false)); + PopulateExpectedPolicy(policy->name, std::string(), NULL, false)); } // Retrieve the contents of the policy table from the UI and verify that it @@ -240,7 +240,8 @@ IN_PROC_BROWSER_TEST_F(PolicyUITest, SendPolicyValues) { policy != policies->end; ++policy) { std::map<std::string, std::string>::const_iterator it = expected_values.find(policy->name); - const std::string value = it == expected_values.end() ? "" : it->second; + const std::string value = + it == expected_values.end() ? std::string() : it->second; const policy::PolicyMap::Entry* metadata = values.Get(policy->name); expected_policies.insert( metadata ? expected_policies.begin() + first_unset_position++ : diff --git a/chrome/browser/ui/webui/print_preview/print_preview_handler.cc b/chrome/browser/ui/webui/print_preview/print_preview_handler.cc index 0525da3..7899260 100644 --- a/chrome/browser/ui/webui/print_preview/print_preview_handler.cc +++ b/chrome/browser/ui/webui/print_preview/print_preview_handler.cc @@ -866,7 +866,7 @@ void PrintPreviewHandler::SelectFile(const base::FilePath& default_filename) { sticky_settings->save_path()->Append(default_filename), &file_type_info, 0, - FILE_PATH_LITERAL(""), + base::FilePath::StringType(), platform_util::GetTopLevel( preview_web_contents()->GetView()->GetNativeView()), NULL); diff --git a/chrome/browser/ui/webui/print_preview/print_preview_ui.cc b/chrome/browser/ui/webui/print_preview/print_preview_ui.cc index 52cbe91..4e10802 100644 --- a/chrome/browser/ui/webui/print_preview/print_preview_ui.cc +++ b/chrome/browser/ui/webui/print_preview/print_preview_ui.cc @@ -571,7 +571,7 @@ void PrintPreviewUI::OnClosePrintPreviewDialog() { ConstrainedWebDialogDelegate* delegate = GetConstrainedDelegate(); if (!delegate) return; - delegate->GetWebDialogDelegate()->OnDialogClosed(""); + delegate->GetWebDialogDelegate()->OnDialogClosed(std::string()); delegate->OnDialogCloseFromWebUI(); } diff --git a/chrome/browser/ui/webui/signin/profile_signin_confirmation_dialog_unittest.cc b/chrome/browser/ui/webui/signin/profile_signin_confirmation_dialog_unittest.cc index e24b730..cd6f5fe 100644 --- a/chrome/browser/ui/webui/signin/profile_signin_confirmation_dialog_unittest.cc +++ b/chrome/browser/ui/webui/signin/profile_signin_confirmation_dialog_unittest.cc @@ -142,11 +142,11 @@ class ProfileSigninConfirmationDialogTest : public testing::Test { false); // Create a dialog, but don't display it. - dialog_ = new ProfileSigninConfirmationDialog( - profile_.get(), "", - base::Bind(&base::DoNothing), - base::Bind(&base::DoNothing), - base::Bind(&base::DoNothing)); + dialog_ = new ProfileSigninConfirmationDialog(profile_.get(), + std::string(), + base::Bind(&base::DoNothing), + base::Bind(&base::DoNothing), + base::Bind(&base::DoNothing)); } virtual void TearDown() OVERRIDE { @@ -204,10 +204,10 @@ TEST_F(ProfileSigninConfirmationDialogTest, PromptForNewProfile_Extensions) { &ProfileSigninConfirmationDialog::CheckShouldPromptForNewProfile, base::Unretained(dialog_)))); - scoped_refptr<extensions::Extension> extension = CreateExtension("foo", ""); + scoped_refptr<extensions::Extension> extension = + CreateExtension("foo", std::string()); extensions->extension_prefs()->AddGrantedPermissions( - extension->id(), - make_scoped_refptr(new extensions::PermissionSet)); + extension->id(), make_scoped_refptr(new extensions::PermissionSet)); extensions->AddExtension(extension); EXPECT_TRUE( GetCallbackResult( diff --git a/chrome/browser/ui/webui/sync_setup_handler_unittest.cc b/chrome/browser/ui/webui/sync_setup_handler_unittest.cc index f958519..19f2d0e 100644 --- a/chrome/browser/ui/webui/sync_setup_handler_unittest.cc +++ b/chrome/browser/ui/webui/sync_setup_handler_unittest.cc @@ -457,8 +457,13 @@ TEST_P(SyncSetupHandlerTest, DisplayBasicLogin) { // Now make sure that the appropriate params are being passed. DictionaryValue* dictionary; ASSERT_TRUE(data.arg2->GetAsDictionary(&dictionary)); - CheckShowSyncSetupArgs( - dictionary, "", false, GoogleServiceAuthError::NONE, "", true, ""); + CheckShowSyncSetupArgs(dictionary, + std::string(), + false, + GoogleServiceAuthError::NONE, + std::string(), + true, + std::string()); } else { ASSERT_FALSE(handler_->is_configuring_sync()); ASSERT_TRUE(handler_->have_signin_tracker()); @@ -494,8 +499,13 @@ TEST_P(SyncSetupHandlerTest, DisplayForceLogin) { // Now make sure that the appropriate params are being passed. DictionaryValue* dictionary; ASSERT_TRUE(data.arg2->GetAsDictionary(&dictionary)); - CheckShowSyncSetupArgs( - dictionary, "", false, GoogleServiceAuthError::NONE, "", true, ""); + CheckShowSyncSetupArgs(dictionary, + std::string(), + false, + GoogleServiceAuthError::NONE, + std::string(), + true, + std::string()); } else { ASSERT_FALSE(handler_->is_configuring_sync()); ASSERT_TRUE(handler_->have_signin_tracker()); @@ -679,7 +689,7 @@ TEST_P(SyncSetupHandlerTest, HandleGaiaAuthFailure) { if (!SyncPromoUI::UseWebBasedSigninFlow()) { // Fake a failed signin attempt. - handler_->TryLogin(kTestUser, kTestPassword, "", ""); + handler_->TryLogin(kTestUser, kTestPassword, std::string(), std::string()); GoogleServiceAuthError error( GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS); handler_->SigninFailed(error); @@ -695,9 +705,13 @@ TEST_P(SyncSetupHandlerTest, HandleGaiaAuthFailure) { // Now make sure that the appropriate params are being passed. DictionaryValue* dictionary; ASSERT_TRUE(data.arg2->GetAsDictionary(&dictionary)); - CheckShowSyncSetupArgs( - dictionary, "", false, GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS, - kTestUser, true, ""); + CheckShowSyncSetupArgs(dictionary, + std::string(), + false, + GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS, + kTestUser, + true, + std::string()); } else { ASSERT_FALSE(handler_->is_configuring_sync()); ASSERT_TRUE(handler_->have_signin_tracker()); @@ -718,7 +732,7 @@ TEST_P(SyncSetupHandlerTest, HandleCaptcha) { if (!SyncPromoUI::UseWebBasedSigninFlow()) { // Fake a failed signin attempt that requires a captcha. - handler_->TryLogin(kTestUser, kTestPassword, "", ""); + handler_->TryLogin(kTestUser, kTestPassword, std::string(), std::string()); GoogleServiceAuthError error = GoogleServiceAuthError::FromClientLoginCaptchaChallenge( "token", GURL(kTestCaptchaImageUrl), GURL(kTestCaptchaUnlockUrl)); @@ -734,9 +748,13 @@ TEST_P(SyncSetupHandlerTest, HandleCaptcha) { // Now make sure that the appropriate params are being passed. DictionaryValue* dictionary; ASSERT_TRUE(data.arg2->GetAsDictionary(&dictionary)); - CheckShowSyncSetupArgs( - dictionary, "", false, GoogleServiceAuthError::CAPTCHA_REQUIRED, - kTestUser, true, kTestCaptchaImageUrl); + CheckShowSyncSetupArgs(dictionary, + std::string(), + false, + GoogleServiceAuthError::CAPTCHA_REQUIRED, + kTestUser, + true, + kTestCaptchaImageUrl); } else { ASSERT_FALSE(handler_->is_configuring_sync()); ASSERT_TRUE(handler_->have_signin_tracker()); @@ -758,7 +776,7 @@ TEST_P(SyncSetupHandlerTest, UnrecoverableErrorInitializingSync) { ASSERT_EQ(1U, web_ui_.call_data().size()); // Fake a successful GAIA request (gaia credentials valid, but signin not // complete yet). - handler_->TryLogin(kTestUser, kTestPassword, "", ""); + handler_->TryLogin(kTestUser, kTestPassword, std::string(), std::string()); handler_->GaiaCredentialsValid(); ASSERT_EQ(2U, web_ui_.call_data().size()); EXPECT_EQ("SyncSetupOverlay.showSuccessAndSettingUp", @@ -780,9 +798,13 @@ TEST_P(SyncSetupHandlerTest, UnrecoverableErrorInitializingSync) { // Now make sure that the appropriate params are being passed. DictionaryValue* dictionary; ASSERT_TRUE(data.arg2->GetAsDictionary(&dictionary)); - CheckShowSyncSetupArgs( - dictionary, "", true, GoogleServiceAuthError::NONE, - kTestUser, true, ""); + CheckShowSyncSetupArgs(dictionary, + std::string(), + true, + GoogleServiceAuthError::NONE, + kTestUser, + true, + std::string()); } else { ASSERT_FALSE(handler_->is_configuring_sync()); ASSERT_TRUE(handler_->have_signin_tracker()); @@ -803,7 +825,7 @@ TEST_P(SyncSetupHandlerTest, GaiaErrorInitializingSync) { ASSERT_EQ(1U, web_ui_.call_data().size()); // Fake a successful GAIA request (gaia credentials valid, but signin not // complete yet). - handler_->TryLogin(kTestUser, kTestPassword, "", ""); + handler_->TryLogin(kTestUser, kTestPassword, std::string(), std::string()); handler_->GaiaCredentialsValid(); ASSERT_EQ(2U, web_ui_.call_data().size()); EXPECT_EQ("SyncSetupOverlay.showSuccessAndSettingUp", @@ -826,9 +848,13 @@ TEST_P(SyncSetupHandlerTest, GaiaErrorInitializingSync) { // Now make sure that the appropriate params are being passed. DictionaryValue* dictionary; ASSERT_TRUE(data.arg2->GetAsDictionary(&dictionary)); - CheckShowSyncSetupArgs( - dictionary, "", false, GoogleServiceAuthError::SERVICE_UNAVAILABLE, - kTestUser, true, ""); + CheckShowSyncSetupArgs(dictionary, + std::string(), + false, + GoogleServiceAuthError::SERVICE_UNAVAILABLE, + kTestUser, + true, + std::string()); } else { ASSERT_FALSE(handler_->is_configuring_sync()); ASSERT_TRUE(handler_->have_signin_tracker()); @@ -837,7 +863,7 @@ TEST_P(SyncSetupHandlerTest, GaiaErrorInitializingSync) { TEST_P(SyncSetupHandlerTest, TestSyncEverything) { std::string args = GetConfiguration( - NULL, SYNC_ALL_DATA, GetAllTypes(), "", ENCRYPT_PASSWORDS); + NULL, SYNC_ALL_DATA, GetAllTypes(), std::string(), ENCRYPT_PASSWORDS); ListValue list_args; list_args.Append(new StringValue(args)); EXPECT_CALL(*mock_pss_, IsPassphraseRequiredForDecryption()) @@ -855,7 +881,7 @@ TEST_P(SyncSetupHandlerTest, TestSyncEverything) { TEST_P(SyncSetupHandlerTest, TurnOnEncryptAll) { std::string args = GetConfiguration( - NULL, SYNC_ALL_DATA, GetAllTypes(), "", ENCRYPT_ALL_DATA); + NULL, SYNC_ALL_DATA, GetAllTypes(), std::string(), ENCRYPT_ALL_DATA); ListValue list_args; list_args.Append(new StringValue(args)); EXPECT_CALL(*mock_pss_, IsPassphraseRequiredForDecryption()) @@ -874,7 +900,7 @@ TEST_P(SyncSetupHandlerTest, TurnOnEncryptAll) { TEST_P(SyncSetupHandlerTest, TestPassphraseStillRequired) { std::string args = GetConfiguration( - NULL, SYNC_ALL_DATA, GetAllTypes(), "", ENCRYPT_PASSWORDS); + NULL, SYNC_ALL_DATA, GetAllTypes(), std::string(), ENCRYPT_PASSWORDS); ListValue list_args; list_args.Append(new StringValue(args)); EXPECT_CALL(*mock_pss_, IsPassphraseRequiredForDecryption()) @@ -990,8 +1016,11 @@ TEST_P(SyncSetupHandlerTest, TestSyncIndividualTypes) { for (it = user_selectable_types.First(); it.Good(); it.Inc()) { syncer::ModelTypeSet type_to_set; type_to_set.Put(it.Get()); - std::string args = GetConfiguration( - NULL, CHOOSE_WHAT_TO_SYNC, type_to_set, "", ENCRYPT_PASSWORDS); + std::string args = GetConfiguration(NULL, + CHOOSE_WHAT_TO_SYNC, + type_to_set, + std::string(), + ENCRYPT_PASSWORDS); ListValue list_args; list_args.Append(new StringValue(args)); EXPECT_CALL(*mock_pss_, IsPassphraseRequiredForDecryption()) @@ -1010,8 +1039,11 @@ TEST_P(SyncSetupHandlerTest, TestSyncIndividualTypes) { } TEST_P(SyncSetupHandlerTest, TestSyncAllManually) { - std::string args = GetConfiguration( - NULL, CHOOSE_WHAT_TO_SYNC, GetAllTypes(), "", ENCRYPT_PASSWORDS); + std::string args = GetConfiguration(NULL, + CHOOSE_WHAT_TO_SYNC, + GetAllTypes(), + std::string(), + ENCRYPT_PASSWORDS); ListValue list_args; list_args.Append(new StringValue(args)); EXPECT_CALL(*mock_pss_, IsPassphraseRequiredForDecryption()) @@ -1074,12 +1106,12 @@ TEST_P(SyncSetupHandlerTest, ShowSyncSetupWithAuthError) { ASSERT_TRUE(data.arg2->GetAsDictionary(&dictionary)); // We should display a login screen with a non-editable username filled in. CheckShowSyncSetupArgs(dictionary, - "", + std::string(), false, GoogleServiceAuthError::NONE, kTestUser, false, - ""); + std::string()); } else { ASSERT_FALSE(handler_->is_configuring_sync()); ASSERT_TRUE(handler_->have_signin_tracker()); @@ -1244,9 +1276,9 @@ TEST_P(SyncSetupHandlerTest, SubmitAuthWithInvalidUsername) { DictionaryValue args; args.SetString("user", "user@not_allowed.com"); args.SetString("pass", "password"); - args.SetString("captcha", ""); - args.SetString("otp", ""); - args.SetString("accessCode", ""); + args.SetString("captcha", std::string()); + args.SetString("otp", std::string()); + args.SetString("accessCode", std::string()); std::string json; base::JSONWriter::Write(&args, &json); ListValue list_args; @@ -1267,8 +1299,13 @@ TEST_P(SyncSetupHandlerTest, SubmitAuthWithInvalidUsername) { DictionaryValue* dictionary; ASSERT_TRUE(data.arg2->GetAsDictionary(&dictionary)); std::string err = l10n_util::GetStringUTF8(IDS_SYNC_LOGIN_NAME_PROHIBITED); - CheckShowSyncSetupArgs( - dictionary, err, false, GoogleServiceAuthError::NONE, "", true, ""); + CheckShowSyncSetupArgs(dictionary, + err, + false, + GoogleServiceAuthError::NONE, + std::string(), + true, + std::string()); handler_->CloseSyncSetup(); EXPECT_EQ(NULL, LoginUIServiceFactory::GetForProfile( diff --git a/chrome/browser/ui/webui/version_ui.cc b/chrome/browser/ui/webui/version_ui.cc index 678492a..6497ae0 100644 --- a/chrome/browser/ui/webui/version_ui.cc +++ b/chrome/browser/ui/webui/version_ui.cc @@ -92,7 +92,7 @@ content::WebUIDataSource* CreateVersionUIDataSource(Profile* profile) { html_source->AddString("command_line", WideToUTF16(CommandLine::ForCurrentProcess()->GetCommandLineString())); #elif defined(OS_POSIX) - std::string command_line = ""; + std::string command_line; typedef std::vector<std::string> ArgvList; const ArgvList& argv = CommandLine::ForCurrentProcess()->argv(); for (ArgvList::const_iterator iter = argv.begin(); iter != argv.end(); iter++) |