diff options
author | avi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-25 07:29:24 +0000 |
---|---|---|
committer | avi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-25 07:29:24 +0000 |
commit | 3295612b187d98b8e64d508fc41595dcc614e8e8 (patch) | |
tree | 00ae8d654e8c9102c6e15188a625ce57580f0e0c | |
parent | 0ea152b98ef30f08442d8f6c74c820f6d0db85bd (diff) | |
download | chromium_src-3295612b187d98b8e64d508fc41595dcc614e8e8.zip chromium_src-3295612b187d98b8e64d508fc41595dcc614e8e8.tar.gz chromium_src-3295612b187d98b8e64d508fc41595dcc614e8e8.tar.bz2 |
Update uses of UTF conversions in content/ to use the base:: namespace.
BUG=330556
TEST=no change
TBR=ben@chromium.org
Review URL: https://codereview.chromium.org/121033002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@242483 0039d316-1c4b-4281-b951-d872f2087c98
197 files changed, 614 insertions, 537 deletions
diff --git a/content/browser/accessibility/accessibility_tree_formatter.cc b/content/browser/accessibility/accessibility_tree_formatter.cc index af33a42..999476f 100644 --- a/content/browser/accessibility/accessibility_tree_formatter.cc +++ b/content/browser/accessibility/accessibility_tree_formatter.cc @@ -79,7 +79,7 @@ void AccessibilityTreeFormatter::RecursiveFormatAccessibilityTree( const base::DictionaryValue& dict, base::string16* contents, int depth) { base::string16 line = ToString(dict, base::string16(depth * kIndentSpaces, ' ')); - if (line.find(ASCIIToUTF16(kSkipString)) != base::string16::npos) + if (line.find(base::ASCIIToUTF16(kSkipString)) != base::string16::npos) return; *contents += line; @@ -105,7 +105,7 @@ base::string16 AccessibilityTreeFormatter::ToString( int id_value; node.GetInteger("id", &id_value); return indent + base::IntToString16(id_value) + - ASCIIToUTF16("\n"); + base::ASCIIToUTF16("\n"); } void AccessibilityTreeFormatter::Initialize() {} @@ -152,7 +152,7 @@ bool AccessibilityTreeFormatter::MatchesFilters( if (iter->type == Filter::ALLOW_EMPTY) allow = true; else if (iter->type == Filter::ALLOW) - allow = (!MatchPattern(text, UTF8ToUTF16("*=''"))); + allow = (!MatchPattern(text, base::UTF8ToUTF16("*=''"))); else allow = false; } @@ -168,12 +168,12 @@ base::string16 AccessibilityTreeFormatter::FormatCoordinates( value.GetInteger(y_name, &y); std::string xy_str(base::StringPrintf("%s=(%d, %d)", name, x, y)); - return UTF8ToUTF16(xy_str); + return base::UTF8ToUTF16(xy_str); } void AccessibilityTreeFormatter::WriteAttribute( bool include_by_default, const std::string& attr, base::string16* line) { - WriteAttribute(include_by_default, UTF8ToUTF16(attr), line); + WriteAttribute(include_by_default, base::UTF8ToUTF16(attr), line); } void AccessibilityTreeFormatter::WriteAttribute( @@ -183,7 +183,7 @@ void AccessibilityTreeFormatter::WriteAttribute( if (!MatchesFilters(attr, include_by_default)) return; if (!line->empty()) - *line += ASCIIToUTF16(" "); + *line += base::ASCIIToUTF16(" "); *line += attr; } diff --git a/content/browser/accessibility/accessibility_tree_formatter_android.cc b/content/browser/accessibility/accessibility_tree_formatter_android.cc index 8ec3ecf..33b5196 100644 --- a/content/browser/accessibility/accessibility_tree_formatter_android.cc +++ b/content/browser/accessibility/accessibility_tree_formatter_android.cc @@ -122,7 +122,7 @@ base::string16 AccessibilityTreeFormatter::ToString( base::string16 class_value; dict.GetString("class", &class_value); - WriteAttribute(true, UTF16ToUTF8(class_value), &line); + WriteAttribute(true, base::UTF16ToUTF8(class_value), &line); for (unsigned i = 0; i < arraysize(BOOL_ATTRIBUTES); i++) { const char* attribute_name = BOOL_ATTRIBUTES[i]; @@ -151,7 +151,7 @@ base::string16 AccessibilityTreeFormatter::ToString( &line); } - return indent + line + ASCIIToUTF16("\n"); + return indent + line + base::ASCIIToUTF16("\n"); } // static diff --git a/content/browser/accessibility/accessibility_tree_formatter_gtk.cc b/content/browser/accessibility/accessibility_tree_formatter_gtk.cc index c930e0d..3891182 100644 --- a/content/browser/accessibility/accessibility_tree_formatter_gtk.cc +++ b/content/browser/accessibility/accessibility_tree_formatter_gtk.cc @@ -74,7 +74,7 @@ base::string16 AccessibilityTreeFormatter::ToString( base::StringPrintf("id=%d", id_value), &line); - return indent + line + ASCIIToUTF16("\n"); + return indent + line + base::ASCIIToUTF16("\n"); } void AccessibilityTreeFormatter::Initialize() {} diff --git a/content/browser/accessibility/accessibility_tree_formatter_mac.mm b/content/browser/accessibility/accessibility_tree_formatter_mac.mm index 021b5fd..230cd8d 100644 --- a/content/browser/accessibility/accessibility_tree_formatter_mac.mm +++ b/content/browser/accessibility/accessibility_tree_formatter_mac.mm @@ -171,7 +171,7 @@ base::string16 AccessibilityTreeFormatter::ToString( nil]; string s_value; dict.GetString(SysNSStringToUTF8(NSAccessibilityRoleAttribute), &s_value); - WriteAttribute(true, UTF8ToUTF16(s_value), &line); + WriteAttribute(true, base::UTF8ToUTF16(s_value), &line); string subroleAttribute = SysNSStringToUTF8(NSAccessibilitySubroleAttribute); if (dict.GetString(subroleAttribute, &s_value)) { @@ -218,7 +218,7 @@ base::string16 AccessibilityTreeFormatter::ToString( &line); } - return indent + line + ASCIIToUTF16("\n"); + return indent + line + base::ASCIIToUTF16("\n"); } // static diff --git a/content/browser/accessibility/accessibility_tree_formatter_win.cc b/content/browser/accessibility/accessibility_tree_formatter_win.cc index c50b526..401f89b 100644 --- a/content/browser/accessibility/accessibility_tree_formatter_win.cc +++ b/content/browser/accessibility/accessibility_tree_formatter_win.cc @@ -90,7 +90,7 @@ void AccessibilityTreeFormatter::AddProperties( for (std::vector<base::string16>::const_iterator it = state_strings.begin(); it != state_strings.end(); ++it) { - states->AppendString(UTF16ToUTF8(*it)); + states->AppendString(base::UTF16ToUTF8(*it)); } dict->Set("states", states); @@ -99,7 +99,7 @@ void AccessibilityTreeFormatter::AddProperties( for (std::vector<base::string16>::const_iterator it = ia2_attributes.begin(); it != ia2_attributes.end(); ++it) { - attributes->AppendString(UTF16ToUTF8(*it)); + attributes->AppendString(base::UTF16ToUTF8(*it)); } dict->Set("attributes", attributes); @@ -206,7 +206,7 @@ base::string16 AccessibilityTreeFormatter::ToString( base::string16 role_value; dict.GetString("role", &role_value); - WriteAttribute(true, UTF16ToUTF8(role_value), &line); + WriteAttribute(true, base::UTF16ToUTF8(role_value), &line); base::string16 name_value; dict.GetString("name", &name_value); @@ -225,7 +225,7 @@ base::string16 AccessibilityTreeFormatter::ToString( value->GetAsString(&string_value); WriteAttribute(false, StringPrintf(L"%ls='%ls'", - UTF8ToUTF16(attribute_name).c_str(), + base::UTF8ToUTF16(attribute_name).c_str(), string_value.c_str()), &line); break; @@ -235,7 +235,8 @@ base::string16 AccessibilityTreeFormatter::ToString( value->GetAsInteger(&int_value); WriteAttribute(false, base::StringPrintf(L"%ls=%d", - UTF8ToUTF16(attribute_name).c_str(), + base::UTF8ToUTF16( + attribute_name).c_str(), int_value), &line); break; @@ -245,7 +246,8 @@ base::string16 AccessibilityTreeFormatter::ToString( value->GetAsDouble(&double_value); WriteAttribute(false, base::StringPrintf(L"%ls=%.2f", - UTF8ToUTF16(attribute_name).c_str(), + base::UTF8ToUTF16( + attribute_name).c_str(), double_value), &line); break; @@ -287,7 +289,7 @@ base::string16 AccessibilityTreeFormatter::ToString( } } - return indent + line + ASCIIToUTF16("\n"); + return indent + line + base::ASCIIToUTF16("\n"); } // static diff --git a/content/browser/accessibility/accessibility_ui.cc b/content/browser/accessibility/accessibility_ui.cc index 5203af6..2937838 100644 --- a/content/browser/accessibility/accessibility_ui.cc +++ b/content/browser/accessibility/accessibility_ui.cc @@ -75,7 +75,7 @@ base::DictionaryValue* BuildTargetDescriptor(RenderViewHost* rvh) { // TODO(nasko): Fix the following code to use a consistent set of data // across the URL, title, and favicon. url = web_contents->GetURL(); - title = UTF16ToUTF8(web_contents->GetTitle()); + title = base::UTF16ToUTF8(web_contents->GetTitle()); NavigationController& controller = web_contents->GetController(); NavigationEntry* entry = controller.GetVisibleEntry(); if (entry != NULL && entry->GetURL().is_valid()) @@ -244,13 +244,14 @@ void AccessibilityUI::RequestAccessibilityTree(const base::ListValue* args) { } std::vector<AccessibilityTreeFormatter::Filter> filters; filters.push_back(AccessibilityTreeFormatter::Filter( - ASCIIToUTF16("*"), + base::ASCIIToUTF16("*"), AccessibilityTreeFormatter::Filter::ALLOW)); formatter->SetFilters(filters); formatter->FormatAccessibilityTree(&accessibility_contents_utf16); result->Set("tree", - new base::StringValue(UTF16ToUTF8(accessibility_contents_utf16))); + new base::StringValue( + base::UTF16ToUTF8(accessibility_contents_utf16))); web_ui()->CallJavascriptFunction("accessibility.showTree", *(result.get())); } diff --git a/content/browser/accessibility/accessibility_win_browsertest.cc b/content/browser/accessibility/accessibility_win_browsertest.cc index bb35348..b94e145 100644 --- a/content/browser/accessibility/accessibility_win_browsertest.cc +++ b/content/browser/accessibility/accessibility_win_browsertest.cc @@ -91,7 +91,7 @@ void RecursiveFindNodeInAccessibilityTree(IAccessible* node, // on the bots, this is really helpful in figuring out why. for (int i = 0; i < depth; i++) printf(" "); - printf("role=%d name=%s\n", V_I4(&role), WideToUTF8(name).c_str()); + printf("role=%d name=%s\n", V_I4(&role), base::WideToUTF8(name).c_str()); if (expected_role == V_I4(&role) && expected_name == name) { *found = true; @@ -286,7 +286,8 @@ void AccessibleChecker::AppendExpectedChild( } void AccessibleChecker::CheckAccessible(IAccessible* accessible) { - SCOPED_TRACE("while checking " + UTF16ToUTF8(RoleVariantToString(role_))); + SCOPED_TRACE("while checking " + + base::UTF16ToUTF8(RoleVariantToString(role_))); CheckAccessibleName(accessible); CheckAccessibleRole(accessible); CheckIA2Role(accessible); diff --git a/content/browser/accessibility/browser_accessibility.cc b/content/browser/accessibility/browser_accessibility.cc index 8429664..1fa15e0 100644 --- a/content/browser/accessibility/browser_accessibility.cc +++ b/content/browser/accessibility/browser_accessibility.cc @@ -481,7 +481,7 @@ base::string16 BrowserAccessibility::GetString16Attribute( std::string value_utf8; if (!GetStringAttribute(attribute, &value_utf8)) return base::string16(); - return UTF8ToUTF16(value_utf8); + return base::UTF8ToUTF16(value_utf8); } bool BrowserAccessibility::GetString16Attribute( @@ -490,7 +490,7 @@ bool BrowserAccessibility::GetString16Attribute( std::string value_utf8; if (!GetStringAttribute(attribute, &value_utf8)) return false; - *value = UTF8ToUTF16(value_utf8); + *value = base::UTF8ToUTF16(value_utf8); return true; } @@ -558,7 +558,7 @@ bool BrowserAccessibility::GetHtmlAttribute( std::string value_utf8; if (!GetHtmlAttribute(html_attr, &value_utf8)) return false; - *value = UTF8ToUTF16(value_utf8); + *value = base::UTF8ToUTF16(value_utf8); return true; } diff --git a/content/browser/accessibility/browser_accessibility_android.cc b/content/browser/accessibility/browser_accessibility_android.cc index 444aee2..b070475 100644 --- a/content/browser/accessibility/browser_accessibility_android.cc +++ b/content/browser/accessibility/browser_accessibility_android.cc @@ -284,13 +284,13 @@ base::string16 BrowserAccessibilityAndroid::GetText() const { case blink::WebAXRoleImageMapLink: case blink::WebAXRoleLink: if (!text.empty()) - text += ASCIIToUTF16(" "); - text += ASCIIToUTF16("Link"); + text += base::ASCIIToUTF16(" "); + text += base::ASCIIToUTF16("Link"); break; case blink::WebAXRoleHeading: // Only append "heading" if this node already has text. if (!text.empty()) - text += ASCIIToUTF16(" Heading"); + text += base::ASCIIToUTF16(" Heading"); break; } @@ -562,7 +562,7 @@ bool BrowserAccessibilityAndroid::HasOnlyStaticTextChildren() const { bool BrowserAccessibilityAndroid::IsIframe() const { base::string16 html_tag = GetString16Attribute( AccessibilityNodeData::ATTR_HTML_TAG); - return html_tag == ASCIIToUTF16("iframe"); + return html_tag == base::ASCIIToUTF16("iframe"); } void BrowserAccessibilityAndroid::PostInitialize() { diff --git a/content/browser/accessibility/browser_accessibility_cocoa.mm b/content/browser/accessibility/browser_accessibility_cocoa.mm index 9364dbb..6164f8a 100644 --- a/content/browser/accessibility/browser_accessibility_cocoa.mm +++ b/content/browser/accessibility/browser_accessibility_cocoa.mm @@ -1299,7 +1299,7 @@ NSDictionary* attributeToMethodNameMap = nil; base::string16 parentRole; browserAccessibility_->parent()->GetHtmlAttribute( "role", &parentRole); - const base::string16 treegridRole(ASCIIToUTF16("treegrid")); + const base::string16 treegridRole(base::ASCIIToUTF16("treegrid")); if (parentRole == treegridRole) { [ret addObjectsFromArray:[NSArray arrayWithObjects: NSAccessibilityDisclosingAttribute, diff --git a/content/browser/accessibility/browser_accessibility_win.cc b/content/browser/accessibility/browser_accessibility_win.cc index f3520da..8b3098d 100644 --- a/content/browser/accessibility/browser_accessibility_win.cc +++ b/content/browser/accessibility/browser_accessibility_win.cc @@ -480,7 +480,7 @@ STDMETHODIMP BrowserAccessibilityWin::get_accName(VARIANT var_id, BSTR* name) { if (name_str.empty()) return S_FALSE; - *name = SysAllocString(UTF8ToUTF16(name_str).c_str()); + *name = SysAllocString(base::UTF8ToUTF16(name_str).c_str()); DCHECK(*name); return S_OK; @@ -591,7 +591,7 @@ STDMETHODIMP BrowserAccessibilityWin::get_accValue(VARIANT var_id, return S_OK; } - *value = SysAllocString(UTF8ToUTF16(target->value()).c_str()); + *value = SysAllocString(base::UTF8ToUTF16(target->value()).c_str()); DCHECK(*value); return S_OK; } @@ -905,7 +905,7 @@ STDMETHODIMP BrowserAccessibilityWin::get_appName(BSTR* app_name) { DCHECK_EQ(2U, product_components.size()); if (product_components.size() != 2) return E_FAIL; - *app_name = SysAllocString(UTF8ToUTF16(product_components[0]).c_str()); + *app_name = SysAllocString(base::UTF8ToUTF16(product_components[0]).c_str()); DCHECK(*app_name); return *app_name ? S_OK : E_FAIL; } @@ -924,7 +924,8 @@ STDMETHODIMP BrowserAccessibilityWin::get_appVersion(BSTR* app_version) { DCHECK_EQ(2U, product_components.size()); if (product_components.size() != 2) return E_FAIL; - *app_version = SysAllocString(UTF8ToUTF16(product_components[1]).c_str()); + *app_version = + SysAllocString(base::UTF8ToUTF16(product_components[1]).c_str()); DCHECK(*app_version); return *app_version ? S_OK : E_FAIL; } @@ -953,7 +954,7 @@ STDMETHODIMP BrowserAccessibilityWin::get_toolkitVersion( return E_INVALIDARG; std::string user_agent = GetContentClient()->GetUserAgent(); - *toolkit_version = SysAllocString(UTF8ToUTF16(user_agent).c_str()); + *toolkit_version = SysAllocString(base::UTF8ToUTF16(user_agent).c_str()); DCHECK(*toolkit_version); return *toolkit_version ? S_OK : E_FAIL; } @@ -2435,7 +2436,7 @@ STDMETHODIMP BrowserAccessibilityWin::get_nodeInfo( *node_name = NULL; *name_space_id = 0; - *node_value = SysAllocString(UTF8ToUTF16(value()).c_str()); + *node_value = SysAllocString(base::UTF8ToUTF16(value()).c_str()); *num_children = PlatformChildCount(); *unique_id = unique_id_win_; @@ -2469,10 +2470,10 @@ STDMETHODIMP BrowserAccessibilityWin::get_attributes( for (unsigned short i = 0; i < *num_attribs; ++i) { attrib_names[i] = SysAllocString( - UTF8ToUTF16(html_attributes()[i].first).c_str()); + base::UTF8ToUTF16(html_attributes()[i].first).c_str()); name_space_id[i] = 0; attrib_values[i] = SysAllocString( - UTF8ToUTF16(html_attributes()[i].second).c_str()); + base::UTF8ToUTF16(html_attributes()[i].second).c_str()); } return S_OK; } @@ -2491,11 +2492,11 @@ STDMETHODIMP BrowserAccessibilityWin::get_attributesForNames( for (unsigned short i = 0; i < num_attribs; ++i) { name_space_id[i] = 0; bool found = false; - std::string name = UTF16ToUTF8((LPCWSTR)attrib_names[i]); + std::string name = base::UTF16ToUTF8((LPCWSTR)attrib_names[i]); for (unsigned int j = 0; j < html_attributes().size(); ++j) { if (html_attributes()[j].first == name) { attrib_values[i] = SysAllocString( - UTF8ToUTF16(html_attributes()[j].second).c_str()); + base::UTF8ToUTF16(html_attributes()[j].second).c_str()); found = true; break; } @@ -3081,7 +3082,7 @@ void BrowserAccessibilityWin::PostInitialize() { for (unsigned int i = 0; i < PlatformChildCount(); ++i) { BrowserAccessibility* child = PlatformGetChild(i); if (child->role() == blink::WebAXRoleStaticText) { - hypertext_ += UTF8ToUTF16(child->name()); + hypertext_ += base::UTF8ToUTF16(child->name()); } else { hyperlink_offset_to_index_[hypertext_.size()] = hyperlinks_.size(); hypertext_ += kEmbeddedCharacter; @@ -3216,7 +3217,7 @@ void BrowserAccessibilityWin::StringAttributeToIA2( const char* ia2_attr) { base::string16 value; if (GetString16Attribute(attribute, &value)) - ia2_attributes_.push_back(ASCIIToUTF16(ia2_attr) + L":" + value); + ia2_attributes_.push_back(base::ASCIIToUTF16(ia2_attr) + L":" + value); } void BrowserAccessibilityWin::BoolAttributeToIA2( @@ -3224,7 +3225,7 @@ void BrowserAccessibilityWin::BoolAttributeToIA2( const char* ia2_attr) { bool value; if (GetBoolAttribute(attribute, &value)) { - ia2_attributes_.push_back((ASCIIToUTF16(ia2_attr) + L":") + + ia2_attributes_.push_back((base::ASCIIToUTF16(ia2_attr) + L":") + (value ? L"true" : L"false")); } } @@ -3234,27 +3235,27 @@ void BrowserAccessibilityWin::IntAttributeToIA2( const char* ia2_attr) { int value; if (GetIntAttribute(attribute, &value)) { - ia2_attributes_.push_back(ASCIIToUTF16(ia2_attr) + L":" + + ia2_attributes_.push_back(base::ASCIIToUTF16(ia2_attr) + L":" + base::IntToString16(value)); } } base::string16 BrowserAccessibilityWin::GetValueText() { float fval; - base::string16 value = UTF8ToUTF16(this->value()); + base::string16 value = base::UTF8ToUTF16(this->value()); if (value.empty() && GetFloatAttribute(AccessibilityNodeData::ATTR_VALUE_FOR_RANGE, &fval)) { - value = UTF8ToUTF16(base::DoubleToString(fval)); + value = base::UTF8ToUTF16(base::DoubleToString(fval)); } return value; } base::string16 BrowserAccessibilityWin::TextForIAccessibleText() { if (IsEditableText()) - return UTF8ToUTF16(value()); + return base::UTF8ToUTF16(value()); return (blink_role() == blink::WebAXRoleStaticText) ? - UTF8ToUTF16(name()) : hypertext_; + base::UTF8ToUTF16(name()) : hypertext_; } void BrowserAccessibilityWin::HandleSpecialTextOffset( diff --git a/content/browser/accessibility/browser_accessibility_win_unittest.cc b/content/browser/accessibility/browser_accessibility_win_unittest.cc index 408fb4df..53d0076 100644 --- a/content/browser/accessibility/browser_accessibility_win_unittest.cc +++ b/content/browser/accessibility/browser_accessibility_win_unittest.cc @@ -549,7 +549,7 @@ TEST_F(BrowserAccessibilityTest, TestComplexHypertext) { const std::string embed = base::UTF16ToUTF8( BrowserAccessibilityWin::kEmbeddedCharacter); EXPECT_EQ(text1_name + embed + text2_name + embed, - UTF16ToUTF8(base::string16(text))); + base::UTF16ToUTF8(base::string16(text))); text.Reset(); long hyperlink_count; diff --git a/content/browser/accessibility/dump_accessibility_tree_browsertest.cc b/content/browser/accessibility/dump_accessibility_tree_browsertest.cc index 8cceea7..cfb0a27 100644 --- a/content/browser/accessibility/dump_accessibility_tree_browsertest.cc +++ b/content/browser/accessibility/dump_accessibility_tree_browsertest.cc @@ -88,9 +88,9 @@ class DumpAccessibilityTreeTest : public ContentBrowserTest { } void AddDefaultFilters(std::vector<Filter>* filters) { - filters->push_back(Filter(ASCIIToUTF16("FOCUSABLE"), Filter::ALLOW)); - filters->push_back(Filter(ASCIIToUTF16("READONLY"), Filter::ALLOW)); - filters->push_back(Filter(ASCIIToUTF16("*=''"), Filter::DENY)); + filters->push_back(Filter(base::ASCIIToUTF16("FOCUSABLE"), Filter::ALLOW)); + filters->push_back(Filter(base::ASCIIToUTF16("READONLY"), Filter::ALLOW)); + filters->push_back(Filter(base::ASCIIToUTF16("*=''"), Filter::DENY)); } void ParseFilters(const std::string& test_html, @@ -109,13 +109,15 @@ class DumpAccessibilityTreeTest : public ContentBrowserTest { AccessibilityTreeFormatter::GetDenyString(); if (StartsWithASCII(line, allow_empty_str, true)) { filters->push_back( - Filter(UTF8ToUTF16(line.substr(allow_empty_str.size())), + Filter(base::UTF8ToUTF16(line.substr(allow_empty_str.size())), Filter::ALLOW_EMPTY)); } else if (StartsWithASCII(line, allow_str, true)) { - filters->push_back(Filter(UTF8ToUTF16(line.substr(allow_str.size())), + filters->push_back(Filter(base::UTF8ToUTF16( + line.substr(allow_str.size())), Filter::ALLOW)); } else if (StartsWithASCII(line, deny_str, true)) { - filters->push_back(Filter(UTF8ToUTF16(line.substr(deny_str.size())), + filters->push_back(Filter(base::UTF8ToUTF16( + line.substr(deny_str.size())), Filter::DENY)); } } @@ -170,7 +172,7 @@ void DumpAccessibilityTreeTest::RunTest( // Load the page. base::string16 html_contents16; - html_contents16 = UTF8ToUTF16(html_contents); + html_contents16 = base::UTF8ToUTF16(html_contents); GURL url = GetTestUrl("accessibility", html_file.BaseName().MaybeAsASCII().c_str()); AccessibilityNotificationWaiter waiter( @@ -193,7 +195,7 @@ void DumpAccessibilityTreeTest::RunTest( // Perform a diff (or write the initial baseline). base::string16 actual_contents_utf16; formatter.FormatAccessibilityTree(&actual_contents_utf16); - std::string actual_contents = UTF16ToUTF8(actual_contents_utf16); + std::string actual_contents = base::UTF16ToUTF8(actual_contents_utf16); std::vector<std::string> actual_lines, expected_lines; Tokenize(actual_contents, "\n", &actual_lines); Tokenize(expected_contents, "\n", &expected_lines); diff --git a/content/browser/android/content_view_core_impl.cc b/content/browser/android/content_view_core_impl.cc index fd808fe..c5a833d 100644 --- a/content/browser/android/content_view_core_impl.cc +++ b/content/browser/android/content_view_core_impl.cc @@ -427,7 +427,7 @@ void ContentViewCoreImpl::SetTitle(const base::string16& title) { if (obj.is_null()) return; ScopedJavaLocalRef<jstring> jtitle = - ConvertUTF8ToJavaString(env, UTF16ToUTF8(title)); + ConvertUTF8ToJavaString(env, base::UTF16ToUTF8(title)); Java_ContentViewCore_setTitle(env, obj.obj(), jtitle.obj()); } diff --git a/content/browser/browser_plugin/browser_plugin_guest.cc b/content/browser/browser_plugin/browser_plugin_guest.cc index f2ac061..065dcec 100644 --- a/content/browser/browser_plugin/browser_plugin_guest.cc +++ b/content/browser/browser_plugin/browser_plugin_guest.cc @@ -221,7 +221,7 @@ class BrowserPluginGuest::JavaScriptDialogRequest : public PermissionRequest { virtual void Respond(bool should_allow, const std::string& user_input) OVERRIDE { - callback_.Run(should_allow, UTF8ToUTF16(user_input)); + callback_.Run(should_allow, base::UTF8ToUTF16(user_input)); } private: @@ -829,7 +829,7 @@ void BrowserPluginGuest::WebContentsCreated(WebContents* source_contents, static_cast<WebContentsImpl*>(new_contents); BrowserPluginGuest* guest = new_contents_impl->GetBrowserPluginGuest(); guest->opener_ = AsWeakPtr(); - std::string guest_name = UTF16ToUTF8(frame_name); + std::string guest_name = base::UTF16ToUTF8(frame_name); guest->name_ = guest_name; // Take ownership of the new guest until it is attached to the embedder's DOM // tree to avoid leaking a guest if this guest is destroyed before attaching @@ -1078,7 +1078,7 @@ void BrowserPluginGuest::DidStopLoading(RenderViewHost* render_view_host) { " window.event.preventDefault(); " "});"; render_view_host->ExecuteJavascriptInWebFrame(base::string16(), - ASCIIToUTF16(script)); + base::ASCIIToUTF16(script)); } } @@ -1308,7 +1308,7 @@ void BrowserPluginGuest::OnImeSetComposition( int selection_start, int selection_end) { Send(new ViewMsg_ImeSetComposition(routing_id(), - UTF8ToUTF16(text), underlines, + base::UTF8ToUTF16(text), underlines, selection_start, selection_end)); } @@ -1317,7 +1317,7 @@ void BrowserPluginGuest::OnImeConfirmComposition( const std::string& text, bool keep_selection) { Send(new ViewMsg_ImeConfirmComposition(routing_id(), - UTF8ToUTF16(text), + base::UTF8ToUTF16(text), gfx::Range::InvalidRange(), keep_selection)); } @@ -1715,10 +1715,10 @@ void BrowserPluginGuest::RunJavaScriptDialog( base::DictionaryValue request_info; request_info.Set( browser_plugin::kDefaultPromptText, - base::Value::CreateStringValue(UTF16ToUTF8(default_prompt_text))); + base::Value::CreateStringValue(base::UTF16ToUTF8(default_prompt_text))); request_info.Set( browser_plugin::kMessageText, - base::Value::CreateStringValue(UTF16ToUTF8(message_text))); + base::Value::CreateStringValue(base::UTF16ToUTF8(message_text))); request_info.Set( browser_plugin::kMessageType, base::Value::CreateStringValue( diff --git a/content/browser/browser_plugin/browser_plugin_host_browsertest.cc b/content/browser/browser_plugin/browser_plugin_host_browsertest.cc index 5096aef..90fdfe9 100644 --- a/content/browser/browser_plugin/browser_plugin_host_browsertest.cc +++ b/content/browser/browser_plugin/browser_plugin_host_browsertest.cc @@ -39,6 +39,7 @@ #include "net/test/spawned_test_server/spawned_test_server.h" #include "third_party/WebKit/public/web/WebInputEvent.h" +using base::ASCIIToUTF16; using blink::WebInputEvent; using blink::WebMouseEvent; using content::BrowserPluginEmbedder; @@ -953,7 +954,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, InputMethod) { { ExecuteSyncJSFunction(guest_rvh, "document.getElementById('input1').focus();"); - base::string16 expected_title = UTF8ToUTF16("InputTest123"); + base::string16 expected_title = base::UTF8ToUTF16("InputTest123"); content::TitleWatcher title_watcher(test_guest()->web_contents(), expected_title); embedder_rvh->Send( @@ -967,7 +968,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, InputMethod) { } // A composition is committed via IME. { - base::string16 expected_title = UTF8ToUTF16("InputTest456"); + base::string16 expected_title = base::UTF8ToUTF16("InputTest456"); content::TitleWatcher title_watcher(test_guest()->web_contents(), expected_title); embedder_rvh->Send( @@ -984,7 +985,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, InputMethod) { { ExecuteSyncJSFunction(guest_rvh, "document.getElementById('input1').value = '';"); - base::string16 composition = UTF8ToUTF16("InputTest789"); + base::string16 composition = base::UTF8ToUTF16("InputTest789"); content::TitleWatcher title_watcher(test_guest()->web_contents(), composition); embedder_rvh->Send( @@ -1005,7 +1006,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, InputMethod) { guest_rvh, "document.getElementById('input1').value"); std::string result; ASSERT_TRUE(value->GetAsString(&result)); - EXPECT_EQ(UTF16ToUTF8(composition), result); + EXPECT_EQ(base::UTF16ToUTF8(composition), result); } // Tests ExtendSelectionAndDelete message works in browser_plugin. { @@ -1016,7 +1017,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, InputMethod) { "i.value = 'InputTestABC';" "i.selectionStart=6;" "i.selectionEnd=6;"); - base::string16 expected_value = UTF8ToUTF16("InputABC"); + base::string16 expected_value = base::UTF8ToUTF16("InputABC"); content::TitleWatcher title_watcher(test_guest()->web_contents(), expected_value); // Delete 'Test' in 'InputTestABC', as the caret is after 'T': @@ -1032,7 +1033,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, InputMethod) { guest_rvh, "document.getElementById('input1').value"); std::string actual_value; ASSERT_TRUE(value->GetAsString(&actual_value)); - EXPECT_EQ(UTF16ToUTF8(expected_value), actual_value); + EXPECT_EQ(base::UTF16ToUTF8(expected_value), actual_value); } } diff --git a/content/browser/dom_storage/dom_storage_area_unittest.cc b/content/browser/dom_storage/dom_storage_area_unittest.cc index 697f625..c4d290c 100644 --- a/content/browser/dom_storage/dom_storage_area_unittest.cc +++ b/content/browser/dom_storage/dom_storage_area_unittest.cc @@ -18,8 +18,9 @@ #include "content/common/dom_storage/dom_storage_types.h" #include "testing/gtest/include/gtest/gtest.h" -namespace content { +using base::ASCIIToUTF16; +namespace content { class DOMStorageAreaTest : public testing::Test { public: diff --git a/content/browser/dom_storage/dom_storage_context_impl_unittest.cc b/content/browser/dom_storage/dom_storage_context_impl_unittest.cc index ba8d8e9..7e33b73 100644 --- a/content/browser/dom_storage/dom_storage_context_impl_unittest.cc +++ b/content/browser/dom_storage/dom_storage_context_impl_unittest.cc @@ -20,6 +20,8 @@ #include "testing/gtest/include/gtest/gtest.h" #include "webkit/browser/quota/mock_special_storage_policy.h" +using base::ASCIIToUTF16; + namespace content { class DOMStorageContextImplTest : public testing::Test { diff --git a/content/browser/dom_storage/dom_storage_database_unittest.cc b/content/browser/dom_storage/dom_storage_database_unittest.cc index f3ba0b6..76d5726 100644 --- a/content/browser/dom_storage/dom_storage_database_unittest.cc +++ b/content/browser/dom_storage/dom_storage_database_unittest.cc @@ -14,6 +14,8 @@ #include "testing/gtest/include/gtest/gtest.h" #include "third_party/sqlite/sqlite3.h" +using base::ASCIIToUTF16; + namespace content { void CreateV1Table(sql::Connection* db) { diff --git a/content/browser/dom_storage/session_storage_database.cc b/content/browser/dom_storage/session_storage_database.cc index 7fa6d5e..8dc8b91 100644 --- a/content/browser/dom_storage/session_storage_database.cc +++ b/content/browser/dom_storage/session_storage_database.cc @@ -77,7 +77,7 @@ class SessionStorageDatabase::DBOperation { session_storage_database_->db_.reset(); #if defined(OS_WIN) leveldb::DestroyDB( - WideToUTF8(session_storage_database_->file_path_.value()), + base::WideToUTF8(session_storage_database_->file_path_.value()), leveldb::Options()); #else leveldb::DestroyDB(session_storage_database_->file_path_.value(), @@ -377,7 +377,7 @@ leveldb::Status SessionStorageDatabase::TryToOpen(leveldb::DB** db) { options.max_open_files = 0; // Use minimum. options.create_if_missing = true; #if defined(OS_WIN) - return leveldb::DB::Open(options, WideToUTF8(file_path_.value()), db); + return leveldb::DB::Open(options, base::WideToUTF8(file_path_.value()), db); #elif defined(OS_POSIX) return leveldb::DB::Open(options, file_path_.value(), db); #endif @@ -571,7 +571,8 @@ bool SessionStorageDatabase::ReadMap(const std::string& map_id, break; } // Key is of the form "map-<mapid>-<key>". - base::string16 key16 = UTF8ToUTF16(key.substr(map_start_key.length())); + base::string16 key16 = + base::UTF8ToUTF16(key.substr(map_start_key.length())); if (only_keys) { (*result)[key16] = base::NullableString16(); } else { @@ -594,7 +595,7 @@ void SessionStorageDatabase::WriteValuesToMap(const std::string& map_id, it != values.end(); ++it) { base::NullableString16 value = it->second; - std::string key = MapKey(map_id, UTF16ToUTF8(it->first)); + std::string key = MapKey(map_id, base::UTF16ToUTF8(it->first)); if (value.is_null()) { batch->Delete(key); } else { @@ -656,7 +657,7 @@ bool SessionStorageDatabase::ClearMap(const std::string& map_id, return false; for (DOMStorageValuesMap::const_iterator it = values.begin(); it != values.end(); ++it) - batch->Delete(MapKey(map_id, UTF16ToUTF8(it->first))); + batch->Delete(MapKey(map_id, base::UTF16ToUTF8(it->first))); return true; } diff --git a/content/browser/dom_storage/session_storage_database_unittest.cc b/content/browser/dom_storage/session_storage_database_unittest.cc index 2f86c3b..414fbe6 100644 --- a/content/browser/dom_storage/session_storage_database_unittest.cc +++ b/content/browser/dom_storage/session_storage_database_unittest.cc @@ -87,13 +87,13 @@ SessionStorageDatabaseTest::SessionStorageDatabaseTest() kNamespace1("namespace1"), kNamespace2("namespace2"), kNamespaceClone("wascloned"), - kKey1(ASCIIToUTF16("key1")), - kKey2(ASCIIToUTF16("key2")), - kKey3(ASCIIToUTF16("key3")), - kValue1(ASCIIToUTF16("value1"), false), - kValue2(ASCIIToUTF16("value2"), false), - kValue3(ASCIIToUTF16("value3"), false), - kValue4(ASCIIToUTF16("value4"), false) { } + kKey1(base::ASCIIToUTF16("key1")), + kKey2(base::ASCIIToUTF16("key2")), + kKey3(base::ASCIIToUTF16("key3")), + kValue1(base::ASCIIToUTF16("value1"), false), + kValue2(base::ASCIIToUTF16("value2"), false), + kValue3(base::ASCIIToUTF16("value3"), false), + kValue4(base::ASCIIToUTF16("value4"), false) { } SessionStorageDatabaseTest::~SessionStorageDatabaseTest() { } diff --git a/content/browser/download/download_item_impl.cc b/content/browser/download/download_item_impl.cc index a9b27f5..380a219 100644 --- a/content/browser/download/download_item_impl.cc +++ b/content/browser/download/download_item_impl.cc @@ -165,7 +165,7 @@ DownloadItemImpl::DownloadItemImpl( TARGET_DISPOSITION_PROMPT : TARGET_DISPOSITION_OVERWRITE), url_chain_(info.url_chain), referrer_url_(info.referrer_url), - suggested_filename_(UTF16ToUTF8(info.save_info->suggested_name)), + suggested_filename_(base::UTF16ToUTF8(info.save_info->suggested_name)), forced_file_path_(info.save_info->file_path), transition_type_(info.transition_type), has_user_gesture_(info.has_user_gesture), diff --git a/content/browser/download/drag_download_util.cc b/content/browser/download/drag_download_util.cc index 0850c3b..7a22662 100644 --- a/content/browser/download/drag_download_util.cc +++ b/content/browser/download/drag_download_util.cc @@ -49,7 +49,7 @@ bool ParseDownloadMetadata(const base::string16& metadata, #if defined(OS_WIN) *file_name = base::FilePath(file_name_str); #else - *file_name = base::FilePath(UTF16ToUTF8(file_name_str)); + *file_name = base::FilePath(base::UTF16ToUTF8(file_name_str)); #endif } if (url) @@ -70,7 +70,8 @@ FileStream* CreateFileStreamForDrop(base::FilePath* file_path, new_file_path = *file_path; } else { #if defined(OS_WIN) - base::string16 suffix = ASCIIToUTF16("-") + base::IntToString16(seq); + base::string16 suffix = + base::ASCIIToUTF16("-") + base::IntToString16(seq); #else std::string suffix = std::string("-") + base::IntToString(seq); #endif diff --git a/content/browser/download/save_package.cc b/content/browser/download/save_package.cc index 5961e6b..33dd5d0 100644 --- a/content/browser/download/save_package.cc +++ b/content/browser/download/save_package.cc @@ -1299,7 +1299,7 @@ const base::FilePath::CharType* SavePackage::ExtensionForMimeType( #if defined(OS_POSIX) base::FilePath::StringType mime_type(contents_mime_type); #elif defined(OS_WIN) - base::FilePath::StringType mime_type(UTF8ToWide(contents_mime_type)); + base::FilePath::StringType mime_type(base::UTF8ToWide(contents_mime_type)); #endif // OS_WIN for (uint32 i = 0; i < ARRAYSIZE_UNSAFE(extensions); ++i) { if (mime_type == extensions[i].mime_type) diff --git a/content/browser/download/save_package_unittest.cc b/content/browser/download/save_package_unittest.cc index 47fd1b4..b0e38c0 100644 --- a/content/browser/download/save_package_unittest.cc +++ b/content/browser/download/save_package_unittest.cc @@ -244,7 +244,7 @@ TEST_F(SavePackageTest, MAYBE_TestLongSafePureFilename) { const base::FilePath::StringType ext(FPL_HTML_EXTENSION); base::FilePath::StringType filename = #if defined(OS_WIN) - ASCIIToWide(long_file_name); + base::ASCIIToWide(long_file_name); #else long_file_name; #endif @@ -352,38 +352,38 @@ static const struct SuggestedSaveNameTestCase { } kSuggestedSaveNames[] = { // Title overrides the URL. { "http://foo.com", - ASCIIToUTF16("A page title"), + base::ASCIIToUTF16("A page title"), FPL("A page title") FPL_HTML_EXTENSION, true }, // Extension is preserved. { "http://foo.com", - ASCIIToUTF16("A page title with.ext"), + base::ASCIIToUTF16("A page title with.ext"), FPL("A page title with.ext"), false }, // If the title matches the URL, use the last component of the URL. { "http://foo.com/bar", - ASCIIToUTF16("foo.com/bar"), + base::ASCIIToUTF16("foo.com/bar"), FPL("bar"), false }, // If the title matches the URL, but there is no "filename" component, // use the domain. { "http://foo.com", - ASCIIToUTF16("foo.com"), + base::ASCIIToUTF16("foo.com"), FPL("foo.com"), false }, // Make sure fuzzy matching works. { "http://foo.com/bar", - ASCIIToUTF16("foo.com/bar"), + base::ASCIIToUTF16("foo.com/bar"), FPL("bar"), false }, // A URL-like title that does not match the title is respected in full. { "http://foo.com", - ASCIIToUTF16("http://www.foo.com/path/title.txt"), + base::ASCIIToUTF16("http://www.foo.com/path/title.txt"), FPL("http www.foo.com path title.txt"), false }, diff --git a/content/browser/fileapi/file_system_dir_url_request_job_unittest.cc b/content/browser/fileapi/file_system_dir_url_request_job_unittest.cc index 874e61b..dd7a536 100644 --- a/content/browser/fileapi/file_system_dir_url_request_job_unittest.cc +++ b/content/browser/fileapi/file_system_dir_url_request_job_unittest.cc @@ -180,7 +180,7 @@ class FileSystemDirURLRequestJobTest : public testing::Test { base::Time date; icu::UnicodeString date_ustr(match.group(5, status)); std::string date_str; - UTF16ToUTF8(date_ustr.getBuffer(), date_ustr.length(), &date_str); + base::UTF16ToUTF8(date_ustr.getBuffer(), date_ustr.length(), &date_str); EXPECT_TRUE(base::Time::FromString(date_str.c_str(), &date)); EXPECT_FALSE(date.is_null()); } diff --git a/content/browser/frame_host/debug_urls.cc b/content/browser/frame_host/debug_urls.cc index 7cb11e8..3322e51 100644 --- a/content/browser/frame_host/debug_urls.cc +++ b/content/browser/frame_host/debug_urls.cc @@ -24,7 +24,8 @@ void HandlePpapiFlashDebugURL(const GURL& url) { bool crash = url == GURL(kChromeUIPpapiFlashCrashURL); std::vector<PpapiPluginProcessHost*> hosts; - PpapiPluginProcessHost::FindByName(UTF8ToUTF16(kFlashPluginName), &hosts); + PpapiPluginProcessHost::FindByName( + base::UTF8ToUTF16(kFlashPluginName), &hosts); for (std::vector<PpapiPluginProcessHost*>::iterator iter = hosts.begin(); iter != hosts.end(); ++iter) { if (crash) diff --git a/content/browser/frame_host/navigation_controller_impl_unittest.cc b/content/browser/frame_host/navigation_controller_impl_unittest.cc index 68f753a..e13573e 100644 --- a/content/browser/frame_host/navigation_controller_impl_unittest.cc +++ b/content/browser/frame_host/navigation_controller_impl_unittest.cc @@ -1125,7 +1125,7 @@ TEST_F(NavigationControllerTest, Reload) { EXPECT_EQ(1U, navigation_entry_committed_counter_); navigation_entry_committed_counter_ = 0; ASSERT_TRUE(controller.GetVisibleEntry()); - controller.GetVisibleEntry()->SetTitle(ASCIIToUTF16("Title")); + controller.GetVisibleEntry()->SetTitle(base::ASCIIToUTF16("Title")); controller.Reload(true); EXPECT_EQ(0U, notifications.size()); @@ -1249,7 +1249,7 @@ TEST_F(NavigationControllerTest, ReloadOriginalRequestURL) { EXPECT_EQ(final_url, controller.GetVisibleEntry()->GetURL()); // Reload using the original URL. - controller.GetVisibleEntry()->SetTitle(ASCIIToUTF16("Title")); + controller.GetVisibleEntry()->SetTitle(base::ASCIIToUTF16("Title")); controller.ReloadOriginalRequestURL(false); EXPECT_EQ(0U, notifications.size()); @@ -2292,7 +2292,7 @@ TEST_F(NavigationControllerTest, RestoreNavigate) { url, Referrer(), PAGE_TRANSITION_RELOAD, false, std::string(), browser_context()); entry->SetPageID(0); - entry->SetTitle(ASCIIToUTF16("Title")); + entry->SetTitle(base::ASCIIToUTF16("Title")); entry->SetPageState(PageState::CreateFromEncodedData("state")); const base::Time timestamp = base::Time::Now(); entry->SetTimestamp(timestamp); @@ -2371,7 +2371,7 @@ TEST_F(NavigationControllerTest, RestoreNavigateAfterFailure) { url, Referrer(), PAGE_TRANSITION_RELOAD, false, std::string(), browser_context()); entry->SetPageID(0); - entry->SetTitle(ASCIIToUTF16("Title")); + entry->SetTitle(base::ASCIIToUTF16("Title")); entry->SetPageState(PageState::CreateFromEncodedData("state")); entries.push_back(entry); scoped_ptr<WebContentsImpl> our_contents(static_cast<WebContentsImpl*>( @@ -2965,7 +2965,7 @@ TEST_F(NavigationControllerTest, CloneAndGoBack) { NavigationControllerImpl& controller = controller_impl(); const GURL url1("http://foo1"); const GURL url2("http://foo2"); - const base::string16 title(ASCIIToUTF16("Title")); + const base::string16 title(base::ASCIIToUTF16("Title")); NavigateAndCommit(url1); controller.GetVisibleEntry()->SetTitle(title); @@ -2990,7 +2990,7 @@ TEST_F(NavigationControllerTest, CloneAndReload) { NavigationControllerImpl& controller = controller_impl(); const GURL url1("http://foo1"); const GURL url2("http://foo2"); - const base::string16 title(ASCIIToUTF16("Title")); + const base::string16 title(base::ASCIIToUTF16("Title")); NavigateAndCommit(url1); controller.GetVisibleEntry()->SetTitle(title); diff --git a/content/browser/frame_host/navigation_entry_impl_unittest.cc b/content/browser/frame_host/navigation_entry_impl_unittest.cc index 488106f..2c38da1 100644 --- a/content/browser/frame_host/navigation_entry_impl_unittest.cc +++ b/content/browser/frame_host/navigation_entry_impl_unittest.cc @@ -11,6 +11,8 @@ #include "content/public/common/ssl_status.h" #include "testing/gtest/include/gtest/gtest.h" +using base::ASCIIToUTF16; + namespace content { class NavigationEntryTest : public testing::Test { diff --git a/content/browser/frame_host/render_frame_host_manager_browsertest.cc b/content/browser/frame_host/render_frame_host_manager_browsertest.cc index 0a00e9f..576e138 100644 --- a/content/browser/frame_host/render_frame_host_manager_browsertest.cc +++ b/content/browser/frame_host/render_frame_host_manager_browsertest.cc @@ -32,6 +32,8 @@ #include "net/base/net_util.h" #include "net/test/spawned_test_server/spawned_test_server.h" +using base::ASCIIToUTF16; + namespace content { class RenderFrameHostManagerTest : public ContentBrowserTest { diff --git a/content/browser/frame_host/render_frame_host_manager_unittest.cc b/content/browser/frame_host/render_frame_host_manager_unittest.cc index 630262c..214c62d 100644 --- a/content/browser/frame_host/render_frame_host_manager_unittest.cc +++ b/content/browser/frame_host/render_frame_host_manager_unittest.cc @@ -260,7 +260,7 @@ TEST_F(RenderFrameHostManagerTest, FilterMessagesWhileSwappedOut) { contents()->GetRenderManagerForTesting()->current_host()); // Send an update title message and make sure it works. - const base::string16 ntp_title = ASCIIToUTF16("NTP Title"); + const base::string16 ntp_title = base::ASCIIToUTF16("NTP Title"); blink::WebTextDirection direction = blink::WebTextDirectionLeftToRight; EXPECT_TRUE(ntp_rvh->OnMessageReceived( ViewHostMsg_UpdateTitle(rvh()->GetRoutingID(), 0, ntp_title, direction))); @@ -288,7 +288,7 @@ TEST_F(RenderFrameHostManagerTest, FilterMessagesWhileSwappedOut) { dest_rvh->SendNavigate(101, kDestUrl); // The new RVH should be able to update its title. - const base::string16 dest_title = ASCIIToUTF16("Google"); + const base::string16 dest_title = base::ASCIIToUTF16("Google"); EXPECT_TRUE(dest_rvh->OnMessageReceived( ViewHostMsg_UpdateTitle(rvh()->GetRoutingID(), 101, dest_title, direction))); @@ -308,7 +308,7 @@ TEST_F(RenderFrameHostManagerTest, FilterMessagesWhileSwappedOut) { MockRenderProcessHost* ntp_process_host = static_cast<MockRenderProcessHost*>(ntp_rvh->GetProcess()); ntp_process_host->sink().ClearMessages(); - const base::string16 msg = ASCIIToUTF16("Message"); + const base::string16 msg = base::ASCIIToUTF16("Message"); bool result = false; base::string16 unused; ViewHostMsg_RunBeforeUnloadConfirm before_unload_msg( diff --git a/content/browser/gamepad/gamepad_platform_data_fetcher_linux.cc b/content/browser/gamepad/gamepad_platform_data_fetcher_linux.cc index d466dde..63733b2 100644 --- a/content/browser/gamepad/gamepad_platform_data_fetcher_linux.cc +++ b/content/browser/gamepad/gamepad_platform_data_fetcher_linux.cc @@ -187,7 +187,7 @@ void GamepadPlatformDataFetcherLinux::RefreshDevice(udev_device* dev) { vendor_id, product_id); base::TruncateUTF8ToByteSize(id, WebGamepad::idLengthCap - 1, &id); - base::string16 tmp16 = UTF8ToUTF16(id); + base::string16 tmp16 = base::UTF8ToUTF16(id); memset(pad.id, 0, sizeof(pad.id)); tmp16.copy(pad.id, arraysize(pad.id) - 1); diff --git a/content/browser/geolocation/network_location_provider.cc b/content/browser/geolocation/network_location_provider.cc index efc68a7..2a9d7c8 100644 --- a/content/browser/geolocation/network_location_provider.cc +++ b/content/browser/geolocation/network_location_provider.cc @@ -77,7 +77,7 @@ bool NetworkLocationProvider::PositionCache::MakeKey( key->clear(); const size_t kCharsPerMacAddress = 6 * 3 + 1; // e.g. "11:22:33:44:55:66|" key->reserve(wifi_data.access_point_data.size() * kCharsPerMacAddress); - const base::string16 separator(ASCIIToUTF16("|")); + const base::string16 separator(base::ASCIIToUTF16("|")); for (WifiData::AccessPointDataSet::const_iterator iter = wifi_data.access_point_data.begin(); iter != wifi_data.access_point_data.end(); diff --git a/content/browser/geolocation/network_location_provider_unittest.cc b/content/browser/geolocation/network_location_provider_unittest.cc index f7c7320..4bd9348 100644 --- a/content/browser/geolocation/network_location_provider_unittest.cc +++ b/content/browser/geolocation/network_location_provider_unittest.cc @@ -162,11 +162,11 @@ class GeolocationNetworkProviderTest : public testing::Test { for (int i = 0; i < ap_count; ++i) { AccessPointData ap; ap.mac_address = - ASCIIToUTF16(base::StringPrintf("%02d-34-56-78-54-32", i)); + base::ASCIIToUTF16(base::StringPrintf("%02d-34-56-78-54-32", i)); ap.radio_signal_strength = ap_count - i; ap.channel = IndexToChannel(i); ap.signal_to_noise = i + 42; - ap.ssid = ASCIIToUTF16("Some nice+network|name\\"); + ap.ssid = base::ASCIIToUTF16("Some nice+network|name\\"); data.access_point_data.insert(ap); } return data; @@ -421,7 +421,7 @@ TEST_F(GeolocationNetworkProviderTest, MultipleWifiScansComplete) { EXPECT_TRUE(position.Validate()); // Token should be in the store. - EXPECT_EQ(UTF8ToUTF16(REFERENCE_ACCESS_TOKEN), + EXPECT_EQ(base::UTF8ToUTF16(REFERENCE_ACCESS_TOKEN), access_token_store_->access_token_set_[test_server_url_]); // Wifi updated again, with one less AP. This is 'close enough' to the @@ -517,7 +517,7 @@ TEST_F(GeolocationNetworkProviderTest, NetworkRequestDeferredForPermission) { TEST_F(GeolocationNetworkProviderTest, NetworkRequestWithWifiDataDeferredForPermission) { access_token_store_->access_token_set_[test_server_url_] = - UTF8ToUTF16(REFERENCE_ACCESS_TOKEN); + base::UTF8ToUTF16(REFERENCE_ACCESS_TOKEN); scoped_ptr<LocationProvider> provider(CreateProvider(false)); EXPECT_TRUE(provider->StartProvider(false)); net::TestURLFetcher* fetcher = get_url_fetcher_and_advance_id(); diff --git a/content/browser/geolocation/network_location_request.cc b/content/browser/geolocation/network_location_request.cc index 3ed7092..8fb6e6a 100644 --- a/content/browser/geolocation/network_location_request.cc +++ b/content/browser/geolocation/network_location_request.cc @@ -262,7 +262,7 @@ void AddWifiData(const WifiData& wifi_data, iter != access_points_by_signal_strength.end(); ++iter) { base::DictionaryValue* wifi_dict = new base::DictionaryValue(); - AddString("macAddress", UTF16ToUTF8((*iter)->mac_address), wifi_dict); + AddString("macAddress", base::UTF16ToUTF8((*iter)->mac_address), wifi_dict); AddInteger("signalStrength", (*iter)->radio_signal_strength, wifi_dict); AddInteger("age", age_milliseconds, wifi_dict); AddInteger("channel", (*iter)->channel, wifi_dict); diff --git a/content/browser/geolocation/wifi_data_provider_chromeos.cc b/content/browser/geolocation/wifi_data_provider_chromeos.cc index a8b2041..49edb23 100644 --- a/content/browser/geolocation/wifi_data_provider_chromeos.cc +++ b/content/browser/geolocation/wifi_data_provider_chromeos.cc @@ -151,11 +151,11 @@ bool WifiDataProviderChromeOs::GetAccessPointData( = access_points.begin(); i != access_points.end(); ++i) { AccessPointData ap_data; - ap_data.mac_address = ASCIIToUTF16(i->mac_address); + ap_data.mac_address = base::ASCIIToUTF16(i->mac_address); ap_data.radio_signal_strength = i->signal_strength; ap_data.channel = i->channel; ap_data.signal_to_noise = i->signal_to_noise; - ap_data.ssid = UTF8ToUTF16(i->ssid); + ap_data.ssid = base::UTF8ToUTF16(i->ssid); result->insert(ap_data); } // If the age is significantly longer than our long polling time, assume the diff --git a/content/browser/geolocation/wifi_data_provider_chromeos_unittest.cc b/content/browser/geolocation/wifi_data_provider_chromeos_unittest.cc index f9deb66..f282f31 100644 --- a/content/browser/geolocation/wifi_data_provider_chromeos_unittest.cc +++ b/content/browser/geolocation/wifi_data_provider_chromeos_unittest.cc @@ -84,7 +84,8 @@ TEST_F(GeolocationChromeOsWifiDataProviderTest, GetOneAccessPoint) { AddAccessPoints(1, 1); EXPECT_TRUE(GetAccessPointData()); ASSERT_EQ(1u, ap_data_.size()); - EXPECT_EQ("00:00:03:04:05:06", UTF16ToUTF8(ap_data_.begin()->mac_address)); + EXPECT_EQ("00:00:03:04:05:06", + base::UTF16ToUTF8(ap_data_.begin()->mac_address)); } TEST_F(GeolocationChromeOsWifiDataProviderTest, GetManyAccessPoints) { diff --git a/content/browser/geolocation/wifi_data_provider_common.cc b/content/browser/geolocation/wifi_data_provider_common.cc index 9c2cbae..388a17e 100644 --- a/content/browser/geolocation/wifi_data_provider_common.cc +++ b/content/browser/geolocation/wifi_data_provider_common.cc @@ -15,13 +15,13 @@ base::string16 MacAddressAsString16(const uint8 mac_as_int[6]) { // Format is XX-XX-XX-XX-XX-XX. static const char* const kMacFormatString = "%02x-%02x-%02x-%02x-%02x-%02x"; - return ASCIIToUTF16(base::StringPrintf(kMacFormatString, - mac_as_int[0], - mac_as_int[1], - mac_as_int[2], - mac_as_int[3], - mac_as_int[4], - mac_as_int[5])); + return base::ASCIIToUTF16(base::StringPrintf(kMacFormatString, + mac_as_int[0], + mac_as_int[1], + mac_as_int[2], + mac_as_int[3], + mac_as_int[4], + mac_as_int[5])); } WifiDataProviderCommon::WifiDataProviderCommon() diff --git a/content/browser/geolocation/wifi_data_provider_common_unittest.cc b/content/browser/geolocation/wifi_data_provider_common_unittest.cc index 61e236f..9c55dfd 100644 --- a/content/browser/geolocation/wifi_data_provider_common_unittest.cc +++ b/content/browser/geolocation/wifi_data_provider_common_unittest.cc @@ -173,7 +173,7 @@ TEST_F(GeolocationWifiDataProviderCommonTest, IntermittentWifi){ single_access_point.mac_address = 3; single_access_point.radio_signal_strength = 4; single_access_point.signal_to_noise = 5; - single_access_point.ssid = ASCIIToUTF16("foossid"); + single_access_point.ssid = base::ASCIIToUTF16("foossid"); wlan_api_->data_out_.insert(single_access_point); provider_->StartDataProvider(); @@ -204,7 +204,7 @@ TEST_F(GeolocationWifiDataProviderCommonTest, DoScanWithResults) { single_access_point.mac_address = 3; single_access_point.radio_signal_strength = 4; single_access_point.signal_to_noise = 5; - single_access_point.ssid = ASCIIToUTF16("foossid"); + single_access_point.ssid = base::ASCIIToUTF16("foossid"); wlan_api_->data_out_.insert(single_access_point); provider_->StartDataProvider(); diff --git a/content/browser/geolocation/wifi_data_provider_common_win.cc b/content/browser/geolocation/wifi_data_provider_common_win.cc index a0d334f..aac728d 100644 --- a/content/browser/geolocation/wifi_data_provider_common_win.cc +++ b/content/browser/geolocation/wifi_data_provider_common_win.cc @@ -19,9 +19,9 @@ bool ConvertToAccessPointData(const NDIS_WLAN_BSSID& data, access_point_data->mac_address = MacAddressAsString16(data.MacAddress); access_point_data->radio_signal_strength = data.Rssi; // Note that _NDIS_802_11_SSID::Ssid::Ssid is not null-terminated. - UTF8ToUTF16(reinterpret_cast<const char*>(data.Ssid.Ssid), - data.Ssid.SsidLength, - &access_point_data->ssid); + base::UTF8ToUTF16(reinterpret_cast<const char*>(data.Ssid.Ssid), + data.Ssid.SsidLength, + &access_point_data->ssid); return true; } diff --git a/content/browser/geolocation/wifi_data_provider_linux.cc b/content/browser/geolocation/wifi_data_provider_linux.cc index a8d2135..1e43658 100644 --- a/content/browser/geolocation/wifi_data_provider_linux.cc +++ b/content/browser/geolocation/wifi_data_provider_linux.cc @@ -254,7 +254,7 @@ bool NetworkManagerWlanApi::GetAccessPointsForAdapter( continue; } std::string ssid(ssid_bytes, ssid_bytes + ssid_length); - access_point_data.ssid = UTF8ToUTF16(ssid); + access_point_data.ssid = base::UTF8ToUTF16(ssid); } { // Read the mac address @@ -275,7 +275,7 @@ bool NetworkManagerWlanApi::GetAccessPointsForAdapter( if (!base::HexStringToBytes(mac, &mac_bytes) || mac_bytes.size() != 6) { LOG(WARNING) << "Can't parse mac address (found " << mac_bytes.size() << " bytes) so using raw string: " << mac; - access_point_data.mac_address = UTF8ToUTF16(mac); + access_point_data.mac_address = base::UTF8ToUTF16(mac); } else { access_point_data.mac_address = MacAddressAsString16(&mac_bytes[0]); } diff --git a/content/browser/geolocation/wifi_data_provider_linux_unittest.cc b/content/browser/geolocation/wifi_data_provider_linux_unittest.cc index 2e72470..498b230 100644 --- a/content/browser/geolocation/wifi_data_provider_linux_unittest.cc +++ b/content/browser/geolocation/wifi_data_provider_linux_unittest.cc @@ -222,8 +222,9 @@ TEST_F(GeolocationWifiDataProviderLinuxTest, GetAccessPointData) { // Check the contents of the access point data. // The expected values come from CreateAccessPointProxyResponse() above. - EXPECT_EQ("test", UTF16ToUTF8(access_point_data.ssid)); - EXPECT_EQ("00-11-22-33-44-55", UTF16ToUTF8(access_point_data.mac_address)); + EXPECT_EQ("test", base::UTF16ToUTF8(access_point_data.ssid)); + EXPECT_EQ("00-11-22-33-44-55", + base::UTF16ToUTF8(access_point_data.mac_address)); EXPECT_EQ(-50, access_point_data.radio_signal_strength); EXPECT_EQ(4, access_point_data.channel); } diff --git a/content/browser/geolocation/wifi_data_provider_mac.cc b/content/browser/geolocation/wifi_data_provider_mac.cc index e7d8e82..6a87801 100644 --- a/content/browser/geolocation/wifi_data_provider_mac.cc +++ b/content/browser/geolocation/wifi_data_provider_mac.cc @@ -140,9 +140,10 @@ bool Apple80211Api::GetAccessPointData(WifiData::AccessPointDataSet* data) { // WirelessNetworkInfo::noise appears to be noise floor in dBm. access_point_data.signal_to_noise = access_point_info->signal - access_point_info->noise; - if (!UTF8ToUTF16(reinterpret_cast<const char*>(access_point_info->name), - access_point_info->nameLen, - &access_point_data.ssid)) { + if (!base::UTF8ToUTF16(reinterpret_cast<const char*>( + access_point_info->name), + access_point_info->nameLen, + &access_point_data.ssid)) { access_point_data.ssid.clear(); } data->insert(access_point_data); diff --git a/content/browser/geolocation/wifi_data_provider_win.cc b/content/browser/geolocation/wifi_data_provider_win.cc index ed69865..a4e6e74 100644 --- a/content/browser/geolocation/wifi_data_provider_win.cc +++ b/content/browser/geolocation/wifi_data_provider_win.cc @@ -520,9 +520,9 @@ bool GetNetworkData(const WLAN_BSS_ENTRY& bss_entry, access_point_data->mac_address = MacAddressAsString16(bss_entry.dot11Bssid); access_point_data->radio_signal_strength = bss_entry.lRssi; // bss_entry.dot11Ssid.ucSSID is not null-terminated. - UTF8ToUTF16(reinterpret_cast<const char*>(bss_entry.dot11Ssid.ucSSID), - static_cast<ULONG>(bss_entry.dot11Ssid.uSSIDLength), - &access_point_data->ssid); + base::UTF8ToUTF16(reinterpret_cast<const char*>(bss_entry.dot11Ssid.ucSSID), + static_cast<ULONG>(bss_entry.dot11Ssid.uSSIDLength), + &access_point_data->ssid); // TODO(steveblock): Is it possible to get the following? // access_point_data->signal_to_noise // access_point_data->age 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 d3e8296..74247eb 100644 --- a/content/browser/indexed_db/indexed_db_backing_store_unittest.cc +++ b/content/browser/indexed_db/indexed_db_backing_store_unittest.cc @@ -11,6 +11,8 @@ #include "testing/gtest/include/gtest/gtest.h" #include "third_party/WebKit/public/platform/WebIDBTypes.h" +using base::ASCIIToUTF16; + namespace content { namespace { diff --git a/content/browser/indexed_db/indexed_db_browsertest.cc b/content/browser/indexed_db/indexed_db_browsertest.cc index 40a3161..1e2325c 100644 --- a/content/browser/indexed_db/indexed_db_browsertest.cc +++ b/content/browser/indexed_db/indexed_db_browsertest.cc @@ -27,6 +27,7 @@ #include "webkit/browser/database/database_util.h" #include "webkit/browser/quota/quota_manager.h" +using base::ASCIIToUTF16; using quota::QuotaManager; using webkit_database::DatabaseUtil; diff --git a/content/browser/indexed_db/indexed_db_database.cc b/content/browser/indexed_db/indexed_db_database.cc index 31d4cc5..ba53e66 100644 --- a/content/browser/indexed_db/indexed_db_database.cc +++ b/content/browser/indexed_db/indexed_db_database.cc @@ -24,6 +24,7 @@ #include "content/public/browser/browser_thread.h" #include "third_party/WebKit/public/platform/WebIDBDatabaseException.h" +using base::ASCIIToUTF16; using base::Int64ToString16; using blink::WebIDBKeyTypeNumber; diff --git a/content/browser/indexed_db/indexed_db_database_error.h b/content/browser/indexed_db/indexed_db_database_error.h index 1a4f449..84fee94 100644 --- a/content/browser/indexed_db/indexed_db_database_error.h +++ b/content/browser/indexed_db/indexed_db_database_error.h @@ -16,7 +16,7 @@ class IndexedDBDatabaseError { IndexedDBDatabaseError(uint16 code) : code_(code) {} IndexedDBDatabaseError(uint16 code, const char* message) - : code_(code), message_(ASCIIToUTF16(message)) {} + : code_(code), message_(base::ASCIIToUTF16(message)) {} IndexedDBDatabaseError(uint16 code, const base::string16& message) : code_(code), message_(message) {} ~IndexedDBDatabaseError() {} diff --git a/content/browser/indexed_db/indexed_db_database_unittest.cc b/content/browser/indexed_db/indexed_db_database_unittest.cc index 73a7ec2..902e004 100644 --- a/content/browser/indexed_db/indexed_db_database_unittest.cc +++ b/content/browser/indexed_db/indexed_db_database_unittest.cc @@ -21,6 +21,8 @@ #include "content/browser/indexed_db/mock_indexed_db_database_callbacks.h" #include "testing/gtest/include/gtest/gtest.h" +using base::ASCIIToUTF16; + namespace content { TEST(IndexedDBDatabaseTest, BackingStoreRetention) { diff --git a/content/browser/indexed_db/indexed_db_factory.cc b/content/browser/indexed_db/indexed_db_factory.cc index 4dce7b1..8cf5042 100644 --- a/content/browser/indexed_db/indexed_db_factory.cc +++ b/content/browser/indexed_db/indexed_db_factory.cc @@ -14,6 +14,8 @@ #include "third_party/WebKit/public/platform/WebIDBDatabaseException.h" #include "webkit/common/database/database_identifier.h" +using base::ASCIIToUTF16; + namespace content { const int64 kBackingStoreGracePeriodMs = 2000; diff --git a/content/browser/indexed_db/indexed_db_factory_unittest.cc b/content/browser/indexed_db/indexed_db_factory_unittest.cc index c235139..a7c4fe7 100644 --- a/content/browser/indexed_db/indexed_db_factory_unittest.cc +++ b/content/browser/indexed_db/indexed_db_factory_unittest.cc @@ -18,6 +18,8 @@ #include "url/gurl.h" #include "webkit/common/database/database_identifier.h" +using base::ASCIIToUTF16; + namespace content { class IndexedDBFactoryTest : public testing::Test { diff --git a/content/browser/indexed_db/indexed_db_index_writer.cc b/content/browser/indexed_db/indexed_db_index_writer.cc index 3e8dc3f..0ea24b6 100644 --- a/content/browser/indexed_db/indexed_db_index_writer.cc +++ b/content/browser/indexed_db/indexed_db_index_writer.cc @@ -13,6 +13,8 @@ #include "content/common/indexed_db/indexed_db_key_path.h" #include "content/common/indexed_db/indexed_db_key_range.h" +using base::ASCIIToUTF16; + namespace content { IndexWriter::IndexWriter( 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 44c4ab8..97128ec 100644 --- a/content/browser/indexed_db/indexed_db_leveldb_coding_unittest.cc +++ b/content/browser/indexed_db/indexed_db_leveldb_coding_unittest.cc @@ -15,6 +15,7 @@ #include "content/common/indexed_db/indexed_db_key_path.h" #include "testing/gtest/include/gtest/gtest.h" +using base::ASCIIToUTF16; using base::StringPiece; using blink::WebIDBKeyTypeDate; using blink::WebIDBKeyTypeNumber; diff --git a/content/browser/indexed_db/indexed_db_transaction.cc b/content/browser/indexed_db/indexed_db_transaction.cc index 82e640f..0d8be37 100644 --- a/content/browser/indexed_db/indexed_db_transaction.cc +++ b/content/browser/indexed_db/indexed_db_transaction.cc @@ -328,7 +328,7 @@ void IndexedDBTransaction::ProcessTaskQueue() { void IndexedDBTransaction::Timeout() { Abort(IndexedDBDatabaseError( blink::WebIDBDatabaseExceptionTimeoutError, - ASCIIToUTF16("Transaction timed out due to inactivity."))); + base::ASCIIToUTF16("Transaction timed out due to inactivity."))); } void IndexedDBTransaction::CloseOpenCursors() { diff --git a/content/browser/indexed_db/indexed_db_transaction_unittest.cc b/content/browser/indexed_db/indexed_db_transaction_unittest.cc index 9aa68fa..d0228bc 100644 --- a/content/browser/indexed_db/indexed_db_transaction_unittest.cc +++ b/content/browser/indexed_db/indexed_db_transaction_unittest.cc @@ -21,7 +21,7 @@ class IndexedDBTransactionTest : public testing::Test { IndexedDBTransactionTest() { IndexedDBFactory* factory = NULL; backing_store_ = new IndexedDBFakeBackingStore(); - db_ = IndexedDBDatabase::Create(ASCIIToUTF16("db"), + db_ = IndexedDBDatabase::Create(base::ASCIIToUTF16("db"), backing_store_, factory, IndexedDBDatabase::Identifier()); diff --git a/content/browser/indexed_db/indexed_db_unittest.cc b/content/browser/indexed_db/indexed_db_unittest.cc index 7c8f249..d0fe981 100644 --- a/content/browser/indexed_db/indexed_db_unittest.cc +++ b/content/browser/indexed_db/indexed_db_unittest.cc @@ -238,7 +238,7 @@ TEST_F(IndexedDBTest, ForceCloseOpenDatabasesOnCommitFailure) { scoped_refptr<MockIndexedDBDatabaseCallbacks> db_callbacks( new MockIndexedDBDatabaseCallbacks()); const int64 transaction_id = 1; - factory->Open(ASCIIToUTF16("db"), + factory->Open(base::ASCIIToUTF16("db"), IndexedDBDatabaseMetadata::DEFAULT_INT_VERSION, transaction_id, callbacks, diff --git a/content/browser/loader/resource_dispatcher_host_browsertest.cc b/content/browser/loader/resource_dispatcher_host_browsertest.cc index 011c975..23a0cca 100644 --- a/content/browser/loader/resource_dispatcher_host_browsertest.cc +++ b/content/browser/loader/resource_dispatcher_host_browsertest.cc @@ -27,6 +27,8 @@ #include "net/test/embedded_test_server/http_request.h" #include "net/test/embedded_test_server/http_response.h" +using base::ASCIIToUTF16; + namespace content { class ResourceDispatcherHostBrowserTest : public ContentBrowserTest, diff --git a/content/browser/media/encrypted_media_browsertest.cc b/content/browser/media/encrypted_media_browsertest.cc index f4e5eaf..9c0dbac 100644 --- a/content/browser/media/encrypted_media_browsertest.cc +++ b/content/browser/media/encrypted_media_browsertest.cc @@ -116,8 +116,8 @@ class EncryptedMediaTest : public content::MediaBrowserTest, // We want to fail quickly when a test fails because an error is encountered. virtual void AddWaitForTitles(content::TitleWatcher* title_watcher) OVERRIDE { MediaBrowserTest::AddWaitForTitles(title_watcher); - title_watcher->AlsoWaitForTitle(ASCIIToUTF16(kEmeNotSupportedError)); - title_watcher->AlsoWaitForTitle(ASCIIToUTF16(kEmeKeyError)); + title_watcher->AlsoWaitForTitle(base::ASCIIToUTF16(kEmeNotSupportedError)); + title_watcher->AlsoWaitForTitle(base::ASCIIToUTF16(kEmeKeyError)); } #if defined(OS_ANDROID) diff --git a/content/browser/media/media_browsertest.cc b/content/browser/media/media_browsertest.cc index 34546b0..c14c362 100644 --- a/content/browser/media/media_browsertest.cc +++ b/content/browser/media/media_browsertest.cc @@ -59,7 +59,7 @@ void MediaBrowserTest::RunMediaTestPage( } void MediaBrowserTest::RunTest(const GURL& gurl, const char* expected) { - const base::string16 expected_title = ASCIIToUTF16(expected); + const base::string16 expected_title = base::ASCIIToUTF16(expected); DVLOG(1) << "Running test URL: " << gurl; TitleWatcher title_watcher(shell()->web_contents(), expected_title); AddWaitForTitles(&title_watcher); @@ -70,9 +70,9 @@ void MediaBrowserTest::RunTest(const GURL& gurl, const char* expected) { } void MediaBrowserTest::AddWaitForTitles(content::TitleWatcher* title_watcher) { - title_watcher->AlsoWaitForTitle(ASCIIToUTF16(kEnded)); - title_watcher->AlsoWaitForTitle(ASCIIToUTF16(kError)); - title_watcher->AlsoWaitForTitle(ASCIIToUTF16(kFailed)); + title_watcher->AlsoWaitForTitle(base::ASCIIToUTF16(kEnded)); + title_watcher->AlsoWaitForTitle(base::ASCIIToUTF16(kError)); + title_watcher->AlsoWaitForTitle(base::ASCIIToUTF16(kFailed)); } // Tests playback and seeking of an audio or video file over file or http based diff --git a/content/browser/media/webrtc_aecdump_browsertest.cc b/content/browser/media/webrtc_aecdump_browsertest.cc index 5ba5a85..bda90c9 100644 --- a/content/browser/media/webrtc_aecdump_browsertest.cc +++ b/content/browser/media/webrtc_aecdump_browsertest.cc @@ -53,7 +53,7 @@ class WebrtcAecDumpBrowserTest : public ContentBrowserTest { } void ExpectTitle(const std::string& expected_title) const { - base::string16 expected_title16(ASCIIToUTF16(expected_title)); + base::string16 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/media/webrtc_browsertest.cc b/content/browser/media/webrtc_browsertest.cc index 5e3666c..af7b087 100644 --- a/content/browser/media/webrtc_browsertest.cc +++ b/content/browser/media/webrtc_browsertest.cc @@ -224,7 +224,7 @@ class WebrtcBrowserTest: public ContentBrowserTest { } void ExpectTitle(const std::string& expected_title) const { - base::string16 expected_title16(ASCIIToUTF16(expected_title)); + base::string16 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/media/webrtc_internals_browsertest.cc b/content/browser/media/webrtc_internals_browsertest.cc index 0d279b3..9750073 100644 --- a/content/browser/media/webrtc_internals_browsertest.cc +++ b/content/browser/media/webrtc_internals_browsertest.cc @@ -145,7 +145,7 @@ class MAYBE_WebRTCInternalsBrowserTest: public ContentBrowserTest { } void ExpectTitle(const std::string& expected_title) const { - base::string16 expected_title16(ASCIIToUTF16(expected_title)); + base::string16 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/plugin_browsertest.cc b/content/browser/plugin_browsertest.cc index 204a143..9c37d50 100644 --- a/content/browser/plugin_browsertest.cc +++ b/content/browser/plugin_browsertest.cc @@ -33,6 +33,8 @@ #define MAYBE(x) x #endif +using base::ASCIIToUTF16; + namespace content { namespace { diff --git a/content/browser/plugin_data_remover_impl.cc b/content/browser/plugin_data_remover_impl.cc index 79e291f..31d3e27 100644 --- a/content/browser/plugin_data_remover_impl.cc +++ b/content/browser/plugin_data_remover_impl.cc @@ -208,7 +208,7 @@ class PluginDataRemoverImpl::Context // the browser). #if defined(OS_WIN) base::FilePath plugin_data_path = - profile_path.Append(base::FilePath(UTF8ToUTF16(plugin_name_))); + profile_path.Append(base::FilePath(base::UTF8ToUTF16(plugin_name_))); #else base::FilePath plugin_data_path = profile_path.Append(base::FilePath(plugin_name_)); diff --git a/content/browser/plugin_loader_posix_unittest.cc b/content/browser/plugin_loader_posix_unittest.cc index 13620f7..4690768 100644 --- a/content/browser/plugin_loader_posix_unittest.cc +++ b/content/browser/plugin_loader_posix_unittest.cc @@ -14,6 +14,8 @@ #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" +using base::ASCIIToUTF16; + namespace content { class MockPluginLoaderPosix : public PluginLoaderPosix { diff --git a/content/browser/plugin_service_impl.cc b/content/browser/plugin_service_impl.cc index cb0a7b4..b65704b 100644 --- a/content/browser/plugin_service_impl.cc +++ b/content/browser/plugin_service_impl.cc @@ -292,7 +292,7 @@ PluginProcessHost* PluginServiceImpl::FindOrStartNpapiPluginProcess( // Record when NPAPI Flash process is started for the first time. static bool counted = false; - if (!counted && UTF16ToUTF8(info.name) == kFlashPluginName) { + if (!counted && base::UTF16ToUTF8(info.name) == kFlashPluginName) { counted = true; UMA_HISTOGRAM_ENUMERATION("Plugin.FlashUsage", START_NPAPI_FLASH_AT_LEAST_ONCE, @@ -574,7 +574,7 @@ base::string16 PluginServiceImpl::GetPluginDisplayNameByPath( // Many plugins on the Mac have .plugin in the actual name, which looks // terrible, so look for that and strip it off if present. const std::string kPluginExtension = ".plugin"; - if (EndsWith(plugin_name, ASCIIToUTF16(kPluginExtension), true)) + if (EndsWith(plugin_name, base::ASCIIToUTF16(kPluginExtension), true)) plugin_name.erase(plugin_name.length() - kPluginExtension.length()); #endif // OS_MACOSX } diff --git a/content/browser/power_save_blocker_win.cc b/content/browser/power_save_blocker_win.cc index cf9bb02..727600d 100644 --- a/content/browser/power_save_blocker_win.cc +++ b/content/browser/power_save_blocker_win.cc @@ -39,7 +39,7 @@ HANDLE CreatePowerRequest(POWER_REQUEST_TYPE type, const std::string& reason) { if (!PowerCreateRequestFn || !PowerSetRequestFn) return INVALID_HANDLE_VALUE; } - base::string16 wide_reason = ASCIIToUTF16(reason); + base::string16 wide_reason = base::ASCIIToUTF16(reason); REASON_CONTEXT context = {0}; context.Version = POWER_REQUEST_CONTEXT_VERSION; context.Flags = POWER_REQUEST_CONTEXT_SIMPLE_STRING; diff --git a/content/browser/ppapi_plugin_process_host.cc b/content/browser/ppapi_plugin_process_host.cc index 131b074..7e17d46 100644 --- a/content/browser/ppapi_plugin_process_host.cc +++ b/content/browser/ppapi_plugin_process_host.cc @@ -253,7 +253,7 @@ bool PpapiPluginProcessHost::Init(const PepperPluginInfo& info) { if (info.name.empty()) { process_->SetName(plugin_path_.BaseName().LossyDisplayName()); } else { - process_->SetName(UTF8ToUTF16(info.name)); + process_->SetName(base::UTF8ToUTF16(info.name)); } std::string channel_id = process_->GetHost()->CreateChannel(); diff --git a/content/browser/renderer_host/database_message_filter.cc b/content/browser/renderer_host/database_message_filter.cc index 55ea305..720cf20 100644 --- a/content/browser/renderer_host/database_message_filter.cc +++ b/content/browser/renderer_host/database_message_filter.cc @@ -186,7 +186,7 @@ void DatabaseMessageFilter::DatabaseDeleteFile( // 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(ASCIIToUTF16("-wal")); + const base::string16 wal_suffix(base::ASCIIToUTF16("-wal")); base::string16 sqlite_suffix; // WAL files can be deleted without having previously been opened. diff --git a/content/browser/renderer_host/gtk_im_context_wrapper.cc b/content/browser/renderer_host/gtk_im_context_wrapper.cc index d4b7789..3601b8d 100644 --- a/content/browser/renderer_host/gtk_im_context_wrapper.cc +++ b/content/browser/renderer_host/gtk_im_context_wrapper.cc @@ -623,7 +623,7 @@ void GtkIMContextWrapper::SendFakeCompositionKeyEvent( void GtkIMContextWrapper::HandleCommitThunk( GtkIMContext* context, gchar* text, GtkIMContextWrapper* self) { - self->HandleCommit(UTF8ToUTF16(text)); + self->HandleCommit(base::UTF8ToUTF16(text)); } void GtkIMContextWrapper::HandlePreeditStartThunk( diff --git a/content/browser/renderer_host/pepper/pepper_truetype_font_list_win.cc b/content/browser/renderer_host/pepper/pepper_truetype_font_list_win.cc index 3530e1e..c52ee96 100644 --- a/content/browser/renderer_host/pepper/pepper_truetype_font_list_win.cc +++ b/content/browser/renderer_host/pepper/pepper_truetype_font_list_win.cc @@ -27,7 +27,7 @@ static int CALLBACK EnumFontFamiliesProc(ENUMLOGFONTEXW* logical_font, const LOGFONTW& lf = logical_font->elfLogFont; if (lf.lfFaceName[0] && lf.lfFaceName[0] != '@' && lf.lfOutPrecision == OUT_STROKE_PRECIS) { // Outline fonts only. - std::string face_name(UTF16ToUTF8(lf.lfFaceName)); + std::string face_name(base::UTF16ToUTF8(lf.lfFaceName)); font_families->push_back(face_name); } } @@ -44,7 +44,7 @@ static int CALLBACK EnumFontsInFamilyProc(ENUMLOGFONTEXW* logical_font, if (lf.lfFaceName[0] && lf.lfFaceName[0] != '@' && lf.lfOutPrecision == OUT_STROKE_PRECIS) { // Outline fonts only. ppapi::proxy::SerializedTrueTypeFontDesc desc; - desc.family = UTF16ToUTF8(lf.lfFaceName); + desc.family = base::UTF16ToUTF8(lf.lfFaceName); if (lf.lfItalic) desc.style = PP_TRUETYPEFONTSTYLE_ITALIC; desc.weight = static_cast<PP_TrueTypeFontWeight_Dev>(lf.lfWeight); @@ -73,7 +73,7 @@ void GetFontsInFamily_SlowBlocking(const std::string& family, LOGFONTW logfont; memset(&logfont, 0, sizeof(logfont)); logfont.lfCharSet = DEFAULT_CHARSET; - base::string16 family16 = UTF8ToUTF16(family); + base::string16 family16 = base::UTF8ToUTF16(family); memcpy(&logfont.lfFaceName, &family16[0], sizeof(logfont.lfFaceName)); base::win::ScopedCreateDC hdc(::CreateCompatibleDC(NULL)); ::EnumFontFamiliesExW(hdc, &logfont, (FONTENUMPROCW)&EnumFontsInFamilyProc, diff --git a/content/browser/renderer_host/render_view_host_impl.cc b/content/browser/renderer_host/render_view_host_impl.cc index 7577b59..a393053 100644 --- a/content/browser/renderer_host/render_view_host_impl.cc +++ b/content/browser/renderer_host/render_view_host_impl.cc @@ -899,15 +899,15 @@ void RenderViewHostImpl::DragTargetDragEnter( // and request permissions to the specific file to cover both cases. // We do not give it the permission to request all file:// URLs. base::FilePath path = - base::FilePath::FromUTF8Unsafe(UTF16ToUTF8(iter->path)); + base::FilePath::FromUTF8Unsafe(base::UTF16ToUTF8(iter->path)); // Make sure we have the same display_name as the one we register. if (iter->display_name.empty()) { std::string name; files.AddPath(path, &name); - iter->display_name = UTF8ToUTF16(name); + iter->display_name = base::UTF8ToUTF16(name); } else { - files.AddPathWithName(path, UTF16ToUTF8(iter->display_name)); + files.AddPathWithName(path, base::UTF16ToUTF8(iter->display_name)); } policy->GrantRequestSpecificFileURL(renderer_id, @@ -932,7 +932,7 @@ void RenderViewHostImpl::DragTargetDragEnter( // Grant the permission iff the ID is valid. policy->GrantReadFileSystem(renderer_id, filesystem_id); } - filtered_data.filesystem_id = UTF8ToUTF16(filesystem_id); + filtered_data.filesystem_id = base::UTF8ToUTF16(filesystem_id); Send(new DragMsg_TargetDragEnter(GetRoutingID(), filtered_data, client_pt, screen_pt, operations_allowed, @@ -1771,7 +1771,8 @@ void RenderViewHostImpl::OnStartDragging( for (std::vector<DropData::FileInfo>::const_iterator it = drop_data.filenames.begin(); it != drop_data.filenames.end(); ++it) { - base::FilePath path(base::FilePath::FromUTF8Unsafe(UTF16ToUTF8(it->path))); + base::FilePath path( + base::FilePath::FromUTF8Unsafe(base::UTF16ToUTF8(it->path))); if (policy->CanReadFile(GetProcess()->GetID(), path)) filtered_data.filenames.push_back(*it); } diff --git a/content/browser/renderer_host/render_view_host_unittest.cc b/content/browser/renderer_host/render_view_host_unittest.cc index 0b56d16..dd50a6c 100644 --- a/content/browser/renderer_host/render_view_host_unittest.cc +++ b/content/browser/renderer_host/render_view_host_unittest.cc @@ -200,7 +200,7 @@ TEST_F(RenderViewHostTest, DragEnteredFileURLsStillBlocked) { GURL sensitive_file_url = net::FilePathToFileURL(sensitive_file_path); dropped_data.url = highlighted_file_url; dropped_data.filenames.push_back(DropData::FileInfo( - UTF8ToUTF16(dragged_file_path.AsUTF8Unsafe()), base::string16())); + base::UTF8ToUTF16(dragged_file_path.AsUTF8Unsafe()), base::string16())); rvh()->DragTargetDragEnter(dropped_data, client_point, screen_point, blink::WebDragOperationNone, 0); 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 21a5a5d..6a9a341 100644 --- a/content/browser/renderer_host/render_widget_host_view_android.cc +++ b/content/browser/renderer_host/render_widget_host_view_android.cc @@ -555,7 +555,7 @@ void RenderWidgetHostViewAndroid::SelectionChanged(const base::string16& text, return; } - std::string utf8_selection = UTF16ToUTF8(text.substr(pos, n)); + std::string utf8_selection = base::UTF16ToUTF8(text.substr(pos, n)); content_view_core_->OnSelectionChanged(utf8_selection); } 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 2198322..2dd76a1 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 @@ -348,7 +348,7 @@ TEST_F(RenderWidgetHostViewAuraTest, SetCompositionText) { view_->Show(); ui::CompositionText composition_text; - composition_text.text = ASCIIToUTF16("|a|b"); + composition_text.text = base::ASCIIToUTF16("|a|b"); // Focused segment composition_text.underlines.push_back( diff --git a/content/browser/renderer_host/render_widget_host_view_gtk.cc b/content/browser/renderer_host/render_widget_host_view_gtk.cc index 7d74ac2..9e35123 100644 --- a/content/browser/renderer_host/render_widget_host_view_gtk.cc +++ b/content/browser/renderer_host/render_widget_host_view_gtk.cc @@ -945,7 +945,7 @@ void RenderWidgetHostViewGtk::SetTooltipText( gtk_widget_set_has_tooltip(view_.get(), FALSE); } else { gtk_widget_set_tooltip_text(view_.get(), - UTF16ToUTF8(clamped_tooltip).c_str()); + base::UTF16ToUTF8(clamped_tooltip).c_str()); } } @@ -1416,7 +1416,7 @@ bool RenderWidgetHostViewGtk::RetrieveSurrounding(std::string* text, DCHECK(offset <= selection_text_.length()); if (offset == selection_text_.length()) { - *text = UTF16ToUTF8(selection_text_); + *text = base::UTF16ToUTF8(selection_text_); *cursor_index = text->length(); return true; } 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 1ad50b3..11eea49 100644 --- a/content/browser/renderer_host/render_widget_host_view_mac.mm +++ b/content/browser/renderer_host/render_widget_host_view_mac.mm @@ -1070,7 +1070,7 @@ void RenderWidgetHostViewMac::SelectionChanged(const base::string16& text, DCHECK(false) << "The text can not cover range."; return; } - selected_text_ = UTF16ToUTF8(text.substr(pos, n)); + selected_text_ = base::UTF16ToUTF8(text.substr(pos, n)); } [cocoa_view_ setSelectedRange:range.ToNSRange()]; 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 2515496..92b41dd 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 @@ -324,7 +324,7 @@ TEST_F(RenderWidgetHostViewMacTest, AcceleratorDestroy) { } TEST_F(RenderWidgetHostViewMacTest, GetFirstRectForCharacterRangeCaretCase) { - const base::string16 kDummyString = UTF8ToUTF16("hogehoge"); + const base::string16 kDummyString = base::UTF8ToUTF16("hogehoge"); const size_t kDummyOffset = 0; gfx::Rect caret_rect(10, 11, 0, 10); diff --git a/content/browser/safe_util_win.cc b/content/browser/safe_util_win.cc index ac077f1..e5843fd 100644 --- a/content/browser/safe_util_win.cc +++ b/content/browser/safe_util_win.cc @@ -81,7 +81,7 @@ HRESULT AVScanFile(const base::FilePath& full_path, // Note: SetSource looks like it needs to be called, even if empty. // Docs say it is optional, but it appears not calling it at all sets // a zone that is too restrictive. - hr = attachment_services->SetSource(UTF8ToWide(source_url).c_str()); + hr = attachment_services->SetSource(base::UTF8ToWide(source_url).c_str()); if (FAILED(hr)) return hr; diff --git a/content/browser/service_worker/service_worker_dispatcher_host.cc b/content/browser/service_worker/service_worker_dispatcher_host.cc index 76e7ff7..92fe5e7 100644 --- a/content/browser/service_worker/service_worker_dispatcher_host.cc +++ b/content/browser/service_worker/service_worker_dispatcher_host.cc @@ -91,7 +91,7 @@ void ServiceWorkerDispatcherHost::OnRegisterServiceWorker( thread_id, request_id, WebServiceWorkerError::DisabledError, - ASCIIToUTF16(kDisabledErrorMessage))); + base::ASCIIToUTF16(kDisabledErrorMessage))); return; } @@ -103,7 +103,7 @@ void ServiceWorkerDispatcherHost::OnRegisterServiceWorker( thread_id, request_id, WebServiceWorkerError::SecurityError, - ASCIIToUTF16(kDomainMismatchErrorMessage))); + base::ASCIIToUTF16(kDomainMismatchErrorMessage))); return; } @@ -128,7 +128,7 @@ void ServiceWorkerDispatcherHost::OnUnregisterServiceWorker( thread_id, request_id, blink::WebServiceWorkerError::DisabledError, - ASCIIToUTF16(kDisabledErrorMessage))); + base::ASCIIToUTF16(kDisabledErrorMessage))); return; } diff --git a/content/browser/service_worker/service_worker_registration_status.cc b/content/browser/service_worker/service_worker_registration_status.cc index 4556b5f..0ceeb8a 100644 --- a/content/browser/service_worker/service_worker_registration_status.cc +++ b/content/browser/service_worker/service_worker_registration_status.cc @@ -28,12 +28,12 @@ void GetServiceWorkerRegistrationStatusResponse( case REGISTRATION_INSTALL_FAILED: *error_type = WebServiceWorkerError::InstallError; - *message = ASCIIToUTF16(kInstallFailedErrorMessage); + *message = base::ASCIIToUTF16(kInstallFailedErrorMessage); return; case REGISTRATION_ACTIVATE_FAILED: *error_type = WebServiceWorkerError::ActivateError; - *message = ASCIIToUTF16(kActivateFailedErrorMessage); + *message = base::ASCIIToUTF16(kActivateFailedErrorMessage); return; } NOTREACHED(); diff --git a/content/browser/session_history_browsertest.cc b/content/browser/session_history_browsertest.cc index bec8293..04d00da 100644 --- a/content/browser/session_history_browsertest.cc +++ b/content/browser/session_history_browsertest.cc @@ -99,7 +99,7 @@ class SessionHistoryTest : public ContentBrowserTest { void NavigateAndCheckTitle(const char* filename, const std::string& expected_title) { - base::string16 expected_title16(ASCIIToUTF16(expected_title)); + base::string16 expected_title16(base::ASCIIToUTF16(expected_title)); TitleWatcher title_watcher(shell()->web_contents(), expected_title16); NavigateToURL(shell(), GetURL(filename)); ASSERT_EQ(expected_title16, title_watcher.WaitAndGetTitle()); diff --git a/content/browser/speech/google_one_shot_remote_engine_unittest.cc b/content/browser/speech/google_one_shot_remote_engine_unittest.cc index f7c6561..a16329c 100644 --- a/content/browser/speech/google_one_shot_remote_engine_unittest.cc +++ b/content/browser/speech/google_one_shot_remote_engine_unittest.cc @@ -83,7 +83,7 @@ TEST_F(GoogleOneShotRemoteEngineTest, BasicTest) { "[{\"utterance\":\"123456\",\"confidence\":0.9}]}"); EXPECT_EQ(error_, SPEECH_RECOGNITION_ERROR_NONE); EXPECT_EQ(1U, result().hypotheses.size()); - EXPECT_EQ(ASCIIToUTF16("123456"), result().hypotheses[0].utterance); + EXPECT_EQ(base::ASCIIToUTF16("123456"), result().hypotheses[0].utterance); EXPECT_EQ(0.9, result().hypotheses[0].confidence); // Normal success case with multiple results. @@ -93,9 +93,9 @@ TEST_F(GoogleOneShotRemoteEngineTest, BasicTest) { "{\"utterance\":\"123456\",\"confidence\":0.5}]}"); EXPECT_EQ(error_, SPEECH_RECOGNITION_ERROR_NONE); EXPECT_EQ(2u, result().hypotheses.size()); - EXPECT_EQ(ASCIIToUTF16("hello"), result().hypotheses[0].utterance); + EXPECT_EQ(base::ASCIIToUTF16("hello"), result().hypotheses[0].utterance); EXPECT_EQ(0.9, result().hypotheses[0].confidence); - EXPECT_EQ(ASCIIToUTF16("123456"), result().hypotheses[1].utterance); + EXPECT_EQ(base::ASCIIToUTF16("123456"), result().hypotheses[1].utterance); EXPECT_EQ(0.5, result().hypotheses[1].confidence); // Zero results. diff --git a/content/browser/speech/google_streaming_remote_engine.cc b/content/browser/speech/google_streaming_remote_engine.cc index b6b68d1..a8d034a 100644 --- a/content/browser/speech/google_streaming_remote_engine.cc +++ b/content/browser/speech/google_streaming_remote_engine.cc @@ -455,7 +455,7 @@ GoogleStreamingRemoteEngine::ProcessDownstreamResponse( DCHECK(ws_alternative.has_transcript()); // TODO(hans): Perhaps the transcript should be required in the proto? if (ws_alternative.has_transcript()) - hypothesis.utterance = UTF8ToUTF16(ws_alternative.transcript()); + hypothesis.utterance = base::UTF8ToUTF16(ws_alternative.transcript()); result.hypotheses.push_back(hypothesis); } diff --git a/content/browser/speech/google_streaming_remote_engine_unittest.cc b/content/browser/speech/google_streaming_remote_engine_unittest.cc index dd0ef89..c484670 100644 --- a/content/browser/speech/google_streaming_remote_engine_unittest.cc +++ b/content/browser/speech/google_streaming_remote_engine_unittest.cc @@ -112,9 +112,9 @@ TEST_F(GoogleStreamingRemoteEngineTest, SingleDefinitiveResult) { SpeechRecognitionResult& result = results.back(); result.is_provisional = false; result.hypotheses.push_back( - SpeechRecognitionHypothesis(UTF8ToUTF16("hypothesis 1"), 0.1F)); + SpeechRecognitionHypothesis(base::UTF8ToUTF16("hypothesis 1"), 0.1F)); result.hypotheses.push_back( - SpeechRecognitionHypothesis(UTF8ToUTF16("hypothesis 2"), 0.2F)); + SpeechRecognitionHypothesis(base::UTF8ToUTF16("hypothesis 2"), 0.2F)); ProvideMockResultDownstream(result); ExpectResultsReceived(results); @@ -142,8 +142,8 @@ TEST_F(GoogleStreamingRemoteEngineTest, SeveralStreamingResults) { SpeechRecognitionResult& result = results.back(); result.is_provisional = (i % 2 == 0); // Alternate result types. float confidence = result.is_provisional ? 0.0F : (i * 0.1F); - result.hypotheses.push_back( - SpeechRecognitionHypothesis(UTF8ToUTF16("hypothesis"), confidence)); + result.hypotheses.push_back(SpeechRecognitionHypothesis( + base::UTF8ToUTF16("hypothesis"), confidence)); ProvideMockResultDownstream(result); ExpectResultsReceived(results); @@ -161,7 +161,7 @@ TEST_F(GoogleStreamingRemoteEngineTest, SeveralStreamingResults) { SpeechRecognitionResult& result = results.back(); result.is_provisional = false; result.hypotheses.push_back( - SpeechRecognitionHypothesis(UTF8ToUTF16("The final result"), 1.0F)); + SpeechRecognitionHypothesis(base::UTF8ToUTF16("The final result"), 1.0F)); ProvideMockResultDownstream(result); ExpectResultsReceived(results); ASSERT_TRUE(engine_under_test_->IsRecognitionPending()); @@ -188,7 +188,7 @@ TEST_F(GoogleStreamingRemoteEngineTest, NoFinalResultAfterAudioChunksEnded) { results.push_back(SpeechRecognitionResult()); SpeechRecognitionResult& result = results.back(); result.hypotheses.push_back( - SpeechRecognitionHypothesis(UTF8ToUTF16("hypothesis"), 1.0F)); + SpeechRecognitionHypothesis(base::UTF8ToUTF16("hypothesis"), 1.0F)); ProvideMockResultDownstream(result); ExpectResultsReceived(results); ASSERT_TRUE(engine_under_test_->IsRecognitionPending()); @@ -228,7 +228,7 @@ TEST_F(GoogleStreamingRemoteEngineTest, NoMatchError) { SpeechRecognitionResult& result = results.back(); result.is_provisional = true; result.hypotheses.push_back( - SpeechRecognitionHypothesis(UTF8ToUTF16("The final result"), 0.0F)); + SpeechRecognitionHypothesis(base::UTF8ToUTF16("The final result"), 0.0F)); ProvideMockResultDownstream(result); ExpectResultsReceived(results); ASSERT_TRUE(engine_under_test_->IsRecognitionPending()); @@ -305,7 +305,7 @@ TEST_F(GoogleStreamingRemoteEngineTest, Stability) { SpeechRecognitionResult& result = results.back(); result.is_provisional = true; result.hypotheses.push_back( - SpeechRecognitionHypothesis(UTF8ToUTF16("foo"), 0.5)); + SpeechRecognitionHypothesis(base::UTF8ToUTF16("foo"), 0.5)); // Check that the protobuf generated the expected result. ExpectResultsReceived(results); @@ -425,7 +425,7 @@ void GoogleStreamingRemoteEngineTest::ProvideMockResultDownstream( proto_result->add_alternative(); const SpeechRecognitionHypothesis& hypothesis = result.hypotheses[i]; proto_alternative->set_confidence(hypothesis.confidence); - proto_alternative->set_transcript(UTF16ToUTF8(hypothesis.utterance)); + proto_alternative->set_transcript(base::UTF16ToUTF8(hypothesis.utterance)); } ProvideMockProtoResultDownstream(proto_event); } diff --git a/content/browser/speech/speech_recognition_browsertest.cc b/content/browser/speech/speech_recognition_browsertest.cc index 82daf32..f97d222 100644 --- a/content/browser/speech/speech_recognition_browsertest.cc +++ b/content/browser/speech/speech_recognition_browsertest.cc @@ -172,7 +172,7 @@ class SpeechRecognitionBrowserTest : SpeechRecognitionResult GetGoodSpeechResult() { SpeechRecognitionResult result; result.hypotheses.push_back(SpeechRecognitionHypothesis( - UTF8ToUTF16("Pictures of the moon"), 1.0F)); + base::UTF8ToUTF16("Pictures of the moon"), 1.0F)); return result; } diff --git a/content/browser/utility_process_host_impl.cc b/content/browser/utility_process_host_impl.cc index ed53fe8..e2f45245 100644 --- a/content/browser/utility_process_host_impl.cc +++ b/content/browser/utility_process_host_impl.cc @@ -142,7 +142,7 @@ bool UtilityProcessHostImpl::StartProcess() { // Name must be set or metrics_service will crash in any test which // launches a UtilityProcessHost. process_.reset(new BrowserChildProcessHostImpl(PROCESS_TYPE_UTILITY, this)); - process_->SetName(ASCIIToUTF16("utility process")); + process_->SetName(base::ASCIIToUTF16("utility process")); std::string channel_id = process_->GetHost()->CreateChannel(); if (channel_id.empty()) diff --git a/content/browser/web_contents/web_contents_drag_win.cc b/content/browser/web_contents/web_contents_drag_win.cc index ffc8713..d319190 100644 --- a/content/browser/web_contents/web_contents_drag_win.cc +++ b/content/browser/web_contents/web_contents_drag_win.cc @@ -243,8 +243,8 @@ void WebContentsDragWin::PrepareDragForDownload( net::GenerateFileName(download_url, std::string(), std::string(), - UTF16ToUTF8(file_name.value()), - UTF16ToUTF8(mime_type), + base::UTF16ToUTF8(file_name.value()), + base::UTF16ToUTF8(mime_type), default_name); base::FilePath temp_dir_path; if (!base::CreateNewTempDirectory(FILE_PATH_LITERAL("chrome_drag"), diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc index 8e34582..9cd08f8 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc @@ -2709,7 +2709,7 @@ bool WebContentsImpl::UpdateTitleForEntry(NavigationEntryImpl* entry, base::string16 final_title; bool explicit_set; if (entry && entry->GetURL().SchemeIsFile() && title.empty()) { - final_title = UTF8ToUTF16(entry->GetURL().ExtractFileName()); + final_title = base::UTF8ToUTF16(entry->GetURL().ExtractFileName()); explicit_set = false; // Don't count synthetic titles toward the set limit. } else { TrimWhitespace(title, TRIM_ALL, &final_title); diff --git a/content/browser/web_contents/web_contents_impl_unittest.cc b/content/browser/web_contents/web_contents_impl_unittest.cc index c9654e2..a44ff44 100644 --- a/content/browser/web_contents/web_contents_impl_unittest.cc +++ b/content/browser/web_contents/web_contents_impl_unittest.cc @@ -304,9 +304,10 @@ TEST_F(WebContentsImplTest, UpdateTitle) { LoadCommittedDetails details; cont.RendererDidNavigate(params, &details); - contents()->UpdateTitle(rvh(), 0, ASCIIToUTF16(" Lots O' Whitespace\n"), + contents()->UpdateTitle(rvh(), 0, + base::ASCIIToUTF16(" Lots O' Whitespace\n"), base::i18n::LEFT_TO_RIGHT); - EXPECT_EQ(ASCIIToUTF16("Lots O' Whitespace"), contents()->GetTitle()); + EXPECT_EQ(base::ASCIIToUTF16("Lots O' Whitespace"), contents()->GetTitle()); } TEST_F(WebContentsImplTest, DontUseTitleFromPendingEntry) { @@ -318,7 +319,7 @@ TEST_F(WebContentsImplTest, DontUseTitleFromPendingEntry) { TEST_F(WebContentsImplTest, UseTitleFromPendingEntryIfSet) { const GURL kGURL("chrome://blah"); - const base::string16 title = ASCIIToUTF16("My Title"); + const base::string16 title = base::ASCIIToUTF16("My Title"); controller().LoadURL( kGURL, Referrer(), PAGE_TRANSITION_TYPED, std::string()); @@ -350,7 +351,7 @@ TEST_F(WebContentsImplTest, NTPViewSource) { LoadCommittedDetails details; cont.RendererDidNavigate(params, &details); // Also check title and url. - EXPECT_EQ(ASCIIToUTF16(kUrl), contents()->GetTitle()); + EXPECT_EQ(base::ASCIIToUTF16(kUrl), contents()->GetTitle()); } // Test to ensure UpdateMaxPageID is working properly. @@ -2037,7 +2038,8 @@ TEST_F(WebContentsImplTest, NoJSMessageOnInterstitials) { IPC::Message* dummy_message = new IPC::Message; bool did_suppress_message = false; contents()->RunJavaScriptMessage(contents()->GetRenderViewHost(), - ASCIIToUTF16("This is an informative message"), ASCIIToUTF16("OK"), + base::ASCIIToUTF16("This is an informative message"), + base::ASCIIToUTF16("OK"), kGURL, JAVASCRIPT_MESSAGE_TYPE_ALERT, dummy_message, &did_suppress_message); EXPECT_TRUE(did_suppress_message); diff --git a/content/browser/web_contents/web_contents_view_aura.cc b/content/browser/web_contents/web_contents_view_aura.cc index 685f5b1..e4ef8c0 100644 --- a/content/browser/web_contents/web_contents_view_aura.cc +++ b/content/browser/web_contents/web_contents_view_aura.cc @@ -281,8 +281,9 @@ void PrepareDragData(const DropData& drop_data, it != drop_data.filenames.end(); ++it) { filenames.push_back( ui::OSExchangeData::FileInfo( - base::FilePath::FromUTF8Unsafe(UTF16ToUTF8(it->path)), - base::FilePath::FromUTF8Unsafe(UTF16ToUTF8(it->display_name)))); + base::FilePath::FromUTF8Unsafe(base::UTF16ToUTF8(it->path)), + base::FilePath::FromUTF8Unsafe( + base::UTF16ToUTF8(it->display_name)))); } provider->SetFilenames(filenames); } @@ -323,8 +324,8 @@ void PrepareDropData(DropData* drop_data, const ui::OSExchangeData& data) { it = files.begin(); it != files.end(); ++it) { drop_data->filenames.push_back( DropData::FileInfo( - UTF8ToUTF16(it->path.AsUTF8Unsafe()), - UTF8ToUTF16(it->display_name.AsUTF8Unsafe()))); + base::UTF8ToUTF16(it->path.AsUTF8Unsafe()), + base::UTF8ToUTF16(it->display_name.AsUTF8Unsafe()))); } } 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 687ce57..eb3bdae 100644 --- a/content/browser/web_contents/web_contents_view_aura_browsertest.cc +++ b/content/browser/web_contents/web_contents_view_aura_browsertest.cc @@ -196,7 +196,7 @@ class WebContentsViewAuraTest : public ContentBrowserTest { { // Do a swipe-right now. That should navigate backwards. - base::string16 expected_title = ASCIIToUTF16("Title: #1"); + base::string16 expected_title = base::ASCIIToUTF16("Title: #1"); content::TitleWatcher title_watcher(web_contents, expected_title); generator.GestureScrollSequence( gfx::Point(bounds.x() + 2, bounds.y() + 10), @@ -214,7 +214,7 @@ class WebContentsViewAuraTest : public ContentBrowserTest { { // Do a fling-right now. That should navigate backwards. - base::string16 expected_title = ASCIIToUTF16("Title:"); + base::string16 expected_title = base::ASCIIToUTF16("Title:"); content::TitleWatcher title_watcher(web_contents, expected_title); generator.GestureScrollSequence( gfx::Point(bounds.x() + 2, bounds.y() + 10), @@ -232,7 +232,7 @@ class WebContentsViewAuraTest : public ContentBrowserTest { { // Do a swipe-left now. That should navigate forward. - base::string16 expected_title = ASCIIToUTF16("Title: #1"); + base::string16 expected_title = base::ASCIIToUTF16("Title: #1"); content::TitleWatcher title_watcher(web_contents, expected_title); generator.GestureScrollSequence( gfx::Point(bounds.right() - 10, bounds.y() + 10), @@ -438,7 +438,7 @@ IN_PROC_BROWSER_TEST_F(WebContentsViewAuraTest, OverscrollScreenshot) { { // Now, swipe right to navigate backwards. This should navigate away from // index 3 to index 2, and index 3 should have a screenshot. - base::string16 expected_title = ASCIIToUTF16("Title: #2"); + base::string16 expected_title = base::ASCIIToUTF16("Title: #2"); content::TitleWatcher title_watcher(web_contents, expected_title); aura::Window* content = web_contents->GetView()->GetContentNativeView(); gfx::Rect bounds = content->GetBoundsInRootWindow(); @@ -469,7 +469,7 @@ IN_PROC_BROWSER_TEST_F(WebContentsViewAuraTest, OverscrollScreenshot) { { // Navigate back in history. - base::string16 expected_title = ASCIIToUTF16("Title: #3"); + base::string16 expected_title = base::ASCIIToUTF16("Title: #3"); content::TitleWatcher title_watcher(web_contents, expected_title); web_contents->GetController().GoBack(); base::string16 actual_title = title_watcher.WaitAndGetTitle(); @@ -641,7 +641,7 @@ IN_PROC_BROWSER_TEST_F(WebContentsViewAuraTest, // Do a swipe left to start a forward navigation. Then quickly do a swipe // right. - base::string16 expected_title = ASCIIToUTF16("Title: #2"); + base::string16 expected_title = base::ASCIIToUTF16("Title: #2"); content::TitleWatcher title_watcher(web_contents, expected_title); NavigationWatcher nav_watcher(web_contents); diff --git a/content/browser/web_contents/web_contents_view_gtk.cc b/content/browser/web_contents/web_contents_view_gtk.cc index bf4dcb7f..516ada0 100644 --- a/content/browser/web_contents/web_contents_view_gtk.cc +++ b/content/browser/web_contents/web_contents_view_gtk.cc @@ -253,7 +253,7 @@ void WebContentsViewGtk::SetPageTitle(const base::string16& title) { if (content_view) { GdkWindow* content_window = gtk_widget_get_window(content_view); if (content_window) { - gdk_window_set_title(content_window, UTF16ToUTF8(title).c_str()); + gdk_window_set_title(content_window, base::UTF16ToUTF8(title).c_str()); } } } diff --git a/content/browser/web_contents/web_drag_dest_gtk.cc b/content/browser/web_contents/web_drag_dest_gtk.cc index 738d6b5..52284a4 100644 --- a/content/browser/web_contents/web_drag_dest_gtk.cc +++ b/content/browser/web_contents/web_drag_dest_gtk.cc @@ -186,7 +186,7 @@ void WebDragDestGtk::OnDragDataReceived( guchar* text = gtk_selection_data_get_text(data); if (text) { drop_data_->text = base::NullableString16( - UTF8ToUTF16(std::string(reinterpret_cast<const char*>(text))), + base::UTF8ToUTF16(std::string(reinterpret_cast<const char*>(text))), false); g_free(text); } @@ -204,7 +204,7 @@ void WebDragDestGtk::OnDragDataReceived( if (url.SchemeIs(chrome::kFileScheme) && net::FileURLToFilePath(url, &file_path)) { drop_data_->filenames.push_back( - DropData::FileInfo(UTF8ToUTF16(file_path.value()), + DropData::FileInfo(base::UTF8ToUTF16(file_path.value()), base::string16())); // This is a hack. Some file managers also populate text/plain with // a file URL when dragging files, so we clear it to avoid exposing @@ -220,7 +220,7 @@ void WebDragDestGtk::OnDragDataReceived( } else if (target == ui::GetAtomForTarget(ui::TEXT_HTML)) { // TODO(estade): Can the html have a non-UTF8 encoding? drop_data_->html = base::NullableString16( - UTF8ToUTF16(std::string(reinterpret_cast<const char*>(raw_data), + base::UTF8ToUTF16(std::string(reinterpret_cast<const char*>(raw_data), data_length)), false); // We leave the base URL empty. @@ -230,8 +230,10 @@ void WebDragDestGtk::OnDragDataReceived( size_t split = netscape_url.find_first_of('\n'); if (split != std::string::npos) { drop_data_->url = GURL(netscape_url.substr(0, split)); - if (split < netscape_url.size() - 1) - drop_data_->url_title = UTF8ToUTF16(netscape_url.substr(split + 1)); + if (split < netscape_url.size() - 1) { + drop_data_->url_title = + base::UTF8ToUTF16(netscape_url.substr(split + 1)); + } } } else if (target == ui::GetAtomForTarget(ui::CHROME_NAMED_URL)) { ui::ExtractNamedURL(data, &drop_data_->url, &drop_data_->url_title); 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 a7dcede..c6c7ab5 100644 --- a/content/browser/web_contents/web_drag_dest_mac_unittest.mm +++ b/content/browser/web_contents/web_drag_dest_mac_unittest.mm @@ -140,7 +140,7 @@ TEST_F(WebDragDestTest, URL) { EXPECT_TRUE(ui::PopulateURLAndTitleFromPasteboard( &result_url, &result_title, pboard, YES)); EXPECT_EQ("file://localhost/bin/sh", result_url.spec()); - EXPECT_EQ("sh", UTF16ToUTF8(result_title)); + EXPECT_EQ("sh", base::UTF16ToUTF8(result_title)); [pboard releaseGlobally]; } diff --git a/content/browser/web_contents/web_drag_source_gtk.cc b/content/browser/web_contents/web_drag_source_gtk.cc index 2f9e587..a515e23 100644 --- a/content/browser/web_contents/web_drag_source_gtk.cc +++ b/content/browser/web_contents/web_drag_source_gtk.cc @@ -179,7 +179,7 @@ void WebDragSourceGtk::OnDragDataGet(GtkWidget* sender, switch (target_type) { case ui::TEXT_PLAIN: { - std::string utf8_text = UTF16ToUTF8(drop_data_->text.string()); + std::string utf8_text = base::UTF16ToUTF8(drop_data_->text.string()); gtk_selection_data_set_text(selection_data, utf8_text.c_str(), utf8_text.length()); break; @@ -188,7 +188,7 @@ void WebDragSourceGtk::OnDragDataGet(GtkWidget* sender, case ui::TEXT_HTML: { // TODO(estade): change relative links to be absolute using // |html_base_url|. - std::string utf8_text = UTF16ToUTF8(drop_data_->html.string()); + std::string utf8_text = base::UTF16ToUTF8(drop_data_->html.string()); gtk_selection_data_set(selection_data, ui::GetAtomForTarget(ui::TEXT_HTML), kBitsPerByte, @@ -319,7 +319,7 @@ void WebDragSourceGtk::OnDragBegin(GtkWidget* sender, std::string(), std::string(), download_file_name_.value(), - UTF16ToUTF8(wide_download_mime_type_), + base::UTF16ToUTF8(wide_download_mime_type_), default_name); // Pass the file name to the drop target by setting the source window's diff --git a/content/browser/web_contents/web_drag_source_mac.mm b/content/browser/web_contents/web_drag_source_mac.mm index c667320..a5b51b0 100644 --- a/content/browser/web_contents/web_drag_source_mac.mm +++ b/content/browser/web_contents/web_drag_source_mac.mm @@ -147,7 +147,7 @@ void PromiseWriterHelper(const DropData& drop_data, - (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 = ASCIIToUTF16( + const base::string16 kHtmlHeader = base::ASCIIToUTF16( "<meta http-equiv=\"Content-Type\" content=\"text/html;charset=UTF-8\">"); // Be extra paranoid; avoid crashing. @@ -397,7 +397,7 @@ void PromiseWriterHelper(const DropData& drop_data, // name. std::string defaultName = content::GetContentClient()->browser()->GetDefaultDownloadName(); - mimeType = UTF16ToUTF8(mimeType16); + mimeType = base::UTF16ToUTF8(mimeType16); downloadFileName_ = net::GenerateFileName(downloadURL_, std::string(), diff --git a/content/browser/webui/web_ui_data_source_unittest.cc b/content/browser/webui/web_ui_data_source_unittest.cc index a5da7eb..4dc9c81 100644 --- a/content/browser/webui/web_ui_data_source_unittest.cc +++ b/content/browser/webui/web_ui_data_source_unittest.cc @@ -27,7 +27,7 @@ class TestClient : public TestContentClient { virtual base::string16 GetLocalizedString(int message_id) const OVERRIDE { if (message_id == kDummyStringId) - return UTF8ToUTF16(kDummyString); + return base::UTF8ToUTF16(kDummyString); return base::string16(); } @@ -100,7 +100,7 @@ TEST_F(WebUIDataSourceTest, EmptyStrings) { TEST_F(WebUIDataSourceTest, SomeStrings) { source()->SetJsonPath("strings.js"); - source()->AddString("planet", ASCIIToUTF16("pluto")); + source()->AddString("planet", base::ASCIIToUTF16("pluto")); source()->AddLocalizedString("button", kDummyStringId); StartDataRequest("strings.js"); std::string result(reinterpret_cast<const char*>( diff --git a/content/browser/webui/web_ui_impl.cc b/content/browser/webui/web_ui_impl.cc index 73c4ebd..0c54523 100644 --- a/content/browser/webui/web_ui_impl.cc +++ b/content/browser/webui/web_ui_impl.cc @@ -37,9 +37,9 @@ base::string16 WebUI::GetJavascriptCall( parameters += char16(','); base::JSONWriter::Write(arg_list[i], &json); - parameters += UTF8ToUTF16(json); + parameters += base::UTF8ToUTF16(json); } - return ASCIIToUTF16(function_name) + + return base::ASCIIToUTF16(function_name) + char16('(') + parameters + char16(')') + char16(';'); } @@ -144,7 +144,7 @@ void WebUIImpl::SetController(WebUIController* controller) { void WebUIImpl::CallJavascriptFunction(const std::string& function_name) { DCHECK(IsStringASCII(function_name)); - base::string16 javascript = ASCIIToUTF16(function_name + "();"); + base::string16 javascript = base::ASCIIToUTF16(function_name + "();"); ExecuteJavascript(javascript); } @@ -233,7 +233,7 @@ void WebUIImpl::AddMessageHandler(WebUIMessageHandler* handler) { void WebUIImpl::ExecuteJavascript(const base::string16& javascript) { static_cast<RenderViewHostImpl*>( web_contents_->GetRenderViewHost())->ExecuteJavascriptInWebFrame( - ASCIIToUTF16(frame_xpath_), javascript); + base::ASCIIToUTF16(frame_xpath_), javascript); } } // namespace content diff --git a/content/browser/webui/web_ui_message_handler_unittest.cc b/content/browser/webui/web_ui_message_handler_unittest.cc index fe09a7b..cd12a3e 100644 --- a/content/browser/webui/web_ui_message_handler_unittest.cc +++ b/content/browser/webui/web_ui_message_handler_unittest.cc @@ -14,9 +14,9 @@ namespace content { TEST(WebUIMessageHandlerTest, ExtractIntegerValue) { base::ListValue list; int value, zero_value = 0, neg_value = -1234, pos_value = 1234; - base::string16 zero_string(UTF8ToUTF16("0")); - base::string16 neg_string(UTF8ToUTF16("-1234")); - base::string16 pos_string(UTF8ToUTF16("1234")); + base::string16 zero_string(base::UTF8ToUTF16("0")); + base::string16 neg_string(base::UTF8ToUTF16("-1234")); + base::string16 pos_string(base::UTF8ToUTF16("1234")); list.Append(new base::FundamentalValue(zero_value)); EXPECT_TRUE(WebUIMessageHandler::ExtractIntegerValue(&list, &value)); @@ -51,9 +51,9 @@ TEST(WebUIMessageHandlerTest, ExtractIntegerValue) { TEST(WebUIMessageHandlerTest, ExtractDoubleValue) { base::ListValue list; double value, zero_value = 0.0, neg_value = -1234.5, pos_value = 1234.5; - base::string16 zero_string(UTF8ToUTF16("0")); - base::string16 neg_string(UTF8ToUTF16("-1234.5")); - base::string16 pos_string(UTF8ToUTF16("1234.5")); + base::string16 zero_string(base::UTF8ToUTF16("0")); + base::string16 neg_string(base::UTF8ToUTF16("-1234.5")); + base::string16 pos_string(base::UTF8ToUTF16("1234.5")); list.Append(new base::FundamentalValue(zero_value)); EXPECT_TRUE(WebUIMessageHandler::ExtractDoubleValue(&list, &value)); @@ -87,7 +87,7 @@ TEST(WebUIMessageHandlerTest, ExtractDoubleValue) { TEST(WebUIMessageHandlerTest, ExtractStringValue) { base::ListValue list; - base::string16 in_string(UTF8ToUTF16( + base::string16 in_string(base::UTF8ToUTF16( "The facts, though interesting, are irrelevant.")); list.Append(new base::StringValue(in_string)); base::string16 out_string = WebUIMessageHandler::ExtractStringValue(&list); diff --git a/content/browser/worker_host/test/worker_browsertest.cc b/content/browser/worker_host/test/worker_browsertest.cc index f895fb7..4884d03 100644 --- a/content/browser/worker_host/test/worker_browsertest.cc +++ b/content/browser/worker_host/test/worker_browsertest.cc @@ -42,7 +42,7 @@ class WorkerTest : public ContentBrowserTest { const std::string& test_case, const std::string& query) { GURL url = GetTestURL(test_case, query); - const base::string16 expected_title = ASCIIToUTF16("OK"); + const base::string16 expected_title = base::ASCIIToUTF16("OK"); TitleWatcher title_watcher(window->web_contents(), expected_title); NavigateToURL(window, url); base::string16 final_title = title_watcher.WaitAndGetTitle(); @@ -275,7 +275,7 @@ IN_PROC_BROWSER_TEST_F(WorkerTest, WebSocketSharedWorker) { // Run test. Shell* window = shell(); - const base::string16 expected_title = ASCIIToUTF16("OK"); + const base::string16 expected_title = base::ASCIIToUTF16("OK"); TitleWatcher title_watcher(window->web_contents(), expected_title); NavigateToURL(window, url); base::string16 final_title = title_watcher.WaitAndGetTitle(); diff --git a/content/browser/worker_host/worker_process_host.cc b/content/browser/worker_host/worker_process_host.cc index 2707ab6..5782397 100644 --- a/content/browser/worker_host/worker_process_host.cc +++ b/content/browser/worker_host/worker_process_host.cc @@ -511,7 +511,7 @@ void WorkerProcessHost::UpdateTitle() { display_title += *i; } - process_->SetName(UTF8ToUTF16(display_title)); + process_->SetName(base::UTF8ToUTF16(display_title)); } void WorkerProcessHost::DocumentDetached(WorkerMessageFilter* filter, diff --git a/content/child/browser_font_resource_trusted.cc b/content/child/browser_font_resource_trusted.cc index be4a8b6..39746a8 100644 --- a/content/child/browser_font_resource_trusted.cc +++ b/content/child/browser_font_resource_trusted.cc @@ -65,7 +65,7 @@ class TextRunCollection { StringVar* text_string = StringVar::FromPPVar(run.text); if (!text_string) return; // Leave num_runs_ = 0 so we'll do nothing. - text_ = UTF8ToUTF16(text_string->value()); + text_ = base::UTF8ToUTF16(text_string->value()); if (run.override_direction) { // Skip autodetection. @@ -127,7 +127,7 @@ bool PPTextRunToWebTextRun(const PP_BrowserFont_Trusted_TextRun& text, if (!text_string) return false; - *run = WebTextRun(UTF8ToUTF16(text_string->value()), + *run = WebTextRun(base::UTF8ToUTF16(text_string->value()), PP_ToBool(text.rtl), PP_ToBool(text.override_direction)); return true; @@ -191,7 +191,7 @@ WebFontDescription PPFontDescToWebFontDesc( } } else { // Use the exact font. - resolved_family = UTF8ToUTF16(face_name->value()); + resolved_family = base::UTF8ToUTF16(face_name->value()); } result.family = resolved_family; @@ -273,7 +273,8 @@ PP_Bool BrowserFontResource_Trusted::Describe( // While converting the other way in PPFontDescToWebFontDesc we validated // that the enums can be casted. WebFontDescription web_desc = font_->fontDescription(); - description->face = StringVar::StringToPPVar(UTF16ToUTF8(web_desc.family)); + description->face = + StringVar::StringToPPVar(base::UTF16ToUTF8(web_desc.family)); description->family = static_cast<PP_BrowserFont_Trusted_Family>(web_desc.genericFamily); description->size = static_cast<uint32_t>(web_desc.size); diff --git a/content/child/child_process.cc b/content/child/child_process.cc index 837ab02..94341d7 100644 --- a/content/child/child_process.cc +++ b/content/child/child_process.cc @@ -116,7 +116,8 @@ void ChildProcess::WaitForDebugger(const std::string& label) { std::string message = label; message += " starting with pid: "; message += base::IntToString(base::GetCurrentProcId()); - ::MessageBox(NULL, UTF8ToWide(message).c_str(), UTF8ToWide(title).c_str(), + ::MessageBox(NULL, base::UTF8ToWide(message).c_str(), + base::UTF8ToWide(title).c_str(), MB_OK | MB_SETFOREGROUND); #elif defined(OS_POSIX) #if defined(OS_ANDROID) diff --git a/content/child/fileapi/webfilesystem_impl.cc b/content/child/fileapi/webfilesystem_impl.cc index 640c1a9..59e9d56 100644 --- a/content/child/fileapi/webfilesystem_impl.cc +++ b/content/child/fileapi/webfilesystem_impl.cc @@ -151,7 +151,7 @@ void OpenFileSystemCallbackAdapter( CallbackFileSystemCallbacks( thread_id, callbacks_id, waitable_results, &WebFileSystemCallbacks::didOpenFileSystem, - MakeTuple(UTF8ToUTF16(name), root)); + MakeTuple(base::UTF8ToUTF16(name), root)); } void ResolveURLCallbackAdapter( @@ -164,7 +164,7 @@ void ResolveURLCallbackAdapter( CallbackFileSystemCallbacks( thread_id, callbacks_id, waitable_results, &WebFileSystemCallbacks::didResolveURL, - MakeTuple(UTF8ToUTF16(info.name), info.root_url, + MakeTuple(base::UTF8ToUTF16(info.name), info.root_url, static_cast<blink::WebFileSystemType>(info.mount_type), normalized_path.AsUTF16Unsafe(), is_directory)); } diff --git a/content/child/npapi/plugin_instance.cc b/content/child/npapi/plugin_instance.cc index 30b3a58..a7e2b94 100644 --- a/content/child/npapi/plugin_instance.cc +++ b/content/child/npapi/plugin_instance.cc @@ -184,7 +184,7 @@ bool PluginInstance::GetFormValue(base::string16* value) { return false; } // Assumes the result is UTF8 text, as Firefox does. - *value = UTF8ToUTF16(plugin_value); + *value = base::UTF8ToUTF16(plugin_value); host_->host_functions()->memfree(plugin_value); return true; } diff --git a/content/child/npapi/webplugin_delegate_impl_mac.mm b/content/child/npapi/webplugin_delegate_impl_mac.mm index c125dc8..6a25bd8 100644 --- a/content/child/npapi/webplugin_delegate_impl_mac.mm +++ b/content/child/npapi/webplugin_delegate_impl_mac.mm @@ -229,7 +229,7 @@ bool WebPluginDelegateImpl::PlatformInitialize() { // that behavior here. const WebPluginInfo& plugin_info = instance_->plugin_lib()->plugin_info(); - if (plugin_info.name.find(ASCIIToUTF16("Flash")) != + if (plugin_info.name.find(base::ASCIIToUTF16("Flash")) != base::string16::npos) gpu_preference = gfx::PreferIntegratedGpu; surface_ = plugin_->GetAcceleratedSurface(gpu_preference); diff --git a/content/child/socket_stream_dispatcher.cc b/content/child/socket_stream_dispatcher.cc index 9370f08..beeee75 100644 --- a/content/child/socket_stream_dispatcher.cc +++ b/content/child/socket_stream_dispatcher.cc @@ -168,7 +168,7 @@ void IPCWebSocketStreamHandleBridge::OnFailed(int error_code, DVLOG(1) << "Bridge #" << socket_id_ << " OnFailed (error_code=" << error_code << ")"; if (delegate_) - delegate_->DidFail(handle_, error_code, ASCIIToUTF16(error_msg)); + delegate_->DidFail(handle_, error_code, base::ASCIIToUTF16(error_msg)); } SocketStreamDispatcher::SocketStreamDispatcher() { diff --git a/content/common/android/address_parser_unittest.cc b/content/common/android/address_parser_unittest.cc index 1a8d17e..cefc537 100644 --- a/content/common/android/address_parser_unittest.cc +++ b/content/common/android/address_parser_unittest.cc @@ -25,14 +25,14 @@ class AddressParserTest : public testing::Test { } std::string GetHouseNumber(const std::string& content) const { - base::string16 content_16 = UTF8ToUTF16(content); + base::string16 content_16 = base::UTF8ToUTF16(content); base::string16 result; HouseNumberParser parser; Word word; if (parser.Parse(content_16.begin(), content_16.end(), &word)) result = base::string16(word.begin, word.end); - return UTF16ToUTF8(result); + return base::UTF16ToUTF8(result); } bool ContainsHouseNumber(const std::string& content) const { @@ -40,7 +40,7 @@ class AddressParserTest : public testing::Test { } bool GetState(const std::string& state, size_t* state_index) const { - base::string16 state_16 = UTF8ToUTF16(state); + base::string16 state_16 = base::UTF8ToUTF16(state); String16Tokenizer tokenizer(state_16.begin(), state_16.end(), base::kWhitespaceUTF16); if (!tokenizer.GetNext()) @@ -62,7 +62,7 @@ class AddressParserTest : public testing::Test { size_t state_index; EXPECT_TRUE(GetState(state, &state_index)); - base::string16 zip_16 = UTF8ToUTF16(zip); + base::string16 zip_16 = base::UTF8ToUTF16(zip); WordList words; TokenizeWords(zip_16, &words); EXPECT_TRUE(words.size() == 1); @@ -70,7 +70,7 @@ class AddressParserTest : public testing::Test { } bool IsLocationName(const std::string& street) const { - base::string16 street_16 = UTF8ToUTF16(street); + base::string16 street_16 = base::UTF8ToUTF16(street); WordList words; TokenizeWords(street_16, &words); EXPECT_TRUE(words.size() == 1); @@ -78,12 +78,12 @@ class AddressParserTest : public testing::Test { } std::string FindAddress(const std::string& content) const { - base::string16 content_16 = UTF8ToUTF16(content); + base::string16 content_16 = base::UTF8ToUTF16(content); base::string16 result_16; size_t start, end; if (::FindAddress(content_16.begin(), content_16.end(), &start, &end)) result_16 = content_16.substr(start, end - start); - return UTF16ToUTF8(result_16); + return base::UTF16ToUTF8(result_16); } bool ContainsAddress(const std::string& content) const { diff --git a/content/common/dom_storage/dom_storage_map_unittest.cc b/content/common/dom_storage/dom_storage_map_unittest.cc index 0937c21..641b6b26 100644 --- a/content/common/dom_storage/dom_storage_map_unittest.cc +++ b/content/common/dom_storage/dom_storage_map_unittest.cc @@ -6,6 +6,8 @@ #include "content/common/dom_storage/dom_storage_map.h" #include "testing/gtest/include/gtest/gtest.h" +using base::ASCIIToUTF16; + namespace content { TEST(DOMStorageMapTest, DOMStorageMapBasics) { diff --git a/content/common/handle_enumerator_win.cc b/content/common/handle_enumerator_win.cc index 7cda767..0b8cbe5 100644 --- a/content/common/handle_enumerator_win.cc +++ b/content/common/handle_enumerator_win.cc @@ -16,6 +16,8 @@ #include "content/public/common/result_codes.h" #include "sandbox/win/src/handle_table.h" +using base::ASCIIToUTF16; + namespace content { namespace { diff --git a/content/common/mac/attributed_string_coder.mm b/content/common/mac/attributed_string_coder.mm index f14103b..bcd8b118 100644 --- a/content/common/mac/attributed_string_coder.mm +++ b/content/common/mac/attributed_string_coder.mm @@ -139,7 +139,7 @@ bool ParamTraits<AttributedStringCoder::EncodedString>::Read( void ParamTraits<AttributedStringCoder::EncodedString>::Log( const param_type& p, std::string* l) { - l->append(UTF16ToUTF8(p.string())); + l->append(base::UTF16ToUTF8(p.string())); } void ParamTraits<AttributedStringCoder::FontAttribute>::Write( diff --git a/content/common/mac/attributed_string_coder_unittest.mm b/content/common/mac/attributed_string_coder_unittest.mm index 72ff166..021ea9b 100644 --- a/content/common/mac/attributed_string_coder_unittest.mm +++ b/content/common/mac/attributed_string_coder_unittest.mm @@ -106,7 +106,8 @@ TEST_F(AttributedStringCoderTest, NilString) { } TEST_F(AttributedStringCoderTest, OutOfRange) { - AttributedStringCoder::EncodedString encoded(ASCIIToUTF16("Hello World")); + AttributedStringCoder::EncodedString encoded( + base::ASCIIToUTF16("Hello World")); encoded.attributes()->push_back( AttributedStringCoder::FontAttribute( FontDescriptor([NSFont systemFontOfSize:12]), diff --git a/content/common/mac/font_descriptor_unittest.mm b/content/common/mac/font_descriptor_unittest.mm index 2496c22..5361a71 100644 --- a/content/common/mac/font_descriptor_unittest.mm +++ b/content/common/mac/font_descriptor_unittest.mm @@ -70,7 +70,7 @@ bool CompareFonts(NSFont* font1, NSFont* font2) { // Create an NSFont via a FontDescriptor object. NSFont* MakeNSFont(const std::string& font_name, float font_point_size) { FontDescriptor desc; - desc.font_name = UTF8ToUTF16(font_name); + desc.font_name = base::UTF8ToUTF16(font_name); desc.font_point_size = font_point_size; return desc.ToNSFont(); } diff --git a/content/common/page_state_serialization.cc b/content/common/page_state_serialization.cc index 5384ab5..4fba507 100644 --- a/content/common/page_state_serialization.cc +++ b/content/common/page_state_serialization.cc @@ -616,7 +616,8 @@ void ReadPageState(SerializeObject* obj, ExplodedPageState* state) { GURL url = ReadGURL(obj); // NOTE: GURL::possibly_invalid_spec() always returns valid UTF-8. state->top.url_string = state->top.original_url_string = - base::NullableString16(UTF8ToUTF16(url.possibly_invalid_spec()), false); + base::NullableString16( + base::UTF8ToUTF16(url.possibly_invalid_spec()), false); return; } diff --git a/content/common/page_state_serialization_unittest.cc b/content/common/page_state_serialization_unittest.cc index b7e5895..dc182b9 100644 --- a/content/common/page_state_serialization_unittest.cc +++ b/content/common/page_state_serialization_unittest.cc @@ -23,7 +23,7 @@ inline bool isnan(double num) { return !!_isnan(num); } #endif base::NullableString16 NS16(const char* s) { - return s ? base::NullableString16(ASCIIToUTF16(s), false) : + return s ? base::NullableString16(base::ASCIIToUTF16(s), false) : base::NullableString16(); } diff --git a/content/common/pepper_plugin_list.cc b/content/common/pepper_plugin_list.cc index ec5f6ae..6f4b21b 100644 --- a/content/common/pepper_plugin_list.cc +++ b/content/common/pepper_plugin_list.cc @@ -79,7 +79,7 @@ void ComputePluginsFromCommandLine(std::vector<PepperPluginInfo>* plugins) { // This means we can't provide plugins from non-ASCII paths, but // since this switch is only for development I don't think that's // too awful. - plugin.path = base::FilePath(ASCIIToUTF16(name_parts[0])); + plugin.path = base::FilePath(base::ASCIIToUTF16(name_parts[0])); #else plugin.path = base::FilePath(name_parts[0]); #endif @@ -108,8 +108,10 @@ void ComputePluginsFromCommandLine(std::vector<PepperPluginInfo>* plugins) { } // If the plugin name is empty, use the filename. - if (plugin.name.empty()) - plugin.name = UTF16ToUTF8(plugin.path.BaseName().LossyDisplayName()); + if (plugin.name.empty()) { + plugin.name = + base::UTF16ToUTF8(plugin.path.BaseName().LossyDisplayName()); + } // Command-line plugins get full permissions. plugin.permissions = ppapi::PERMISSION_ALL_BITS; diff --git a/content/common/plugin_list.cc b/content/common/plugin_list.cc index d623fad..df1f77b 100644 --- a/content/common/plugin_list.cc +++ b/content/common/plugin_list.cc @@ -153,7 +153,7 @@ bool PluginList::ParseMimeTypes( // On Windows, the description likely has a list of file extensions // embedded in it (e.g. "SurfWriter file (*.swr)"). Remove an extension // list from the description if it is present. - size_t ext = mime_type.description.find(ASCIIToUTF16("(*")); + size_t ext = mime_type.description.find(base::ASCIIToUTF16("(*")); if (ext != base::string16::npos) { if (ext > 1 && mime_type.description[ext - 1] == ' ') ext--; diff --git a/content/common/plugin_list_mac.mm b/content/common/plugin_list_mac.mm index fc4813a..8ac4a65 100644 --- a/content/common/plugin_list_mac.mm +++ b/content/common/plugin_list_mac.mm @@ -56,8 +56,9 @@ bool IsBlacklistedPlugin(const WebPluginInfo& info) { // Versions of Flip4Mac 2.3 before 2.3.6 often hang the renderer, so don't // load them. - if (StartsWith(info.name, ASCIIToUTF16("Flip4Mac Windows Media"), false) && - StartsWith(info.version, ASCIIToUTF16("2.3"), false)) { + if (StartsWith(info.name, + base::ASCIIToUTF16("Flip4Mac Windows Media"), false) && + StartsWith(info.version, base::ASCIIToUTF16("2.3"), false)) { std::vector<base::string16> components; base::SplitString(info.version, '.', &components); int bugfix_version = 0; @@ -169,14 +170,14 @@ bool ReadPlistPluginInfo(const base::FilePath& filename, CFBundleRef bundle, if (plugin_name) info->name = base::SysNSStringToUTF16(plugin_name); else - info->name = UTF8ToUTF16(filename.BaseName().value()); + info->name = base::UTF8ToUTF16(filename.BaseName().value()); info->path = filename; if (plugin_vers) info->version = base::SysNSStringToUTF16(plugin_vers); if (plugin_desc) info->desc = base::SysNSStringToUTF16(plugin_desc); else - info->desc = UTF8ToUTF16(filename.BaseName().value()); + info->desc = base::UTF8ToUTF16(filename.BaseName().value()); return true; } diff --git a/content/common/plugin_list_posix.cc b/content/common/plugin_list_posix.cc index acd7830..0bfa2a7 100644 --- a/content/common/plugin_list_posix.cc +++ b/content/common/plugin_list_posix.cc @@ -321,23 +321,23 @@ bool PluginList::ReadWebPluginInfo(const base::FilePath& filename, const char* name = NULL; NP_GetValue(NULL, nsPluginVariable_NameString, &name); if (name) { - info->name = UTF8ToUTF16(name); + info->name = base::UTF8ToUTF16(name); ExtractVersionString(name, info); } const char* description = NULL; NP_GetValue(NULL, nsPluginVariable_DescriptionString, &description); if (description) { - info->desc = UTF8ToUTF16(description); + info->desc = base::UTF8ToUTF16(description); if (info->version.empty()) ExtractVersionString(description, info); } LOG_IF(ERROR, PluginList::DebugPluginLoading()) << "Got info for plugin " << filename.value() - << " Name = \"" << UTF16ToUTF8(info->name) - << "\", Description = \"" << UTF16ToUTF8(info->desc) - << "\", Version = \"" << UTF16ToUTF8(info->version) + << " Name = \"" << base::UTF16ToUTF8(info->name) + << "\", Description = \"" << base::UTF16ToUTF8(info->desc) + << "\", Version = \"" << base::UTF16ToUTF8(info->version) << "\"."; } else { LOG_IF(ERROR, PluginList::DebugPluginLoading()) @@ -383,9 +383,10 @@ void PluginList::ParseMIMEDescription( // It's ok for end to run off the string here. If there's no // trailing semicolon we consume the remainder of the string. if (end != std::string::npos) { - mime_type.description = UTF8ToUTF16(description.substr(ofs, end - ofs)); + mime_type.description = + base::UTF8ToUTF16(description.substr(ofs, end - ofs)); } else { - mime_type.description = UTF8ToUTF16(description.substr(ofs)); + mime_type.description = base::UTF8ToUTF16(description.substr(ofs)); } mime_types->push_back(mime_type); if (end == std::string::npos) @@ -423,7 +424,7 @@ void PluginList::ExtractVersionString(const std::string& desc, } } if (!version.empty()) { - info->version = UTF8ToUTF16(version); + info->version = base::UTF8ToUTF16(version); } } diff --git a/content/common/plugin_list_unittest.cc b/content/common/plugin_list_unittest.cc index a9e592e..6980699 100644 --- a/content/common/plugin_list_unittest.cc +++ b/content/common/plugin_list_unittest.cc @@ -41,14 +41,14 @@ bool Contains(const std::vector<WebPluginInfo>& list, class PluginListTest : public testing::Test { public: PluginListTest() - : foo_plugin_(ASCIIToUTF16(kFooName), + : foo_plugin_(base::ASCIIToUTF16(kFooName), base::FilePath(kFooPath), - ASCIIToUTF16("1.2.3"), - ASCIIToUTF16("foo")), - bar_plugin_(ASCIIToUTF16("Bar Plugin"), + base::ASCIIToUTF16("1.2.3"), + base::ASCIIToUTF16("foo")), + bar_plugin_(base::ASCIIToUTF16("Bar Plugin"), base::FilePath(kBarPath), - ASCIIToUTF16("2.3.4"), - ASCIIToUTF16("bar")) { + base::ASCIIToUTF16("2.3.4"), + base::ASCIIToUTF16("bar")) { } virtual void SetUp() { @@ -149,7 +149,7 @@ TEST(MIMEDescriptionParse, Simple) { EXPECT_EQ("audio/x-pn-realaudio-plugin", type.mime_type); ASSERT_EQ(1U, type.file_extensions.size()); EXPECT_EQ("rpm", type.file_extensions[0]); - EXPECT_EQ(ASCIIToUTF16("RealAudio document"), type.description); + EXPECT_EQ(base::ASCIIToUTF16("RealAudio document"), type.description); } // Test parsing a multi-entry description: QuickTime as provided by Totem. @@ -170,7 +170,7 @@ TEST(MIMEDescriptionParse, Multi) { EXPECT_EQ("image/x-quicktime", type.mime_type); ASSERT_EQ(3U, type.file_extensions.size()); EXPECT_EQ("pict2", type.file_extensions[2]); - EXPECT_EQ(ASCIIToUTF16("QuickTime image"), type.description); + EXPECT_EQ(base::ASCIIToUTF16("QuickTime image"), type.description); } // Test parsing a Japanese description, since we got this wrong in the past. @@ -222,7 +222,7 @@ TEST(MIMEDescriptionParse, ComplicatedJava) { ASSERT_EQ(12U, types.size()); for (size_t i = 0; i < types.size(); ++i) - EXPECT_EQ(ASCIIToUTF16("IcedTea"), types[i].description); + EXPECT_EQ(base::ASCIIToUTF16("IcedTea"), types[i].description); // Verify that the mime types with semis are coming through ok. EXPECT_TRUE(types[4].mime_type.find(';') != std::string::npos); @@ -233,16 +233,16 @@ TEST(MIMEDescriptionParse, ComplicatedJava) { TEST(PluginDescriptionParse, ExtractVersion) { WebPluginInfo info; PluginList::ExtractVersionString("Shockwave Flash 10.1 r102", &info); - EXPECT_EQ(ASCIIToUTF16("10.1 r102"), info.version); + EXPECT_EQ(base::ASCIIToUTF16("10.1 r102"), info.version); PluginList::ExtractVersionString("Java(TM) Plug-in 1.6.0_22", &info); - EXPECT_EQ(ASCIIToUTF16("1.6.0_22"), info.version); + EXPECT_EQ(base::ASCIIToUTF16("1.6.0_22"), info.version); // It's actually much more likely for a modern Linux distribution to have // IcedTea. PluginList::ExtractVersionString( "IcedTea-Web Plugin " "(using IcedTea-Web 1.2 (1.2-2ubuntu0.10.04.2))", &info); - EXPECT_EQ(ASCIIToUTF16("1.2"), info.version); + EXPECT_EQ(base::ASCIIToUTF16("1.2"), info.version); } #endif // defined(OS_POSIX) && !defined(OS_MACOSX) diff --git a/content/common/sandbox_mac_diraccess_unittest.mm b/content/common/sandbox_mac_diraccess_unittest.mm index 6d3ddad..45c730c 100644 --- a/content/common/sandbox_mac_diraccess_unittest.mm +++ b/content/common/sandbox_mac_diraccess_unittest.mm @@ -99,13 +99,14 @@ TEST_F(MacDirAccessSandboxTest, RegexEscape) { EXPECT_TRUE(Sandbox::QuoteStringForRegex("}", &out)); // } == 0x7D == 125 EXPECT_FALSE(Sandbox::QuoteStringForRegex("~", &out)); // ~ == 0x7E == 126 EXPECT_FALSE( - Sandbox::QuoteStringForRegex(WideToUTF8(L"^\u2135.\u2136$"), &out)); + Sandbox::QuoteStringForRegex(base::WideToUTF8(L"^\u2135.\u2136$"), + &out)); } { for (size_t i = 0; i < ARRAYSIZE_UNSAFE(regex_cases); ++i) { std::string out; - std::string in = WideToUTF8(regex_cases[i].to_escape); + std::string in = base::WideToUTF8(regex_cases[i].to_escape); EXPECT_TRUE(Sandbox::QuoteStringForRegex(in, &out)); std::string expected("^"); expected.append(regex_cases[i].escaped); diff --git a/content/common/webplugininfo_unittest.cc b/content/common/webplugininfo_unittest.cc index 3464bab..e067e45 100644 --- a/content/common/webplugininfo_unittest.cc +++ b/content/common/webplugininfo_unittest.cc @@ -33,7 +33,7 @@ TEST(PluginUtilsTest, VersionExtraction) { for (size_t i = 0; i < arraysize(versions); i++) { base::Version version; WebPluginInfo::CreateVersionFromString( - ASCIIToUTF16(versions[i][0]), &version); + base::ASCIIToUTF16(versions[i][0]), &version); ASSERT_TRUE(version.IsValid()); EXPECT_EQ(versions[i][1], version.GetString()); diff --git a/content/ppapi_plugin/broker_process_dispatcher.cc b/content/ppapi_plugin/broker_process_dispatcher.cc index 5f1ff63..35d5b9d 100644 --- a/content/ppapi_plugin/broker_process_dispatcher.cc +++ b/content/ppapi_plugin/broker_process_dispatcher.cc @@ -22,7 +22,7 @@ const int kBrokerReleaseTimeSeconds = 30; std::string ConvertPluginDataPath(const base::FilePath& plugin_data_path) { // The string is always 8-bit, convert on Windows. #if defined(OS_WIN) - return WideToUTF8(plugin_data_path.value()); + return base::WideToUTF8(plugin_data_path.value()); #else return plugin_data_path.value(); #endif diff --git a/content/public/common/page_state.cc b/content/public/common/page_state.cc index 1e429b8..09ffcb2 100644 --- a/content/public/common/page_state.cc +++ b/content/public/common/page_state.cc @@ -12,7 +12,7 @@ namespace content { namespace { base::NullableString16 ToNullableString16(const std::string& utf8) { - return base::NullableString16(UTF8ToUTF16(utf8), false); + return base::NullableString16(base::UTF8ToUTF16(utf8), false); } base::FilePath ToFilePath(const base::NullableString16& s) { diff --git a/content/public/common/pepper_plugin_info.cc b/content/public/common/pepper_plugin_info.cc index 21ef4e8..d627a4b 100644 --- a/content/public/common/pepper_plugin_info.cc +++ b/content/public/common/pepper_plugin_info.cc @@ -34,10 +34,10 @@ WebPluginInfo PepperPluginInfo::ToWebPluginInfo() const { WebPluginInfo::PLUGIN_TYPE_PEPPER_IN_PROCESS; info.name = name.empty() ? - path.BaseName().LossyDisplayName() : UTF8ToUTF16(name); + path.BaseName().LossyDisplayName() : base::UTF8ToUTF16(name); info.path = path; - info.version = ASCIIToUTF16(version); - info.desc = ASCIIToUTF16(description); + info.version = base::ASCIIToUTF16(version); + info.desc = base::ASCIIToUTF16(description); info.mime_types = mime_types; info.pepper_permissions = permissions; diff --git a/content/public/common/webplugininfo.cc b/content/public/common/webplugininfo.cc index f785e57..760a634 100644 --- a/content/public/common/webplugininfo.cc +++ b/content/public/common/webplugininfo.cc @@ -21,7 +21,7 @@ WebPluginMimeType::WebPluginMimeType(const std::string& m, const std::string& d) : mime_type(m), file_extensions(), - description(ASCIIToUTF16(d)) { + description(base::ASCIIToUTF16(d)) { file_extensions.push_back(f); } diff --git a/content/public/test/browser_test_utils.cc b/content/public/test/browser_test_utils.cc index 29252b3..a7d8c78 100644 --- a/content/public/test/browser_test_utils.cc +++ b/content/public/test/browser_test_utils.cc @@ -96,8 +96,8 @@ bool ExecuteScriptHelper(RenderViewHost* render_view_host, std::string script = "window.domAutomationController.setAutomationId(0);" + original_script; DOMOperationObserver dom_op_observer(render_view_host); - render_view_host->ExecuteJavascriptInWebFrame(UTF8ToUTF16(frame_xpath), - UTF8ToUTF16(script)); + render_view_host->ExecuteJavascriptInWebFrame(base::UTF8ToUTF16(frame_xpath), + base::UTF8ToUTF16(script)); std::string json; if (!dom_op_observer.WaitAndGetResponse(&json)) { DLOG(ERROR) << "Cannot communicate with DOMOperationObserver."; diff --git a/content/public/test/fake_speech_recognition_manager.cc b/content/public/test/fake_speech_recognition_manager.cc index 3d7b582..7f8e367 100644 --- a/content/public/test/fake_speech_recognition_manager.cc +++ b/content/public/test/fake_speech_recognition_manager.cc @@ -147,7 +147,7 @@ void FakeSpeechRecognitionManager::SetFakeRecognitionResult() { listener_->OnAudioEnd(session_id_); SpeechRecognitionResult result; result.hypotheses.push_back(SpeechRecognitionHypothesis( - ASCIIToUTF16(kTestResult), 1.0)); + base::ASCIIToUTF16(kTestResult), 1.0)); SpeechRecognitionResults results; results.push_back(result); listener_->OnRecognitionResults(session_id_, results); diff --git a/content/public/test/test_utils.cc b/content/public/test/test_utils.cc index c417483..98b7c1f 100644 --- a/content/public/test/test_utils.cc +++ b/content/public/test/test_utils.cc @@ -138,7 +138,7 @@ scoped_ptr<base::Value> ExecuteScriptAndGetValue( render_view_host->ExecuteJavascriptInWebFrameCallbackResult( base::string16(), // frame_xpath, - UTF8ToUTF16(script), + base::UTF8ToUTF16(script), base::Bind(&ScriptCallback::ResultCallback, base::Unretained(&observer))); base::MessageLoop* loop = base::MessageLoop::current(); loop->Run(); diff --git a/content/renderer/accessibility/accessibility_node_serializer.cc b/content/renderer/accessibility/accessibility_node_serializer.cc index db79307..6bace0e 100644 --- a/content/renderer/accessibility/accessibility_node_serializer.cc +++ b/content/renderer/accessibility/accessibility_node_serializer.cc @@ -133,14 +133,15 @@ void SerializeAccessibilityNode( dst->state = ConvertState(src); dst->location = src.boundingBoxRect(); dst->id = src.axID(); - std::string name = UTF16ToUTF8(src.title()); + std::string name = base::UTF16ToUTF8(src.title()); std::string value; if (src.valueDescription().length()) { dst->AddStringAttribute(dst->ATTR_VALUE, - UTF16ToUTF8(src.valueDescription())); + base::UTF16ToUTF8(src.valueDescription())); } else { - dst->AddStringAttribute(dst->ATTR_VALUE, UTF16ToUTF8(src.stringValue())); + dst->AddStringAttribute(dst->ATTR_VALUE, + base::UTF16ToUTF8(src.stringValue())); } if (dst->role == blink::WebAXRoleColorWell) { @@ -177,10 +178,14 @@ void SerializeAccessibilityNode( dst->AddIntListAttribute(dst->ATTR_WORD_ENDS, word_ends); } - if (src.accessKey().length()) - dst->AddStringAttribute(dst->ATTR_ACCESS_KEY, UTF16ToUTF8(src.accessKey())); - if (src.actionVerb().length()) - dst->AddStringAttribute(dst->ATTR_ACTION, UTF16ToUTF8(src.actionVerb())); + if (src.accessKey().length()) { + dst->AddStringAttribute(dst->ATTR_ACCESS_KEY, + base::UTF16ToUTF8(src.accessKey())); + } + if (src.actionVerb().length()) { + dst->AddStringAttribute(dst->ATTR_ACTION, + base::UTF16ToUTF8(src.actionVerb())); + } if (src.isAriaReadOnly()) dst->AddBoolAttribute(dst->ATTR_ARIA_READONLY, true); if (src.isButtonStateMixed()) @@ -189,17 +194,17 @@ void SerializeAccessibilityNode( dst->AddBoolAttribute(dst->ATTR_CAN_SET_VALUE, true); if (src.accessibilityDescription().length()) { dst->AddStringAttribute(dst->ATTR_DESCRIPTION, - UTF16ToUTF8(src.accessibilityDescription())); + base::UTF16ToUTF8(src.accessibilityDescription())); } if (src.hasComputedStyle()) { dst->AddStringAttribute(dst->ATTR_DISPLAY, - UTF16ToUTF8(src.computedStyleDisplay())); + base::UTF16ToUTF8(src.computedStyleDisplay())); } if (src.helpText().length()) - dst->AddStringAttribute(dst->ATTR_HELP, UTF16ToUTF8(src.helpText())); + dst->AddStringAttribute(dst->ATTR_HELP, base::UTF16ToUTF8(src.helpText())); if (src.keyboardShortcut().length()) { dst->AddStringAttribute(dst->ATTR_SHORTCUT, - UTF16ToUTF8(src.keyboardShortcut())); + base::UTF16ToUTF8(src.keyboardShortcut())); } if (!src.titleUIElement().isDetached()) { dst->AddIntAttribute(dst->ATTR_TITLE_UI_ELEMENT, @@ -234,7 +239,7 @@ void SerializeAccessibilityNode( if (!node.isNull() && node.isElementNode()) { WebElement element = node.to<WebElement>(); - is_iframe = (element.tagName() == ASCIIToUTF16("IFRAME")); + is_iframe = (element.tagName() == base::ASCIIToUTF16("IFRAME")); if (LowerCaseEqualsASCII(element.getAttribute("aria-expanded"), "true")) dst->state |= (1 << blink::WebAXStateExpanded); @@ -244,11 +249,11 @@ void SerializeAccessibilityNode( // a WebElement method that returns the original lower cased tagName. dst->AddStringAttribute( dst->ATTR_HTML_TAG, - StringToLowerASCII(UTF16ToUTF8(element.tagName()))); + StringToLowerASCII(base::UTF16ToUTF8(element.tagName()))); for (unsigned i = 0; i < element.attributeCount(); ++i) { - std::string name = StringToLowerASCII(UTF16ToUTF8( + std::string name = StringToLowerASCII(base::UTF16ToUTF8( element.attributeLocalName(i))); - std::string value = UTF16ToUTF8(element.attributeValue(i)); + std::string value = base::UTF16ToUTF8(element.attributeValue(i)); dst->html_attributes.push_back(std::make_pair(name, value)); } @@ -272,14 +277,14 @@ void SerializeAccessibilityNode( // ARIA role. if (element.hasAttribute("role")) { dst->AddStringAttribute(dst->ATTR_ROLE, - UTF16ToUTF8(element.getAttribute("role"))); + base::UTF16ToUTF8(element.getAttribute("role"))); } // Live region attributes - live_atomic = UTF16ToUTF8(element.getAttribute("aria-atomic")); - live_busy = UTF16ToUTF8(element.getAttribute("aria-busy")); - live_status = UTF16ToUTF8(element.getAttribute("aria-live")); - live_relevant = UTF16ToUTF8(element.getAttribute("aria-relevant")); + live_atomic = base::UTF16ToUTF8(element.getAttribute("aria-atomic")); + live_busy = base::UTF16ToUTF8(element.getAttribute("aria-busy")); + live_status = base::UTF16ToUTF8(element.getAttribute("aria-live")); + live_relevant = base::UTF16ToUTF8(element.getAttribute("aria-relevant")); } // Walk up the parent chain to set live region attributes of containers @@ -295,22 +300,22 @@ void SerializeAccessibilityNode( if (container_elem.hasAttribute("aria-atomic") && container_live_atomic.empty()) { container_live_atomic = - UTF16ToUTF8(container_elem.getAttribute("aria-atomic")); + base::UTF16ToUTF8(container_elem.getAttribute("aria-atomic")); } if (container_elem.hasAttribute("aria-busy") && container_live_busy.empty()) { container_live_busy = - UTF16ToUTF8(container_elem.getAttribute("aria-busy")); + base::UTF16ToUTF8(container_elem.getAttribute("aria-busy")); } if (container_elem.hasAttribute("aria-live") && container_live_status.empty()) { container_live_status = - UTF16ToUTF8(container_elem.getAttribute("aria-live")); + base::UTF16ToUTF8(container_elem.getAttribute("aria-live")); } if (container_elem.hasAttribute("aria-relevant") && container_live_relevant.empty()) { container_live_relevant = - UTF16ToUTF8(container_elem.getAttribute("aria-relevant")); + base::UTF16ToUTF8(container_elem.getAttribute("aria-relevant")); } } container_accessible = container_accessible.parentObject(); @@ -358,8 +363,9 @@ void SerializeAccessibilityNode( dst->AddStringAttribute(dst->ATTR_HTML_TAG, "#document"); const WebDocument& document = src.document(); if (name.empty()) - name = UTF16ToUTF8(document.title()); - dst->AddStringAttribute(dst->ATTR_DOC_TITLE, UTF16ToUTF8(document.title())); + name = base::UTF16ToUTF8(document.title()); + dst->AddStringAttribute(dst->ATTR_DOC_TITLE, + base::UTF16ToUTF8(document.title())); dst->AddStringAttribute(dst->ATTR_DOC_URL, document.url().spec()); dst->AddStringAttribute( dst->ATTR_DOC_MIMETYPE, @@ -371,7 +377,7 @@ void SerializeAccessibilityNode( const WebDocumentType& doctype = document.doctype(); if (!doctype.isNull()) { dst->AddStringAttribute(dst->ATTR_DOC_DOCTYPE, - UTF16ToUTF8(doctype.name())); + base::UTF16ToUTF8(doctype.name())); } const gfx::Size& scroll_offset = document.frame()->scrollOffset(); @@ -478,7 +484,7 @@ bool ShouldIncludeChildNode( WebNode node = parent.node(); if (!node.isNull() && node.isElementNode()) { WebElement element = node.to<WebElement>(); - is_iframe = (element.tagName() == ASCIIToUTF16("IFRAME")); + is_iframe = (element.tagName() == base::ASCIIToUTF16("IFRAME")); } return (is_iframe || IsParentUnignoredOf(parent, child)); diff --git a/content/renderer/android/address_detector.cc b/content/renderer/android/address_detector.cc index fdc70b1..6ab267f 100644 --- a/content/renderer/android/address_detector.cc +++ b/content/renderer/android/address_detector.cc @@ -41,7 +41,7 @@ std::string AddressDetector::GetContentText(const base::string16& text) { base::string16 address_16 = CollapseWhitespace(text, false); std::replace(address_16.begin(), address_16.end(), static_cast<char16>(0x2022), static_cast<char16>(',')); - return UTF16ToUTF8(address_16); + return base::UTF16ToUTF8(address_16); } bool AddressDetector::FindContent( diff --git a/content/renderer/android/email_detector.cc b/content/renderer/android/email_detector.cc index dba1f42..1c335ee 100644 --- a/content/renderer/android/email_detector.cc +++ b/content/renderer/android/email_detector.cc @@ -63,7 +63,8 @@ bool EmailDetector::FindContent(const base::string16::const_iterator& begin, DCHECK(U_SUCCESS(status)); icu::UnicodeString content_ustr(matcher->group(status)); DCHECK(U_SUCCESS(status)); - UTF16ToUTF8(content_ustr.getBuffer(), content_ustr.length(), content_text); + base::UTF16ToUTF8(content_ustr.getBuffer(), content_ustr.length(), + content_text); return true; } diff --git a/content/renderer/android/email_detector_unittest.cc b/content/renderer/android/email_detector_unittest.cc index 45bcc9b..c695617 100644 --- a/content/renderer/android/email_detector_unittest.cc +++ b/content/renderer/android/email_detector_unittest.cc @@ -13,7 +13,7 @@ class EmailDetectorTest : public testing::Test { public: static void FindAndCheckEmail(const std::string& content, const std::string& expected) { - base::string16 content_16 = UTF8ToUTF16(content); + base::string16 content_16 = base::UTF8ToUTF16(content); base::string16 result_16; size_t start, end; EmailDetector detector; @@ -22,7 +22,7 @@ class EmailDetectorTest : public testing::Test { &start, &end, &content_text)) { result_16 = content_16.substr(start, end - start); } - EXPECT_EQ(expected, UTF16ToUTF8(result_16)); + EXPECT_EQ(expected, base::UTF16ToUTF8(result_16)); EXPECT_EQ(expected, content_text); } }; diff --git a/content/renderer/android/phone_number_detector.cc b/content/renderer/android/phone_number_detector.cc index 843adfa..18229dd 100644 --- a/content/renderer/android/phone_number_detector.cc +++ b/content/renderer/android/phone_number_detector.cc @@ -61,7 +61,7 @@ bool PhoneNumberDetector::FindContent( size_t* end_pos, std::string* content_text) { base::string16 utf16_input = base::string16(begin, end); - std::string utf8_input = UTF16ToUTF8(utf16_input); + std::string utf8_input = base::UTF16ToUTF8(utf16_input); PhoneNumberMatcher matcher(utf8_input, region_code_); if (matcher.HasNext()) { @@ -78,8 +78,9 @@ bool PhoneNumberDetector::FindContent( return false; // Need to return start_pos and end_pos relative to a UTF16 encoding. - *start_pos = UTF8ToUTF16(utf8_input.substr(0, match.start())).length(); - *end_pos = *start_pos + UTF8ToUTF16(match.raw_string()).length(); + *start_pos = + base::UTF8ToUTF16(utf8_input.substr(0, match.start())).length(); + *end_pos = *start_pos + base::UTF8ToUTF16(match.raw_string()).length(); return true; } diff --git a/content/renderer/android/phone_number_detector_unittest.cc b/content/renderer/android/phone_number_detector_unittest.cc index e248f0e..5078cb5 100644 --- a/content/renderer/android/phone_number_detector_unittest.cc +++ b/content/renderer/android/phone_number_detector_unittest.cc @@ -13,7 +13,7 @@ class PhoneNumberDetectorTest : public testing::Test { public: static std::string FindNumber(const std::string& content, const std::string& region) { - base::string16 content_16 = UTF8ToUTF16(content); + base::string16 content_16 = base::UTF8ToUTF16(content); base::string16 result_16; size_t start, end; PhoneNumberDetector detector(region); @@ -21,12 +21,12 @@ class PhoneNumberDetectorTest : public testing::Test { if (detector.FindContent(content_16.begin(), content_16.end(), &start, &end, &content_text)) result_16 = content_16.substr(start, end - start); - return UTF16ToUTF8(result_16); + return base::UTF16ToUTF8(result_16); } static std::string FindAndFormatNumber(const std::string& content, const std::string& region) { - base::string16 content_16 = UTF8ToUTF16(content); + base::string16 content_16 = base::UTF8ToUTF16(content); base::string16 result_16; size_t start, end; PhoneNumberDetector detector(region); diff --git a/content/renderer/clipboard_utils.cc b/content/renderer/clipboard_utils.cc index 28c04c9..eb88332 100644 --- a/content/renderer/clipboard_utils.cc +++ b/content/renderer/clipboard_utils.cc @@ -17,7 +17,7 @@ std::string URLToMarkup(const blink::WebURL& url, markup.append(url.spec()); markup.append("\">"); // TODO(darin): HTML escape this - markup.append(net::EscapeForHTML(UTF16ToUTF8(title))); + markup.append(net::EscapeForHTML(base::UTF16ToUTF8(title))); markup.append("</a>"); return markup; } @@ -29,7 +29,7 @@ std::string URLToImageMarkup(const blink::WebURL& url, markup.append("\""); if (!title.isEmpty()) { markup.append(" alt=\""); - markup.append(net::EscapeForHTML(UTF16ToUTF8(title))); + markup.append(net::EscapeForHTML(base::UTF16ToUTF8(title))); markup.append("\""); } markup.append("/>"); diff --git a/content/renderer/cpp_bound_class_unittest.cc b/content/renderer/cpp_bound_class_unittest.cc index 8b05fea..9504c65 100644 --- a/content/renderer/cpp_bound_class_unittest.cc +++ b/content/renderer/cpp_bound_class_unittest.cc @@ -105,7 +105,7 @@ class CppBoundClassTest : public RenderViewTest { void CheckTrue(const std::string& expression) { int was_page_a = -1; base::string16 check_page_a = - ASCIIToUTF16(std::string("Number(") + expression + ")"); + base::ASCIIToUTF16(std::string("Number(") + expression + ")"); EXPECT_TRUE(ExecuteJavaScriptAndReturnIntValue(check_page_a, &was_page_a)); EXPECT_EQ(1, was_page_a); } diff --git a/content/renderer/devtools/devtools_client.cc b/content/renderer/devtools/devtools_client.cc index 3d51312..5799fa4 100644 --- a/content/renderer/devtools/devtools_client.cc +++ b/content/renderer/devtools/devtools_client.cc @@ -29,7 +29,8 @@ DevToolsClient::DevToolsClient(RenderViewImpl* render_view) WebDevToolsFrontend::create( render_view->webview(), this, - ASCIIToUTF16(command_line.GetSwitchValueASCII(switches::kLang)))); + base::ASCIIToUTF16( + command_line.GetSwitchValueASCII(switches::kLang)))); } DevToolsClient::~DevToolsClient() { diff --git a/content/renderer/dom_serializer_browsertest.cc b/content/renderer/dom_serializer_browsertest.cc index b7d82b7..43d0b5c 100644 --- a/content/renderer/dom_serializer_browsertest.cc +++ b/content/renderer/dom_serializer_browsertest.cc @@ -585,8 +585,8 @@ class DomSerializerTests : public ContentBrowserTest, '%', 0x2285, 0x00b9, '\'', 0 }; WebString value = body_element.getAttribute("title"); - ASSERT_TRUE(UTF16ToWide(value) == parsed_value); - ASSERT_TRUE(UTF16ToWide(body_element.innerText()) == parsed_value); + ASSERT_TRUE(base::UTF16ToWide(value) == parsed_value); + ASSERT_TRUE(base::UTF16ToWide(body_element.innerText()) == parsed_value); // Do serialization. SerializeDomForURL(file_url, false); diff --git a/content/renderer/dom_storage/dom_storage_cached_area_unittest.cc b/content/renderer/dom_storage/dom_storage_cached_area_unittest.cc index 04b5a28..eeec43e 100644 --- a/content/renderer/dom_storage/dom_storage_cached_area_unittest.cc +++ b/content/renderer/dom_storage/dom_storage_cached_area_unittest.cc @@ -120,8 +120,8 @@ class DOMStorageCachedAreaTest : public testing::Test { DOMStorageCachedAreaTest() : kNamespaceId(10), kOrigin("http://dom_storage/"), - kKey(ASCIIToUTF16("key")), - kValue(ASCIIToUTF16("value")), + kKey(base::ASCIIToUTF16("key")), + kValue(base::ASCIIToUTF16("value")), kPageUrl("http://dom_storage/page") { } diff --git a/content/renderer/external_popup_menu_browsertest.cc b/content/renderer/external_popup_menu_browsertest.cc index 2e3e664..a0a6a90 100644 --- a/content/renderer/external_popup_menu_browsertest.cc +++ b/content/renderer/external_popup_menu_browsertest.cc @@ -57,8 +57,8 @@ class ExternalPopupMenuTest : public RenderViewTest { } int GetSelectedIndex() { - base::string16 script(ASCIIToUTF16(kSelectID)); - script.append(ASCIIToUTF16(".selectedIndex")); + base::string16 script(base::ASCIIToUTF16(kSelectID)); + script.append(base::ASCIIToUTF16(".selectedIndex")); int selected_index = -1; ExecuteJavaScriptAndReturnIntValue(script, &selected_index); return selected_index; diff --git a/content/renderer/input_tag_speech_dispatcher.cc b/content/renderer/input_tag_speech_dispatcher.cc index b9490ce7..36788c7 100644 --- a/content/renderer/input_tag_speech_dispatcher.cc +++ b/content/renderer/input_tag_speech_dispatcher.cc @@ -60,9 +60,9 @@ bool InputTagSpeechDispatcher::startRecognition( DVLOG(1) << "InputTagSpeechDispatcher::startRecognition enter"; InputTagSpeechHostMsg_StartRecognition_Params params; - params.grammar = UTF16ToUTF8(grammar); - params.language = UTF16ToUTF8(language); - params.origin_url = UTF16ToUTF8(origin.toString()); + params.grammar = base::UTF16ToUTF8(grammar); + params.language = base::UTF16ToUTF8(language); + params.origin_url = base::UTF16ToUTF8(origin.toString()); params.render_view_id = routing_id(); params.request_id = request_id; params.element_rect = element_rect; diff --git a/content/renderer/media/media_stream_audio_processor_options.cc b/content/renderer/media/media_stream_audio_processor_options.cc index add7f957..5aa01599 100644 --- a/content/renderer/media/media_stream_audio_processor_options.cc +++ b/content/renderer/media/media_stream_audio_processor_options.cc @@ -80,7 +80,7 @@ void StartAecDump(AudioProcessing* audio_processing) { base::FilePath file = path.Append(FILE_PATH_LITERAL("audio.aecdump")); #if defined(OS_WIN) - const std::string file_name = WideToUTF8(file.value()); + const std::string file_name = base::WideToUTF8(file.value()); #else const std::string file_name = file.value(); #endif diff --git a/content/renderer/media/media_stream_dependency_factory.cc b/content/renderer/media/media_stream_dependency_factory.cc index e87c7548..8d4fe56 100644 --- a/content/renderer/media/media_stream_dependency_factory.cc +++ b/content/renderer/media/media_stream_dependency_factory.cc @@ -398,7 +398,7 @@ void MediaStreamDependencyFactory::CreateNativeLocalMediaStream( return; } - std::string label = UTF16ToUTF8(web_stream->id()); + std::string label = base::UTF16ToUTF8(web_stream->id()); scoped_refptr<webrtc::MediaStreamInterface> native_stream = CreateLocalMediaStream(label); MediaStreamExtraData* extra_data = @@ -462,7 +462,7 @@ MediaStreamDependencyFactory::CreateNativeAudioMediaStreamTrack( } } - std::string track_id = UTF16ToUTF8(track.id()); + std::string track_id = base::UTF16ToUTF8(track.id()); scoped_refptr<WebRtcAudioCapturer> capturer; if (GetWebRtcAudioDevice()) capturer = GetWebRtcAudioDevice()->GetDefaultCapturer(); @@ -500,7 +500,7 @@ MediaStreamDependencyFactory::CreateNativeVideoMediaStreamTrack( return NULL; } - std::string track_id = UTF16ToUTF8(track.id()); + std::string track_id = base::UTF16ToUTF8(track.id()); scoped_refptr<webrtc::VideoTrackInterface> video_track( CreateLocalVideoTrack(track_id, source_data->video_source())); AddNativeTrackToBlinkTrack(video_track.get(), track, true); @@ -582,7 +582,7 @@ bool MediaStreamDependencyFactory::AddNativeVideoMediaTrack( // Create a new webkit video track. blink::WebMediaStreamTrack webkit_track; blink::WebMediaStreamSource webkit_source; - blink::WebString webkit_track_id(UTF8ToUTF16(track_id)); + blink::WebString webkit_track_id(base::UTF8ToUTF16(track_id)); blink::WebMediaStreamSource::Type type = blink::WebMediaStreamSource::TypeVideo; webkit_source.initialize(webkit_track_id, type, webkit_track_id); @@ -602,7 +602,7 @@ bool MediaStreamDependencyFactory::RemoveNativeMediaStreamTrack( static_cast<MediaStreamExtraData*>(stream.extraData()); webrtc::MediaStreamInterface* native_stream = extra_data->stream().get(); DCHECK(native_stream); - std::string track_id = UTF16ToUTF8(track.id()); + std::string track_id = base::UTF16ToUTF8(track.id()); switch (track.source().type()) { case blink::WebMediaStreamSource::TypeAudio: return native_stream->RemoveTrack( diff --git a/content/renderer/media/media_stream_impl.cc b/content/renderer/media/media_stream_impl.cc index bc72020..c6dd957 100644 --- a/content/renderer/media/media_stream_impl.cc +++ b/content/renderer/media/media_stream_impl.cc @@ -226,7 +226,7 @@ MediaStreamImpl::GetVideoFrameProvider( return NULL; // This is not a valid stream. DVLOG(1) << "MediaStreamImpl::GetVideoFrameProvider stream:" - << UTF16ToUTF8(web_stream.id()); + << base::UTF16ToUTF8(web_stream.id()); blink::WebVector<blink::WebMediaStreamTrack> video_tracks; web_stream.videoTracks(video_tracks); @@ -245,7 +245,7 @@ MediaStreamImpl::GetAudioRenderer(const GURL& url) { return NULL; // This is not a valid stream. DVLOG(1) << "MediaStreamImpl::GetAudioRenderer stream:" - << UTF16ToUTF8(web_stream.id()); + << base::UTF16ToUTF8(web_stream.id()); MediaStreamExtraData* extra_data = static_cast<MediaStreamExtraData*>(web_stream.extraData()); @@ -350,7 +350,7 @@ void MediaStreamImpl::OnStreamGenerated( request_info->frame, video_source_vector); blink::WebUserMediaRequest* request = &(request_info->request); - blink::WebString webkit_id = UTF8ToUTF16(label); + blink::WebString webkit_id = base::UTF8ToUTF16(label); blink::WebMediaStream* web_stream = &(request_info->web_stream); blink::WebVector<blink::WebMediaStreamTrack> audio_track_vector( @@ -462,9 +462,9 @@ void MediaStreamImpl::CreateWebKitSourceVector( continue; } webkit_sources[i].initialize( - UTF8ToUTF16(devices[i].device.id), + base::UTF8ToUTF16(devices[i].device.id), type, - UTF8ToUTF16(devices[i].device.name)); + base::UTF8ToUTF16(devices[i].device.name)); MediaStreamSourceExtraData* source_extra_data( new content::MediaStreamSourceExtraData( devices[i], @@ -600,7 +600,7 @@ MediaStreamImpl::UserMediaRequestInfo* MediaStreamImpl::FindUserMediaRequestInfo(const std::string& label) { UserMediaRequests::iterator it = user_media_requests_.begin(); for (; it != user_media_requests_.end(); ++it) { - if ((*it)->generated && (*it)->web_stream.id() == UTF8ToUTF16(label)) + if ((*it)->generated && (*it)->web_stream.id() == base::UTF8ToUTF16(label)) return (*it); } return NULL; diff --git a/content/renderer/media/midi_message_filter.cc b/content/renderer/media/midi_message_filter.cc index d114618..992c46e 100644 --- a/content/renderer/media/midi_message_filter.cc +++ b/content/renderer/media/midi_message_filter.cc @@ -123,18 +123,18 @@ void MIDIMessageFilter::HandleSessionStarted( // Add the client's input and output ports. for (size_t i = 0; i < inputs.size(); ++i) { client->didAddInputPort( - UTF8ToUTF16(inputs[i].id), - UTF8ToUTF16(inputs[i].manufacturer), - UTF8ToUTF16(inputs[i].name), - UTF8ToUTF16(inputs[i].version)); + base::UTF8ToUTF16(inputs[i].id), + base::UTF8ToUTF16(inputs[i].manufacturer), + base::UTF8ToUTF16(inputs[i].name), + base::UTF8ToUTF16(inputs[i].version)); } for (size_t i = 0; i < outputs.size(); ++i) { client->didAddOutputPort( - UTF8ToUTF16(outputs[i].id), - UTF8ToUTF16(outputs[i].manufacturer), - UTF8ToUTF16(outputs[i].name), - UTF8ToUTF16(outputs[i].version)); + base::UTF8ToUTF16(outputs[i].id), + base::UTF8ToUTF16(outputs[i].manufacturer), + base::UTF8ToUTF16(outputs[i].name), + base::UTF8ToUTF16(outputs[i].version)); } } client->didStartSession(success); diff --git a/content/renderer/media/mock_media_stream_registry.cc b/content/renderer/media/mock_media_stream_registry.cc index cc29c05..de57ad0 100644 --- a/content/renderer/media/mock_media_stream_registry.cc +++ b/content/renderer/media/mock_media_stream_registry.cc @@ -28,7 +28,7 @@ void MockMediaStreamRegistry::Init(const std::string& stream_url) { factory_->CreateLocalMediaStream(kTestStreamLabel)); blink::WebVector<blink::WebMediaStreamTrack> webkit_audio_tracks; blink::WebVector<blink::WebMediaStreamTrack> webkit_video_tracks; - blink::WebString webkit_stream_label(UTF8ToUTF16(stream->label())); + blink::WebString webkit_stream_label(base::UTF8ToUTF16(stream->label())); test_stream_.initialize(webkit_stream_label, webkit_audio_tracks, webkit_video_tracks); test_stream_.setExtraData(new MediaStreamExtraData(stream.get(), false)); diff --git a/content/renderer/media/mock_web_rtc_peer_connection_handler_client.cc b/content/renderer/media/mock_web_rtc_peer_connection_handler_client.cc index a50525e..a4b8e55 100644 --- a/content/renderer/media/mock_web_rtc_peer_connection_handler_client.cc +++ b/content/renderer/media/mock_web_rtc_peer_connection_handler_client.cc @@ -32,9 +32,9 @@ MockWebRTCPeerConnectionHandlerClient:: void MockWebRTCPeerConnectionHandlerClient::didGenerateICECandidateWorker( const blink::WebRTCICECandidate& candidate) { if (!candidate.isNull()) { - candidate_sdp_ = UTF16ToUTF8(candidate.candidate()); + candidate_sdp_ = base::UTF16ToUTF8(candidate.candidate()); candidate_mline_index_ = candidate.sdpMLineIndex(); - candidate_mid_ = UTF16ToUTF8(candidate.sdpMid()); + candidate_mid_ = base::UTF16ToUTF8(candidate.sdpMid()); } else { candidate_sdp_ = ""; candidate_mline_index_ = -1; diff --git a/content/renderer/media/peer_connection_tracker.cc b/content/renderer/media/peer_connection_tracker.cc index b55191c..ef6fa66 100644 --- a/content/renderer/media/peer_connection_tracker.cc +++ b/content/renderer/media/peer_connection_tracker.cc @@ -64,13 +64,13 @@ static string SerializeMediaConstraints( static string SerializeMediaStreamComponent( const blink::WebMediaStreamTrack component) { - string id = UTF16ToUTF8(component.source().id()); + string id = base::UTF16ToUTF8(component.source().id()); return id; } static string SerializeMediaDescriptor( const blink::WebMediaStream& stream) { - string label = UTF16ToUTF8(stream.id()); + string label = base::UTF16ToUTF8(stream.id()); string result = "label: " + label; blink::WebVector<blink::WebMediaStreamTrack> tracks; stream.audioTracks(tracks); @@ -306,8 +306,8 @@ void PeerConnectionTracker::TrackSetSessionDescription( RTCPeerConnectionHandler* pc_handler, const blink::WebRTCSessionDescription& desc, Source source) { - string sdp = UTF16ToUTF8(desc.sdp()); - string type = UTF16ToUTF8(desc.type()); + string sdp = base::UTF16ToUTF8(desc.sdp()); + string type = base::UTF16ToUTF8(desc.type()); string value = "type: " + type + ", sdp: " + sdp; SendPeerConnectionUpdate( @@ -332,8 +332,8 @@ void PeerConnectionTracker::TrackAddIceCandidate( RTCPeerConnectionHandler* pc_handler, const blink::WebRTCICECandidate& candidate, Source source) { - string value = "mid: " + UTF16ToUTF8(candidate.sdpMid()) + ", " + - "candidate: " + UTF16ToUTF8(candidate.candidate()); + string value = "mid: " + base::UTF16ToUTF8(candidate.sdpMid()) + ", " + + "candidate: " + base::UTF16ToUTF8(candidate.candidate()); SendPeerConnectionUpdate( pc_handler, source == SOURCE_LOCAL ? "onIceCandidate" : "addIceCandidate", value); @@ -431,7 +431,7 @@ void PeerConnectionTracker::TrackCreateDTMFSender( RTCPeerConnectionHandler* pc_handler, const blink::WebMediaStreamTrack& track) { SendPeerConnectionUpdate(pc_handler, "createDTMFSender", - UTF16ToUTF8(track.id())); + base::UTF16ToUTF8(track.id())); } int PeerConnectionTracker::GetNextLocalID() { diff --git a/content/renderer/media/remote_media_stream_impl.cc b/content/renderer/media/remote_media_stream_impl.cc index af430e2..3397728 100644 --- a/content/renderer/media/remote_media_stream_impl.cc +++ b/content/renderer/media/remote_media_stream_impl.cc @@ -49,7 +49,7 @@ void InitializeWebkitTrack(webrtc::MediaStreamTrackInterface* track, blink::WebMediaStreamTrack* webkit_track, blink::WebMediaStreamSource::Type type) { blink::WebMediaStreamSource webkit_source; - blink::WebString webkit_track_id(UTF8ToUTF16(track->id())); + blink::WebString webkit_track_id(base::UTF8ToUTF16(track->id())); webkit_source.initialize(webkit_track_id, type, webkit_track_id); webkit_track->initialize(webkit_track_id, webkit_source); @@ -150,7 +150,7 @@ RemoteMediaStreamImpl::RemoteMediaStreamImpl( webkit_video_tracks[i])); } - webkit_stream_.initialize(UTF8ToUTF16(webrtc_stream->label()), + webkit_stream_.initialize(base::UTF8ToUTF16(webrtc_stream->label()), webkit_audio_tracks, webkit_video_tracks); webkit_stream_.setExtraData(new MediaStreamExtraData(webrtc_stream, false)); } diff --git a/content/renderer/media/rtc_data_channel_handler.cc b/content/renderer/media/rtc_data_channel_handler.cc index 065048a..4b2a618 100644 --- a/content/renderer/media/rtc_data_channel_handler.cc +++ b/content/renderer/media/rtc_data_channel_handler.cc @@ -30,7 +30,7 @@ void RtcDataChannelHandler::setClient( } blink::WebString RtcDataChannelHandler::label() { - return UTF8ToUTF16(channel_->label()); + return base::UTF8ToUTF16(channel_->label()); } bool RtcDataChannelHandler::isReliable() { @@ -50,7 +50,7 @@ unsigned short RtcDataChannelHandler::maxRetransmits() const { } blink::WebString RtcDataChannelHandler::protocol() const { - return UTF8ToUTF16(channel_->protocol()); + return base::UTF8ToUTF16(channel_->protocol()); } bool RtcDataChannelHandler::negotiated() const { @@ -66,7 +66,7 @@ unsigned long RtcDataChannelHandler::bufferedAmount() { } bool RtcDataChannelHandler::sendStringData(const blink::WebString& data) { - std::string utf8_buffer = UTF16ToUTF8(data); + std::string utf8_buffer = base::UTF16ToUTF8(data); talk_base::Buffer buffer(utf8_buffer.c_str(), utf8_buffer.length()); webrtc::DataBuffer data_buffer(buffer, false); return channel_->Send(data_buffer); @@ -121,7 +121,7 @@ void RtcDataChannelHandler::OnMessage(const webrtc::DataBuffer& buffer) { webkit_client_->didReceiveRawData(buffer.data.data(), buffer.data.length()); } else { base::string16 utf16; - if (!UTF8ToUTF16(buffer.data.data(), buffer.data.length(), &utf16)) { + if (!base::UTF8ToUTF16(buffer.data.data(), buffer.data.length(), &utf16)) { LOG(ERROR) << "Failed convert received data to UTF16"; return; } diff --git a/content/renderer/media/rtc_dtmf_sender_handler.cc b/content/renderer/media/rtc_dtmf_sender_handler.cc index 3df592c..23c5cc1 100644 --- a/content/renderer/media/rtc_dtmf_sender_handler.cc +++ b/content/renderer/media/rtc_dtmf_sender_handler.cc @@ -31,7 +31,7 @@ void RtcDtmfSenderHandler::setClient( } blink::WebString RtcDtmfSenderHandler::currentToneBuffer() { - return UTF8ToUTF16(dtmf_sender_->tones()); + return base::UTF8ToUTF16(dtmf_sender_->tones()); } bool RtcDtmfSenderHandler::canInsertDTMF() { @@ -41,7 +41,7 @@ bool RtcDtmfSenderHandler::canInsertDTMF() { bool RtcDtmfSenderHandler::insertDTMF(const blink::WebString& tones, long duration, long interToneGap) { - std::string utf8_tones = UTF16ToUTF8(tones); + std::string utf8_tones = base::UTF16ToUTF8(tones); return dtmf_sender_->InsertDtmf(utf8_tones, static_cast<int>(duration), static_cast<int>(interToneGap)); } @@ -51,7 +51,7 @@ void RtcDtmfSenderHandler::OnToneChange(const std::string& tone) { LOG(ERROR) << "WebRTCDTMFSenderHandlerClient not set."; return; } - webkit_client_->didPlayTone(UTF8ToUTF16(tone)); + webkit_client_->didPlayTone(base::UTF8ToUTF16(tone)); } } // namespace content diff --git a/content/renderer/media/rtc_peer_connection_handler.cc b/content/renderer/media/rtc_peer_connection_handler.cc index 1536ec3..08f71c0 100644 --- a/content/renderer/media/rtc_peer_connection_handler.cc +++ b/content/renderer/media/rtc_peer_connection_handler.cc @@ -121,7 +121,8 @@ CreateWebKitSessionDescription( return description; } - description.initialize(UTF8ToUTF16(native_desc->type()), UTF8ToUTF16(sdp)); + description.initialize(base::UTF8ToUTF16(native_desc->type()), + base::UTF8ToUTF16(sdp)); return description; } @@ -136,8 +137,8 @@ static void GetNativeIceServers( webrtc::PeerConnectionInterface::IceServer server; const blink::WebRTCICEServer& webkit_server = server_configuration.server(i); - server.username = UTF16ToUTF8(webkit_server.username()); - server.password = UTF16ToUTF8(webkit_server.credential()); + server.username = base::UTF16ToUTF8(webkit_server.username()); + server.password = base::UTF16ToUTF8(webkit_server.credential()); server.uri = webkit_server.uri().spec(); servers->push_back(server); } @@ -188,7 +189,7 @@ class CreateSessionDescriptionRequest } virtual void OnFailure(const std::string& error) OVERRIDE { tracker_.TrackOnFailure(error); - webkit_request_.requestFailed(UTF8ToUTF16(error)); + webkit_request_.requestFailed(base::UTF8ToUTF16(error)); } protected: @@ -216,7 +217,7 @@ class SetSessionDescriptionRequest } virtual void OnFailure(const std::string& error) OVERRIDE { tracker_.TrackOnFailure(error); - webkit_request_.requestFailed(UTF8ToUTF16(error)); + webkit_request_.requestFailed(base::UTF8ToUTF16(error)); } protected: @@ -507,9 +508,9 @@ bool RTCPeerConnectionHandler::addICECandidate( const blink::WebRTCICECandidate& candidate) { scoped_ptr<webrtc::IceCandidateInterface> native_candidate( dependency_factory_->CreateIceCandidate( - UTF16ToUTF8(candidate.sdpMid()), + base::UTF16ToUTF8(candidate.sdpMid()), candidate.sdpMLineIndex(), - UTF16ToUTF8(candidate.candidate()))); + base::UTF16ToUTF8(candidate.candidate()))); if (!native_candidate) { LOG(ERROR) << "Could not create native ICE candidate."; return false; @@ -532,7 +533,7 @@ void RTCPeerConnectionHandler::OnaddICECandidateResult( // We don't have the actual error code from the libjingle, so for now // using a generic error string. return webkit_request.requestFailed( - UTF8ToUTF16("Error processing ICE candidate")); + base::UTF8ToUTF16("Error processing ICE candidate")); } return webkit_request.requestSucceeded(); @@ -607,7 +608,7 @@ void RTCPeerConnectionHandler::GetStats( blink::WebRTCDataChannelHandler* RTCPeerConnectionHandler::createDataChannel( const blink::WebString& label, const blink::WebRTCDataChannelInit& init) { - DVLOG(1) << "createDataChannel label " << UTF16ToUTF8(label); + DVLOG(1) << "createDataChannel label " << base::UTF16ToUTF8(label); webrtc::DataChannelInit config; // TODO(jiayl): remove the deprecated reliable field once Libjingle is updated @@ -618,10 +619,11 @@ blink::WebRTCDataChannelHandler* RTCPeerConnectionHandler::createDataChannel( config.negotiated = init.negotiated; config.maxRetransmits = init.maxRetransmits; config.maxRetransmitTime = init.maxRetransmitTime; - config.protocol = UTF16ToUTF8(init.protocol); + config.protocol = base::UTF16ToUTF8(init.protocol); talk_base::scoped_refptr<webrtc::DataChannelInterface> webrtc_channel( - native_peer_connection_->CreateDataChannel(UTF16ToUTF8(label), &config)); + native_peer_connection_->CreateDataChannel(base::UTF16ToUTF8(label), + &config)); if (!webrtc_channel) { DLOG(ERROR) << "Could not create native data channel."; return NULL; @@ -756,8 +758,8 @@ void RTCPeerConnectionHandler::OnIceCandidate( return; } blink::WebRTCICECandidate web_candidate; - web_candidate.initialize(UTF8ToUTF16(sdp), - UTF8ToUTF16(candidate->sdp_mid()), + web_candidate.initialize(base::UTF8ToUTF16(sdp), + base::UTF8ToUTF16(candidate->sdp_mid()), candidate->sdp_mline_index()); if (peer_connection_tracker_) peer_connection_tracker_->TrackAddIceCandidate( @@ -791,8 +793,8 @@ webrtc::SessionDescriptionInterface* RTCPeerConnectionHandler::CreateNativeSessionDescription( const blink::WebRTCSessionDescription& description, webrtc::SdpParseError* error) { - std::string sdp = UTF16ToUTF8(description.sdp()); - std::string type = UTF16ToUTF8(description.type()); + std::string sdp = base::UTF16ToUTF8(description.sdp()); + std::string type = base::UTF16ToUTF8(description.type()); webrtc::SessionDescriptionInterface* native_desc = dependency_factory_->CreateSessionDescription(type, sdp, error); diff --git a/content/renderer/media/rtc_peer_connection_handler_unittest.cc b/content/renderer/media/rtc_peer_connection_handler_unittest.cc index 18901ea..522a107 100644 --- a/content/renderer/media/rtc_peer_connection_handler_unittest.cc +++ b/content/renderer/media/rtc_peer_connection_handler_unittest.cc @@ -234,14 +234,14 @@ class RTCPeerConnectionHandlerTest : public ::testing::Test { video_tracks[0].initialize(video_source.id(), video_source); blink::WebMediaStream local_stream; - local_stream.initialize(UTF8ToUTF16(stream_label), audio_tracks, + local_stream.initialize(base::UTF8ToUTF16(stream_label), audio_tracks, video_tracks); scoped_refptr<webrtc::MediaStreamInterface> native_stream( mock_dependency_factory_->CreateLocalMediaStream(stream_label)); local_stream.audioTracks(audio_tracks); - const std::string audio_track_id = UTF16ToUTF8(audio_tracks[0].id()); + const std::string audio_track_id = base::UTF16ToUTF8(audio_tracks[0].id()); scoped_refptr<WebRtcAudioCapturer> capturer; RTCMediaConstraints audio_constraints(audio_source.constraints()); scoped_refptr<webrtc::AudioTrackInterface> audio_track( @@ -253,7 +253,7 @@ class RTCPeerConnectionHandlerTest : public ::testing::Test { native_stream->AddTrack(audio_track.get()); local_stream.videoTracks(video_tracks); - const std::string video_track_id = UTF16ToUTF8(video_tracks[0].id()); + const std::string video_track_id = base::UTF16ToUTF8(video_tracks[0].id()); webrtc::VideoSourceInterface* source = NULL; scoped_refptr<webrtc::VideoTrackInterface> video_track( mock_dependency_factory_->CreateLocalVideoTrack( @@ -653,20 +653,20 @@ TEST_F(RTCPeerConnectionHandlerTest, OnAddAndOnRemoveStream) { EXPECT_CALL(*mock_tracker_.get(), TrackAddStream( pc_handler_.get(), testing::Property(&blink::WebMediaStream::id, - UTF8ToUTF16(remote_stream_label)), + base::UTF8ToUTF16(remote_stream_label)), PeerConnectionTracker::SOURCE_REMOTE)); EXPECT_CALL(*mock_client_.get(), didAddRemoteStream( testing::Property(&blink::WebMediaStream::id, - UTF8ToUTF16(remote_stream_label)))); + base::UTF8ToUTF16(remote_stream_label)))); EXPECT_CALL(*mock_tracker_.get(), TrackRemoveStream( pc_handler_.get(), testing::Property(&blink::WebMediaStream::id, - UTF8ToUTF16(remote_stream_label)), + base::UTF8ToUTF16(remote_stream_label)), PeerConnectionTracker::SOURCE_REMOTE)); EXPECT_CALL(*mock_client_.get(), didRemoveRemoteStream( testing::Property(&blink::WebMediaStream::id, - UTF8ToUTF16(remote_stream_label)))); + base::UTF8ToUTF16(remote_stream_label)))); pc_handler_->OnAddStream(remote_stream.get()); pc_handler_->OnRemoveStream(remote_stream.get()); @@ -681,7 +681,7 @@ TEST_F(RTCPeerConnectionHandlerTest, RemoteTrackState) { testing::InSequence sequence; EXPECT_CALL(*mock_client_.get(), didAddRemoteStream( testing::Property(&blink::WebMediaStream::id, - UTF8ToUTF16(remote_stream_label)))); + base::UTF8ToUTF16(remote_stream_label)))); pc_handler_->OnAddStream(remote_stream.get()); const blink::WebMediaStream& webkit_stream = mock_client_->remote_stream(); @@ -713,7 +713,7 @@ TEST_F(RTCPeerConnectionHandlerTest, RemoveAndAddAudioTrackFromRemoteStream) { EXPECT_CALL(*mock_client_.get(), didAddRemoteStream( testing::Property(&blink::WebMediaStream::id, - UTF8ToUTF16(remote_stream_label)))); + base::UTF8ToUTF16(remote_stream_label)))); pc_handler_->OnAddStream(remote_stream.get()); const blink::WebMediaStream& webkit_stream = mock_client_->remote_stream(); @@ -743,7 +743,7 @@ TEST_F(RTCPeerConnectionHandlerTest, RemoveAndAddVideoTrackFromRemoteStream) { EXPECT_CALL(*mock_client_.get(), didAddRemoteStream( testing::Property(&blink::WebMediaStream::id, - UTF8ToUTF16(remote_stream_label)))); + base::UTF8ToUTF16(remote_stream_label)))); pc_handler_->OnAddStream(remote_stream.get()); const blink::WebMediaStream& webkit_stream = mock_client_->remote_stream(); diff --git a/content/renderer/npapi/webplugin_delegate_proxy.cc b/content/renderer/npapi/webplugin_delegate_proxy.cc index 3a71976..90e7c1d 100644 --- a/content/renderer/npapi/webplugin_delegate_proxy.cc +++ b/content/renderer/npapi/webplugin_delegate_proxy.cc @@ -1211,7 +1211,7 @@ bool WebPluginDelegateProxy::UseSynchronousGeometryUpdates() { // Need to update geometry synchronously with WMP, otherwise if a site // scripts the plugin to start playing while it's in the middle of handling // an update geometry message, videos don't play. See urls in bug 20260. - if (info_.name.find(ASCIIToUTF16("Windows Media Player")) != + if (info_.name.find(base::ASCIIToUTF16("Windows Media Player")) != base::string16::npos) return true; diff --git a/content/renderer/npapi/webplugin_impl.cc b/content/renderer/npapi/webplugin_impl.cc index da30d84..864f024 100644 --- a/content/renderer/npapi/webplugin_impl.cc +++ b/content/renderer/npapi/webplugin_impl.cc @@ -773,7 +773,7 @@ std::string WebPluginImpl::GetCookies(const GURL& url, return std::string(); } - return UTF16ToUTF8(cookie_jar->cookies(url, first_party_for_cookies)); + return base::UTF16ToUTF8(cookie_jar->cookies(url, first_party_for_cookies)); } void WebPluginImpl::URLRedirectResponse(bool allow, int resource_id) { diff --git a/content/renderer/pepper/event_conversion.cc b/content/renderer/pepper/event_conversion.cc index b7c0601..2ceaf07 100644 --- a/content/renderer/pepper/event_conversion.cc +++ b/content/renderer/pepper/event_conversion.cc @@ -370,7 +370,7 @@ WebKeyboardEvent* BuildCharEvent(const InputEventData& event) { // 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::textLengthCap; - base::string16 text16 = UTF8ToUTF16(event.character_text); + base::string16 text16 = base::UTF8ToUTF16(event.character_text); memset(key_event->text, 0, text_length_cap); memset(key_event->unmodifiedText, 0, text_length_cap); diff --git a/content/renderer/pepper/host_globals.cc b/content/renderer/pepper/host_globals.cc index 31c5f0b..437addd 100644 --- a/content/renderer/pepper/host_globals.cc +++ b/content/renderer/pepper/host_globals.cc @@ -70,7 +70,7 @@ WebConsoleMessage MakeLogMessage(PP_LogLevel level, result.append(": "); result.append(message); return WebConsoleMessage(LogLevelToWebLogLevel(level), - WebString(UTF8ToUTF16(result))); + WebString(base::UTF8ToUTF16(result))); } } // namespace diff --git a/content/renderer/pepper/pepper_file_chooser_host.cc b/content/renderer/pepper/pepper_file_chooser_host.cc index ca13f5a..eb7e2dd 100644 --- a/content/renderer/pepper/pepper_file_chooser_host.cc +++ b/content/renderer/pepper/pepper_file_chooser_host.cc @@ -103,7 +103,7 @@ void PepperFileChooserHost::StoreChosenFiles( std::vector<std::string> display_names; for (size_t i = 0; i < files.size(); i++) { #if defined(OS_WIN) - base::FilePath file_path(UTF8ToWide(files[i].path)); + base::FilePath file_path(base::UTF8ToWide(files[i].path)); #else base::FilePath file_path(files[i].path); #endif diff --git a/content/renderer/pepper/pepper_file_chooser_host_unittest.cc b/content/renderer/pepper/pepper_file_chooser_host_unittest.cc index 0afde5b..9f4a758 100644 --- a/content/renderer/pepper/pepper_file_chooser_host_unittest.cc +++ b/content/renderer/pepper/pepper_file_chooser_host_unittest.cc @@ -59,7 +59,7 @@ class PepperFileChooserHostTest : public RenderViewTest { // For testing to convert our hardcoded file paths to 8-bit. std::string FilePathToUTF8(const base::FilePath::StringType& path) { #if defined(OS_WIN) - return UTF16ToUTF8(path); + return base::UTF16ToUTF8(path); #else return path; #endif @@ -97,7 +97,7 @@ TEST_F(PepperFileChooserHostTest, Show) { // Basic validation of request. EXPECT_EQ(FileChooserParams::Open, chooser_params.mode); ASSERT_EQ(1u, chooser_params.accept_types.size()); - EXPECT_EQ(accept[0], UTF16ToUTF8(chooser_params.accept_types[0])); + EXPECT_EQ(accept[0], base::UTF16ToUTF8(chooser_params.accept_types[0])); // 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. diff --git a/content/renderer/pepper/pepper_plugin_instance_impl.cc b/content/renderer/pepper/pepper_plugin_instance_impl.cc index 7e5c968..ff753fe 100644 --- a/content/renderer/pepper/pepper_plugin_instance_impl.cc +++ b/content/renderer/pepper/pepper_plugin_instance_impl.cc @@ -1249,7 +1249,7 @@ base::string16 PepperPluginInstanceImpl::GetSelectedText(bool html) { StringVar* string = StringVar::FromPPVar(rv); base::string16 selection; if (string) - selection = UTF8ToUTF16(string->value()); + selection = base::UTF8ToUTF16(string->value()); // Release the ref the plugin transfered to us. HostGlobals::Get()->GetVarTracker()->ReleaseVar(rv); return selection; @@ -1269,7 +1269,7 @@ base::string16 PepperPluginInstanceImpl::GetLinkAtPosition( StringVar* string = StringVar::FromPPVar(rv); base::string16 link; if (string) - link = UTF8ToUTF16(string->value()); + link = base::UTF8ToUTF16(string->value()); // Release the ref the plugin transfered to us. PpapiGlobals::Get()->GetVarTracker()->ReleaseVar(rv); return link; @@ -1304,7 +1304,7 @@ bool PepperPluginInstanceImpl::StartFind(const base::string16& search_text, return PP_ToBool( plugin_find_interface_->StartFind( pp_instance(), - UTF16ToUTF8(search_text.c_str()).c_str(), + base::UTF16ToUTF8(search_text.c_str()).c_str(), PP_FromBool(case_sensitive))); } @@ -2053,7 +2053,7 @@ bool PepperPluginInstanceImpl::SimulateIMEEvent( break; case PP_INPUTEVENT_TYPE_IME_TEXT: render_frame_->SimulateImeConfirmComposition( - UTF8ToUTF16(input_event.character_text), gfx::Range()); + base::UTF8ToUTF16(input_event.character_text), gfx::Range()); break; default: return false; diff --git a/content/renderer/pepper/pepper_truetype_font_win.cc b/content/renderer/pepper/pepper_truetype_font_win.cc index 6d04044..edd503a 100644 --- a/content/renderer/pepper/pepper_truetype_font_win.cc +++ b/content/renderer/pepper/pepper_truetype_font_win.cc @@ -83,7 +83,7 @@ PepperTrueTypeFontWin::PepperTrueTypeFontWin( CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, pitch_and_family, - UTF8ToUTF16(desc.family).c_str()); + base::UTF8ToUTF16(desc.family).c_str()); } PepperTrueTypeFontWin::~PepperTrueTypeFontWin() { @@ -131,7 +131,7 @@ int32_t PepperTrueTypeFontWin::Describe( base::win::ScopedSelectObject select_object(hdc, font_); WCHAR name[LF_FACESIZE]; GetTextFace(hdc, LF_FACESIZE, name); - desc->family = UTF16ToUTF8(name); + desc->family = base::UTF16ToUTF8(name); } return PP_OK; } diff --git a/content/renderer/pepper/ppb_graphics_3d_impl.cc b/content/renderer/pepper/ppb_graphics_3d_impl.cc index 1564279..4f138f3 100644 --- a/content/renderer/pepper/ppb_graphics_3d_impl.cc +++ b/content/renderer/pepper/ppb_graphics_3d_impl.cc @@ -287,7 +287,7 @@ void PPB_Graphics3D_Impl::OnConsoleMessage(const std::string& message, if (!frame) return; WebConsoleMessage console_message = WebConsoleMessage( - WebConsoleMessage::LevelError, WebString(UTF8ToUTF16(message))); + WebConsoleMessage::LevelError, WebString(base::UTF8ToUTF16(message))); frame->addMessageToConsole(console_message); } diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc index 39f20fd..5c7bf33 100644 --- a/content/renderer/render_frame_impl.cc +++ b/content/renderer/render_frame_impl.cc @@ -611,7 +611,7 @@ blink::WebFrame* RenderFrameImpl::createChildFrame( Send(new FrameHostMsg_CreateChildFrame(routing_id_, parent->identifier(), child_frame_identifier, - UTF16ToUTF8(name), + base::UTF16ToUTF8(name), &routing_id)); child_render_frame = RenderFrameImpl::Create(render_view_, routing_id); } @@ -697,7 +697,7 @@ void RenderFrameImpl::didChangeName(blink::WebFrame* frame, new ViewHostMsg_UpdateFrameName(render_view_->GetRoutingID(), frame->identifier(), !frame->parent(), - UTF16ToUTF8(name))); + base::UTF16ToUTF8(name))); } void RenderFrameImpl::didMatchCSS( diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc index 9b85289..6ca739b 100644 --- a/content/renderer/render_thread_impl.cc +++ b/content/renderer/render_thread_impl.cc @@ -729,7 +729,7 @@ void RenderThreadImpl::EnsureWebKitInitialized() { void RenderThreadImpl::RegisterSchemes() { // swappedout: pages should not be accessible, and should also // be treated as empty documents that can commit synchronously. - WebString swappedout_scheme(ASCIIToUTF16(kSwappedOutScheme)); + WebString swappedout_scheme(base::ASCIIToUTF16(kSwappedOutScheme)); WebSecurityPolicy::registerURLSchemeAsDisplayIsolated(swappedout_scheme); WebSecurityPolicy::registerURLSchemeAsEmptyDocument(swappedout_scheme); } diff --git a/content/renderer/render_view_browsertest.cc b/content/renderer/render_view_browsertest.cc index 6b9aa19..35f3400 100644 --- a/content/renderer/render_view_browsertest.cc +++ b/content/renderer/render_view_browsertest.cc @@ -947,7 +947,7 @@ TEST_F(RenderViewImplTest, OnImeTypeChanged) { test_case->input_id); // Move the input focus to the target <input> element, where we should // activate IMEs. - ExecuteJavaScriptAndReturnIntValue(ASCIIToUTF16(javascript), NULL); + ExecuteJavaScriptAndReturnIntValue(base::ASCIIToUTF16(javascript), NULL); ProcessPendingMessages(); render_thread_->sink().ClearMessages(); @@ -1295,7 +1295,7 @@ TEST_F(RenderViewImplTest, MAYBE_OnHandleKeyboardEvent) { // text created from a virtual-key code, a character code, and the // modifier-key status. const int kMaxOutputCharacters = 1024; - std::string output = UTF16ToUTF8( + std::string output = base::UTF16ToUTF8( GetMainFrame()->contentAsText(kMaxOutputCharacters)); EXPECT_EQ(expected_result, output); } @@ -1776,7 +1776,7 @@ TEST_F(RenderViewImplTest, TestBackForward) { blink::WebHistoryItem page_a_item = GetMainFrame()->currentHistoryItem(); int was_page_a = -1; base::string16 check_page_a = - ASCIIToUTF16( + base::ASCIIToUTF16( "Number(document.getElementById('pagename').innerHTML == 'Page A')"); EXPECT_TRUE(ExecuteJavaScriptAndReturnIntValue(check_page_a, &was_page_a)); EXPECT_EQ(1, was_page_a); @@ -1784,7 +1784,7 @@ TEST_F(RenderViewImplTest, TestBackForward) { LoadHTML("<div id=pagename>Page B</div>"); int was_page_b = -1; base::string16 check_page_b = - ASCIIToUTF16( + base::ASCIIToUTF16( "Number(document.getElementById('pagename').innerHTML == 'Page B')"); EXPECT_TRUE(ExecuteJavaScriptAndReturnIntValue(check_page_b, &was_page_b)); EXPECT_EQ(1, was_page_b); @@ -1792,7 +1792,7 @@ TEST_F(RenderViewImplTest, TestBackForward) { LoadHTML("<div id=pagename>Page C</div>"); int was_page_c = -1; base::string16 check_page_c = - ASCIIToUTF16( + base::ASCIIToUTF16( "Number(document.getElementById('pagename').innerHTML == 'Page C')"); EXPECT_TRUE(ExecuteJavaScriptAndReturnIntValue(check_page_c, &was_page_c)); EXPECT_EQ(1, was_page_b); @@ -1832,14 +1832,14 @@ TEST_F(RenderViewImplTest, GetCompositionCharacterBoundsTest) { LoadHTML("<textarea id=\"test\"></textarea>"); ExecuteJavaScript("document.getElementById('test').focus();"); - const base::string16 empty_string = UTF8ToUTF16(""); + const base::string16 empty_string; const std::vector<blink::WebCompositionUnderline> empty_underline; std::vector<gfx::Rect> bounds; view()->OnSetFocus(true); view()->OnSetInputMethodActive(true); // ASCII composition - const base::string16 ascii_composition = UTF8ToUTF16("aiueo"); + const base::string16 ascii_composition = base::UTF8ToUTF16("aiueo"); view()->OnImeSetComposition(ascii_composition, empty_underline, 0, 0); view()->GetCompositionCharacterBounds(&bounds); ASSERT_EQ(ascii_composition.size(), bounds.size()); @@ -1849,7 +1849,7 @@ TEST_F(RenderViewImplTest, GetCompositionCharacterBoundsTest) { empty_string, gfx::Range::InvalidRange(), false); // Non surrogate pair unicode character. - const base::string16 unicode_composition = UTF8ToUTF16( + const base::string16 unicode_composition = base::UTF8ToUTF16( "\xE3\x81\x82\xE3\x81\x84\xE3\x81\x86\xE3\x81\x88\xE3\x81\x8A"); view()->OnImeSetComposition(unicode_composition, empty_underline, 0, 0); view()->GetCompositionCharacterBounds(&bounds); @@ -1860,7 +1860,8 @@ TEST_F(RenderViewImplTest, GetCompositionCharacterBoundsTest) { empty_string, gfx::Range::InvalidRange(), false); // Surrogate pair character. - const base::string16 surrogate_pair_char = UTF8ToUTF16("\xF0\xA0\xAE\x9F"); + const base::string16 surrogate_pair_char = + base::UTF8ToUTF16("\xF0\xA0\xAE\x9F"); view()->OnImeSetComposition(surrogate_pair_char, empty_underline, 0, @@ -1874,8 +1875,8 @@ TEST_F(RenderViewImplTest, GetCompositionCharacterBoundsTest) { // Mixed string. const base::string16 surrogate_pair_mixed_composition = - surrogate_pair_char + UTF8ToUTF16("\xE3\x81\x82") + surrogate_pair_char + - UTF8ToUTF16("b") + surrogate_pair_char; + surrogate_pair_char + base::UTF8ToUTF16("\xE3\x81\x82") + + surrogate_pair_char + base::UTF8ToUTF16("b") + surrogate_pair_char; const size_t utf16_length = 8UL; const bool is_surrogate_pair_empty_rect[8] = { false, true, false, false, true, false, false, true }; @@ -2175,7 +2176,7 @@ TEST_F(RenderViewImplTest, SendCandidateWindowEvents) { // Retrieve the content and check if it is expected. const int kMaxOutputCharacters = 50; - std::string output = UTF16ToUTF8( + std::string output = base::UTF16ToUTF8( GetMainFrame()->contentAsText(kMaxOutputCharacters)); EXPECT_EQ(output, "\nResult:showupdatehide"); } diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc index c6d2f91..ab5adf8 100644 --- a/content/renderer/render_view_impl.cc +++ b/content/renderer/render_view_impl.cc @@ -2028,7 +2028,7 @@ void RenderViewImpl::UpdateTitle(WebFrame* frame, return; base::debug::TraceLog::GetInstance()->UpdateProcessLabel( - routing_id_, UTF16ToUTF8(title)); + routing_id_, base::UTF16ToUTF8(title)); base::string16 shortened_title = title.substr(0, kMaxTitleChars); Send(new ViewHostMsg_UpdateTitle(routing_id_, page_id_, shortened_title, @@ -2477,7 +2477,7 @@ void RenderViewImpl::didChangeSelection(bool is_empty_selection) { } void RenderViewImpl::didExecuteCommand(const WebString& command_name) { - const std::string& name = UTF16ToUTF8(command_name); + const std::string& name = base::UTF16ToUTF8(command_name); if (StartsWithASCII(name, "Move", true) || StartsWithASCII(name, "Insert", true) || StartsWithASCII(name, "Delete", true)) @@ -6028,12 +6028,12 @@ void RenderViewImpl::registerProtocolHandler(const WebString& scheme, const WebString& title) { bool user_gesture = WebUserGestureIndicator::isProcessingUserGesture(); GURL base(base_url); - GURL absolute_url = base.Resolve(UTF16ToUTF8(url)); + GURL absolute_url = base.Resolve(base::UTF16ToUTF8(url)); if (base.GetOrigin() != absolute_url.GetOrigin()) { return; } Send(new ViewHostMsg_RegisterProtocolHandler(routing_id_, - UTF16ToUTF8(scheme), + base::UTF16ToUTF8(scheme), absolute_url, title, user_gesture)); @@ -6111,7 +6111,7 @@ WebContentDetectionResult RenderViewImpl::detectContentAround( ContentDetector::Result content = (*it)->FindTappedContent(touch_hit); if (content.valid) { return WebContentDetectionResult(content.content_boundaries, - UTF8ToUTF16(content.text), content.intent_url); + base::UTF8ToUTF16(content.text), content.intent_url); } } return WebContentDetectionResult(); diff --git a/content/renderer/render_view_impl_unittest.cc b/content/renderer/render_view_impl_unittest.cc index 971a4fb..65389f7 100644 --- a/content/renderer/render_view_impl_unittest.cc +++ b/content/renderer/render_view_impl_unittest.cc @@ -28,10 +28,10 @@ TEST(RenderViewImplTest, ShouldUpdateSelectionTextFromContextMenuParams) { ContextMenuParams params; for (size_t i = 0; i < ARRAYSIZE_UNSAFE(cases); ++i) { - params.selection_text = UTF8ToUTF16(cases[i].params_selection_text); + params.selection_text = base::UTF8ToUTF16(cases[i].params_selection_text); EXPECT_EQ(cases[i].expected_result, RenderViewImpl::ShouldUpdateSelectionTextFromContextMenuParams( - UTF8ToUTF16(cases[i].selection_text), + base::UTF8ToUTF16(cases[i].selection_text), cases[i].selection_text_offset, cases[i].selection_range, params)); diff --git a/content/renderer/renderer_webcookiejar_impl.cc b/content/renderer/renderer_webcookiejar_impl.cc index 4018ac0..40bef32 100644 --- a/content/renderer/renderer_webcookiejar_impl.cc +++ b/content/renderer/renderer_webcookiejar_impl.cc @@ -21,7 +21,7 @@ namespace content { void RendererWebCookieJarImpl::setCookie( const WebURL& url, const WebURL& first_party_for_cookies, const WebString& value) { - std::string value_utf8 = UTF16ToUTF8(value); + std::string value_utf8 = base::UTF16ToUTF8(value); sender_->Send(new ViewHostMsg_SetCookie( sender_->GetRoutingID(), url, first_party_for_cookies, value_utf8)); } @@ -63,7 +63,7 @@ void RendererWebCookieJarImpl::rawCookies( void RendererWebCookieJarImpl::deleteCookie( const WebURL& url, const WebString& cookie_name) { - std::string cookie_name_utf8 = UTF16ToUTF8(cookie_name); + std::string cookie_name_utf8 = base::UTF16ToUTF8(cookie_name); sender_->Send(new ViewHostMsg_DeleteCookie(url, cookie_name_utf8)); } diff --git a/content/renderer/renderer_webkitplatformsupport_impl.cc b/content/renderer/renderer_webkitplatformsupport_impl.cc index 6013a05..c7fa271 100644 --- a/content/renderer/renderer_webkitplatformsupport_impl.cc +++ b/content/renderer/renderer_webkitplatformsupport_impl.cc @@ -338,7 +338,7 @@ void RendererWebKitPlatformSupportImpl::cacheMetadata( } WebString RendererWebKitPlatformSupportImpl::defaultLocale() { - return ASCIIToUTF16(RenderThread::Get()->GetLocale()); + return base::ASCIIToUTF16(RenderThread::Get()->GetLocale()); } void RendererWebKitPlatformSupportImpl::suddenTerminationChanged(bool enabled) { @@ -456,7 +456,7 @@ RendererWebKitPlatformSupportImpl::MimeRegistry::mimeTypeForExtension( RenderThread::Get()->Send( new MimeRegistryMsg_GetMimeTypeFromExtension( base::FilePath::FromUTF16Unsafe(file_extension).value(), &mime_type)); - return ASCIIToUTF16(mime_type); + return base::ASCIIToUTF16(mime_type); } WebString RendererWebKitPlatformSupportImpl::MimeRegistry::mimeTypeFromFile( @@ -470,7 +470,7 @@ WebString RendererWebKitPlatformSupportImpl::MimeRegistry::mimeTypeFromFile( RenderThread::Get()->Send(new MimeRegistryMsg_GetMimeTypeFromFile( base::FilePath::FromUTF16Unsafe(file_path), &mime_type)); - return ASCIIToUTF16(mime_type); + return base::ASCIIToUTF16(mime_type); } //------------------------------------------------------------------------------ @@ -716,7 +716,7 @@ RendererWebKitPlatformSupportImpl::createAudioDevice( int session_id = 0; if (input_device_id.isNull() || - !base::StringToInt(UTF16ToUTF8(input_device_id), &session_id)) { + !base::StringToInt(base::UTF16ToUTF8(input_device_id), &session_id)) { if (input_channels > 0) DLOG(WARNING) << "createAudioDevice(): request for audio input ignored"; diff --git a/content/renderer/speech_recognition_dispatcher.cc b/content/renderer/speech_recognition_dispatcher.cc index 1ac2237..3d76c20 100644 --- a/content/renderer/speech_recognition_dispatcher.cc +++ b/content/renderer/speech_recognition_dispatcher.cc @@ -66,7 +66,7 @@ void SpeechRecognitionDispatcher::start( msg_params.grammars.push_back( SpeechRecognitionGrammar(grammar.src().spec(), grammar.weight())); } - msg_params.language = UTF16ToUTF8(params.language()); + msg_params.language = base::UTF16ToUTF8(params.language()); msg_params.max_hypotheses = static_cast<uint32>(params.maxAlternatives()); msg_params.continuous = params.continuous(); msg_params.interim_results = params.interimResults(); diff --git a/content/renderer/web_preferences.cc b/content/renderer/web_preferences.cc index 5a94512..b3cf5a4 100644 --- a/content/renderer/web_preferences.cc +++ b/content/renderer/web_preferences.cc @@ -131,7 +131,8 @@ void ApplyWebPreferences(const WebPreferences& prefs, WebView* web_view) { settings->setDefaultFixedFontSize(prefs.default_fixed_font_size); settings->setMinimumFontSize(prefs.minimum_font_size); settings->setMinimumLogicalFontSize(prefs.minimum_logical_font_size); - settings->setDefaultTextEncodingName(ASCIIToUTF16(prefs.default_encoding)); + settings->setDefaultTextEncodingName( + base::ASCIIToUTF16(prefs.default_encoding)); settings->setJavaScriptEnabled(prefs.javascript_enabled); settings->setWebSecurityEnabled(prefs.web_security_enabled); settings->setJavaScriptCanOpenWindowsAutomatically( @@ -341,7 +342,7 @@ void ApplyWebPreferences(const WebPreferences& prefs, WebView* web_view) { settings->setMediaFullscreenRequiresUserGesture( prefs.user_gesture_required_for_media_fullscreen); settings->setDefaultVideoPosterURL( - ASCIIToUTF16(prefs.default_video_poster_url.spec())); + base::ASCIIToUTF16(prefs.default_video_poster_url.spec())); settings->setSupportDeprecatedTargetDensityDPI( prefs.support_deprecated_target_density_dpi); settings->setUseLegacyBackgroundSizeShorthandBehavior( diff --git a/content/renderer/webclipboard_impl.cc b/content/renderer/webclipboard_impl.cc index c1ee0a7..4f6e54f 100644 --- a/content/renderer/webclipboard_impl.cc +++ b/content/renderer/webclipboard_impl.cc @@ -107,7 +107,7 @@ WebString WebClipboardImpl::readPlainText(Buffer buffer) { std::string text; client_->ReadAsciiText(clipboard_type, &text); if (!text.empty()) - return ASCIIToUTF16(text); + return base::ASCIIToUTF16(text); } return WebString(); @@ -187,7 +187,8 @@ void WebClipboardImpl::writeImage(const WebImage& image, // We also don't want to write HTML on a Mac, since Mail.app prefers to use // the image markup over attaching the actual image. See // http://crbug.com/33016 for details. - scw.WriteHTML(UTF8ToUTF16(URLToImageMarkup(url, title)), std::string()); + scw.WriteHTML(base::UTF8ToUTF16(URLToImageMarkup(url, title)), + std::string()); #endif } } diff --git a/content/shell/app/shell_breakpad_client.cc b/content/shell/app/shell_breakpad_client.cc index 0e7cb95..423b890 100644 --- a/content/shell/app/shell_breakpad_client.cc +++ b/content/shell/app/shell_breakpad_client.cc @@ -27,8 +27,8 @@ void ShellBreakpadClient::GetProductNameAndVersion( base::string16* version, base::string16* special_build, base::string16* channel_name) { - *product_name = ASCIIToUTF16("content_shell"); - *version = ASCIIToUTF16(CONTENT_SHELL_VERSION); + *product_name = base::ASCIIToUTF16("content_shell"); + *version = base::ASCIIToUTF16(CONTENT_SHELL_VERSION); *special_build = base::string16(); *channel_name = base::string16(); } diff --git a/content/shell/app/webkit_test_platform_support_win.cc b/content/shell/app/webkit_test_platform_support_win.cc index 59156fe..938bd19 100644 --- a/content/shell/app/webkit_test_platform_support_win.cc +++ b/content/shell/app/webkit_test_platform_support_win.cc @@ -36,7 +36,7 @@ bool SetupFonts() { std::string font_buffer; if (!base::ReadFileToString(font_path, &font_buffer)) { - std::cerr << "Failed to load font " << WideToUTF8(font_path.value()) + std::cerr << "Failed to load font " << base::WideToUTF8(font_path.value()) << "\n"; return false; } diff --git a/content/shell/browser/shell_browser_main.cc b/content/shell/browser/shell_browser_main.cc index ad2cbda..ca2cd82 100644 --- a/content/shell/browser/shell_browser_main.cc +++ b/content/shell/browser/shell_browser_main.cc @@ -99,7 +99,7 @@ bool GetNextTest(const CommandLine::StringVector& args, if (args[*position] == FILE_PATH_LITERAL("-")) return !!std::getline(std::cin, *test, '\n'); #if defined(OS_WIN) - *test = WideToUTF8(args[(*position)++]); + *test = base::WideToUTF8(args[(*position)++]); #else *test = args[(*position)++]; #endif diff --git a/content/shell/browser/shell_devtools_delegate.cc b/content/shell/browser/shell_devtools_delegate.cc index c7aecb2..b583097 100644 --- a/content/shell/browser/shell_devtools_delegate.cc +++ b/content/shell/browser/shell_devtools_delegate.cc @@ -107,7 +107,7 @@ Target::Target(WebContents* web_contents) { agent_host_ = DevToolsAgentHost::GetOrCreateFor(web_contents->GetRenderViewHost()); id_ = agent_host_->GetId(); - title_ = UTF16ToUTF8(web_contents->GetTitle()); + title_ = base::UTF16ToUTF8(web_contents->GetTitle()); url_ = web_contents->GetURL(); content::NavigationController& controller = web_contents->GetController(); content::NavigationEntry* entry = controller.GetActiveEntry(); diff --git a/content/shell/browser/shell_devtools_frontend.cc b/content/shell/browser/shell_devtools_frontend.cc index bfa93d4..bc0467c 100644 --- a/content/shell/browser/shell_devtools_frontend.cc +++ b/content/shell/browser/shell_devtools_frontend.cc @@ -103,7 +103,7 @@ void ShellDevToolsFrontend::RenderViewCreated( void ShellDevToolsFrontend::DocumentOnLoadCompletedInMainFrame(int32 page_id) { web_contents()->GetRenderViewHost()->ExecuteJavascriptInWebFrame( base::string16(), - ASCIIToUTF16("InspectorFrontendAPI.setUseSoftMenu(true);")); + base::ASCIIToUTF16("InspectorFrontendAPI.setUseSoftMenu(true);")); } void ShellDevToolsFrontend::WebContentsDestroyed(WebContents* web_contents) { diff --git a/content/shell/browser/shell_gtk.cc b/content/shell/browser/shell_gtk.cc index 3d2580a..e4242cf 100644 --- a/content/shell/browser/shell_gtk.cc +++ b/content/shell/browser/shell_gtk.cc @@ -339,7 +339,7 @@ void Shell::PlatformSetTitle(const base::string16& title) { if (headless_) return; - std::string title_utf8 = UTF16ToUTF8(title); + std::string title_utf8 = base::UTF16ToUTF8(title); gtk_window_set_title(GTK_WINDOW(window_), title_utf8.c_str()); } diff --git a/content/shell/browser/shell_javascript_dialog_gtk.cc b/content/shell/browser/shell_javascript_dialog_gtk.cc index 65bf739..14326ca 100644 --- a/content/shell/browser/shell_javascript_dialog_gtk.cc +++ b/content/shell/browser/shell_javascript_dialog_gtk.cc @@ -23,7 +23,7 @@ base::string16 GetPromptText(GtkDialog* dialog) { GtkWidget* widget = static_cast<GtkWidget*>( g_object_get_data(G_OBJECT(dialog), kPromptTextId)); if (widget) - return UTF8ToUTF16(gtk_entry_get_text(GTK_ENTRY(widget))); + return base::UTF8ToUTF16(gtk_entry_get_text(GTK_ENTRY(widget))); return base::string16(); } @@ -70,7 +70,7 @@ ShellJavaScriptDialog::ShellJavaScriptDialog( gtk_message_type, buttons, "%s", - UTF16ToUTF8(message_text).c_str()); + base::UTF16ToUTF8(message_text).c_str()); g_signal_connect(gtk_dialog_, "delete-event", G_CALLBACK(gtk_widget_hide_on_delete), @@ -89,7 +89,7 @@ ShellJavaScriptDialog::ShellJavaScriptDialog( gtk_dialog_get_content_area(GTK_DIALOG(gtk_dialog_)); GtkWidget* text_box = gtk_entry_new(); gtk_entry_set_text(GTK_ENTRY(text_box), - UTF16ToUTF8(default_prompt_text).c_str()); + base::UTF16ToUTF8(default_prompt_text).c_str()); gtk_box_pack_start(GTK_BOX(content_area), text_box, TRUE, TRUE, 0); g_object_set_data(G_OBJECT(gtk_dialog_), kPromptTextId, text_box); gtk_entry_set_activates_default(GTK_ENTRY(text_box), TRUE); diff --git a/content/shell/browser/shell_javascript_dialog_manager.cc b/content/shell/browser/shell_javascript_dialog_manager.cc index 6ac7243b..7f3b678 100644 --- a/content/shell/browser/shell_javascript_dialog_manager.cc +++ b/content/shell/browser/shell_javascript_dialog_manager.cc @@ -53,7 +53,7 @@ void ShellJavaScriptDialogManager::RunJavaScriptDialog( } base::string16 new_message_text = net::FormatUrl(origin_url, accept_lang) + - ASCIIToUTF16("\n\n") + + base::ASCIIToUTF16("\n\n") + message_text; gfx::NativeWindow parent_window = web_contents->GetView()->GetTopLevelNativeWindow(); @@ -97,7 +97,7 @@ void ShellJavaScriptDialogManager::RunBeforeUnloadDialog( base::string16 new_message_text = message_text + - ASCIIToUTF16("\n\nIs it OK to leave/reload this page?"); + base::ASCIIToUTF16("\n\nIs it OK to leave/reload this page?"); gfx::NativeWindow parent_window = web_contents->GetView()->GetTopLevelNativeWindow(); diff --git a/content/shell/browser/shell_login_dialog.cc b/content/shell/browser/shell_login_dialog.cc index b01fe98..b531b65 100644 --- a/content/shell/browser/shell_login_dialog.cc +++ b/content/shell/browser/shell_login_dialog.cc @@ -23,8 +23,8 @@ ShellLoginDialog::ShellLoginDialog( BrowserThread::PostTask( BrowserThread::UI, FROM_HERE, base::Bind(&ShellLoginDialog::PrepDialog, this, - ASCIIToUTF16(auth_info->challenger.ToString()), - UTF8ToUTF16(auth_info->realm))); + base::ASCIIToUTF16(auth_info->challenger.ToString()), + base::UTF8ToUTF16(auth_info->realm))); } void ShellLoginDialog::OnRequestCancelled() { @@ -77,13 +77,13 @@ void ShellLoginDialog::PrepDialog(const base::string16& host, gfx::ElideString(realm, 120, &elided_realm); base::string16 explanation = - ASCIIToUTF16("The server ") + host + - ASCIIToUTF16(" requires a username and password."); + base::ASCIIToUTF16("The server ") + host + + base::ASCIIToUTF16(" requires a username and password."); if (!elided_realm.empty()) { - explanation += ASCIIToUTF16(" The server says: "); + explanation += base::ASCIIToUTF16(" The server says: "); explanation += elided_realm; - explanation += ASCIIToUTF16("."); + explanation += base::ASCIIToUTF16("."); } PlatformCreateDialog(explanation); diff --git a/content/shell/browser/shell_login_dialog_gtk.cc b/content/shell/browser/shell_login_dialog_gtk.cc index 3241e37..bf24361 100644 --- a/content/shell/browser/shell_login_dialog_gtk.cc +++ b/content/shell/browser/shell_login_dialog_gtk.cc @@ -46,7 +46,7 @@ void ShellLoginDialog::PlatformCreateDialog(const base::string16& message) { "Please log in."); GtkWidget* content_area = gtk_dialog_get_content_area(GTK_DIALOG(root_)); - GtkWidget* label = gtk_label_new(UTF16ToUTF8(message).c_str()); + GtkWidget* label = gtk_label_new(base::UTF16ToUTF8(message).c_str()); gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); gtk_box_pack_start(GTK_BOX(content_area), label, FALSE, FALSE, 0); @@ -94,8 +94,8 @@ void ShellLoginDialog::OnResponse(GtkWidget* sender, int response_id) { switch (response_id) { case GTK_RESPONSE_OK: UserAcceptedAuth( - UTF8ToUTF16(gtk_entry_get_text(GTK_ENTRY(username_entry_))), - UTF8ToUTF16(gtk_entry_get_text(GTK_ENTRY(password_entry_)))); + base::UTF8ToUTF16(gtk_entry_get_text(GTK_ENTRY(username_entry_))), + base::UTF8ToUTF16(gtk_entry_get_text(GTK_ENTRY(password_entry_)))); break; case GTK_RESPONSE_CANCEL: case GTK_RESPONSE_DELETE_EVENT: diff --git a/content/shell/browser/shell_plugin_service_filter.cc b/content/shell/browser/shell_plugin_service_filter.cc index 7cabea4..f9cd7b9 100644 --- a/content/shell/browser/shell_plugin_service_filter.cc +++ b/content/shell/browser/shell_plugin_service_filter.cc @@ -20,7 +20,7 @@ bool ShellPluginServiceFilter::IsPluginAvailable( const GURL& url, const GURL& policy_url, WebPluginInfo* plugin) { - return plugin->name == ASCIIToUTF16("WebKit Test PlugIn"); + return plugin->name == base::ASCIIToUTF16("WebKit Test PlugIn"); } bool ShellPluginServiceFilter::CanLoadPlugin(int render_process_id, diff --git a/content/shell/browser/shell_views.cc b/content/shell/browser/shell_views.cc index c87f198..741c6ba 100644 --- a/content/shell/browser/shell_views.cc +++ b/content/shell/browser/shell_views.cc @@ -82,7 +82,7 @@ class ShellWindowDelegateView : public views::WidgetDelegateView, // Update the state of UI controls void SetAddressBarURL(const GURL& url) { - url_entry_->SetText(ASCIIToUTF16(url.spec())); + url_entry_->SetText(base::ASCIIToUTF16(url.spec())); } void SetWebContents(WebContents* web_contents, const gfx::Size& size) { contents_view_->SetLayoutManager(new views::FillLayout()); @@ -145,7 +145,7 @@ class ShellWindowDelegateView : public views::WidgetDelegateView, views::ColumnSet* toolbar_column_set = toolbar_layout->AddColumnSet(0); // Back button - back_button_ = new views::LabelButton(this, ASCIIToUTF16("Back")); + back_button_ = new views::LabelButton(this, base::ASCIIToUTF16("Back")); back_button_->SetStyle(views::Button::STYLE_NATIVE_TEXTBUTTON); gfx::Size back_button_size = back_button_->GetPreferredSize(); toolbar_column_set->AddColumn(views::GridLayout::CENTER, @@ -154,7 +154,8 @@ class ShellWindowDelegateView : public views::WidgetDelegateView, back_button_size.width(), back_button_size.width() / 2); // Forward button - forward_button_ = new views::LabelButton(this, ASCIIToUTF16("Forward")); + forward_button_ = + new views::LabelButton(this, base::ASCIIToUTF16("Forward")); forward_button_->SetStyle(views::Button::STYLE_NATIVE_TEXTBUTTON); gfx::Size forward_button_size = forward_button_->GetPreferredSize(); toolbar_column_set->AddColumn(views::GridLayout::CENTER, @@ -163,7 +164,8 @@ class ShellWindowDelegateView : public views::WidgetDelegateView, forward_button_size.width(), forward_button_size.width() / 2); // Refresh button - refresh_button_ = new views::LabelButton(this, ASCIIToUTF16("Refresh")); + refresh_button_ = + new views::LabelButton(this, base::ASCIIToUTF16("Refresh")); refresh_button_->SetStyle(views::Button::STYLE_NATIVE_TEXTBUTTON); gfx::Size refresh_button_size = refresh_button_->GetPreferredSize(); toolbar_column_set->AddColumn(views::GridLayout::CENTER, @@ -172,7 +174,7 @@ class ShellWindowDelegateView : public views::WidgetDelegateView, refresh_button_size.width(), refresh_button_size.width() / 2); // Stop button - stop_button_ = new views::LabelButton(this, ASCIIToUTF16("Stop")); + stop_button_ = new views::LabelButton(this, base::ASCIIToUTF16("Stop")); stop_button_->SetStyle(views::Button::STYLE_NATIVE_TEXTBUTTON); gfx::Size stop_button_size = stop_button_->GetPreferredSize(); toolbar_column_set->AddColumn(views::GridLayout::CENTER, @@ -216,11 +218,11 @@ class ShellWindowDelegateView : public views::WidgetDelegateView, virtual bool HandleKeyEvent(views::Textfield* sender, const ui::KeyEvent& key_event) OVERRIDE { if (sender == url_entry_ && key_event.key_code() == ui::VKEY_RETURN) { - std::string text = UTF16ToUTF8(url_entry_->text()); + std::string text = base::UTF16ToUTF8(url_entry_->text()); GURL url(text); if (!url.has_scheme()) { url = GURL(std::string("http://") + std::string(text)); - url_entry_->SetText(ASCIIToUTF16(url.spec())); + url_entry_->SetText(base::ASCIIToUTF16(url.spec())); } shell_->LoadURL(url); return true; diff --git a/content/shell/browser/shell_win.cc b/content/shell/browser/shell_win.cc index b9e57a9..3e253ff 100644 --- a/content/shell/browser/shell_win.cc +++ b/content/shell/browser/shell_win.cc @@ -76,7 +76,7 @@ void Shell::PlatformEnableUIControl(UIControl control, bool is_enabled) { } void Shell::PlatformSetAddressBarURL(const GURL& url) { - std::wstring url_string = UTF8ToWide(url.spec()); + std::wstring url_string = base::UTF8ToWide(url.spec()); SendMessage(url_edit_view_, WM_SETTEXT, 0, reinterpret_cast<LPARAM>(url_string.c_str())); } diff --git a/content/shell/common/shell_content_client.cc b/content/shell/common/shell_content_client.cc index 8cb0f88..55f62dd 100644 --- a/content/shell/common/shell_content_client.cc +++ b/content/shell/common/shell_content_client.cc @@ -33,21 +33,21 @@ base::string16 ShellContentClient::GetLocalizedString(int message_id) const { if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) { switch (message_id) { case IDS_FORM_OTHER_DATE_LABEL: - return ASCIIToUTF16("<<OtherDateLabel>>"); + return base::ASCIIToUTF16("<<OtherDateLabel>>"); case IDS_FORM_OTHER_MONTH_LABEL: - return ASCIIToUTF16("<<OtherMonthLabel>>"); + return base::ASCIIToUTF16("<<OtherMonthLabel>>"); case IDS_FORM_OTHER_TIME_LABEL: - return ASCIIToUTF16("<<OtherTimeLabel>>"); + return base::ASCIIToUTF16("<<OtherTimeLabel>>"); case IDS_FORM_OTHER_WEEK_LABEL: - return ASCIIToUTF16("<<OtherWeekLabel>>"); + return base::ASCIIToUTF16("<<OtherWeekLabel>>"); case IDS_FORM_CALENDAR_CLEAR: - return ASCIIToUTF16("<<CalendarClear>>"); + return base::ASCIIToUTF16("<<CalendarClear>>"); case IDS_FORM_CALENDAR_TODAY: - return ASCIIToUTF16("<<CalendarToday>>"); + return base::ASCIIToUTF16("<<CalendarToday>>"); case IDS_FORM_THIS_MONTH_LABEL: - return ASCIIToUTF16("<<ThisMonthLabel>>"); + return base::ASCIIToUTF16("<<ThisMonthLabel>>"); case IDS_FORM_THIS_WEEK_LABEL: - return ASCIIToUTF16("<<ThisWeekLabel>>"); + return base::ASCIIToUTF16("<<ThisWeekLabel>>"); } } return l10n_util::GetStringUTF16(message_id); diff --git a/content/shell/common/webkit_test_helpers.cc b/content/shell/common/webkit_test_helpers.cc index 131b453..f7c2ca3 100644 --- a/content/shell/common/webkit_test_helpers.cc +++ b/content/shell/common/webkit_test_helpers.cc @@ -74,25 +74,25 @@ void ApplyLayoutTestDefaultPreferences(WebPreferences* prefs) { base::string16 serif; #if defined(OS_MACOSX) prefs->cursive_font_family_map[webkit_glue::kCommonScript] = - ASCIIToUTF16("Apple Chancery"); + base::ASCIIToUTF16("Apple Chancery"); prefs->fantasy_font_family_map[webkit_glue::kCommonScript] = - ASCIIToUTF16("Papyrus"); - serif = ASCIIToUTF16("Times"); + base::ASCIIToUTF16("Papyrus"); + serif = base::ASCIIToUTF16("Times"); #else prefs->cursive_font_family_map[webkit_glue::kCommonScript] = - ASCIIToUTF16("Comic Sans MS"); + base::ASCIIToUTF16("Comic Sans MS"); prefs->fantasy_font_family_map[webkit_glue::kCommonScript] = - ASCIIToUTF16("Impact"); - serif = ASCIIToUTF16("times new roman"); + base::ASCIIToUTF16("Impact"); + serif = base::ASCIIToUTF16("times new roman"); #endif prefs->serif_font_family_map[webkit_glue::kCommonScript] = serif; prefs->standard_font_family_map[webkit_glue::kCommonScript] = serif; prefs->fixed_font_family_map[webkit_glue::kCommonScript] = - ASCIIToUTF16("Courier"); + base::ASCIIToUTF16("Courier"); prefs->sans_serif_font_family_map[ - webkit_glue::kCommonScript] = ASCIIToUTF16("Helvetica"); + webkit_glue::kCommonScript] = base::ASCIIToUTF16("Helvetica"); prefs->minimum_logical_font_size = 9; prefs->asynchronous_spell_checking_enabled = false; prefs->threaded_html_parser = true; diff --git a/content/shell/geolocation/shell_access_token_store.cc b/content/shell/geolocation/shell_access_token_store.cc index 4b8b007..cec481d 100644 --- a/content/shell/geolocation/shell_access_token_store.cc +++ b/content/shell/geolocation/shell_access_token_store.cc @@ -44,7 +44,7 @@ void ShellAccessTokenStore::RespondOnOriginatingThread( // Since content_shell is a test executable, rather than an end user program, // we provide a dummy access_token set to avoid hitting the server. AccessTokenSet access_token_set; - access_token_set[GURL()] = ASCIIToUTF16("chromium_content_shell"); + access_token_set[GURL()] = base::ASCIIToUTF16("chromium_content_shell"); callback.Run(access_token_set, system_request_context_); } diff --git a/content/shell/renderer/webkit_test_runner.cc b/content/shell/renderer/webkit_test_runner.cc index 666cd53..5d939e1 100644 --- a/content/shell/renderer/webkit_test_runner.cc +++ b/content/shell/renderer/webkit_test_runner.cc @@ -309,10 +309,10 @@ WebURL WebKitTestRunner::rewriteLayoutTestsURL(const std::string& utf8_url) { ShellRenderProcessObserver::GetInstance()->webkit_source_dir().Append( FILE_PATH_LITERAL("LayoutTests/")); #if defined(OS_WIN) - std::string utf8_path = WideToUTF8(replace_path.value()); + std::string utf8_path = base::WideToUTF8(replace_path.value()); #else std::string utf8_path = - WideToUTF8(base::SysNativeMBToWide(replace_path.value())); + base::WideToUTF8(base::SysNativeMBToWide(replace_path.value())); #endif std::string new_url = std::string("file://") + utf8_path + utf8_url.substr(kPrefixLen); diff --git a/content/test/content_browser_test_test.cc b/content/test/content_browser_test_test.cc index b9bf217..21b4543 100644 --- a/content/test/content_browser_test_test.cc +++ b/content/test/content_browser_test_test.cc @@ -31,7 +31,7 @@ class ContentBrowserTestSanityTest : public ContentBrowserTest { void Test() { GURL url = GetTestUrl(".", "simple_page.html"); - base::string16 expected_title(ASCIIToUTF16("OK")); + base::string16 expected_title(base::ASCIIToUTF16("OK")); TitleWatcher title_watcher(shell()->web_contents(), expected_title); NavigateToURL(shell(), url); base::string16 title = title_watcher.WaitAndGetTitle(); diff --git a/content/test/mock_google_streaming_server.cc b/content/test/mock_google_streaming_server.cc index e1b7fdf..4eae25c 100644 --- a/content/test/mock_google_streaming_server.cc +++ b/content/test/mock_google_streaming_server.cc @@ -93,7 +93,7 @@ void MockGoogleStreamingServer::SimulateResult( proto_result->add_alternative(); const SpeechRecognitionHypothesis& hypothesis = result.hypotheses[i]; proto_alternative->set_confidence(hypothesis.confidence); - proto_alternative->set_transcript(UTF16ToUTF8(hypothesis.utterance)); + proto_alternative->set_transcript(base::UTF16ToUTF8(hypothesis.utterance)); } std::string msg_string; diff --git a/content/test/plugin/plugin_geturl_test.cc b/content/test/plugin/plugin_geturl_test.cc index c9b344d..20838e5 100644 --- a/content/test/plugin/plugin_geturl_test.cc +++ b/content/test/plugin/plugin_geturl_test.cc @@ -206,7 +206,7 @@ NPError PluginGetURLTest::NewStream(NPMIMEType type, NPStream* stream, #if defined(OS_WIN) filename = filename.substr(8); // remove "file:///" // Assume an ASCII path on Windows. - base::FilePath path = base::FilePath(ASCIIToWide(filename)); + base::FilePath path = base::FilePath(base::ASCIIToWide(filename)); #else filename = filename.substr(7); // remove "file://" base::FilePath path = base::FilePath(filename); diff --git a/content/test/test_webkit_platform_support.cc b/content/test/test_webkit_platform_support.cc index ea6ea71..a254830 100644 --- a/content/test/test_webkit_platform_support.cc +++ b/content/test/test_webkit_platform_support.cc @@ -162,23 +162,23 @@ blink::WebString TestWebKitPlatformSupport::queryLocalizedString( // Returns placeholder strings to check if they are correctly localized. switch (name) { case blink::WebLocalizedString::OtherDateLabel: - return ASCIIToUTF16("<<OtherDateLabel>>"); + return base::ASCIIToUTF16("<<OtherDateLabel>>"); case blink::WebLocalizedString::OtherMonthLabel: - return ASCIIToUTF16("<<OtherMonthLabel>>"); + return base::ASCIIToUTF16("<<OtherMonthLabel>>"); case blink::WebLocalizedString::OtherTimeLabel: - return ASCIIToUTF16("<<OtherTimeLabel>>"); + return base::ASCIIToUTF16("<<OtherTimeLabel>>"); case blink::WebLocalizedString::OtherWeekLabel: - return ASCIIToUTF16("<<OtherWeekLabel>>"); + return base::ASCIIToUTF16("<<OtherWeekLabel>>"); case blink::WebLocalizedString::CalendarClear: - return ASCIIToUTF16("<<CalendarClear>>"); + return base::ASCIIToUTF16("<<CalendarClear>>"); case blink::WebLocalizedString::CalendarToday: - return ASCIIToUTF16("<<CalendarToday>>"); + return base::ASCIIToUTF16("<<CalendarToday>>"); case blink::WebLocalizedString::ThisMonthButtonLabel: - return ASCIIToUTF16("<<ThisMonthLabel>>"); + return base::ASCIIToUTF16("<<ThisMonthLabel>>"); case blink::WebLocalizedString::ThisWeekButtonLabel: - return ASCIIToUTF16("<<ThisWeekLabel>>"); + return base::ASCIIToUTF16("<<ThisWeekLabel>>"); case blink::WebLocalizedString::WeekFormatTemplate: - return ASCIIToUTF16("Week $2, $1"); + return base::ASCIIToUTF16("Week $2, $1"); default: return WebKitPlatformSupportImpl::queryLocalizedString(name); } @@ -188,9 +188,9 @@ blink::WebString TestWebKitPlatformSupport::queryLocalizedString( blink::WebLocalizedString::Name name, const blink::WebString& value) { if (name == blink::WebLocalizedString::ValidationRangeUnderflow) - return ASCIIToUTF16("range underflow"); + return base::ASCIIToUTF16("range underflow"); if (name == blink::WebLocalizedString::ValidationRangeOverflow) - return ASCIIToUTF16("range overflow"); + return base::ASCIIToUTF16("range overflow"); return WebKitPlatformSupportImpl::queryLocalizedString(name, value); } @@ -199,14 +199,14 @@ blink::WebString TestWebKitPlatformSupport::queryLocalizedString( const blink::WebString& value1, const blink::WebString& value2) { if (name == blink::WebLocalizedString::ValidationTooLong) - return ASCIIToUTF16("too long"); + return base::ASCIIToUTF16("too long"); if (name == blink::WebLocalizedString::ValidationStepMismatch) - return ASCIIToUTF16("step mismatch"); + return base::ASCIIToUTF16("step mismatch"); return WebKitPlatformSupportImpl::queryLocalizedString(name, value1, value2); } blink::WebString TestWebKitPlatformSupport::defaultLocale() { - return ASCIIToUTF16("en-US"); + return base::ASCIIToUTF16("en-US"); } #if defined(OS_WIN) || defined(OS_MACOSX) diff --git a/content/test/webrtc_audio_device_test.cc b/content/test/webrtc_audio_device_test.cc index f414a82..357f7fb 100644 --- a/content/test/webrtc_audio_device_test.cc +++ b/content/test/webrtc_audio_device_test.cc @@ -430,7 +430,7 @@ std::string MAYBE_WebRTCAudioDeviceTest::GetTestDataPath( path = path.Append(file_name); EXPECT_TRUE(base::PathExists(path)); #if defined(OS_WIN) - return WideToUTF8(path.value()); + return base::WideToUTF8(path.value()); #else return path.value(); #endif diff --git a/content/worker/worker_webkitplatformsupport_impl.cc b/content/worker/worker_webkitplatformsupport_impl.cc index 1d7b326..23fb80e 100644 --- a/content/worker/worker_webkitplatformsupport_impl.cc +++ b/content/worker/worker_webkitplatformsupport_impl.cc @@ -264,7 +264,7 @@ WebString WorkerWebKitPlatformSupportImpl::mimeTypeForExtension( std::string mime_type; thread_safe_sender_->Send(new MimeRegistryMsg_GetMimeTypeFromExtension( base::FilePath::FromUTF16Unsafe(file_extension).value(), &mime_type)); - return ASCIIToUTF16(mime_type); + return base::ASCIIToUTF16(mime_type); } WebString WorkerWebKitPlatformSupportImpl::wellKnownMimeTypeForExtension( @@ -272,7 +272,7 @@ WebString WorkerWebKitPlatformSupportImpl::wellKnownMimeTypeForExtension( std::string mime_type; net::GetWellKnownMimeTypeFromExtension( base::FilePath::FromUTF16Unsafe(file_extension).value(), &mime_type); - return ASCIIToUTF16(mime_type); + return base::ASCIIToUTF16(mime_type); } WebString WorkerWebKitPlatformSupportImpl::mimeTypeFromFile( @@ -282,7 +282,7 @@ WebString WorkerWebKitPlatformSupportImpl::mimeTypeFromFile( new MimeRegistryMsg_GetMimeTypeFromFile( base::FilePath::FromUTF16Unsafe(file_path), &mime_type)); - return ASCIIToUTF16(mime_type); + return base::ASCIIToUTF16(mime_type); } WebBlobRegistry* WorkerWebKitPlatformSupportImpl::blobRegistry() { |