diff options
Diffstat (limited to 'content/browser')
187 files changed, 936 insertions, 885 deletions
diff --git a/content/browser/accessibility/accessibility_tree_formatter.cc b/content/browser/accessibility/accessibility_tree_formatter.cc index 3e03b80..af33a42 100644 --- a/content/browser/accessibility/accessibility_tree_formatter.cc +++ b/content/browser/accessibility/accessibility_tree_formatter.cc @@ -55,7 +55,7 @@ AccessibilityTreeFormatter::BuildAccessibilityTree() { } void AccessibilityTreeFormatter::FormatAccessibilityTree( - string16* contents) { + base::string16* contents) { scoped_ptr<base::DictionaryValue> dict = BuildAccessibilityTree(); RecursiveFormatAccessibilityTree(*(dict.get()), contents); } @@ -76,9 +76,10 @@ void AccessibilityTreeFormatter::RecursiveBuildAccessibilityTree( } void AccessibilityTreeFormatter::RecursiveFormatAccessibilityTree( - const base::DictionaryValue& dict, string16* contents, int depth) { - string16 line = ToString(dict, string16(depth * kIndentSpaces, ' ')); - if (line.find(ASCIIToUTF16(kSkipString)) != string16::npos) + 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) return; *contents += line; @@ -98,8 +99,9 @@ void AccessibilityTreeFormatter::AddProperties(const BrowserAccessibility& node, dict->SetInteger("id", node.renderer_id()); } -string16 AccessibilityTreeFormatter::ToString(const base::DictionaryValue& node, - const string16& indent) { +base::string16 AccessibilityTreeFormatter::ToString( + const base::DictionaryValue& node, + const base::string16& indent) { int id_value; node.GetInteger("id", &id_value); return indent + base::IntToString16(id_value) + @@ -142,7 +144,7 @@ void AccessibilityTreeFormatter::SetFilters( } bool AccessibilityTreeFormatter::MatchesFilters( - const string16& text, bool default_result) const { + const base::string16& text, bool default_result) const { std::vector<Filter>::const_iterator iter = filters_.begin(); bool allow = default_result; for (iter = filters_.begin(); iter != filters_.end(); ++iter) { @@ -158,7 +160,7 @@ bool AccessibilityTreeFormatter::MatchesFilters( return allow; } -string16 AccessibilityTreeFormatter::FormatCoordinates( +base::string16 AccessibilityTreeFormatter::FormatCoordinates( const char* name, const char* x_name, const char* y_name, const base::DictionaryValue& value) { int x, y; @@ -170,12 +172,12 @@ string16 AccessibilityTreeFormatter::FormatCoordinates( } void AccessibilityTreeFormatter::WriteAttribute( - bool include_by_default, const std::string& attr, string16* line) { + bool include_by_default, const std::string& attr, base::string16* line) { WriteAttribute(include_by_default, UTF8ToUTF16(attr), line); } void AccessibilityTreeFormatter::WriteAttribute( - bool include_by_default, const string16& attr, string16* line) { + bool include_by_default, const base::string16& attr, base::string16* line) { if (attr.empty()) return; if (!MatchesFilters(attr, include_by_default)) diff --git a/content/browser/accessibility/accessibility_tree_formatter.h b/content/browser/accessibility/accessibility_tree_formatter.h index 006ee9a..a290886 100644 --- a/content/browser/accessibility/accessibility_tree_formatter.h +++ b/content/browser/accessibility/accessibility_tree_formatter.h @@ -52,7 +52,7 @@ class CONTENT_EXPORT AccessibilityTreeFormatter { scoped_ptr<base::DictionaryValue> BuildAccessibilityTree(); // Dumps a BrowserAccessibility tree into a string. - void FormatAccessibilityTree(string16* contents); + void FormatAccessibilityTree(base::string16* contents); // A single filter specification. See GetAllowString() and GetDenyString() // for more information. @@ -62,10 +62,10 @@ class CONTENT_EXPORT AccessibilityTreeFormatter { ALLOW_EMPTY, DENY }; - string16 match_str; + base::string16 match_str; Type type; - Filter(string16 match_str, Type type) + Filter(base::string16 match_str, Type type) : match_str(match_str), type(type) {} }; @@ -100,12 +100,12 @@ class CONTENT_EXPORT AccessibilityTreeFormatter { protected: void RecursiveFormatAccessibilityTree(const BrowserAccessibility& node, - string16* contents, + base::string16* contents, int indent); void RecursiveBuildAccessibilityTree(const BrowserAccessibility& node, base::DictionaryValue* tree_node); void RecursiveFormatAccessibilityTree(const base::DictionaryValue& tree_node, - string16* contents, + base::string16* contents, int depth = 0); // Overridden by each platform to add the required attributes for each node @@ -113,27 +113,28 @@ class CONTENT_EXPORT AccessibilityTreeFormatter { void AddProperties(const BrowserAccessibility& node, base::DictionaryValue* dict); - string16 FormatCoordinates(const char* name, - const char* x_name, - const char* y_name, - const base::DictionaryValue& value); + base::string16 FormatCoordinates(const char* name, + const char* x_name, + const char* y_name, + const base::DictionaryValue& value); // Returns a platform specific representation of a BrowserAccessibility. // Should be zero or more complete lines, each with |prefix| prepended // (to indent each line). - string16 ToString(const base::DictionaryValue& node, const string16& indent); + base::string16 ToString(const base::DictionaryValue& node, + const base::string16& indent); void Initialize(); - bool MatchesFilters(const string16& text, bool default_result) const; + bool MatchesFilters(const base::string16& text, bool default_result) const; // Writes the given attribute string out to |line| if it matches the filters. void WriteAttribute(bool include_by_default, - const string16& attr, - string16* line); + const base::string16& attr, + base::string16* line); void WriteAttribute(bool include_by_default, const std::string& attr, - string16* line); + base::string16* line); BrowserAccessibility* root_; diff --git a/content/browser/accessibility/accessibility_tree_formatter_android.cc b/content/browser/accessibility/accessibility_tree_formatter_android.cc index ae34ef5..da5da24 100644 --- a/content/browser/accessibility/accessibility_tree_formatter_android.cc +++ b/content/browser/accessibility/accessibility_tree_formatter_android.cc @@ -77,11 +77,12 @@ void AccessibilityTreeFormatter::AddProperties( dict->SetInteger("item_count", android_node->GetItemCount()); } -string16 AccessibilityTreeFormatter::ToString(const DictionaryValue& dict, - const string16& indent) { - string16 line; +base::string16 AccessibilityTreeFormatter::ToString( + const DictionaryValue& dict, + const base::string16& indent) { + base::string16 line; - string16 class_value; + base::string16 class_value; dict.GetString("class", &class_value); WriteAttribute(true, UTF16ToUTF8(class_value), &line); diff --git a/content/browser/accessibility/accessibility_tree_formatter_gtk.cc b/content/browser/accessibility/accessibility_tree_formatter_gtk.cc index 8dd6b93..0dc21ce 100644 --- a/content/browser/accessibility/accessibility_tree_formatter_gtk.cc +++ b/content/browser/accessibility/accessibility_tree_formatter_gtk.cc @@ -37,9 +37,10 @@ void AccessibilityTreeFormatter::AddProperties(const BrowserAccessibility& node, dict->SetInteger("id", node.renderer_id()); } -string16 AccessibilityTreeFormatter::ToString(const base::DictionaryValue& node, - const string16& indent) { - string16 line; +base::string16 AccessibilityTreeFormatter::ToString( + const base::DictionaryValue& node, + const base::string16& indent) { + base::string16 line; std::string role_value; node.GetString("role", &role_value); if (!role_value.empty()) diff --git a/content/browser/accessibility/accessibility_tree_formatter_mac.mm b/content/browser/accessibility/accessibility_tree_formatter_mac.mm index 58881b4..021b5fd 100644 --- a/content/browser/accessibility/accessibility_tree_formatter_mac.mm +++ b/content/browser/accessibility/accessibility_tree_formatter_mac.mm @@ -161,9 +161,10 @@ void AccessibilityTreeFormatter::AddProperties(const BrowserAccessibility& node, dict->Set(kSizeDictAttr, PopulateSize(cocoa_node).release()); } -string16 AccessibilityTreeFormatter::ToString(const base::DictionaryValue& dict, - const string16& indent) { - string16 line; +base::string16 AccessibilityTreeFormatter::ToString( + const base::DictionaryValue& dict, + const base::string16& indent) { + base::string16 line; NSArray* defaultAttributes = [NSArray arrayWithObjects:NSAccessibilityTitleAttribute, NSAccessibilityValueAttribute, diff --git a/content/browser/accessibility/accessibility_tree_formatter_utils_win.cc b/content/browser/accessibility/accessibility_tree_formatter_utils_win.cc index 053e39b..e2cebc1 100644 --- a/content/browser/accessibility/accessibility_tree_formatter_utils_win.cc +++ b/content/browser/accessibility/accessibility_tree_formatter_utils_win.cc @@ -20,10 +20,10 @@ class AccessibilityRoleStateMap { public: static AccessibilityRoleStateMap* GetInstance(); - std::map<int32, string16> ia_role_string_map; - std::map<int32, string16> ia2_role_string_map; - std::map<int32, string16> ia_state_string_map; - std::map<int32, string16> ia2_state_string_map; + std::map<int32, base::string16> ia_role_string_map; + std::map<int32, base::string16> ia2_role_string_map; + std::map<int32, base::string16> ia_state_string_map; + std::map<int32, base::string16> ia2_state_string_map; private: AccessibilityRoleStateMap(); @@ -220,44 +220,44 @@ AccessibilityRoleStateMap::AccessibilityRoleStateMap() { } // namespace. -string16 IAccessibleRoleToString(int32 ia_role) { +base::string16 IAccessibleRoleToString(int32 ia_role) { return AccessibilityRoleStateMap::GetInstance()->ia_role_string_map[ia_role]; } -string16 IAccessible2RoleToString(int32 ia_role) { +base::string16 IAccessible2RoleToString(int32 ia_role) { return AccessibilityRoleStateMap::GetInstance()->ia2_role_string_map[ia_role]; } void IAccessibleStateToStringVector(int32 ia_state, - std::vector<string16>* result) { - const std::map<int32, string16>& state_string_map = + std::vector<base::string16>* result) { + const std::map<int32, base::string16>& state_string_map = AccessibilityRoleStateMap::GetInstance()->ia_state_string_map; - std::map<int32, string16>::const_iterator it; + std::map<int32, base::string16>::const_iterator it; for (it = state_string_map.begin(); it != state_string_map.end(); ++it) { if (it->first & ia_state) result->push_back(it->second); } } -string16 IAccessibleStateToString(int32 ia_state) { - std::vector<string16> strings; +base::string16 IAccessibleStateToString(int32 ia_state) { + std::vector<base::string16> strings; IAccessibleStateToStringVector(ia_state, &strings); return JoinString(strings, ','); } void IAccessible2StateToStringVector(int32 ia2_state, - std::vector<string16>* result) { - const std::map<int32, string16>& state_string_map = + std::vector<base::string16>* result) { + const std::map<int32, base::string16>& state_string_map = AccessibilityRoleStateMap::GetInstance()->ia2_state_string_map; - std::map<int32, string16>::const_iterator it; + std::map<int32, base::string16>::const_iterator it; for (it = state_string_map.begin(); it != state_string_map.end(); ++it) { if (it->first & ia2_state) result->push_back(it->second); } } -string16 IAccessible2StateToString(int32 ia2_state) { - std::vector<string16> strings; +base::string16 IAccessible2StateToString(int32 ia2_state) { + std::vector<base::string16> strings; IAccessible2StateToStringVector(ia2_state, &strings); return JoinString(strings, ','); } diff --git a/content/browser/accessibility/accessibility_tree_formatter_utils_win.h b/content/browser/accessibility/accessibility_tree_formatter_utils_win.h index 1baf20d..86b377a 100644 --- a/content/browser/accessibility/accessibility_tree_formatter_utils_win.h +++ b/content/browser/accessibility/accessibility_tree_formatter_utils_win.h @@ -13,14 +13,14 @@ namespace content { -CONTENT_EXPORT string16 IAccessibleRoleToString(int32 ia_role); -CONTENT_EXPORT string16 IAccessible2RoleToString(int32 ia_role); -CONTENT_EXPORT string16 IAccessibleStateToString(int32 ia_state); +CONTENT_EXPORT base::string16 IAccessibleRoleToString(int32 ia_role); +CONTENT_EXPORT base::string16 IAccessible2RoleToString(int32 ia_role); +CONTENT_EXPORT base::string16 IAccessibleStateToString(int32 ia_state); CONTENT_EXPORT void IAccessibleStateToStringVector( - int32 ia_state, std::vector<string16>* result); -CONTENT_EXPORT string16 IAccessible2StateToString(int32 ia2_state); + int32 ia_state, std::vector<base::string16>* result); +CONTENT_EXPORT base::string16 IAccessible2StateToString(int32 ia2_state); CONTENT_EXPORT void IAccessible2StateToStringVector( - int32 ia_state, std::vector<string16>* result); + int32 ia_state, std::vector<base::string16>* result); } // namespace content diff --git a/content/browser/accessibility/accessibility_tree_formatter_win.cc b/content/browser/accessibility/accessibility_tree_formatter_win.cc index 679843d..c50b526 100644 --- a/content/browser/accessibility/accessibility_tree_formatter_win.cc +++ b/content/browser/accessibility/accessibility_tree_formatter_win.cc @@ -76,7 +76,7 @@ void AccessibilityTreeFormatter::AddProperties( if (hresult == S_OK) dict->SetString("value", msaa_variant.m_str); - std::vector<string16> state_strings; + std::vector<base::string16> state_strings; int32 ia_state = acc_obj->ia_state(); // Avoid flakiness: these states depend on whether the window is focused @@ -87,16 +87,16 @@ void AccessibilityTreeFormatter::AddProperties( IAccessibleStateToStringVector(ia_state, &state_strings); IAccessible2StateToStringVector(acc_obj->ia2_state(), &state_strings); base::ListValue* states = new base::ListValue; - for (std::vector<string16>::const_iterator it = state_strings.begin(); + for (std::vector<base::string16>::const_iterator it = state_strings.begin(); it != state_strings.end(); ++it) { states->AppendString(UTF16ToUTF8(*it)); } dict->Set("states", states); - const std::vector<string16>& ia2_attributes = acc_obj->ia2_attributes(); + const std::vector<base::string16>& ia2_attributes = acc_obj->ia2_attributes(); base::ListValue* attributes = new base::ListValue; - for (std::vector<string16>::const_iterator it = ia2_attributes.begin(); + for (std::vector<base::string16>::const_iterator it = ia2_attributes.begin(); it != ia2_attributes.end(); ++it) { attributes->AppendString(UTF16ToUTF8(*it)); @@ -199,15 +199,16 @@ void AccessibilityTreeFormatter::AddProperties( } } -string16 AccessibilityTreeFormatter::ToString(const base::DictionaryValue& dict, - const string16& indent) { - string16 line; +base::string16 AccessibilityTreeFormatter::ToString( + const base::DictionaryValue& dict, + const base::string16& indent) { + base::string16 line; - string16 role_value; + base::string16 role_value; dict.GetString("role", &role_value); WriteAttribute(true, UTF16ToUTF8(role_value), &line); - string16 name_value; + base::string16 name_value; dict.GetString("name", &name_value); WriteAttribute(true, base::StringPrintf(L"name='%ls'", name_value.c_str()), &line); @@ -220,7 +221,7 @@ string16 AccessibilityTreeFormatter::ToString(const base::DictionaryValue& dict, switch (value->GetType()) { case base::Value::TYPE_STRING: { - string16 string_value; + base::string16 string_value; value->GetAsString(&string_value); WriteAttribute(false, StringPrintf(L"%ls='%ls'", @@ -257,7 +258,7 @@ string16 AccessibilityTreeFormatter::ToString(const base::DictionaryValue& dict, for (base::ListValue::const_iterator it = list_value->begin(); it != list_value->end(); ++it) { - string16 string_value; + base::string16 string_value; if ((*it)->GetAsString(&string_value)) WriteAttribute(false, string_value, &line); } diff --git a/content/browser/accessibility/accessibility_ui.cc b/content/browser/accessibility/accessibility_ui.cc index 7808cc1..5203af6 100644 --- a/content/browser/accessibility/accessibility_ui.cc +++ b/content/browser/accessibility/accessibility_ui.cc @@ -233,7 +233,7 @@ void AccessibilityUI::RequestAccessibilityTree(const base::ListValue* args) { } scoped_ptr<AccessibilityTreeFormatter> formatter( AccessibilityTreeFormatter::Create(rvh)); - string16 accessibility_contents_utf16; + base::string16 accessibility_contents_utf16; BrowserAccessibilityManager* manager = host_view->GetBrowserAccessibilityManager(); if (!manager) { diff --git a/content/browser/accessibility/accessibility_win_browsertest.cc b/content/browser/accessibility/accessibility_win_browsertest.cc index 8131513..bb35348 100644 --- a/content/browser/accessibility/accessibility_win_browsertest.cc +++ b/content/browser/accessibility/accessibility_win_browsertest.cc @@ -226,7 +226,7 @@ class AccessibleChecker { void CheckAccessibleValue(IAccessible* accessible); void CheckAccessibleState(IAccessible* accessible); void CheckAccessibleChildren(IAccessible* accessible); - string16 RoleVariantToString(const base::win::ScopedVariant& role); + base::string16 RoleVariantToString(const base::win::ScopedVariant& role); // Expected accessible name. Checked against IAccessible::get_accName. std::wstring name_; @@ -403,13 +403,13 @@ void AccessibleChecker::CheckAccessibleChildren(IAccessible* parent) { } } -string16 AccessibleChecker::RoleVariantToString( +base::string16 AccessibleChecker::RoleVariantToString( const base::win::ScopedVariant& role) { if (role.type() == VT_I4) return IAccessibleRoleToString(V_I4(&role)); if (role.type() == VT_BSTR) - return string16(V_BSTR(&role), SysStringLen(V_BSTR(&role))); - return string16(); + return base::string16(V_BSTR(&role), SysStringLen(V_BSTR(&role))); + return base::string16(); } } // namespace diff --git a/content/browser/accessibility/browser_accessibility.cc b/content/browser/accessibility/browser_accessibility.cc index 45f2201..223cd8d 100644 --- a/content/browser/accessibility/browser_accessibility.cc +++ b/content/browser/accessibility/browser_accessibility.cc @@ -444,17 +444,17 @@ bool BrowserAccessibility::GetStringAttribute( return false; } -string16 BrowserAccessibility::GetString16Attribute( +base::string16 BrowserAccessibility::GetString16Attribute( StringAttribute attribute) const { std::string value_utf8; if (!GetStringAttribute(attribute, &value_utf8)) - return string16(); + return base::string16(); return UTF8ToUTF16(value_utf8); } bool BrowserAccessibility::GetString16Attribute( StringAttribute attribute, - string16* value) const { + base::string16* value) const { std::string value_utf8; if (!GetStringAttribute(attribute, &value_utf8)) return false; @@ -522,7 +522,7 @@ bool BrowserAccessibility::GetHtmlAttribute( } bool BrowserAccessibility::GetHtmlAttribute( - const char* html_attr, string16* value) const { + const char* html_attr, base::string16* value) const { std::string value_utf8; if (!GetHtmlAttribute(html_attr, &value_utf8)) return false; @@ -537,7 +537,7 @@ bool BrowserAccessibility::GetAriaTristate( *is_defined = false; *is_mixed = false; - string16 value; + base::string16 value; if (!GetHtmlAttribute(html_attr, &value) || value.empty() || EqualsASCII(value, "undefined")) { diff --git a/content/browser/accessibility/browser_accessibility.h b/content/browser/accessibility/browser_accessibility.h index 1f858f1..701010f 100644 --- a/content/browser/accessibility/browser_accessibility.h +++ b/content/browser/accessibility/browser_accessibility.h @@ -192,7 +192,7 @@ class CONTENT_EXPORT BrowserAccessibility { // need to distinguish between the default value and a missing attribute), // and another that returns the default value for that type if the // attribute is not present. In addition, strings can be returned as - // either std::string or string16, for convenience. + // either std::string or base::string16, for convenience. bool HasBoolAttribute(AccessibilityNodeData::BoolAttribute attr) const; bool GetBoolAttribute(AccessibilityNodeData::BoolAttribute attr) const; @@ -217,8 +217,8 @@ class CONTENT_EXPORT BrowserAccessibility { std::string* value) const; bool GetString16Attribute(AccessibilityNodeData::StringAttribute attribute, - string16* value) const; - string16 GetString16Attribute( + base::string16* value) const; + base::string16 GetString16Attribute( AccessibilityNodeData::StringAttribute attribute) const; bool HasIntListAttribute( @@ -234,7 +234,7 @@ class CONTENT_EXPORT BrowserAccessibility { // Retrieve the value of a html attribute from the attribute map and // returns true if found. - bool GetHtmlAttribute(const char* attr, string16* value) const; + bool GetHtmlAttribute(const char* attr, base::string16* value) const; bool GetHtmlAttribute(const char* attr, std::string* value) const; // Utility method to handle special cases for ARIA booleans, tristates and diff --git a/content/browser/accessibility/browser_accessibility_android.cc b/content/browser/accessibility/browser_accessibility_android.cc index 433c7a1..d5920be 100644 --- a/content/browser/accessibility/browser_accessibility_android.cc +++ b/content/browser/accessibility/browser_accessibility_android.cc @@ -40,7 +40,7 @@ bool BrowserAccessibilityAndroid::PlatformIsLeaf() const { return false; // Headings with text can drop their children. - string16 name = GetText(); + base::string16 name = GetText(); if (role() == blink::WebAXRoleHeading && !name.empty()) return true; @@ -168,15 +168,15 @@ const char* BrowserAccessibilityAndroid::GetClassName() const { return class_name; } -string16 BrowserAccessibilityAndroid::GetText() const { +base::string16 BrowserAccessibilityAndroid::GetText() const { if (IsIframe() || role() == blink::WebAXRoleWebArea) { - return string16(); + return base::string16(); } - string16 description = GetString16Attribute( + base::string16 description = GetString16Attribute( AccessibilityNodeData::ATTR_DESCRIPTION); - string16 text; + base::string16 text; if (!name().empty()) text = base::UTF8ToUTF16(name()); else if (!description.empty()) @@ -320,7 +320,7 @@ int BrowserAccessibilityAndroid::GetTextChangeRemovedCount() const { return (old_len - left - right); } -string16 BrowserAccessibilityAndroid::GetTextChangeBeforeText() const { +base::string16 BrowserAccessibilityAndroid::GetTextChangeBeforeText() const { return old_value_; } @@ -365,7 +365,7 @@ bool BrowserAccessibilityAndroid::HasOnlyStaticTextChildren() const { } bool BrowserAccessibilityAndroid::IsIframe() const { - string16 html_tag = GetString16Attribute( + base::string16 html_tag = GetString16Attribute( AccessibilityNodeData::ATTR_HTML_TAG); return html_tag == ASCIIToUTF16("iframe"); } @@ -383,7 +383,7 @@ void BrowserAccessibilityAndroid::PostInitialize() { if (role_ == blink::WebAXRoleAlert && first_time_) manager_->NotifyAccessibilityEvent(blink::WebAXEventAlert, this); - string16 live; + base::string16 live; if (GetString16Attribute( AccessibilityNodeData::ATTR_CONTAINER_LIVE_STATUS, &live)) { NotifyLiveRegionUpdate(live); @@ -392,12 +392,13 @@ void BrowserAccessibilityAndroid::PostInitialize() { first_time_ = false; } -void BrowserAccessibilityAndroid::NotifyLiveRegionUpdate(string16& aria_live) { +void BrowserAccessibilityAndroid::NotifyLiveRegionUpdate( + base::string16& aria_live) { if (!EqualsASCII(aria_live, aria_strings::kAriaLivePolite) && !EqualsASCII(aria_live, aria_strings::kAriaLiveAssertive)) return; - string16 text = GetText(); + base::string16 text = GetText(); if (cached_text_ != text) { if (!text.empty()) { manager_->NotifyAccessibilityEvent(blink::WebAXEventShow, diff --git a/content/browser/accessibility/browser_accessibility_android.h b/content/browser/accessibility/browser_accessibility_android.h index 7cb979b..cb882f4 100644 --- a/content/browser/accessibility/browser_accessibility_android.h +++ b/content/browser/accessibility/browser_accessibility_android.h @@ -30,7 +30,7 @@ class BrowserAccessibilityAndroid : public BrowserAccessibility { bool IsVisibleToUser() const; const char* GetClassName() const; - string16 GetText() const; + base::string16 GetText() const; int GetItemIndex() const; int GetItemCount() const; @@ -43,7 +43,7 @@ class BrowserAccessibilityAndroid : public BrowserAccessibility { int GetTextChangeFromIndex() const; int GetTextChangeAddedCount() const; int GetTextChangeRemovedCount() const; - string16 GetTextChangeBeforeText() const; + base::string16 GetTextChangeBeforeText() const; int GetSelectionStart() const; int GetSelectionEnd() const; @@ -59,12 +59,12 @@ class BrowserAccessibilityAndroid : public BrowserAccessibility { bool HasOnlyStaticTextChildren() const; bool IsIframe() const; - void NotifyLiveRegionUpdate(string16& aria_live); + void NotifyLiveRegionUpdate(base::string16& aria_live); - string16 cached_text_; + base::string16 cached_text_; bool first_time_; - string16 old_value_; - string16 new_value_; + base::string16 old_value_; + base::string16 new_value_; DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityAndroid); }; diff --git a/content/browser/accessibility/browser_accessibility_cocoa.mm b/content/browser/accessibility/browser_accessibility_cocoa.mm index 15ac608..9364dbb 100644 --- a/content/browser/accessibility/browser_accessibility_cocoa.mm +++ b/content/browser/accessibility/browser_accessibility_cocoa.mm @@ -569,7 +569,7 @@ NSDictionary* attributeToMethodNameMap = nil; } - (NSString*)invalid { - string16 invalidUTF; + base::string16 invalidUTF; if (!browserAccessibility_->GetHtmlAttribute("aria-invalid", &invalidUTF)) return NULL; NSString* invalid = base::SysUTF16ToNSString(invalidUTF); @@ -1296,10 +1296,10 @@ NSDictionary* attributeToMethodNameMap = nil; nil]]; } else if ([role isEqualToString:NSAccessibilityRowRole]) { if (browserAccessibility_->parent()) { - string16 parentRole; + base::string16 parentRole; browserAccessibility_->parent()->GetHtmlAttribute( "role", &parentRole); - const string16 treegridRole(ASCIIToUTF16("treegrid")); + const base::string16 treegridRole(ASCIIToUTF16("treegrid")); if (parentRole == treegridRole) { [ret addObjectsFromArray:[NSArray arrayWithObjects: NSAccessibilityDisclosingAttribute, diff --git a/content/browser/accessibility/browser_accessibility_state_impl_win.cc b/content/browser/accessibility/browser_accessibility_state_impl_win.cc index 824055f..28f05e0 100644 --- a/content/browser/accessibility/browser_accessibility_state_impl_win.cc +++ b/content/browser/accessibility/browser_accessibility_state_impl_win.cc @@ -57,7 +57,7 @@ void BrowserAccessibilityStateImpl::UpdatePlatformSpecificHistograms() { for (size_t i = 0; i < module_count; i++) { TCHAR filename[MAX_PATH]; GetModuleFileName(modules[i], filename, sizeof(filename)); - string16 module_name(base::FilePath(filename).BaseName().value()); + base::string16 module_name(base::FilePath(filename).BaseName().value()); if (LowerCaseEqualsASCII(module_name, "fsdomsrv.dll")) jaws = true; if (LowerCaseEqualsASCII(module_name, "vbufbackend_gecko_ia2.dll")) diff --git a/content/browser/accessibility/browser_accessibility_win.cc b/content/browser/accessibility/browser_accessibility_win.cc index 801a2d7..fe21c82 100644 --- a/content/browser/accessibility/browser_accessibility_win.cc +++ b/content/browser/accessibility/browser_accessibility_win.cc @@ -58,7 +58,7 @@ class BrowserAccessibilityRelation CONTENT_EXPORT virtual ~BrowserAccessibilityRelation() {} CONTENT_EXPORT void Initialize(BrowserAccessibilityWin* owner, - const string16& type); + const base::string16& type); CONTENT_EXPORT void AddTarget(int target_id); // IAccessibleRelation methods. @@ -75,13 +75,13 @@ class BrowserAccessibilityRelation } private: - string16 type_; + base::string16 type_; base::win::ScopedComPtr<BrowserAccessibilityWin> owner_; std::vector<int> target_ids_; }; void BrowserAccessibilityRelation::Initialize(BrowserAccessibilityWin* owner, - const string16& type) { + const base::string16& type) { owner_ = owner; type_ = type; } @@ -564,7 +564,7 @@ STDMETHODIMP BrowserAccessibilityWin::get_accValue(VARIANT var_id, if (target->ia_role() == ROLE_SYSTEM_PROGRESSBAR || target->ia_role() == ROLE_SYSTEM_SCROLLBAR || target->ia_role() == ROLE_SYSTEM_SLIDER) { - string16 value_text = target->GetValueText(); + base::string16 value_text = target->GetValueText(); *value = SysAllocString(value_text.c_str()); DCHECK(*value); return S_OK; @@ -578,7 +578,7 @@ STDMETHODIMP BrowserAccessibilityWin::get_accValue(VARIANT var_id, AccessibilityNodeData::ATTR_COLOR_VALUE_GREEN); int b = target->GetIntAttribute( AccessibilityNodeData::ATTR_COLOR_VALUE_BLUE); - string16 value_text; + base::string16 value_text; value_text = base::IntToString16((r * 100) / 255) + L"% red " + base::IntToString16((g * 100) / 255) + L"% green " + base::IntToString16((b * 100) / 255) + L"% blue"; @@ -684,7 +684,7 @@ STDMETHODIMP BrowserAccessibilityWin::get_attributes(BSTR* attributes) { // The iaccessible2 attributes are a set of key-value pairs // separated by semicolons, with a colon between the key and the value. - string16 str; + base::string16 str; for (unsigned int i = 0; i < ia2_attributes_.size(); ++i) { if (i != 0) str += L';'; @@ -1133,7 +1133,7 @@ STDMETHODIMP BrowserAccessibilityWin::get_columnDescription(long column, BrowserAccessibilityWin* cell = static_cast<BrowserAccessibilityWin*>( manager_->GetFromRendererID(cell_id)); if (cell && cell->role_ == blink::WebAXRoleColumnHeader) { - string16 cell_name = cell->GetString16Attribute( + base::string16 cell_name = cell->GetString16Attribute( AccessibilityNodeData::ATTR_NAME); if (cell_name.size() > 0) { *description = SysAllocString(cell_name.c_str()); @@ -1320,7 +1320,7 @@ STDMETHODIMP BrowserAccessibilityWin::get_rowDescription(long row, BrowserAccessibilityWin* cell = manager_->GetFromRendererID(cell_id)->ToBrowserAccessibilityWin(); if (cell && cell->role_ == blink::WebAXRoleRowHeader) { - string16 cell_name = cell->GetString16Attribute( + base::string16 cell_name = cell->GetString16Attribute( AccessibilityNodeData::ATTR_NAME); if (cell_name.size() > 0) { *description = SysAllocString(cell_name.c_str()); @@ -1926,7 +1926,7 @@ STDMETHODIMP BrowserAccessibilityWin::get_characterExtents( if (!out_x || !out_y || !out_width || !out_height) return E_INVALIDARG; - const string16& text_str = TextForIAccessibleText(); + const base::string16& text_str = TextForIAccessibleText(); HandleSpecialTextOffset(text_str, &offset); if (offset < 0 || offset > static_cast<LONG>(text_str.size())) @@ -2010,7 +2010,7 @@ STDMETHODIMP BrowserAccessibilityWin::get_text(LONG start_offset, if (!text) return E_INVALIDARG; - const string16& text_str = TextForIAccessibleText(); + const base::string16& text_str = TextForIAccessibleText(); // Handle special text offsets. HandleSpecialTextOffset(text_str, &start_offset); @@ -2031,7 +2031,8 @@ STDMETHODIMP BrowserAccessibilityWin::get_text(LONG start_offset, if (end_offset > len) return E_INVALIDARG; - string16 substr = text_str.substr(start_offset, end_offset - start_offset); + base::string16 substr = text_str.substr(start_offset, + end_offset - start_offset); if (substr.empty()) return S_FALSE; @@ -2061,7 +2062,7 @@ STDMETHODIMP BrowserAccessibilityWin::get_textAtOffset( return S_FALSE; } - const string16& text_str = TextForIAccessibleText(); + const base::string16& text_str = TextForIAccessibleText(); *start_offset = FindBoundary( text_str, boundary_type, offset, ui::BACKWARDS_DIRECTION); @@ -2091,7 +2092,7 @@ STDMETHODIMP BrowserAccessibilityWin::get_textBeforeOffset( return S_FALSE; } - const string16& text_str = TextForIAccessibleText(); + const base::string16& text_str = TextForIAccessibleText(); *start_offset = FindBoundary( text_str, boundary_type, offset, ui::BACKWARDS_DIRECTION); @@ -2120,7 +2121,7 @@ STDMETHODIMP BrowserAccessibilityWin::get_textAfterOffset( return S_FALSE; } - const string16& text_str = TextForIAccessibleText(); + const base::string16& text_str = TextForIAccessibleText(); *start_offset = offset; *end_offset = FindBoundary( @@ -2135,7 +2136,7 @@ STDMETHODIMP BrowserAccessibilityWin::get_newText(IA2TextSegment* new_text) { if (!new_text) return E_INVALIDARG; - string16 text = TextForIAccessibleText(); + base::string16 text = TextForIAccessibleText(); new_text->text = SysAllocString(text.c_str()); new_text->start = 0; @@ -2196,7 +2197,7 @@ STDMETHODIMP BrowserAccessibilityWin::addSelection(LONG start_offset, if (!instance_active_) return E_FAIL; - const string16& text_str = TextForIAccessibleText(); + const base::string16& text_str = TextForIAccessibleText(); HandleSpecialTextOffset(text_str, &start_offset); HandleSpecialTextOffset(text_str, &end_offset); @@ -2219,7 +2220,7 @@ STDMETHODIMP BrowserAccessibilityWin::setCaretOffset(LONG offset) { if (!instance_active_) return E_FAIL; - const string16& text_str = TextForIAccessibleText(); + const base::string16& text_str = TextForIAccessibleText(); HandleSpecialTextOffset(text_str, &offset); manager_->SetTextSelection(*this, offset, offset); return S_OK; @@ -2234,7 +2235,7 @@ STDMETHODIMP BrowserAccessibilityWin::setSelection(LONG selection_index, if (selection_index != 0) return E_INVALIDARG; - const string16& text_str = TextForIAccessibleText(); + const base::string16& text_str = TextForIAccessibleText(); HandleSpecialTextOffset(text_str, &start_offset); HandleSpecialTextOffset(text_str, &end_offset); @@ -2429,7 +2430,7 @@ STDMETHODIMP BrowserAccessibilityWin::get_nodeInfo( return E_INVALIDARG; } - string16 tag; + base::string16 tag; if (GetString16Attribute(AccessibilityNodeData::ATTR_HTML_TAG, &tag)) *node_name = SysAllocString(tag.c_str()); else @@ -2522,7 +2523,7 @@ STDMETHODIMP BrowserAccessibilityWin::get_computedStyle( // We only cache a single style property for now: DISPLAY - string16 display; + base::string16 display; if (max_style_properties == 0 || !GetString16Attribute(AccessibilityNodeData::ATTR_DISPLAY, &display)) { *num_style_properties = 0; @@ -2550,10 +2551,10 @@ STDMETHODIMP BrowserAccessibilityWin::get_computedStyleForProperties( // We only cache a single style property for now: DISPLAY for (unsigned short i = 0; i < num_style_properties; ++i) { - string16 name = (LPCWSTR)style_properties[i]; + base::string16 name = (LPCWSTR)style_properties[i]; StringToLowerASCII(&name); if (name == L"display") { - string16 display = GetString16Attribute( + base::string16 display = GetString16Attribute( AccessibilityNodeData::ATTR_DISPLAY); style_values[i] = SysAllocString(display.c_str()); } else { @@ -2713,7 +2714,7 @@ STDMETHODIMP BrowserAccessibilityWin::get_unclippedSubstringBounds( if (!out_x || !out_y || !out_width || !out_height) return E_INVALIDARG; - const string16& text_str = TextForIAccessibleText(); + const base::string16& text_str = TextForIAccessibleText(); if (start_index > text_str.size() || end_index > text_str.size() || start_index > end_index) { @@ -2738,7 +2739,7 @@ STDMETHODIMP BrowserAccessibilityWin::scrollToSubstring( if (!instance_active_) return E_FAIL; - const string16& text_str = TextForIAccessibleText(); + const base::string16& text_str = TextForIAccessibleText(); if (start_index > text_str.size() || end_index > text_str.size() || start_index > end_index) { @@ -2958,7 +2959,7 @@ void BrowserAccessibilityWin::PreInitialize() { for (size_t i = 0; i < unique_cell_ids.size(); ++i) { if (unique_cell_ids[i] == renderer_id_) { ia2_attributes_.push_back( - string16(L"table-cell-index:") + base::IntToString16(i)); + base::string16(L"table-cell-index:") + base::IntToString16(i)); } } } @@ -3097,7 +3098,7 @@ void BrowserAccessibilityWin::PostInitialize() { manager_->NotifyAccessibilityEvent(blink::WebAXEventAlert, this); // Fire events if text has changed. - string16 text = TextForIAccessibleText(); + base::string16 text = TextForIAccessibleText(); if (previous_text_ != text) { if (!previous_text_.empty() && !text.empty()) { manager_->NotifyAccessibilityEvent( @@ -3185,7 +3186,7 @@ BrowserAccessibilityWin* BrowserAccessibilityWin::GetTargetFromChildID( HRESULT BrowserAccessibilityWin::GetStringAttributeAsBstr( AccessibilityNodeData::StringAttribute attribute, BSTR* value_bstr) { - string16 str; + base::string16 str; if (!GetString16Attribute(attribute, &str)) return S_FALSE; @@ -3202,7 +3203,7 @@ HRESULT BrowserAccessibilityWin::GetStringAttributeAsBstr( void BrowserAccessibilityWin::StringAttributeToIA2( AccessibilityNodeData::StringAttribute attribute, const char* ia2_attr) { - string16 value; + base::string16 value; if (GetString16Attribute(attribute, &value)) ia2_attributes_.push_back(ASCIIToUTF16(ia2_attr) + L":" + value); } @@ -3227,9 +3228,9 @@ void BrowserAccessibilityWin::IntAttributeToIA2( } } -string16 BrowserAccessibilityWin::GetValueText() { +base::string16 BrowserAccessibilityWin::GetValueText() { float fval; - string16 value = UTF8ToUTF16(value_); + base::string16 value = UTF8ToUTF16(value_); if (value.empty() && GetFloatAttribute(AccessibilityNodeData::ATTR_VALUE_FOR_RANGE, &fval)) { value = UTF8ToUTF16(base::DoubleToString(fval)); @@ -3237,15 +3238,16 @@ string16 BrowserAccessibilityWin::GetValueText() { return value; } -string16 BrowserAccessibilityWin::TextForIAccessibleText() { +base::string16 BrowserAccessibilityWin::TextForIAccessibleText() { if (IsEditableText()) return UTF8ToUTF16(value_); return (role_ == blink::WebAXRoleStaticText) ? UTF8ToUTF16(name_) : hypertext_; } -void BrowserAccessibilityWin::HandleSpecialTextOffset(const string16& text, - LONG* offset) { +void BrowserAccessibilityWin::HandleSpecialTextOffset( + const base::string16& text, + LONG* offset) { if (*offset == IA2_TEXT_OFFSET_LENGTH) *offset = static_cast<LONG>(text.size()); else if (*offset == IA2_TEXT_OFFSET_CARET) @@ -3268,7 +3270,7 @@ ui::TextBoundaryType BrowserAccessibilityWin::IA2TextBoundaryToTextBoundary( } LONG BrowserAccessibilityWin::FindBoundary( - const string16& text, + const base::string16& text, IA2TextBoundaryType ia2_boundary, LONG start_offset, ui::TextBoundaryDirection direction) { @@ -3345,7 +3347,7 @@ void BrowserAccessibilityWin::InitRoleAndState() { if (!HasState(blink::WebAXStateReadonly)) ia2_state_ |= IA2_STATE_EDITABLE; - string16 invalid; + base::string16 invalid; if (GetHtmlAttribute("aria-invalid", &invalid)) ia2_state_ |= IA2_STATE_INVALID_ENTRY; @@ -3355,7 +3357,7 @@ void BrowserAccessibilityWin::InitRoleAndState() { if (GetBoolAttribute(AccessibilityNodeData::ATTR_CAN_SET_VALUE)) ia2_state_ |= IA2_STATE_EDITABLE; - string16 html_tag = GetString16Attribute( + base::string16 html_tag = GetString16Attribute( AccessibilityNodeData::ATTR_HTML_TAG); ia_role_ = 0; ia2_role_ = 0; @@ -3469,7 +3471,7 @@ void BrowserAccessibilityWin::InitRoleAndState() { ia_state_ |= STATE_SYSTEM_READONLY; break; case blink::WebAXRoleGroup: { - string16 aria_role = GetString16Attribute( + base::string16 aria_role = GetString16Attribute( AccessibilityNodeData::ATTR_ROLE); if (aria_role == L"group" || html_tag == L"fieldset") { ia_role_ = ROLE_SYSTEM_GROUPING; @@ -3667,7 +3669,7 @@ void BrowserAccessibilityWin::InitRoleAndState() { ia_role_ = ROLE_SYSTEM_PAGETAB; break; case blink::WebAXRoleTable: { - string16 aria_role = GetString16Attribute( + base::string16 aria_role = GetString16Attribute( AccessibilityNodeData::ATTR_ROLE); if (aria_role == L"treegrid") { ia_role_ = ROLE_SYSTEM_OUTLINE; diff --git a/content/browser/accessibility/browser_accessibility_win.h b/content/browser/accessibility/browser_accessibility_win.h index 1bb6ee2..992b3d1 100644 --- a/content/browser/accessibility/browser_accessibility_win.h +++ b/content/browser/accessibility/browser_accessibility_win.h @@ -86,8 +86,8 @@ BrowserAccessibilityWin // Mappings from roles and states to human readable strings. Initialize // with |InitializeStringMaps|. - static std::map<int32, string16> role_string_map; - static std::map<int32, string16> state_string_map; + static std::map<int32, base::string16> role_string_map; + static std::map<int32, base::string16> state_string_map; CONTENT_EXPORT BrowserAccessibilityWin(); @@ -765,10 +765,10 @@ BrowserAccessibilityWin // Accessors. int32 ia_role() const { return ia_role_; } int32 ia_state() const { return ia_state_; } - const string16& role_name() const { return role_name_; } + const base::string16& role_name() const { return role_name_; } int32 ia2_role() const { return ia2_role_; } int32 ia2_state() const { return ia2_state_; } - const std::vector<string16>& ia2_attributes() const { + const std::vector<base::string16>& ia2_attributes() const { return ia2_attributes_; } @@ -813,15 +813,15 @@ BrowserAccessibilityWin // Get the value text, which might come from the floating-point // value for some roles. - string16 GetValueText(); + base::string16 GetValueText(); // Get the text of this node for the purposes of IAccessibleText - it may // be the name, it may be the value, etc. depending on the role. - string16 TextForIAccessibleText(); + base::string16 TextForIAccessibleText(); // If offset is a member of IA2TextSpecialOffsets this function updates the // value of offset and returns, otherwise offset remains unchanged. - void HandleSpecialTextOffset(const string16& text, LONG* offset); + void HandleSpecialTextOffset(const base::string16& text, LONG* offset); // Convert from a IA2TextBoundaryType to a ui::TextBoundaryType. ui::TextBoundaryType IA2TextBoundaryToTextBoundary(IA2TextBoundaryType type); @@ -829,7 +829,7 @@ BrowserAccessibilityWin // Search forwards (direction == 1) or backwards (direction == -1) // from the given offset until the given boundary is found, and // return the offset of that boundary. - LONG FindBoundary(const string16& text, + LONG FindBoundary(const base::string16& text, IA2TextBoundaryType ia2_boundary, LONG start_offset, ui::TextBoundaryDirection direction); @@ -846,26 +846,26 @@ BrowserAccessibilityWin // IAccessible role and state. int32 ia_role_; int32 ia_state_; - string16 role_name_; + base::string16 role_name_; // IAccessible2 role and state. int32 ia2_role_; int32 ia2_state_; // IAccessible2 attributes. - std::vector<string16> ia2_attributes_; + std::vector<base::string16> ia2_attributes_; // True in Initialize when the object is first created, and false // subsequent times. bool first_time_; // The previous text, before the last update to this object. - string16 previous_text_; + base::string16 previous_text_; // The old text to return in IAccessibleText::get_oldText - this is like // previous_text_ except that it's NOT updated when the object // is initialized again but the text doesn't change. - string16 old_text_; + base::string16 old_text_; // The previous state, used to see if there was a state change. int32 old_ia_state_; @@ -874,7 +874,7 @@ BrowserAccessibilityWin std::vector<BrowserAccessibilityRelation*> relations_; // The text of this node including embedded hyperlink characters. - string16 hypertext_; + base::string16 hypertext_; // Maps the |hypertext_| embedded character offset to an index in // |hyperlinks_|. diff --git a/content/browser/accessibility/browser_accessibility_win_unittest.cc b/content/browser/accessibility/browser_accessibility_win_unittest.cc index edb572f..c1159e6 100644 --- a/content/browser/accessibility/browser_accessibility_win_unittest.cc +++ b/content/browser/accessibility/browser_accessibility_win_unittest.cc @@ -219,7 +219,7 @@ TEST_F(BrowserAccessibilityTest, TestChildrenChange) { base::win::ScopedBstr name; hr = text_accessible->get_accName(childid_self, name.Receive()); ASSERT_EQ(S_OK, hr); - EXPECT_EQ(L"old text", string16(name)); + EXPECT_EQ(L"old text", base::string16(name)); name.Reset(); text_dispatch.Release(); @@ -250,7 +250,7 @@ TEST_F(BrowserAccessibilityTest, TestChildrenChange) { hr = text_accessible->get_accName(childid_self, name.Receive()); ASSERT_EQ(S_OK, hr); - EXPECT_EQ(L"new text", string16(name)); + EXPECT_EQ(L"new text", base::string16(name)); text_dispatch.Release(); text_accessible.Release(); @@ -354,7 +354,7 @@ TEST_F(BrowserAccessibilityTest, TestTextBoundaries) { base::win::ScopedBstr text; ASSERT_EQ(S_OK, text1_obj->get_text(0, text1_len, text.Receive())); - ASSERT_EQ(text1_value, base::UTF16ToUTF8(string16(text))); + ASSERT_EQ(text1_value, base::UTF16ToUTF8(base::string16(text))); text.Reset(); ASSERT_EQ(S_OK, text1_obj->get_text(0, 4, text.Receive())); @@ -452,7 +452,7 @@ TEST_F(BrowserAccessibilityTest, TestSimpleHypertext) { base::win::ScopedBstr text; ASSERT_EQ(S_OK, root_obj->get_text(0, text_len, text.Receive())); - EXPECT_EQ(text1_name + text2_name, base::UTF16ToUTF8(string16(text))); + EXPECT_EQ(text1_name + text2_name, base::UTF16ToUTF8(base::string16(text))); long hyperlink_count; ASSERT_EQ(S_OK, root_obj->get_nHyperlinks(&hyperlink_count)); @@ -548,7 +548,7 @@ TEST_F(BrowserAccessibilityTest, TestComplexHypertext) { const std::string embed = base::UTF16ToUTF8( BrowserAccessibilityWin::kEmbeddedCharacter); EXPECT_EQ(text1_name + embed + text2_name + embed, - UTF16ToUTF8(string16(text))); + UTF16ToUTF8(base::string16(text))); text.Reset(); long hyperlink_count; @@ -566,7 +566,7 @@ TEST_F(BrowserAccessibilityTest, TestComplexHypertext) { hyperlink.QueryInterface<IAccessibleText>(hypertext.Receive())); EXPECT_EQ(S_OK, hypertext->get_text(0, 3, text.Receive())); EXPECT_STREQ(button1_text_name.c_str(), - base::UTF16ToUTF8(string16(text)).c_str()); + base::UTF16ToUTF8(base::string16(text)).c_str()); text.Reset(); hyperlink.Release(); hypertext.Release(); @@ -576,7 +576,7 @@ TEST_F(BrowserAccessibilityTest, TestComplexHypertext) { hyperlink.QueryInterface<IAccessibleText>(hypertext.Receive())); EXPECT_EQ(S_OK, hypertext->get_text(0, 4, text.Receive())); EXPECT_STREQ(link1_text_name.c_str(), - base::UTF16ToUTF8(string16(text)).c_str()); + base::UTF16ToUTF8(base::string16(text)).c_str()); text.Reset(); hyperlink.Release(); hypertext.Release(); diff --git a/content/browser/accessibility/dump_accessibility_tree_browsertest.cc b/content/browser/accessibility/dump_accessibility_tree_browsertest.cc index 45bf951..3dd07d8 100644 --- a/content/browser/accessibility/dump_accessibility_tree_browsertest.cc +++ b/content/browser/accessibility/dump_accessibility_tree_browsertest.cc @@ -169,7 +169,7 @@ void DumpAccessibilityTreeTest::RunTest( } // Load the page. - string16 html_contents16; + base::string16 html_contents16; html_contents16 = UTF8ToUTF16(html_contents); GURL url = GetTestUrl("accessibility", html_file.BaseName().MaybeAsASCII().c_str()); @@ -191,7 +191,7 @@ void DumpAccessibilityTreeTest::RunTest( formatter.SetFilters(filters); // Perform a diff (or write the initial baseline). - string16 actual_contents_utf16; + base::string16 actual_contents_utf16; formatter.FormatAccessibilityTree(&actual_contents_utf16); std::string actual_contents = UTF16ToUTF8(actual_contents_utf16); std::vector<std::string> actual_lines, expected_lines; diff --git a/content/browser/android/content_view_core_impl.cc b/content/browser/android/content_view_core_impl.cc index 2a53563..0f61633 100644 --- a/content/browser/android/content_view_core_impl.cc +++ b/content/browser/android/content_view_core_impl.cc @@ -389,7 +389,7 @@ void ContentViewCoreImpl::UpdateFrameInfo( overdraw_bottom_height); } -void ContentViewCoreImpl::SetTitle(const string16& title) { +void ContentViewCoreImpl::SetTitle(const base::string16& title) { JNIEnv* env = AttachCurrentThread(); ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); if (obj.is_null()) @@ -438,7 +438,7 @@ void ContentViewCoreImpl::ShowSelectPopupMenu( ScopedJavaLocalRef<jintArray> enabled_array(env, env->NewIntArray(items.size())); - std::vector<string16> labels; + std::vector<base::string16> labels; labels.reserve(items.size()); for (size_t i = 0; i < items.size(); ++i) { labels.push_back(items[i].label); @@ -1487,7 +1487,7 @@ void ContentViewCoreImpl::EvaluateJavaScript(JNIEnv* env, if (!callback) { // No callback requested. - rvh->ExecuteJavascriptInWebFrame(string16(), // frame_xpath + rvh->ExecuteJavascriptInWebFrame(base::string16(), // frame_xpath ConvertJavaStringToUTF16(env, script)); return; } @@ -1500,7 +1500,7 @@ void ContentViewCoreImpl::EvaluateJavaScript(JNIEnv* env, base::Bind(&JavaScriptResultCallback, j_callback); rvh->ExecuteJavascriptInWebFrameCallbackResult( - string16(), // frame_xpath + base::string16(), // frame_xpath ConvertJavaStringToUTF16(env, script), c_callback); } diff --git a/content/browser/android/content_view_core_impl.h b/content/browser/android/content_view_core_impl.h index 0c3a5ec..138aecc 100644 --- a/content/browser/android/content_view_core_impl.h +++ b/content/browser/android/content_view_core_impl.h @@ -258,7 +258,7 @@ class ContentViewCoreImpl : public ContentViewCore, int selection_start, int selection_end, int composition_start, int composition_end, bool show_ime_if_needed, bool require_ack); - void SetTitle(const string16& title); + void SetTitle(const base::string16& title); void OnBackgroundColorChanged(SkColor color); bool HasFocus(); diff --git a/content/browser/android/content_view_statics.cc b/content/browser/android/content_view_statics.cc index 917da58..e176564 100644 --- a/content/browser/android/content_view_statics.cc +++ b/content/browser/android/content_view_statics.cc @@ -62,8 +62,8 @@ void ResumeWebkitSharedTimers(const std::vector<int>& suspended_processes) { // Returns the first substring consisting of the address of a physical location. static jstring FindAddress(JNIEnv* env, jclass clazz, jstring addr) { - string16 content_16 = ConvertJavaStringToUTF16(env, addr); - string16 result_16; + base::string16 content_16 = ConvertJavaStringToUTF16(env, addr); + base::string16 result_16; if (content::address_parser::FindAddress(content_16, &result_16)) return ConvertUTF16ToJavaString(env, result_16).Release(); return NULL; diff --git a/content/browser/android/web_contents_observer_android.cc b/content/browser/android/web_contents_observer_android.cc index f2494e8..235041b 100644 --- a/content/browser/android/web_contents_observer_android.cc +++ b/content/browser/android/web_contents_observer_android.cc @@ -98,11 +98,11 @@ void WebContentsObserverAndroid::DidStopLoading( void WebContentsObserverAndroid::DidFailProvisionalLoad( int64 frame_id, - const string16& frame_unique_name, + const base::string16& frame_unique_name, bool is_main_frame, const GURL& validated_url, int error_code, - const string16& error_description, + const base::string16& error_description, RenderViewHost* render_view_host) { DidFailLoadInternal( true, is_main_frame, error_code, error_description, validated_url); @@ -113,7 +113,7 @@ void WebContentsObserverAndroid::DidFailLoad( const GURL& validated_url, bool is_main_frame, int error_code, - const string16& error_description, + const base::string16& error_description, RenderViewHost* render_view_host) { DidFailLoadInternal( false, is_main_frame, error_code, error_description, validated_url); @@ -175,7 +175,7 @@ void WebContentsObserverAndroid::DidStartProvisionalLoadForFrame( void WebContentsObserverAndroid::DidCommitProvisionalLoadForFrame( int64 frame_id, - const string16& frame_unique_name, + const base::string16& frame_unique_name, bool is_main_frame, const GURL& url, PageTransition transition_type, @@ -251,7 +251,7 @@ void WebContentsObserverAndroid::DidFailLoadInternal( bool is_provisional_load, bool is_main_frame, int error_code, - const string16& description, + const base::string16& description, const GURL& url) { JNIEnv* env = AttachCurrentThread(); ScopedJavaLocalRef<jobject> obj(weak_java_observer_.get(env)); diff --git a/content/browser/android/web_contents_observer_android.h b/content/browser/android/web_contents_observer_android.h index 9742d28..15a1363 100644 --- a/content/browser/android/web_contents_observer_android.h +++ b/content/browser/android/web_contents_observer_android.h @@ -38,17 +38,17 @@ class WebContentsObserverAndroid : public WebContentsObserver { virtual void DidStopLoading(RenderViewHost* render_view_host) OVERRIDE; virtual void DidFailProvisionalLoad( int64 frame_id, - const string16& frame_unique_name, + const base::string16& frame_unique_name, bool is_main_frame, const GURL& validated_url, int error_code, - const string16& error_description, + const base::string16& error_description, RenderViewHost* render_view_host) OVERRIDE; virtual void DidFailLoad(int64 frame_id, const GURL& validated_url, bool is_main_frame, int error_code, - const string16& error_description, + const base::string16& error_description, RenderViewHost* render_view_host) OVERRIDE; virtual void DidNavigateMainFrame(const LoadCommittedDetails& details, const FrameNavigateParams& params) OVERRIDE; @@ -64,7 +64,7 @@ class WebContentsObserverAndroid : public WebContentsObserver { RenderViewHost* render_view_host) OVERRIDE; virtual void DidCommitProvisionalLoadForFrame( int64 frame_id, - const string16& frame_unique_name, + const base::string16& frame_unique_name, bool is_main_frame, const GURL& url, PageTransition transition_type, @@ -83,7 +83,7 @@ class WebContentsObserverAndroid : public WebContentsObserver { void DidFailLoadInternal(bool is_provisional_load, bool is_main_frame, int error_code, - const string16& description, + const base::string16& description, const GURL& url); JavaObjectWeakGlobalRef weak_java_observer_; diff --git a/content/browser/browser_child_process_host_impl.cc b/content/browser/browser_child_process_host_impl.cc index 8e6bde3..4261572 100644 --- a/content/browser/browser_child_process_host_impl.cc +++ b/content/browser/browser_child_process_host_impl.cc @@ -192,7 +192,7 @@ base::ProcessHandle BrowserChildProcessHostImpl::GetHandle() const { return child_process_->GetHandle(); } -void BrowserChildProcessHostImpl::SetName(const string16& name) { +void BrowserChildProcessHostImpl::SetName(const base::string16& name) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); data_.name = name; } diff --git a/content/browser/browser_child_process_host_impl.h b/content/browser/browser_child_process_host_impl.h index 6345595..428da3d 100644 --- a/content/browser/browser_child_process_host_impl.h +++ b/content/browser/browser_child_process_host_impl.h @@ -54,7 +54,7 @@ class CONTENT_EXPORT BrowserChildProcessHostImpl virtual ChildProcessHost* GetHost() const OVERRIDE; virtual base::TerminationStatus GetTerminationStatus( bool known_dead, int* exit_code) OVERRIDE; - virtual void SetName(const string16& name) OVERRIDE; + virtual void SetName(const base::string16& name) OVERRIDE; virtual void SetHandle(base::ProcessHandle handle) OVERRIDE; // Returns the handle of the child process. This can be called only after diff --git a/content/browser/browser_plugin/browser_plugin_guest.cc b/content/browser/browser_plugin/browser_plugin_guest.cc index 7d166a6..6d28a5e 100644 --- a/content/browser/browser_plugin/browser_plugin_guest.cc +++ b/content/browser/browser_plugin/browser_plugin_guest.cc @@ -365,9 +365,9 @@ BrowserPluginGuest::BrowserPluginGuest( bool BrowserPluginGuest::AddMessageToConsole(WebContents* source, int32 level, - const string16& message, + const base::string16& message, int32 line_no, - const string16& source_id) { + const base::string16& source_id) { if (!delegate_) return false; @@ -796,7 +796,7 @@ WebContents* BrowserPluginGuest::OpenURLFromTab(WebContents* source, void BrowserPluginGuest::WebContentsCreated(WebContents* source_contents, int64 source_frame_id, - const string16& frame_name, + const base::string16& frame_name, const GURL& target_url, WebContents* new_contents) { WebContentsImpl* new_contents_impl = @@ -1028,7 +1028,7 @@ void BrowserPluginGuest::SendQueuedMessages() { void BrowserPluginGuest::DidCommitProvisionalLoadForFrame( int64 frame_id, - const string16& frame_unique_name, + const base::string16& frame_unique_name, bool is_main_frame, const GURL& url, PageTransition transition_type, @@ -1045,7 +1045,7 @@ void BrowserPluginGuest::DidStopLoading(RenderViewHost* render_view_host) { const char script[] = "window.addEventListener('dragstart', function() { " " window.event.preventDefault(); " "});"; - render_view_host->ExecuteJavascriptInWebFrame(string16(), + render_view_host->ExecuteJavascriptInWebFrame(base::string16(), ASCIIToUTF16(script)); } } @@ -1633,8 +1633,8 @@ void BrowserPluginGuest::RunJavaScriptDialog( const GURL& origin_url, const std::string& accept_lang, JavaScriptMessageType javascript_message_type, - const string16& message_text, - const string16& default_prompt_text, + const base::string16& message_text, + const base::string16& default_prompt_text, const DialogClosedCallback& callback, bool* did_suppress_message) { base::DictionaryValue request_info; @@ -1659,18 +1659,18 @@ void BrowserPluginGuest::RunJavaScriptDialog( void BrowserPluginGuest::RunBeforeUnloadDialog( WebContents* web_contents, - const string16& message_text, + const base::string16& message_text, bool is_reload, const DialogClosedCallback& callback) { // This is called if the guest has a beforeunload event handler. // This callback allows navigation to proceed. - callback.Run(true, string16()); + callback.Run(true, base::string16()); } bool BrowserPluginGuest::HandleJavaScriptDialog( WebContents* web_contents, bool accept, - const string16* prompt_override) { + const base::string16* prompt_override) { return false; } diff --git a/content/browser/browser_plugin/browser_plugin_guest.h b/content/browser/browser_plugin/browser_plugin_guest.h index 2a9c36c..6b6bf34 100644 --- a/content/browser/browser_plugin/browser_plugin_guest.h +++ b/content/browser/browser_plugin/browser_plugin_guest.h @@ -147,7 +147,7 @@ class CONTENT_EXPORT BrowserPluginGuest // WebContentsObserver implementation. virtual void DidCommitProvisionalLoadForFrame( int64 frame_id, - const string16& frame_unique_name, + const base::string16& frame_unique_name, bool is_main_frame, const GURL& url, PageTransition transition_type, @@ -161,9 +161,9 @@ class CONTENT_EXPORT BrowserPluginGuest // WebContentsDelegate implementation. virtual bool AddMessageToConsole(WebContents* source, int32 level, - const string16& message, + const base::string16& message, int32 line_no, - const string16& source_id) OVERRIDE; + const base::string16& source_id) OVERRIDE; // If a new window is created with target="_blank" and rel="noreferrer", then // this method is called, indicating that the new WebContents is ready to be // attached. @@ -189,7 +189,7 @@ class CONTENT_EXPORT BrowserPluginGuest const OpenURLParams& params) OVERRIDE; virtual void WebContentsCreated(WebContents* source_contents, int64 source_frame_id, - const string16& frame_name, + const base::string16& frame_name, const GURL& target_url, WebContents* new_contents) OVERRIDE; virtual void RendererUnresponsive(WebContents* source) OVERRIDE; @@ -208,18 +208,19 @@ class CONTENT_EXPORT BrowserPluginGuest const GURL& origin_url, const std::string& accept_lang, JavaScriptMessageType javascript_message_type, - const string16& message_text, - const string16& default_prompt_text, + const base::string16& message_text, + const base::string16& default_prompt_text, const DialogClosedCallback& callback, bool* did_suppress_message) OVERRIDE; virtual void RunBeforeUnloadDialog( WebContents* web_contents, - const string16& message_text, + const base::string16& message_text, bool is_reload, const DialogClosedCallback& callback) OVERRIDE; - virtual bool HandleJavaScriptDialog(WebContents* web_contents, - bool accept, - const string16* prompt_override) OVERRIDE; + virtual bool HandleJavaScriptDialog( + WebContents* web_contents, + bool accept, + const base::string16* prompt_override) OVERRIDE; virtual void CancelActiveAndPendingDialogs( WebContents* web_contents) OVERRIDE; virtual void WebContentsDestroyed(WebContents* web_contents) OVERRIDE; diff --git a/content/browser/browser_plugin/browser_plugin_host_browsertest.cc b/content/browser/browser_plugin/browser_plugin_host_browsertest.cc index 42c7486..cb10824 100644 --- a/content/browser/browser_plugin/browser_plugin_host_browsertest.cc +++ b/content/browser/browser_plugin/browser_plugin_host_browsertest.cc @@ -453,11 +453,11 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, MAYBE_EmbedderSameAfterNav) { // does not happen and existing embedder doesn't change in web_contents. GURL test_url_new(embedded_test_server()->GetURL( "/browser_plugin_title_change.html")); - const string16 expected_title = ASCIIToUTF16("done"); + const base::string16 expected_title = ASCIIToUTF16("done"); content::TitleWatcher title_watcher(shell()->web_contents(), expected_title); NavigateToURL(shell(), test_url_new); VLOG(0) << "Start waiting for title"; - string16 actual_title = title_watcher.WaitAndGetTitle(); + base::string16 actual_title = title_watcher.WaitAndGetTitle(); EXPECT_EQ(expected_title, actual_title); VLOG(0) << "Done navigating to second page"; @@ -536,26 +536,26 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, ReloadEmbedder) { // the page has successfully reloaded when it goes back to 'embedder' // in the next step. { - const string16 expected_title = ASCIIToUTF16("modified"); + const base::string16 expected_title = ASCIIToUTF16("modified"); content::TitleWatcher title_watcher(test_embedder()->web_contents(), expected_title); ExecuteSyncJSFunction(rvh, base::StringPrintf("SetTitle('%s');", "modified")); - string16 actual_title = title_watcher.WaitAndGetTitle(); + base::string16 actual_title = title_watcher.WaitAndGetTitle(); EXPECT_EQ(expected_title, actual_title); } // Reload the embedder page, and verify that the reload was successful. // Then navigate the guest to verify that the browser process does not crash. { - const string16 expected_title = ASCIIToUTF16("embedder"); + const base::string16 expected_title = ASCIIToUTF16("embedder"); content::TitleWatcher title_watcher(test_embedder()->web_contents(), expected_title); test_embedder()->web_contents()->GetController().Reload(false); - string16 actual_title = title_watcher.WaitAndGetTitle(); + base::string16 actual_title = title_watcher.WaitAndGetTitle(); EXPECT_EQ(expected_title, actual_title); ExecuteSyncJSFunction( @@ -618,7 +618,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, MAYBE_AcceptDragEvents) { // This should trigger appropriate messages from the embedder to the guest, // and end with a drop on the guest. The guest changes title when a drop // happens. - const string16 expected_title = ASCIIToUTF16("DROPPED"); + const base::string16 expected_title = ASCIIToUTF16("DROPPED"); content::TitleWatcher title_watcher(test_guest()->web_contents(), expected_title); @@ -628,7 +628,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, MAYBE_AcceptDragEvents) { blink::WebDragOperationEvery, 0); rvh->DragTargetDrop(gfx::Point(end_x, end_y), gfx::Point(end_x, end_y), 0); - string16 actual_title = title_watcher.WaitAndGetTitle(); + base::string16 actual_title = title_watcher.WaitAndGetTitle(); EXPECT_EQ(expected_title, actual_title); } @@ -650,7 +650,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, PostMessage) { RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>( test_embedder()->web_contents()->GetRenderViewHost()); { - const string16 expected_title = ASCIIToUTF16("main guest"); + const base::string16 expected_title = ASCIIToUTF16("main guest"); content::TitleWatcher title_watcher(test_embedder()->web_contents(), expected_title); @@ -661,7 +661,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, PostMessage) { // The title will be updated to "main guest" at the last stage of the // process described above. - string16 actual_title = title_watcher.WaitAndGetTitle(); + base::string16 actual_title = title_watcher.WaitAndGetTitle(); EXPECT_EQ(expected_title, actual_title); } } @@ -678,7 +678,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, DISABLED_PostMessageToIFrame) { RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>( test_embedder()->web_contents()->GetRenderViewHost()); { - const string16 expected_title = ASCIIToUTF16("main guest"); + const base::string16 expected_title = ASCIIToUTF16("main guest"); content::TitleWatcher title_watcher(test_embedder()->web_contents(), expected_title); @@ -687,7 +687,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, DISABLED_PostMessageToIFrame) { // The title will be updated to "main guest" at the last stage of the // process described above. - string16 actual_title = title_watcher.WaitAndGetTitle(); + base::string16 actual_title = title_watcher.WaitAndGetTitle(); EXPECT_EQ(expected_title, actual_title); } { @@ -703,7 +703,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, DISABLED_PostMessageToIFrame) { base::StringPrintf( "CreateChildFrame('%s');", test_url.spec().c_str())); - string16 actual_title = ready_watcher.WaitAndGetTitle(); + base::string16 actual_title = ready_watcher.WaitAndGetTitle(); EXPECT_EQ(ASCIIToUTF16("ready"), actual_title); content::TitleWatcher iframe_watcher(test_embedder()->web_contents(), diff --git a/content/browser/browser_plugin/test_browser_plugin_guest_delegate.cc b/content/browser/browser_plugin/test_browser_plugin_guest_delegate.cc index dc2db35..59ae635 100644 --- a/content/browser/browser_plugin/test_browser_plugin_guest_delegate.cc +++ b/content/browser/browser_plugin/test_browser_plugin_guest_delegate.cc @@ -20,9 +20,9 @@ void TestBrowserPluginGuestDelegate::ResetStates() { void TestBrowserPluginGuestDelegate::AddMessageToConsole( int32 level, - const string16& message, + const base::string16& message, int32 line_no, - const string16& source_id) { + const base::string16& source_id) { } void TestBrowserPluginGuestDelegate::Close() { diff --git a/content/browser/browser_plugin/test_browser_plugin_guest_delegate.h b/content/browser/browser_plugin/test_browser_plugin_guest_delegate.h index 910ff9f..4bfae4c 100644 --- a/content/browser/browser_plugin/test_browser_plugin_guest_delegate.h +++ b/content/browser/browser_plugin/test_browser_plugin_guest_delegate.h @@ -22,9 +22,9 @@ class TestBrowserPluginGuestDelegate : public BrowserPluginGuestDelegate { private: // Overridden from BrowserPluginGuestDelegate: virtual void AddMessageToConsole(int32 level, - const string16& message, + const base::string16& message, int32 line_no, - const string16& source_id) OVERRIDE; + const base::string16& source_id) OVERRIDE; virtual void Close() OVERRIDE; virtual void GuestProcessGone(base::TerminationStatus status) OVERRIDE; virtual bool HandleKeyboardEvent( diff --git a/content/browser/devtools/renderer_overrides_handler.cc b/content/browser/devtools/renderer_overrides_handler.cc index cf3224d..28a09fc 100644 --- a/content/browser/devtools/renderer_overrides_handler.cc +++ b/content/browser/devtools/renderer_overrides_handler.cc @@ -293,8 +293,8 @@ RendererOverridesHandler::PageHandleJavaScriptDialog( bool accept; if (!params || !params->GetBoolean(paramAccept, &accept)) return command->InvalidParamResponse(paramAccept); - string16 prompt_override; - string16* prompt_override_ptr = &prompt_override; + base::string16 prompt_override; + base::string16* prompt_override_ptr = &prompt_override; if (!params || !params->GetString( devtools::Page::handleJavaScriptDialog::kParamPromptText, prompt_override_ptr)) { diff --git a/content/browser/devtools/worker_devtools_manager.cc b/content/browser/devtools/worker_devtools_manager.cc index f08523b..f060881 100644 --- a/content/browser/devtools/worker_devtools_manager.cc +++ b/content/browser/devtools/worker_devtools_manager.cc @@ -52,13 +52,15 @@ base::LazyInstance<AgentHosts>::Leaky g_orphan_map = LAZY_INSTANCE_INITIALIZER; } // namespace struct WorkerDevToolsManager::TerminatedInspectedWorker { - TerminatedInspectedWorker(WorkerId id, const GURL& url, const string16& name) + TerminatedInspectedWorker(WorkerId id, + const GURL& url, + const base::string16& name) : old_worker_id(id), worker_url(url), worker_name(name) {} WorkerId old_worker_id; GURL worker_url; - string16 worker_name; + base::string16 worker_name; }; @@ -202,7 +204,7 @@ class WorkerDevToolsManager::DetachedClientHosts { struct WorkerDevToolsManager::InspectedWorker { InspectedWorker(WorkerProcessHost* host, int route_id, const GURL& url, - const string16& name) + const base::string16& name) : host(host), route_id(route_id), worker_url(url), @@ -210,7 +212,7 @@ struct WorkerDevToolsManager::InspectedWorker { WorkerProcessHost* const host; int const route_id; GURL worker_url; - string16 worker_name; + base::string16 worker_name; }; // static diff --git a/content/browser/dom_storage/dom_storage_message_filter.cc b/content/browser/dom_storage/dom_storage_message_filter.cc index 3ab972c..fbc3880 100644 --- a/content/browser/dom_storage/dom_storage_message_filter.cc +++ b/content/browser/dom_storage/dom_storage_message_filter.cc @@ -116,8 +116,8 @@ void DOMStorageMessageFilter::OnLoadStorageArea(int connection_id, } void DOMStorageMessageFilter::OnSetItem( - int connection_id, const string16& key, - const string16& value, const GURL& page_url) { + int connection_id, const base::string16& key, + const base::string16& value, const GURL& page_url) { DCHECK(!BrowserThread::CurrentlyOn(BrowserThread::IO)); DCHECK_EQ(0, connection_dispatching_message_for_); base::AutoReset<int> auto_reset(&connection_dispatching_message_for_, @@ -129,20 +129,20 @@ void DOMStorageMessageFilter::OnSetItem( } void DOMStorageMessageFilter::OnLogGetItem( - int connection_id, const string16& key, + int connection_id, const base::string16& key, const base::NullableString16& value) { DCHECK(!BrowserThread::CurrentlyOn(BrowserThread::IO)); host_->LogGetAreaItem(connection_id, key, value); } void DOMStorageMessageFilter::OnRemoveItem( - int connection_id, const string16& key, + int connection_id, const base::string16& key, const GURL& page_url) { DCHECK(!BrowserThread::CurrentlyOn(BrowserThread::IO)); DCHECK_EQ(0, connection_dispatching_message_for_); base::AutoReset<int> auto_reset(&connection_dispatching_message_for_, connection_id); - string16 not_used; + base::string16 not_used; host_->RemoveAreaItem(connection_id, key, page_url, ¬_used); Send(new DOMStorageMsg_AsyncOperationComplete(true)); } @@ -163,8 +163,8 @@ void DOMStorageMessageFilter::OnFlushMessages() { void DOMStorageMessageFilter::OnDOMStorageItemSet( const DOMStorageArea* area, - const string16& key, - const string16& new_value, + const base::string16& key, + const base::string16& new_value, const base::NullableString16& old_value, const GURL& page_url) { SendDOMStorageEvent(area, page_url, @@ -175,8 +175,8 @@ void DOMStorageMessageFilter::OnDOMStorageItemSet( void DOMStorageMessageFilter::OnDOMStorageItemRemoved( const DOMStorageArea* area, - const string16& key, - const string16& old_value, + const base::string16& key, + const base::string16& old_value, const GURL& page_url) { SendDOMStorageEvent(area, page_url, base::NullableString16(key, false), diff --git a/content/browser/dom_storage/dom_storage_message_filter.h b/content/browser/dom_storage/dom_storage_message_filter.h index a2670ef..3c82418 100644 --- a/content/browser/dom_storage/dom_storage_message_filter.h +++ b/content/browser/dom_storage/dom_storage_message_filter.h @@ -53,11 +53,11 @@ class DOMStorageMessageFilter void OnCloseStorageArea(int connection_id); void OnLoadStorageArea(int connection_id, DOMStorageValuesMap* map, bool* send_log_get_messages); - void OnSetItem(int connection_id, const string16& key, - const string16& value, const GURL& page_url); - void OnLogGetItem(int connection_id, const string16& key, + void OnSetItem(int connection_id, const base::string16& key, + const base::string16& value, const GURL& page_url); + void OnLogGetItem(int connection_id, const base::string16& key, const base::NullableString16& value); - void OnRemoveItem(int connection_id, const string16& key, + void OnRemoveItem(int connection_id, const base::string16& key, const GURL& page_url); void OnClear(int connection_id, const GURL& page_url); void OnFlushMessages(); @@ -66,14 +66,14 @@ class DOMStorageMessageFilter // sends events back to our renderer process. virtual void OnDOMStorageItemSet( const DOMStorageArea* area, - const string16& key, - const string16& new_value, + const base::string16& key, + const base::string16& new_value, const base::NullableString16& old_value, const GURL& page_url) OVERRIDE; virtual void OnDOMStorageItemRemoved( const DOMStorageArea* area, - const string16& key, - const string16& old_value, + const base::string16& key, + const base::string16& old_value, const GURL& page_url) OVERRIDE; virtual void OnDOMStorageAreaCleared( const DOMStorageArea* area, diff --git a/content/browser/download/download_manager_impl_unittest.cc b/content/browser/download/download_manager_impl_unittest.cc index aecded1..3afc41a 100644 --- a/content/browser/download/download_manager_impl_unittest.cc +++ b/content/browser/download/download_manager_impl_unittest.cc @@ -120,7 +120,7 @@ class MockDownloadItemImpl : public DownloadItemImpl { MOCK_CONST_METHOD0(CurrentSpeed, int64()); MOCK_CONST_METHOD0(PercentComplete, int()); MOCK_CONST_METHOD0(AllDataSaved, bool()); - MOCK_CONST_METHOD1(MatchesQuery, bool(const string16& query)); + MOCK_CONST_METHOD1(MatchesQuery, bool(const base::string16& query)); MOCK_CONST_METHOD0(IsDone, bool()); MOCK_CONST_METHOD0(GetFullPath, const base::FilePath&()); MOCK_CONST_METHOD0(GetTargetFilePath, const base::FilePath&()); diff --git a/content/browser/download/drag_download_util.cc b/content/browser/download/drag_download_util.cc index 41bff06..0850c3b 100644 --- a/content/browser/download/drag_download_util.cc +++ b/content/browser/download/drag_download_util.cc @@ -23,18 +23,18 @@ using net::FileStream; namespace content { -bool ParseDownloadMetadata(const string16& metadata, - string16* mime_type, +bool ParseDownloadMetadata(const base::string16& metadata, + base::string16* mime_type, base::FilePath* file_name, GURL* url) { const char16 separator = L':'; size_t mime_type_end_pos = metadata.find(separator); - if (mime_type_end_pos == string16::npos) + if (mime_type_end_pos == base::string16::npos) return false; size_t file_name_end_pos = metadata.find(separator, mime_type_end_pos + 1); - if (file_name_end_pos == string16::npos) + if (file_name_end_pos == base::string16::npos) return false; GURL parsed_url = GURL(metadata.substr(file_name_end_pos + 1)); @@ -44,7 +44,7 @@ bool ParseDownloadMetadata(const string16& metadata, if (mime_type) *mime_type = metadata.substr(0, mime_type_end_pos); if (file_name) { - string16 file_name_str = metadata.substr( + base::string16 file_name_str = metadata.substr( mime_type_end_pos + 1, file_name_end_pos - mime_type_end_pos - 1); #if defined(OS_WIN) *file_name = base::FilePath(file_name_str); @@ -70,7 +70,7 @@ FileStream* CreateFileStreamForDrop(base::FilePath* file_path, new_file_path = *file_path; } else { #if defined(OS_WIN) - string16 suffix = ASCIIToUTF16("-") + base::IntToString16(seq); + base::string16 suffix = ASCIIToUTF16("-") + base::IntToString16(seq); #else std::string suffix = std::string("-") + base::IntToString(seq); #endif diff --git a/content/browser/download/drag_download_util.h b/content/browser/download/drag_download_util.h index 8b58f48..ca266efa 100644 --- a/content/browser/download/drag_download_util.h +++ b/content/browser/download/drag_download_util.h @@ -32,8 +32,8 @@ namespace content { // appropriately. // For example, we can have // text/plain:example.txt:http://example.com/example.txt -bool ParseDownloadMetadata(const string16& metadata, - string16* mime_type, +bool ParseDownloadMetadata(const base::string16& metadata, + base::string16* mime_type, base::FilePath* file_name, GURL* url); diff --git a/content/browser/download/save_package.h b/content/browser/download/save_package.h index 939002e..1ab429e 100644 --- a/content/browser/download/save_package.h +++ b/content/browser/download/save_package.h @@ -279,7 +279,7 @@ class CONTENT_EXPORT SavePackage base::FilePath saved_main_directory_path_; // The title of the page the user wants to save. - string16 title_; + base::string16 title_; // Used to calculate package download speed (in files per second). base::TimeTicks start_tick_; diff --git a/content/browser/download/save_package_unittest.cc b/content/browser/download/save_package_unittest.cc index c0aa3f8..3045c42 100644 --- a/content/browser/download/save_package_unittest.cc +++ b/content/browser/download/save_package_unittest.cc @@ -346,7 +346,7 @@ TEST_F(SavePackageTest, MAYBE_TestEnsureMimeExtension) { static const struct SuggestedSaveNameTestCase { const char* page_url; - const string16 page_title; + const base::string16 page_title; const base::FilePath::CharType* expected_name; bool ensure_html_extension; } kSuggestedSaveNames[] = { diff --git a/content/browser/frame_host/interstitial_page_impl.cc b/content/browser/frame_host/interstitial_page_impl.cc index 8b249e9..27cff1f 100644 --- a/content/browser/frame_host/interstitial_page_impl.cc +++ b/content/browser/frame_host/interstitial_page_impl.cc @@ -431,7 +431,7 @@ void InterstitialPageImpl::DidNavigate( void InterstitialPageImpl::UpdateTitle( RenderViewHost* render_view_host, int32 page_id, - const string16& title, + const base::string16& title, base::i18n::TextDirection title_direction) { if (!enabled()) return; @@ -545,7 +545,7 @@ WebContentsView* InterstitialPageImpl::CreateWebContentsView() { int32 max_page_id = web_contents()-> GetMaxPageIDForSiteInstance(render_view_host_->GetSiteInstance()); - render_view_host_->CreateRenderView(string16(), + render_view_host_->CreateRenderView(base::string16(), MSG_ROUTING_NONE, max_page_id); controller_->delegate()->RenderViewForInterstitialPageCreated( diff --git a/content/browser/frame_host/interstitial_page_impl.h b/content/browser/frame_host/interstitial_page_impl.h index 47a127e..07695b2 100644 --- a/content/browser/frame_host/interstitial_page_impl.h +++ b/content/browser/frame_host/interstitial_page_impl.h @@ -112,7 +112,7 @@ class CONTENT_EXPORT InterstitialPageImpl const ViewHostMsg_FrameNavigate_Params& params) OVERRIDE; virtual void UpdateTitle(RenderViewHost* render_view_host, int32 page_id, - const string16& title, + const base::string16& title, base::i18n::TextDirection title_direction) OVERRIDE; virtual RendererPreferences GetRendererPrefs( BrowserContext* browser_context) const OVERRIDE; @@ -246,7 +246,7 @@ class CONTENT_EXPORT InterstitialPageImpl // The original title of the contents that should be reverted to when the // interstitial is hidden. - string16 original_web_contents_title_; + base::string16 original_web_contents_title_; // Our RenderViewHostViewDelegate, necessary for accelerators to work. scoped_ptr<InterstitialPageRVHDelegateView> rvh_delegate_view_; diff --git a/content/browser/frame_host/navigation_controller_impl.cc b/content/browser/frame_host/navigation_controller_impl.cc index 0c6f803..a49a932 100644 --- a/content/browser/frame_host/navigation_controller_impl.cc +++ b/content/browser/frame_host/navigation_controller_impl.cc @@ -163,7 +163,7 @@ NavigationEntry* NavigationController::CreateNavigationEntry( -1, loaded_url, referrer, - string16(), + base::string16(), transition, is_renderer_initiated); entry->SetVirtualURL(url); @@ -354,7 +354,7 @@ void NavigationControllerImpl::ReloadInternal(bool check_for_repost, // meanwhile, so we need to revert to the default title upon reload and // invalidate the previously cached title (SetTitle will do both). // See Chromium issue 96041. - pending_entry_->SetTitle(string16()); + pending_entry_->SetTitle(base::string16()); pending_entry_->SetTransitionType(PAGE_TRANSITION_RELOAD); } diff --git a/content/browser/frame_host/navigation_controller_impl_unittest.cc b/content/browser/frame_host/navigation_controller_impl_unittest.cc index 1f31e11..30475ec 100644 --- a/content/browser/frame_host/navigation_controller_impl_unittest.cc +++ b/content/browser/frame_host/navigation_controller_impl_unittest.cc @@ -921,7 +921,7 @@ TEST_F(NavigationControllerTest, LoadURL_AbortDoesntCancelPending) { params.frame_id = 1; params.is_main_frame = true; params.error_code = net::ERR_ABORTED; - params.error_description = string16(); + params.error_description = base::string16(); params.url = kNewURL; params.showing_repost_interstitial = false; test_rvh()->OnMessageReceived( @@ -999,7 +999,7 @@ TEST_F(NavigationControllerTest, LoadURL_RedirectAbortDoesntShowPendingURL) { params.frame_id = 1; params.is_main_frame = true; params.error_code = net::ERR_ABORTED; - params.error_description = string16(); + params.error_description = base::string16(); params.url = kRedirectURL; params.showing_repost_interstitial = false; test_rvh()->OnMessageReceived( @@ -2342,7 +2342,7 @@ TEST_F(NavigationControllerTest, RestoreNavigateAfterFailure) { fail_load_params.frame_id = 1; fail_load_params.is_main_frame = true; fail_load_params.error_code = net::ERR_ABORTED; - fail_load_params.error_description = string16(); + fail_load_params.error_description = base::string16(); fail_load_params.url = url; fail_load_params.showing_repost_interstitial = false; rvh->OnMessageReceived( @@ -2897,7 +2897,7 @@ TEST_F(NavigationControllerTest, CloneAndGoBack) { NavigationControllerImpl& controller = controller_impl(); const GURL url1("http://foo1"); const GURL url2("http://foo2"); - const string16 title(ASCIIToUTF16("Title")); + const base::string16 title(ASCIIToUTF16("Title")); NavigateAndCommit(url1); controller.GetVisibleEntry()->SetTitle(title); @@ -2922,7 +2922,7 @@ TEST_F(NavigationControllerTest, CloneAndReload) { NavigationControllerImpl& controller = controller_impl(); const GURL url1("http://foo1"); const GURL url2("http://foo2"); - const string16 title(ASCIIToUTF16("Title")); + const base::string16 title(ASCIIToUTF16("Title")); NavigateAndCommit(url1); controller.GetVisibleEntry()->SetTitle(title); diff --git a/content/browser/frame_host/navigation_entry_impl.cc b/content/browser/frame_host/navigation_entry_impl.cc index a9b37cc..d5d6fc2 100644 --- a/content/browser/frame_host/navigation_entry_impl.cc +++ b/content/browser/frame_host/navigation_entry_impl.cc @@ -60,7 +60,7 @@ NavigationEntryImpl::NavigationEntryImpl(SiteInstanceImpl* instance, int page_id, const GURL& url, const Referrer& referrer, - const string16& title, + const base::string16& title, PageTransition transition_type, bool is_renderer_initiated) : unique_id_(GetUniqueIDInConstructor()), @@ -130,12 +130,12 @@ const GURL& NavigationEntryImpl::GetVirtualURL() const { return virtual_url_.is_empty() ? url_ : virtual_url_; } -void NavigationEntryImpl::SetTitle(const string16& title) { +void NavigationEntryImpl::SetTitle(const base::string16& title) { title_ = title; cached_display_title_.clear(); } -const string16& NavigationEntryImpl::GetTitle() const { +const base::string16& NavigationEntryImpl::GetTitle() const { return title_; } @@ -166,7 +166,7 @@ void NavigationEntryImpl::SetBindings(int bindings) { bindings_ = bindings; } -const string16& NavigationEntryImpl::GetTitleForDisplay( +const base::string16& NavigationEntryImpl::GetTitleForDisplay( const std::string& languages) const { // Most pages have real titles. Don't even bother caching anything if this is // the case. @@ -179,7 +179,7 @@ const string16& NavigationEntryImpl::GetTitleForDisplay( return cached_display_title_; // Use the virtual URL first if any, and fall back on using the real URL. - string16 title; + base::string16 title; if (!virtual_url_.is_empty()) { title = net::FormatUrl(virtual_url_, languages); } else if (!url_.is_empty()) { @@ -188,8 +188,8 @@ const string16& NavigationEntryImpl::GetTitleForDisplay( // For file:// URLs use the filename as the title, not the full path. if (url_.SchemeIsFile()) { - string16::size_type slashpos = title.rfind('/'); - if (slashpos != string16::npos) + base::string16::size_type slashpos = title.rfind('/'); + if (slashpos != base::string16::npos) title = title.substr(slashpos + 1); } @@ -306,13 +306,14 @@ const std::string& NavigationEntryImpl::GetFrameToNavigate() const { } void NavigationEntryImpl::SetExtraData(const std::string& key, - const string16& data) { + const base::string16& data) { extra_data_[key] = data; } bool NavigationEntryImpl::GetExtraData(const std::string& key, - string16* data) const { - std::map<std::string, string16>::const_iterator iter = extra_data_.find(key); + base::string16* data) const { + std::map<std::string, base::string16>::const_iterator iter = + extra_data_.find(key); if (iter == extra_data_.end()) return false; *data = iter->second; diff --git a/content/browser/frame_host/navigation_entry_impl.h b/content/browser/frame_host/navigation_entry_impl.h index c7f4f5f..8a51888 100644 --- a/content/browser/frame_host/navigation_entry_impl.h +++ b/content/browser/frame_host/navigation_entry_impl.h @@ -29,7 +29,7 @@ class CONTENT_EXPORT NavigationEntryImpl int page_id, const GURL& url, const Referrer& referrer, - const string16& title, + const base::string16& title, PageTransition transition_type, bool is_renderer_initiated); virtual ~NavigationEntryImpl(); @@ -45,13 +45,13 @@ class CONTENT_EXPORT NavigationEntryImpl virtual const Referrer& GetReferrer() const OVERRIDE; virtual void SetVirtualURL(const GURL& url) OVERRIDE; virtual const GURL& GetVirtualURL() const OVERRIDE; - virtual void SetTitle(const string16& title) OVERRIDE; - virtual const string16& GetTitle() const OVERRIDE; + virtual void SetTitle(const base::string16& title) OVERRIDE; + virtual const base::string16& GetTitle() const OVERRIDE; virtual void SetPageState(const PageState& state) OVERRIDE; virtual const PageState& GetPageState() const OVERRIDE; virtual void SetPageID(int page_id) OVERRIDE; virtual int32 GetPageID() const OVERRIDE; - virtual const string16& GetTitleForDisplay( + virtual const base::string16& GetTitleForDisplay( const std::string& languages) const OVERRIDE; virtual bool IsViewSourceMode() const OVERRIDE; virtual void SetTransitionType(PageTransition transition_type) OVERRIDE; @@ -80,9 +80,9 @@ class CONTENT_EXPORT NavigationEntryImpl virtual void SetFrameToNavigate(const std::string& frame_name) OVERRIDE; virtual const std::string& GetFrameToNavigate() const OVERRIDE; virtual void SetExtraData(const std::string& key, - const string16& data) OVERRIDE; + const base::string16& data) OVERRIDE; virtual bool GetExtraData(const std::string& key, - string16* data) const OVERRIDE; + base::string16* data) const OVERRIDE; virtual void ClearExtraData(const std::string& key) OVERRIDE; virtual void SetHttpStatusCode(int http_status_code) OVERRIDE; virtual int GetHttpStatusCode() const OVERRIDE; @@ -243,7 +243,7 @@ class CONTENT_EXPORT NavigationEntryImpl Referrer referrer_; GURL virtual_url_; bool update_virtual_url_with_url_; - string16 title_; + base::string16 title_; FaviconStatus favicon_; PageState page_state_; int32 page_id_; @@ -290,7 +290,7 @@ class CONTENT_EXPORT NavigationEntryImpl // us from having to do URL formatting on the URL every time the title is // displayed. When the URL, virtual URL, or title is set, this should be // cleared to force a refresh. - mutable string16 cached_display_title_; + mutable base::string16 cached_display_title_; // In case a navigation is transferred to a new RVH but the request has // been generated in the renderer already, this identifies the old request so @@ -342,7 +342,7 @@ class CONTENT_EXPORT NavigationEntryImpl // Used to store extra data to support browser features. This member is not // persisted, unless specific data is taken out/put back in at save/restore // time (see TabNavigation for an example of this). - std::map<std::string, string16> extra_data_; + std::map<std::string, base::string16> extra_data_; // Copy and assignment is explicitly allowed for this class. }; diff --git a/content/browser/frame_host/navigation_entry_impl_unittest.cc b/content/browser/frame_host/navigation_entry_impl_unittest.cc index cb742e4..488106f 100644 --- a/content/browser/frame_host/navigation_entry_impl_unittest.cc +++ b/content/browser/frame_host/navigation_entry_impl_unittest.cc @@ -136,7 +136,7 @@ TEST_F(NavigationEntryTest, NavigationEntryAccessors) { EXPECT_EQ(GURL("from2"), entry2_->GetReferrer().url); // Title - EXPECT_EQ(string16(), entry1_->GetTitle()); + EXPECT_EQ(base::string16(), entry1_->GetTitle()); EXPECT_EQ(ASCIIToUTF16("title"), entry2_->GetTitle()); entry2_->SetTitle(ASCIIToUTF16("title2")); EXPECT_EQ(ASCIIToUTF16("title2"), entry2_->GetTitle()); @@ -219,8 +219,8 @@ TEST_F(NavigationEntryTest, NavigationEntryTimestamps) { // Test extra data stored in the navigation entry. TEST_F(NavigationEntryTest, NavigationEntryExtraData) { - string16 test_data = ASCIIToUTF16("my search terms"); - string16 output; + base::string16 test_data = ASCIIToUTF16("my search terms"); + base::string16 output; entry1_->SetExtraData("search_terms", test_data); EXPECT_FALSE(entry1_->GetExtraData("non_existent_key", &output)); @@ -233,7 +233,7 @@ TEST_F(NavigationEntryTest, NavigationEntryExtraData) { EXPECT_FALSE(entry1_->GetExtraData("search_terms", &output)); EXPECT_EQ(test_data, output); // Using an empty string shows that the data is not present in the map. - string16 output2; + base::string16 output2; EXPECT_FALSE(entry1_->GetExtraData("search_terms", &output2)); EXPECT_EQ(ASCIIToUTF16(""), output2); } 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 9a4b004..69d977b 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 string16 ntp_title = ASCIIToUTF16("NTP Title"); + const base::string16 ntp_title = 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 string16 dest_title = ASCIIToUTF16("Google"); + const base::string16 dest_title = ASCIIToUTF16("Google"); EXPECT_TRUE(dest_rvh->OnMessageReceived( ViewHostMsg_UpdateTitle(rvh()->GetRoutingID(), 101, dest_title, direction))); @@ -308,9 +308,9 @@ TEST_F(RenderFrameHostManagerTest, FilterMessagesWhileSwappedOut) { MockRenderProcessHost* ntp_process_host = static_cast<MockRenderProcessHost*>(ntp_rvh->GetProcess()); ntp_process_host->sink().ClearMessages(); - const string16 msg = ASCIIToUTF16("Message"); + const base::string16 msg = ASCIIToUTF16("Message"); bool result = false; - string16 unused; + base::string16 unused; ViewHostMsg_RunBeforeUnloadConfirm before_unload_msg( rvh()->GetRoutingID(), kChromeURL, msg, false, &result, &unused); // Enable pumping for check in BrowserMessageFilter::CheckCanDispatchOnUI. @@ -604,7 +604,7 @@ TEST_F(RenderFrameHostManagerTest, Navigate) { const GURL kUrl1("http://www.google.com/"); NavigationEntryImpl entry1( NULL /* instance */, -1 /* page_id */, kUrl1, Referrer(), - string16() /* title */, PAGE_TRANSITION_TYPED, + base::string16() /* title */, PAGE_TRANSITION_TYPED, false /* is_renderer_init */); host = manager.Navigate(entry1); @@ -626,7 +626,7 @@ TEST_F(RenderFrameHostManagerTest, Navigate) { NavigationEntryImpl entry2( NULL /* instance */, -1 /* page_id */, kUrl2, Referrer(kUrl1, blink::WebReferrerPolicyDefault), - string16() /* title */, PAGE_TRANSITION_LINK, + base::string16() /* title */, PAGE_TRANSITION_LINK, true /* is_renderer_init */); host = manager.Navigate(entry2); @@ -646,7 +646,7 @@ TEST_F(RenderFrameHostManagerTest, Navigate) { NavigationEntryImpl entry3( NULL /* instance */, -1 /* page_id */, kUrl3, Referrer(kUrl2, blink::WebReferrerPolicyDefault), - string16() /* title */, PAGE_TRANSITION_LINK, + base::string16() /* title */, PAGE_TRANSITION_LINK, false /* is_renderer_init */); host = manager.Navigate(entry3); @@ -693,7 +693,7 @@ TEST_F(RenderFrameHostManagerTest, NavigateWithEarlyReNavigation) { // 1) The first navigation. -------------------------- const GURL kUrl1("http://www.google.com/"); NavigationEntryImpl entry1(NULL /* instance */, -1 /* page_id */, kUrl1, - Referrer(), string16() /* title */, + Referrer(), base::string16() /* title */, PAGE_TRANSITION_TYPED, false /* is_renderer_init */); RenderViewHost* host = manager.Navigate(entry1); @@ -721,7 +721,7 @@ TEST_F(RenderFrameHostManagerTest, NavigateWithEarlyReNavigation) { const GURL kUrl2("http://www.example.com"); NavigationEntryImpl entry2( NULL /* instance */, -1 /* page_id */, kUrl2, Referrer(), - string16() /* title */, PAGE_TRANSITION_TYPED, + base::string16() /* title */, PAGE_TRANSITION_TYPED, false /* is_renderer_init */); RenderViewHostImpl* host2 = static_cast<RenderViewHostImpl*>( manager.Navigate(entry2)); @@ -772,7 +772,7 @@ TEST_F(RenderFrameHostManagerTest, NavigateWithEarlyReNavigation) { // 3) Cross-site navigate to next site before 2) has committed. -------------- const GURL kUrl3("http://webkit.org/"); NavigationEntryImpl entry3(NULL /* instance */, -1 /* page_id */, kUrl3, - Referrer(), string16() /* title */, + Referrer(), base::string16() /* title */, PAGE_TRANSITION_TYPED, false /* is_renderer_init */); test_process_host->sink().ClearMessages(); @@ -836,7 +836,7 @@ TEST_F(RenderFrameHostManagerTest, WebUI) { const GURL kUrl("chrome://foo"); NavigationEntryImpl entry(NULL /* instance */, -1 /* page_id */, kUrl, - Referrer(), string16() /* title */, + Referrer(), base::string16() /* title */, PAGE_TRANSITION_TYPED, false /* is_renderer_init */); RenderViewHost* host = manager.Navigate(entry); @@ -880,12 +880,12 @@ TEST_F(RenderFrameHostManagerTest, WebUIInNewTab) { manager1.Init( browser_context(), blank_instance, MSG_ROUTING_NONE, MSG_ROUTING_NONE); // Test the case that new RVH is considered live. - manager1.current_host()->CreateRenderView(string16(), -1, -1); + manager1.current_host()->CreateRenderView(base::string16(), -1, -1); // Navigate to a WebUI page. const GURL kUrl1("chrome://foo"); NavigationEntryImpl entry1(NULL /* instance */, -1 /* page_id */, kUrl1, - Referrer(), string16() /* title */, + Referrer(), base::string16() /* title */, PAGE_TRANSITION_TYPED, false /* is_renderer_init */); RenderViewHost* host1 = manager1.Navigate(entry1); @@ -911,11 +911,11 @@ TEST_F(RenderFrameHostManagerTest, WebUIInNewTab) { browser_context(), webui_instance, MSG_ROUTING_NONE, MSG_ROUTING_NONE); // Make sure the new RVH is considered live. This is usually done in // RenderWidgetHost::Init when opening a new tab from a link. - manager2.current_host()->CreateRenderView(string16(), -1, -1); + manager2.current_host()->CreateRenderView(base::string16(), -1, -1); const GURL kUrl2("chrome://foo/bar"); NavigationEntryImpl entry2(NULL /* instance */, -1 /* page_id */, kUrl2, - Referrer(), string16() /* title */, + Referrer(), base::string16() /* title */, PAGE_TRANSITION_LINK, true /* is_renderer_init */); RenderViewHost* host2 = manager2.Navigate(entry2); @@ -1107,7 +1107,7 @@ TEST_F(RenderFrameHostManagerTest, CleanUpSwappedOutRVHOnProcessCrash) { contents()->SetOpener(opener1.get()); // Make sure the new opener RVH is considered live. - opener1_manager->current_host()->CreateRenderView(string16(), -1, -1); + opener1_manager->current_host()->CreateRenderView(base::string16(), -1, -1); // Use a cross-process navigation in the opener to swap out the old RVH. EXPECT_FALSE(opener1_manager->GetSwappedOutRenderViewHost( @@ -1202,7 +1202,7 @@ TEST_F(RenderFrameHostManagerTest, NoSwapOnGuestNavigations) { const GURL kUrl1("http://www.google.com/"); NavigationEntryImpl entry1( NULL /* instance */, -1 /* page_id */, kUrl1, Referrer(), - string16() /* title */, PAGE_TRANSITION_TYPED, + base::string16() /* title */, PAGE_TRANSITION_TYPED, false /* is_renderer_init */); host = manager.Navigate(entry1); @@ -1225,7 +1225,7 @@ TEST_F(RenderFrameHostManagerTest, NoSwapOnGuestNavigations) { NavigationEntryImpl entry2( NULL /* instance */, -1 /* page_id */, kUrl2, Referrer(kUrl1, blink::WebReferrerPolicyDefault), - string16() /* title */, PAGE_TRANSITION_LINK, + base::string16() /* title */, PAGE_TRANSITION_LINK, true /* is_renderer_init */); host = manager.Navigate(entry2); @@ -1264,7 +1264,7 @@ TEST_F(RenderFrameHostManagerTest, NavigateWithEarlyClose) { // 1) The first navigation. -------------------------- const GURL kUrl1("http://www.google.com/"); NavigationEntryImpl entry1(NULL /* instance */, -1 /* page_id */, kUrl1, - Referrer(), string16() /* title */, + Referrer(), base::string16() /* title */, PAGE_TRANSITION_TYPED, false /* is_renderer_init */); RenderViewHost* host = manager.Navigate(entry1); @@ -1291,7 +1291,7 @@ TEST_F(RenderFrameHostManagerTest, NavigateWithEarlyClose) { const GURL kUrl2("http://www.example.com"); NavigationEntryImpl entry2( NULL /* instance */, -1 /* page_id */, kUrl2, Referrer(), - string16() /* title */, PAGE_TRANSITION_TYPED, + base::string16() /* title */, PAGE_TRANSITION_TYPED, false /* is_renderer_init */); RenderViewHostImpl* host2 = static_cast<RenderViewHostImpl*>( manager.Navigate(entry2)); diff --git a/content/browser/gamepad/gamepad_platform_data_fetcher_linux.cc b/content/browser/gamepad/gamepad_platform_data_fetcher_linux.cc index ba048ae..148ec49 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); TruncateUTF8ToByteSize(id, WebGamepad::idLengthCap - 1, &id); - string16 tmp16 = UTF8ToUTF16(id); + base::string16 tmp16 = UTF8ToUTF16(id); memset(pad.id, 0, sizeof(pad.id)); tmp16.copy(pad.id, arraysize(pad.id) - 1); diff --git a/content/browser/geolocation/fake_access_token_store.cc b/content/browser/geolocation/fake_access_token_store.cc index 9f9f61b..0e5fe40 100644 --- a/content/browser/geolocation/fake_access_token_store.cc +++ b/content/browser/geolocation/fake_access_token_store.cc @@ -45,7 +45,7 @@ void FakeAccessTokenStore::DefaultLoadAccessTokens( } void FakeAccessTokenStore::DefaultSaveAccessToken( - const GURL& server_url, const string16& access_token) { + const GURL& server_url, const base::string16& access_token) { DCHECK(server_url.is_valid()); access_token_set_[server_url] = access_token; } diff --git a/content/browser/geolocation/fake_access_token_store.h b/content/browser/geolocation/fake_access_token_store.h index 4d0867b..30a0185 100644 --- a/content/browser/geolocation/fake_access_token_store.h +++ b/content/browser/geolocation/fake_access_token_store.h @@ -23,12 +23,13 @@ class FakeAccessTokenStore : public AccessTokenStore { MOCK_METHOD1(LoadAccessTokens, void(const LoadAccessTokensCallbackType& callback)); MOCK_METHOD2(SaveAccessToken, - void(const GURL& server_url, const string16& access_token)); + void(const GURL& server_url, + const base::string16& access_token)); void DefaultLoadAccessTokens(const LoadAccessTokensCallbackType& callback); void DefaultSaveAccessToken(const GURL& server_url, - const string16& access_token); + const base::string16& access_token); AccessTokenSet access_token_set_; LoadAccessTokensCallbackType callback_; diff --git a/content/browser/geolocation/location_arbitrator_impl.cc b/content/browser/geolocation/location_arbitrator_impl.cc index 37c34ee..b8ed8c4 100644 --- a/content/browser/geolocation/location_arbitrator_impl.cc +++ b/content/browser/geolocation/location_arbitrator_impl.cc @@ -149,7 +149,7 @@ LocationProvider* LocationArbitratorImpl::NewNetworkLocationProvider( AccessTokenStore* access_token_store, net::URLRequestContextGetter* context, const GURL& url, - const string16& access_token) { + const base::string16& access_token) { #if defined(OS_ANDROID) // Android uses its own SystemLocationProvider. return NULL; diff --git a/content/browser/geolocation/location_arbitrator_impl.h b/content/browser/geolocation/location_arbitrator_impl.h index 45910552..e756f5e 100644 --- a/content/browser/geolocation/location_arbitrator_impl.h +++ b/content/browser/geolocation/location_arbitrator_impl.h @@ -57,7 +57,7 @@ class CONTENT_EXPORT LocationArbitratorImpl : public LocationArbitrator { AccessTokenStore* access_token_store, net::URLRequestContextGetter* context, const GURL& url, - const string16& access_token); + const base::string16& access_token); virtual LocationProvider* NewSystemLocationProvider(); virtual base::Time GetTimeNow() const; diff --git a/content/browser/geolocation/location_arbitrator_impl_unittest.cc b/content/browser/geolocation/location_arbitrator_impl_unittest.cc index 02df431..81df7a4 100644 --- a/content/browser/geolocation/location_arbitrator_impl_unittest.cc +++ b/content/browser/geolocation/location_arbitrator_impl_unittest.cc @@ -85,7 +85,7 @@ class TestingLocationArbitrator : public LocationArbitratorImpl { AccessTokenStore* access_token_store, net::URLRequestContextGetter* context, const GURL& url, - const string16& access_token) OVERRIDE { + const base::string16& access_token) OVERRIDE { return new MockLocationProvider(&cell_); } diff --git a/content/browser/geolocation/network_location_provider.cc b/content/browser/geolocation/network_location_provider.cc index 678edb2..efc68a7 100644 --- a/content/browser/geolocation/network_location_provider.cc +++ b/content/browser/geolocation/network_location_provider.cc @@ -27,7 +27,7 @@ bool NetworkLocationProvider::PositionCache::CachePosition( const WifiData& wifi_data, const Geoposition& position) { // Check that we can generate a valid key for the wifi data. - string16 key; + base::string16 key; if (!MakeKey(wifi_data, &key)) { return false; } @@ -57,7 +57,7 @@ bool NetworkLocationProvider::PositionCache::CachePosition( // the cached position if available, NULL otherwise. const Geoposition* NetworkLocationProvider::PositionCache::FindPosition( const WifiData& wifi_data) { - string16 key; + base::string16 key; if (!MakeKey(wifi_data, &key)) { return NULL; } @@ -71,13 +71,13 @@ const Geoposition* NetworkLocationProvider::PositionCache::FindPosition( // static bool NetworkLocationProvider::PositionCache::MakeKey( const WifiData& wifi_data, - string16* key) { + base::string16* key) { // Currently we use only WiFi data and base the key only on the MAC addresses. DCHECK(key); 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 string16 separator(ASCIIToUTF16("|")); + const base::string16 separator(ASCIIToUTF16("|")); for (WifiData::AccessPointDataSet::const_iterator iter = wifi_data.access_point_data.begin(); iter != wifi_data.access_point_data.end(); @@ -96,7 +96,7 @@ LocationProviderBase* NewNetworkLocationProvider( AccessTokenStore* access_token_store, net::URLRequestContextGetter* context, const GURL& url, - const string16& access_token) { + const base::string16& access_token) { return new NetworkLocationProvider( access_token_store, context, url, access_token); } @@ -106,7 +106,7 @@ NetworkLocationProvider::NetworkLocationProvider( AccessTokenStore* access_token_store, net::URLRequestContextGetter* url_context_getter, const GURL& url, - const string16& access_token) + const base::string16& access_token) : access_token_store_(access_token_store), wifi_data_provider_(NULL), wifi_data_update_callback_( @@ -163,7 +163,7 @@ void NetworkLocationProvider::WifiDataUpdateAvailable( void NetworkLocationProvider::LocationResponseAvailable( const Geoposition& position, bool server_error, - const string16& access_token, + const base::string16& access_token, const WifiData& wifi_data) { DCHECK(CalledOnValidThread()); // Record the position and update our cache. diff --git a/content/browser/geolocation/network_location_provider.h b/content/browser/geolocation/network_location_provider.h index d5f3e99..710fd3f 100644 --- a/content/browser/geolocation/network_location_provider.h +++ b/content/browser/geolocation/network_location_provider.h @@ -54,12 +54,12 @@ class NetworkLocationProvider // Makes the key for the map of cached positions, using a set of // data. Returns true if a good key was generated, false otherwise. static bool MakeKey(const WifiData& wifi_data, - string16* key); + base::string16* key); // The cache of positions. This is stored as a map keyed on a string that // represents a set of data, and a list to provide // least-recently-added eviction. - typedef std::map<string16, Geoposition> CacheMap; + typedef std::map<base::string16, Geoposition> CacheMap; CacheMap cache_; typedef std::list<CacheMap::iterator> CacheAgeList; CacheAgeList cache_age_list_; // Oldest first. @@ -68,7 +68,7 @@ class NetworkLocationProvider NetworkLocationProvider(AccessTokenStore* access_token_store, net::URLRequestContextGetter* context, const GURL& url, - const string16& access_token); + const base::string16& access_token); virtual ~NetworkLocationProvider(); // LocationProvider implementation @@ -92,7 +92,7 @@ class NetworkLocationProvider void LocationResponseAvailable(const Geoposition& position, bool server_error, - const string16& access_token, + const base::string16& access_token, const WifiData& wifi_data); scoped_refptr<AccessTokenStore> access_token_store_; @@ -111,7 +111,7 @@ class NetworkLocationProvider // Cached value loaded from the token store or set by a previous server // response, and sent in each subsequent network request. - string16 access_token_; + base::string16 access_token_; // The current best position estimate. Geoposition position_; @@ -138,7 +138,7 @@ CONTENT_EXPORT LocationProviderBase* NewNetworkLocationProvider( AccessTokenStore* access_token_store, net::URLRequestContextGetter* context, const GURL& url, - const string16& access_token); + const base::string16& access_token); } // namespace content diff --git a/content/browser/geolocation/network_location_request.cc b/content/browser/geolocation/network_location_request.cc index 2e269b3..3ed7092 100644 --- a/content/browser/geolocation/network_location_request.cc +++ b/content/browser/geolocation/network_location_request.cc @@ -72,7 +72,7 @@ GURL FormRequestURL(const GURL& url); void FormUploadData(const WifiData& wifi_data, const base::Time& timestamp, - const string16& access_token, + const base::string16& access_token, std::string* upload_data); // Attempts to extract a position from the response. Detects and indicates @@ -83,7 +83,7 @@ void GetLocationFromResponse(bool http_post_result, const base::Time& timestamp, const GURL& server_url, Geoposition* position, - string16* access_token); + base::string16* access_token); // Parses the server response body. Returns true if parsing was successful. // Sets |*position| to the parsed location if a valid fix was received, @@ -91,7 +91,7 @@ void GetLocationFromResponse(bool http_post_result, bool ParseServerResponse(const std::string& response_body, const base::Time& timestamp, Geoposition* position, - string16* access_token); + base::string16* access_token); void AddWifiData(const WifiData& wifi_data, int age_milliseconds, base::DictionaryValue* request); @@ -111,7 +111,7 @@ NetworkLocationRequest::NetworkLocationRequest( NetworkLocationRequest::~NetworkLocationRequest() { } -bool NetworkLocationRequest::MakeRequest(const string16& access_token, +bool NetworkLocationRequest::MakeRequest(const base::string16& access_token, const WifiData& wifi_data, const base::Time& timestamp) { RecordUmaEvent(NETWORK_LOCATION_REQUEST_EVENT_REQUEST_START); @@ -150,7 +150,7 @@ void NetworkLocationRequest::OnURLFetchComplete( RecordUmaResponseCode(response_code); Geoposition position; - string16 access_token; + base::string16 access_token; std::string data; source->GetResponseAsString(&data); GetLocationFromResponse(status.is_success(), @@ -207,7 +207,7 @@ GURL FormRequestURL(const GURL& url) { void FormUploadData(const WifiData& wifi_data, const base::Time& timestamp, - const string16& access_token, + const base::string16& access_token, std::string* upload_data) { int age = kint32min; // Invalid so AddInteger() will ignore. if (!timestamp.is_null()) { @@ -291,7 +291,7 @@ void GetLocationFromResponse(bool http_post_result, const base::Time& timestamp, const GURL& server_url, Geoposition* position, - string16* access_token) { + base::string16* access_token) { DCHECK(position); DCHECK(access_token); @@ -351,7 +351,7 @@ bool GetAsDouble(const base::DictionaryValue& object, bool ParseServerResponse(const std::string& response_body, const base::Time& timestamp, Geoposition* position, - string16* access_token) { + base::string16* access_token) { DCHECK(position); DCHECK(!position->Validate()); DCHECK(position->error_code == Geoposition::ERROR_CODE_NONE); diff --git a/content/browser/geolocation/network_location_request.h b/content/browser/geolocation/network_location_request.h index 38aaf3e..6fea08b 100644 --- a/content/browser/geolocation/network_location_request.h +++ b/content/browser/geolocation/network_location_request.h @@ -33,7 +33,7 @@ class NetworkLocationRequest : private net::URLFetcherDelegate { // server or network error - either no response or a 500 error code. typedef base::Callback<void(const Geoposition& /* position */, bool /* server_error */, - const string16& /* access_token */, + const base::string16& /* access_token */, const WifiData& /* wifi_data */)> LocationResponseCallback; @@ -45,7 +45,7 @@ class NetworkLocationRequest : private net::URLFetcherDelegate { // Makes a new request. Returns true if the new request was successfully // started. In all cases, any currently pending request will be canceled. - bool MakeRequest(const string16& access_token, + bool MakeRequest(const base::string16& access_token, const WifiData& wifi_data, const base::Time& timestamp); diff --git a/content/browser/geolocation/wifi_data.h b/content/browser/geolocation/wifi_data.h index a24e42e..72bc306 100644 --- a/content/browser/geolocation/wifi_data.h +++ b/content/browser/geolocation/wifi_data.h @@ -19,11 +19,11 @@ struct CONTENT_EXPORT AccessPointData { ~AccessPointData(); // MAC address, formatted as per MacAddressAsString16. - string16 mac_address; + base::string16 mac_address; int radio_signal_strength; // Measured in dBm int channel; int signal_to_noise; // Ratio in dB - string16 ssid; // Network identifier + base::string16 ssid; // Network identifier }; // This is to allow AccessPointData to be used in std::set. We order diff --git a/content/browser/geolocation/wifi_data_provider_common.cc b/content/browser/geolocation/wifi_data_provider_common.cc index 31f969c..9c2cbae 100644 --- a/content/browser/geolocation/wifi_data_provider_common.cc +++ b/content/browser/geolocation/wifi_data_provider_common.cc @@ -10,7 +10,7 @@ namespace content { -string16 MacAddressAsString16(const uint8 mac_as_int[6]) { +base::string16 MacAddressAsString16(const uint8 mac_as_int[6]) { // mac_as_int is big-endian. Write in byte chunks. // Format is XX-XX-XX-XX-XX-XX. static const char* const kMacFormatString = diff --git a/content/browser/geolocation/wifi_data_provider_common.h b/content/browser/geolocation/wifi_data_provider_common.h index c42b4c2..befdb69 100644 --- a/content/browser/geolocation/wifi_data_provider_common.h +++ b/content/browser/geolocation/wifi_data_provider_common.h @@ -18,7 +18,7 @@ namespace content { // Converts a MAC address stored as an array of uint8 to a string. -string16 MacAddressAsString16(const uint8 mac_as_int[6]); +base::string16 MacAddressAsString16(const uint8 mac_as_int[6]); // Base class to promote code sharing between platform specific wifi data // providers. It's optional for specific platforms to derive this, but if they diff --git a/content/browser/geolocation/wifi_data_provider_win.cc b/content/browser/geolocation/wifi_data_provider_win.cc index 8efb191..ed69865 100644 --- a/content/browser/geolocation/wifi_data_provider_win.cc +++ b/content/browser/geolocation/wifi_data_provider_win.cc @@ -127,15 +127,15 @@ class WindowsNdisApi : public WifiDataProviderCommon::WlanApiInterface { private: static bool GetInterfacesNDIS( - std::vector<string16>* interface_service_names_out); + std::vector<base::string16>* interface_service_names_out); // Swaps in content of the vector passed - explicit WindowsNdisApi(std::vector<string16>* interface_service_names); + explicit WindowsNdisApi(std::vector<base::string16>* interface_service_names); bool GetInterfaceDataNDIS(HANDLE adapter_handle, WifiData::AccessPointDataSet* data); // NDIS variables. - std::vector<string16> interface_service_names_; + std::vector<base::string16> interface_service_names_; // Remembers scan result buffer size across calls. int oid_buffer_size_; @@ -144,9 +144,9 @@ class WindowsNdisApi : public WifiDataProviderCommon::WlanApiInterface { // Extracts data for an access point and converts to Gears format. bool GetNetworkData(const WLAN_BSS_ENTRY& bss_entry, AccessPointData* access_point_data); -bool UndefineDosDevice(const string16& device_name); -bool DefineDosDeviceIfNotExists(const string16& device_name); -HANDLE GetFileHandle(const string16& device_name); +bool UndefineDosDevice(const base::string16& device_name); +bool DefineDosDeviceIfNotExists(const base::string16& device_name); +HANDLE GetFileHandle(const base::string16& device_name); // Makes the OID query and returns a Win32 error code. int PerformQuery(HANDLE adapter_handle, BYTE* buffer, @@ -155,7 +155,7 @@ int PerformQuery(HANDLE adapter_handle, bool ResizeBuffer(int requested_size, scoped_ptr_malloc<BYTE>* buffer); // Gets the system directory and appends a trailing slash if not already // present. -bool GetSystemDirectory(string16* path); +bool GetSystemDirectory(base::string16* path); } // namespace WifiDataProviderImplBase* WifiDataProvider::DefaultFactoryFunction() { @@ -202,12 +202,12 @@ WindowsWlanApi* WindowsWlanApi::Create() { if (base::win::GetVersion() < base::win::VERSION_VISTA) return NULL; // We use an absolute path to load the DLL to avoid DLL preloading attacks. - string16 system_directory; + base::string16 system_directory; if (!GetSystemDirectory(&system_directory)) { return NULL; } DCHECK(!system_directory.empty()); - string16 dll_path = system_directory + L"wlanapi.dll"; + base::string16 dll_path = system_directory + L"wlanapi.dll"; HINSTANCE library = LoadLibraryEx(dll_path.c_str(), NULL, LOAD_WITH_ALTERED_SEARCH_PATH); @@ -359,7 +359,7 @@ int WindowsWlanApi::GetInterfaceDataWLAN( // WindowsNdisApi WindowsNdisApi::WindowsNdisApi( - std::vector<string16>* interface_service_names) + std::vector<base::string16>* interface_service_names) : oid_buffer_size_(kInitialBufferSize) { DCHECK(!interface_service_names->empty()); interface_service_names_.swap(*interface_service_names); @@ -369,7 +369,7 @@ WindowsNdisApi::~WindowsNdisApi() { } WindowsNdisApi* WindowsNdisApi::Create() { - std::vector<string16> interface_service_names; + std::vector<base::string16> interface_service_names; if (GetInterfacesNDIS(&interface_service_names)) { return new WindowsNdisApi(&interface_service_names); } @@ -412,7 +412,7 @@ bool WindowsNdisApi::GetAccessPointData(WifiData::AccessPointDataSet* data) { } bool WindowsNdisApi::GetInterfacesNDIS( - std::vector<string16>* interface_service_names_out) { + std::vector<base::string16>* interface_service_names_out) { HKEY network_cards_key = NULL; if (RegOpenKeyEx( HKEY_LOCAL_MACHINE, @@ -530,18 +530,18 @@ bool GetNetworkData(const WLAN_BSS_ENTRY& bss_entry, return true; } -bool UndefineDosDevice(const string16& device_name) { +bool UndefineDosDevice(const base::string16& device_name) { // We remove only the mapping we use, that is \Device\<device_name>. - string16 target_path = L"\\Device\\" + device_name; + base::string16 target_path = L"\\Device\\" + device_name; return DefineDosDevice( DDD_RAW_TARGET_PATH | DDD_REMOVE_DEFINITION | DDD_EXACT_MATCH_ON_REMOVE, device_name.c_str(), target_path.c_str()) == TRUE; } -bool DefineDosDeviceIfNotExists(const string16& device_name) { +bool DefineDosDeviceIfNotExists(const base::string16& device_name) { // We create a DOS device name for the device at \Device\<device_name>. - string16 target_path = L"\\Device\\" + device_name; + base::string16 target_path = L"\\Device\\" + device_name; TCHAR target[kStringLength]; if (QueryDosDevice(device_name.c_str(), target, kStringLength) > 0 && @@ -565,10 +565,10 @@ bool DefineDosDeviceIfNotExists(const string16& device_name) { target_path.compare(target) == 0; } -HANDLE GetFileHandle(const string16& device_name) { +HANDLE GetFileHandle(const base::string16& device_name) { // We access a device with DOS path \Device\<device_name> at // \\.\<device_name>. - string16 formatted_device_name = L"\\\\.\\" + device_name; + base::string16 formatted_device_name = L"\\\\.\\" + device_name; return CreateFile(formatted_device_name.c_str(), GENERIC_READ, @@ -610,7 +610,7 @@ bool ResizeBuffer(int requested_size, scoped_ptr_malloc<BYTE>* buffer) { return buffer != NULL; } -bool GetSystemDirectory(string16* path) { +bool GetSystemDirectory(base::string16* path) { DCHECK(path); // Return value includes terminating NULL. int buffer_size = ::GetSystemDirectory(NULL, 0); diff --git a/content/browser/gpu/gpu_process_host.cc b/content/browser/gpu/gpu_process_host.cc index 26b33d4..53e9841 100644 --- a/content/browser/gpu/gpu_process_host.cc +++ b/content/browser/gpu/gpu_process_host.cc @@ -252,7 +252,7 @@ class GpuSandboxedProcessLauncherDelegate #endif if (cmd_line_->HasSwitch(switches::kEnableLogging)) { - string16 log_file_path = logging::GetLogFileFullPath(); + base::string16 log_file_path = logging::GetLogFileFullPath(); if (!log_file_path.empty()) { result = policy->AddRule(sandbox::TargetPolicy::SUBSYS_FILES, sandbox::TargetPolicy::FILES_ALLOW_ANY, diff --git a/content/browser/indexed_db/indexed_db_backing_store.cc b/content/browser/indexed_db/indexed_db_backing_store.cc index 766d6a4..92f4b22 100644 --- a/content/browser/indexed_db/indexed_db_backing_store.cc +++ b/content/browser/indexed_db/indexed_db_backing_store.cc @@ -157,7 +157,7 @@ static void PutVarInt(LevelDBTransaction* transaction, template <typename DBOrTransaction> WARN_UNUSED_RESULT static bool GetString(DBOrTransaction* db, const StringPiece& key, - string16* found_string, + base::string16* found_string, bool* found) { std::string result; *found = false; @@ -172,7 +172,7 @@ WARN_UNUSED_RESULT static bool GetString(DBOrTransaction* db, static void PutString(LevelDBTransaction* transaction, const StringPiece& key, - const string16& value) { + const base::string16& value) { std::string buffer; EncodeString(value, &buffer); transaction->Put(key, &buffer); @@ -653,8 +653,8 @@ scoped_refptr<IndexedDBBackingStore> IndexedDBBackingStore::Create( return backing_store; } -std::vector<string16> IndexedDBBackingStore::GetDatabaseNames() { - std::vector<string16> found_names; +std::vector<base::string16> IndexedDBBackingStore::GetDatabaseNames() { + std::vector<base::string16> found_names; const std::string start_key = DatabaseNameKey::EncodeMinKeyForOrigin(origin_identifier_); const std::string stop_key = @@ -678,7 +678,7 @@ std::vector<string16> IndexedDBBackingStore::GetDatabaseNames() { } bool IndexedDBBackingStore::GetIDBDatabaseMetaData( - const string16& name, + const base::string16& name, IndexedDBDatabaseMetadata* metadata, bool* found) { const std::string key = DatabaseNameKey::Encode(origin_identifier_, name); @@ -755,10 +755,11 @@ WARN_UNUSED_RESULT static bool GetNewDatabaseId(LevelDBTransaction* transaction, return true; } -bool IndexedDBBackingStore::CreateIDBDatabaseMetaData(const string16& name, - const string16& version, - int64 int_version, - int64* row_id) { +bool IndexedDBBackingStore::CreateIDBDatabaseMetaData( + const base::string16& name, + const base::string16& version, + int64 int_version, + int64* row_id) { scoped_refptr<LevelDBTransaction> transaction = new LevelDBTransaction(db_.get()); @@ -811,7 +812,7 @@ static void DeleteRange(LevelDBTransaction* transaction, transaction->Remove(it->Key()); } -bool IndexedDBBackingStore::DeleteDatabase(const string16& name) { +bool IndexedDBBackingStore::DeleteDatabase(const base::string16& name) { IDB_TRACE("IndexedDBBackingStore::DeleteDatabase"); scoped_ptr<LevelDBWriteOnlyTransaction> transaction = LevelDBWriteOnlyTransaction::Create(db_.get()); @@ -895,7 +896,7 @@ bool IndexedDBBackingStore::GetObjectStores( // TODO(jsbell): Do this by direct key lookup rather than iteration, to // simplify. - string16 object_store_name; + base::string16 object_store_name; { StringPiece slice(it->Value()); if (!DecodeString(&slice, &object_store_name) || !slice.empty()) @@ -1049,7 +1050,7 @@ bool IndexedDBBackingStore::CreateObjectStore( IndexedDBBackingStore::Transaction* transaction, int64 database_id, int64 object_store_id, - const string16& name, + const base::string16& name, const IndexedDBKeyPath& key_path, bool auto_increment) { IDB_TRACE("IndexedDBBackingStore::CreateObjectStore"); @@ -1103,7 +1104,7 @@ bool IndexedDBBackingStore::DeleteObjectStore( return false; LevelDBTransaction* leveldb_transaction = transaction->transaction(); - string16 object_store_name; + base::string16 object_store_name; bool found = false; bool ok = GetString( leveldb_transaction, @@ -1473,7 +1474,7 @@ bool IndexedDBBackingStore::GetIndexes( // TODO(jsbell): Do this by direct key lookup rather than iteration, to // simplify. int64 index_id = meta_data_key.IndexId(); - string16 index_name; + base::string16 index_name; { StringPiece slice(it->Value()); if (!DecodeString(&slice, &index_name) || !slice.empty()) @@ -1553,7 +1554,7 @@ bool IndexedDBBackingStore::CreateIndex( int64 database_id, int64 object_store_id, int64 index_id, - const string16& name, + const base::string16& name, const IndexedDBKeyPath& key_path, bool is_unique, bool is_multi_entry) { diff --git a/content/browser/indexed_db/indexed_db_backing_store.h b/content/browser/indexed_db/indexed_db_backing_store.h index 9ea71f1..00b15a3 100644 --- a/content/browser/indexed_db/indexed_db_backing_store.h +++ b/content/browser/indexed_db/indexed_db_backing_store.h @@ -69,19 +69,19 @@ class CONTENT_EXPORT IndexedDBBackingStore const GURL& origin_url, LevelDBFactory* factory); - virtual std::vector<string16> GetDatabaseNames(); - virtual bool GetIDBDatabaseMetaData(const string16& name, + virtual std::vector<base::string16> GetDatabaseNames(); + virtual bool GetIDBDatabaseMetaData(const base::string16& name, IndexedDBDatabaseMetadata* metadata, bool* success) WARN_UNUSED_RESULT; - virtual bool CreateIDBDatabaseMetaData(const string16& name, - const string16& version, + virtual bool CreateIDBDatabaseMetaData(const base::string16& name, + const base::string16& version, int64 int_version, int64* row_id); virtual bool UpdateIDBDatabaseIntVersion( IndexedDBBackingStore::Transaction* transaction, int64 row_id, int64 int_version); - virtual bool DeleteDatabase(const string16& name); + virtual bool DeleteDatabase(const base::string16& name); bool GetObjectStores(int64 database_id, IndexedDBDatabaseMetadata::ObjectStoreMap* map) @@ -90,7 +90,7 @@ class CONTENT_EXPORT IndexedDBBackingStore IndexedDBBackingStore::Transaction* transaction, int64 database_id, int64 object_store_id, - const string16& name, + const base::string16& name, const IndexedDBKeyPath& key_path, bool auto_increment); virtual bool DeleteObjectStore( @@ -160,7 +160,7 @@ class CONTENT_EXPORT IndexedDBBackingStore int64 database_id, int64 object_store_id, int64 index_id, - const string16& name, + const base::string16& name, const IndexedDBKeyPath& key_path, bool is_unique, bool is_multi_entry) WARN_UNUSED_RESULT; 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 396189e..d3e8296 100644 --- a/content/browser/indexed_db/indexed_db_backing_store_unittest.cc +++ b/content/browser/indexed_db/indexed_db_backing_store_unittest.cc @@ -236,19 +236,19 @@ TEST_F(IndexedDBBackingStoreTest, InvalidIds) { } TEST_F(IndexedDBBackingStoreTest, CreateDatabase) { - const string16 database_name(ASCIIToUTF16("db1")); + const base::string16 database_name(ASCIIToUTF16("db1")); int64 database_id; - const string16 version(ASCIIToUTF16("old_string_version")); + const base::string16 version(ASCIIToUTF16("old_string_version")); const int64 int_version = 9; const int64 object_store_id = 99; - const string16 object_store_name(ASCIIToUTF16("object_store1")); + const base::string16 object_store_name(ASCIIToUTF16("object_store1")); const bool auto_increment = true; const IndexedDBKeyPath object_store_key_path( ASCIIToUTF16("object_store_key")); const int64 index_id = 999; - const string16 index_name(ASCIIToUTF16("index1")); + const base::string16 index_name(ASCIIToUTF16("index1")); const bool unique = true; const bool multi_entry = true; const IndexedDBKeyPath index_key_path(ASCIIToUTF16("index_key")); diff --git a/content/browser/indexed_db/indexed_db_browsertest.cc b/content/browser/indexed_db/indexed_db_browsertest.cc index 687ce48..74b81b6 100644 --- a/content/browser/indexed_db/indexed_db_browsertest.cc +++ b/content/browser/indexed_db/indexed_db_browsertest.cc @@ -66,7 +66,7 @@ class IndexedDBBrowserTest : public ContentBrowserTest { if (hash) url = GURL(url.spec() + hash); - string16 expected_title16(ASCIIToUTF16(expected_string)); + base::string16 expected_title16(ASCIIToUTF16(expected_string)); TitleWatcher title_watcher(shell->web_contents(), expected_title16); NavigateToURL(shell, url); EXPECT_EQ(expected_title16, title_watcher.WaitAndGetTitle()); @@ -399,7 +399,7 @@ IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTest, ConnectionsClosedOnTabClose) { NavigateAndWaitForTitle(new_shell, "version_change_blocked.html", "#tab2", "setVersion(3) blocked"); - string16 expected_title16(ASCIIToUTF16("setVersion(3) complete")); + base::string16 expected_title16(ASCIIToUTF16("setVersion(3) complete")); TitleWatcher title_watcher(new_shell->web_contents(), expected_title16); base::KillProcess( @@ -421,7 +421,7 @@ IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTest, ForceCloseEventTest) { GetContext(), GURL("file:///"))); - string16 expected_title16(ASCIIToUTF16("connection closed")); + base::string16 expected_title16(ASCIIToUTF16("connection closed")); TitleWatcher title_watcher(shell()->web_contents(), expected_title16); EXPECT_EQ(expected_title16, title_watcher.WaitAndGetTitle()); } diff --git a/content/browser/indexed_db/indexed_db_callbacks.cc b/content/browser/indexed_db/indexed_db_callbacks.cc index 587b66f..755551c 100644 --- a/content/browser/indexed_db/indexed_db_callbacks.cc +++ b/content/browser/indexed_db/indexed_db_callbacks.cc @@ -71,7 +71,7 @@ void IndexedDBCallbacks::OnError(const IndexedDBDatabaseError& error) { dispatcher_host_ = NULL; } -void IndexedDBCallbacks::OnSuccess(const std::vector<string16>& value) { +void IndexedDBCallbacks::OnSuccess(const std::vector<base::string16>& value) { DCHECK(dispatcher_host_.get()); DCHECK_EQ(kNoCursor, ipc_cursor_id_); @@ -79,7 +79,7 @@ void IndexedDBCallbacks::OnSuccess(const std::vector<string16>& value) { DCHECK_EQ(kNoDatabase, ipc_database_id_); DCHECK_EQ(kNoDatabaseCallbacks, ipc_database_callbacks_id_); - std::vector<string16> list; + std::vector<base::string16> list; for (unsigned i = 0; i < value.size(); ++i) list.push_back(value[i]); diff --git a/content/browser/indexed_db/indexed_db_callbacks.h b/content/browser/indexed_db/indexed_db_callbacks.h index 1ea0c0b..048b563 100644 --- a/content/browser/indexed_db/indexed_db_callbacks.h +++ b/content/browser/indexed_db/indexed_db_callbacks.h @@ -51,7 +51,7 @@ class CONTENT_EXPORT IndexedDBCallbacks virtual void OnError(const IndexedDBDatabaseError& error); // IndexedDBFactory::GetDatabaseNames - virtual void OnSuccess(const std::vector<string16>& string); + virtual void OnSuccess(const std::vector<base::string16>& string); // IndexedDBFactory::Open / DeleteDatabase virtual void OnBlocked(int64 existing_version); diff --git a/content/browser/indexed_db/indexed_db_database.cc b/content/browser/indexed_db/indexed_db_database.cc index 8d63293..258b01e 100644 --- a/content/browser/indexed_db/indexed_db_database.cc +++ b/content/browser/indexed_db/indexed_db_database.cc @@ -108,7 +108,7 @@ class IndexedDBDatabase::PendingDeleteCall { }; scoped_refptr<IndexedDBDatabase> IndexedDBDatabase::Create( - const string16& name, + const base::string16& name, IndexedDBBackingStore* backing_store, IndexedDBFactory* factory, const Identifier& unique_identifier) { @@ -128,7 +128,7 @@ bool Contains(const T& container, const U& item) { } } -IndexedDBDatabase::IndexedDBDatabase(const string16& name, +IndexedDBDatabase::IndexedDBDatabase(const base::string16& name, IndexedDBBackingStore* backing_store, IndexedDBFactory* factory, const Identifier& unique_identifier) @@ -273,7 +273,7 @@ bool IndexedDBDatabase::ValidateObjectStoreIdAndNewIndexId( void IndexedDBDatabase::CreateObjectStore(int64 transaction_id, int64 object_store_id, - const string16& name, + const base::string16& name, const IndexedDBKeyPath& key_path, bool auto_increment) { IDB_TRACE("IndexedDBDatabase::CreateObjectStore"); @@ -351,7 +351,7 @@ void IndexedDBDatabase::DeleteObjectStore(int64 transaction_id, void IndexedDBDatabase::CreateIndex(int64 transaction_id, int64 object_store_id, int64 index_id, - const string16& name, + const base::string16& name, const IndexedDBKeyPath& key_path, bool unique, bool multi_entry) { @@ -392,8 +392,9 @@ void IndexedDBDatabase::CreateIndexOperation( index_metadata.key_path, index_metadata.unique, index_metadata.multi_entry)) { - string16 error_string = ASCIIToUTF16("Internal error creating index '") + - index_metadata.name + ASCIIToUTF16("'."); + base::string16 error_string = + ASCIIToUTF16("Internal error creating index '") + + index_metadata.name + ASCIIToUTF16("'."); transaction->Abort(IndexedDBDatabaseError( blink::WebIDBDatabaseExceptionUnknownError, error_string)); return; @@ -446,8 +447,9 @@ void IndexedDBDatabase::DeleteIndexOperation( object_store_id, index_metadata.id); if (!ok) { - string16 error_string = ASCIIToUTF16("Internal error deleting index '") + - index_metadata.name + ASCIIToUTF16("'."); + base::string16 error_string = + ASCIIToUTF16("Internal error deleting index '") + + index_metadata.name + ASCIIToUTF16("'."); transaction->Abort(IndexedDBDatabaseError( blink::WebIDBDatabaseExceptionUnknownError, error_string)); } @@ -791,7 +793,7 @@ void IndexedDBDatabase::PutOperation(scoped_ptr<PutOperationParams> params, } ScopedVector<IndexWriter> index_writers; - string16 error_message; + base::string16 error_message; bool obeys_constraints = false; bool backing_store_success = MakeIndexWriters(transaction, backing_store_.get(), @@ -897,7 +899,7 @@ void IndexedDBDatabase::SetIndexKeys(int64 transaction_id, } ScopedVector<IndexWriter> index_writers; - string16 error_message; + base::string16 error_message; bool obeys_constraints = false; DCHECK(metadata_.object_stores.find(object_store_id) != metadata_.object_stores.end()); @@ -1219,7 +1221,7 @@ void IndexedDBDatabase::DeleteObjectStoreOperation( transaction->database()->id(), object_store_metadata.id); if (!ok) { - string16 error_string = + base::string16 error_string = ASCIIToUTF16("Internal error deleting object store '") + object_store_metadata.name + ASCIIToUTF16("'."); transaction->Abort(IndexedDBDatabaseError( @@ -1449,7 +1451,7 @@ void IndexedDBDatabase::OpenConnection( DCHECK_EQ(IndexedDBDatabaseMetadata::NO_INT_VERSION, metadata_.int_version); } else { - string16 message; + base::string16 message; if (version == IndexedDBDatabaseMetadata::NO_INT_VERSION) message = ASCIIToUTF16( "Internal error opening database with no version specified."); @@ -1714,7 +1716,7 @@ void IndexedDBDatabase::DeleteObjectStoreAbortOperation( } void IndexedDBDatabase::VersionChangeAbortOperation( - const string16& previous_version, + const base::string16& previous_version, int64 previous_int_version, IndexedDBTransaction* transaction) { IDB_TRACE("IndexedDBDatabase::VersionChangeAbortOperation"); diff --git a/content/browser/indexed_db/indexed_db_database.h b/content/browser/indexed_db/indexed_db_database.h index fa730b0..b9b4dac 100644 --- a/content/browser/indexed_db/indexed_db_database.h +++ b/content/browser/indexed_db/indexed_db_database.h @@ -52,7 +52,7 @@ class CONTENT_EXPORT IndexedDBDatabase static const int64 kMinimumIndexId = 30; static scoped_refptr<IndexedDBDatabase> Create( - const string16& name, + const base::string16& name, IndexedDBBackingStore* backing_store, IndexedDBFactory* factory, const Identifier& unique_identifier); @@ -88,7 +88,7 @@ class CONTENT_EXPORT IndexedDBDatabase void CreateObjectStore(int64 transaction_id, int64 object_store_id, - const string16& name, + const base::string16& name, const IndexedDBKeyPath& key_path, bool auto_increment); void DeleteObjectStore(int64 transaction_id, int64 object_store_id); @@ -105,7 +105,7 @@ class CONTENT_EXPORT IndexedDBDatabase void CreateIndex(int64 transaction_id, int64 object_store_id, int64 index_id, - const string16& name, + const base::string16& name, const IndexedDBKeyPath& key_path, bool unique, bool multi_entry); @@ -198,7 +198,7 @@ class CONTENT_EXPORT IndexedDBDatabase blink::WebIDBDataLoss data_loss, std::string data_loss_message, IndexedDBTransaction* transaction); - void VersionChangeAbortOperation(const string16& previous_version, + void VersionChangeAbortOperation(const base::string16& previous_version, int64 previous_int_version, IndexedDBTransaction* transaction); void CreateIndexOperation(int64 object_store_id, @@ -243,7 +243,7 @@ class CONTENT_EXPORT IndexedDBDatabase private: friend class base::RefCounted<IndexedDBDatabase>; - IndexedDBDatabase(const string16& name, + IndexedDBDatabase(const base::string16& name, IndexedDBBackingStore* backing_store, IndexedDBFactory* factory, const Identifier& unique_identifier); diff --git a/content/browser/indexed_db/indexed_db_database_error.h b/content/browser/indexed_db/indexed_db_database_error.h index 297bec7..1a4f449 100644 --- a/content/browser/indexed_db/indexed_db_database_error.h +++ b/content/browser/indexed_db/indexed_db_database_error.h @@ -17,16 +17,16 @@ class IndexedDBDatabaseError { : code_(code) {} IndexedDBDatabaseError(uint16 code, const char* message) : code_(code), message_(ASCIIToUTF16(message)) {} - IndexedDBDatabaseError(uint16 code, const string16& message) + IndexedDBDatabaseError(uint16 code, const base::string16& message) : code_(code), message_(message) {} ~IndexedDBDatabaseError() {} uint16 code() const { return code_; } - const string16& message() const { return message_; } + const base::string16& message() const { return message_; } private: const uint16 code_; - const string16 message_; + const base::string16 message_; }; } // namespace content diff --git a/content/browser/indexed_db/indexed_db_factory.cc b/content/browser/indexed_db/indexed_db_factory.cc index 2cfef62..bd0c0ad 100644 --- a/content/browser/indexed_db/indexed_db_factory.cc +++ b/content/browser/indexed_db/indexed_db_factory.cc @@ -130,7 +130,7 @@ void IndexedDBFactory::GetDatabaseNames( } void IndexedDBFactory::DeleteDatabase( - const string16& name, + const base::string16& name, scoped_refptr<IndexedDBCallbacks> callbacks, const GURL& origin_url, const base::FilePath& data_directory) { @@ -233,7 +233,7 @@ scoped_refptr<IndexedDBBackingStore> IndexedDBFactory::OpenBackingStore( } void IndexedDBFactory::Open( - const string16& name, + const base::string16& name, int64 version, int64 transaction_id, scoped_refptr<IndexedDBCallbacks> callbacks, diff --git a/content/browser/indexed_db/indexed_db_factory.h b/content/browser/indexed_db/indexed_db_factory.h index b143853..74168d6 100644 --- a/content/browser/indexed_db/indexed_db_factory.h +++ b/content/browser/indexed_db/indexed_db_factory.h @@ -36,7 +36,7 @@ class CONTENT_EXPORT IndexedDBFactory void GetDatabaseNames(scoped_refptr<IndexedDBCallbacks> callbacks, const GURL& origin_url, const base::FilePath& data_directory); - void Open(const string16& name, + void Open(const base::string16& name, int64 version, int64 transaction_id, scoped_refptr<IndexedDBCallbacks> callbacks, @@ -44,7 +44,7 @@ class CONTENT_EXPORT IndexedDBFactory const GURL& origin_url, const base::FilePath& data_directory); - void DeleteDatabase(const string16& name, + void DeleteDatabase(const base::string16& name, scoped_refptr<IndexedDBCallbacks> callbacks, const GURL& origin_url, const base::FilePath& data_directory); diff --git a/content/browser/indexed_db/indexed_db_factory_unittest.cc b/content/browser/indexed_db/indexed_db_factory_unittest.cc index 859c2b7..9afa9e7 100644 --- a/content/browser/indexed_db/indexed_db_factory_unittest.cc +++ b/content/browser/indexed_db/indexed_db_factory_unittest.cc @@ -217,7 +217,7 @@ TEST_F(IndexedDBFactoryTest, QuotaErrorOnDiskFull) { new LookingForQuotaErrorMockCallbacks; scoped_refptr<IndexedDBDatabaseCallbacks> dummy_database_callbacks = new IndexedDBDatabaseCallbacks(NULL, 0, 0); - const string16 name(ASCIIToUTF16("name")); + const base::string16 name(ASCIIToUTF16("name")); factory->Open(name, 1, /* version */ 2, /* transaction_id */ diff --git a/content/browser/indexed_db/indexed_db_fake_backing_store.cc b/content/browser/indexed_db/indexed_db_fake_backing_store.cc index 8766162..3825982 100644 --- a/content/browser/indexed_db/indexed_db_fake_backing_store.cc +++ b/content/browser/indexed_db/indexed_db_fake_backing_store.cc @@ -10,19 +10,19 @@ namespace content { IndexedDBFakeBackingStore::~IndexedDBFakeBackingStore() {} -std::vector<string16> IndexedDBFakeBackingStore::GetDatabaseNames() { - return std::vector<string16>(); +std::vector<base::string16> IndexedDBFakeBackingStore::GetDatabaseNames() { + return std::vector<base::string16>(); } bool IndexedDBFakeBackingStore::GetIDBDatabaseMetaData( - const string16& name, + const base::string16& name, IndexedDBDatabaseMetadata*, bool* found) { return true; } bool IndexedDBFakeBackingStore::CreateIDBDatabaseMetaData( - const string16& name, - const string16& version, + const base::string16& name, + const base::string16& version, int64 int_version, int64* row_id) { return true; @@ -32,14 +32,14 @@ bool IndexedDBFakeBackingStore::UpdateIDBDatabaseIntVersion(Transaction*, int64 version) { return false; } -bool IndexedDBFakeBackingStore::DeleteDatabase(const string16& name) { +bool IndexedDBFakeBackingStore::DeleteDatabase(const base::string16& name) { return true; } bool IndexedDBFakeBackingStore::CreateObjectStore(Transaction*, int64 database_id, int64 object_store_id, - const string16& name, + const base::string16& name, const IndexedDBKeyPath&, bool auto_increment) { return false; @@ -85,7 +85,7 @@ bool IndexedDBFakeBackingStore::CreateIndex(Transaction*, int64 database_id, int64 object_store_id, int64 index_id, - const string16& name, + const base::string16& name, const IndexedDBKeyPath&, bool is_unique, bool is_multi_entry) { diff --git a/content/browser/indexed_db/indexed_db_fake_backing_store.h b/content/browser/indexed_db/indexed_db_fake_backing_store.h index 07b63de..93d047c 100644 --- a/content/browser/indexed_db/indexed_db_fake_backing_store.h +++ b/content/browser/indexed_db/indexed_db_fake_backing_store.h @@ -17,23 +17,23 @@ class IndexedDBFakeBackingStore : public IndexedDBBackingStore { : IndexedDBBackingStore(GURL("http://localhost:81"), scoped_ptr<LevelDBDatabase>(), scoped_ptr<LevelDBComparator>()) {} - virtual std::vector<string16> GetDatabaseNames() OVERRIDE; - virtual bool GetIDBDatabaseMetaData(const string16& name, + virtual std::vector<base::string16> GetDatabaseNames() OVERRIDE; + virtual bool GetIDBDatabaseMetaData(const base::string16& name, IndexedDBDatabaseMetadata*, bool* found) OVERRIDE; - virtual bool CreateIDBDatabaseMetaData(const string16& name, - const string16& version, + virtual bool CreateIDBDatabaseMetaData(const base::string16& name, + const base::string16& version, int64 int_version, int64* row_id) OVERRIDE; virtual bool UpdateIDBDatabaseIntVersion(Transaction*, int64 row_id, int64 version) OVERRIDE; - virtual bool DeleteDatabase(const string16& name) OVERRIDE; + virtual bool DeleteDatabase(const base::string16& name) OVERRIDE; virtual bool CreateObjectStore(Transaction*, int64 database_id, int64 object_store_id, - const string16& name, + const base::string16& name, const IndexedDBKeyPath&, bool auto_increment) OVERRIDE; @@ -65,7 +65,7 @@ class IndexedDBFakeBackingStore : public IndexedDBBackingStore { int64 database_id, int64 object_store_id, int64 index_id, - const string16& name, + const base::string16& name, const IndexedDBKeyPath&, bool is_unique, bool is_multi_entry) OVERRIDE; diff --git a/content/browser/indexed_db/indexed_db_index_writer.cc b/content/browser/indexed_db/indexed_db_index_writer.cc index 3b36cad..1c2ac0a 100644 --- a/content/browser/indexed_db/indexed_db_index_writer.cc +++ b/content/browser/indexed_db/indexed_db_index_writer.cc @@ -34,7 +34,7 @@ bool IndexWriter::VerifyIndexKeys( int64 index_id, bool* can_add_keys, const IndexedDBKey& primary_key, - string16* error_message) const { + base::string16* error_message) const { *can_add_keys = false; for (size_t i = 0; i < index_keys_.size(); ++i) { bool ok = AddingKeyAllowed(backing_store, @@ -122,7 +122,7 @@ bool MakeIndexWriters( const std::vector<int64>& index_ids, const std::vector<IndexedDBDatabase::IndexKeys>& index_keys, ScopedVector<IndexWriter>* index_writers, - string16* error_message, + base::string16* error_message, bool* completed) { DCHECK_EQ(index_ids.size(), index_keys.size()); *completed = false; diff --git a/content/browser/indexed_db/indexed_db_index_writer.h b/content/browser/indexed_db/indexed_db_index_writer.h index 2ea1c98..8a2cdad 100644 --- a/content/browser/indexed_db/indexed_db_index_writer.h +++ b/content/browser/indexed_db/indexed_db_index_writer.h @@ -34,7 +34,7 @@ class IndexWriter { int64 index_id, bool* can_add_keys, const IndexedDBKey& primary_key, - string16* error_message) const WARN_UNUSED_RESULT; + base::string16* error_message) const WARN_UNUSED_RESULT; void WriteIndexKeys(const IndexedDBBackingStore::RecordIdentifier& record, IndexedDBBackingStore* store, @@ -68,7 +68,7 @@ bool MakeIndexWriters( const std::vector<int64>& index_ids, const std::vector<IndexedDBDatabase::IndexKeys>& index_keys, ScopedVector<IndexWriter>* index_writers, - string16* error_message, + base::string16* error_message, bool* completed) WARN_UNUSED_RESULT; } // namespace content diff --git a/content/browser/indexed_db/indexed_db_leveldb_coding.cc b/content/browser/indexed_db/indexed_db_leveldb_coding.cc index dd3964a..fad767c 100644 --- a/content/browser/indexed_db/indexed_db_leveldb_coding.cc +++ b/content/browser/indexed_db/indexed_db_leveldb_coding.cc @@ -257,7 +257,7 @@ void EncodeVarInt(int64 value, std::string* into) { } while (n); } -void EncodeString(const string16& value, std::string* into) { +void EncodeString(const base::string16& value, std::string* into) { if (value.empty()) return; // Backing store is UTF-16BE, convert from host endianness. @@ -277,7 +277,7 @@ void EncodeBinary(const std::string& value, std::string* into) { DCHECK(into->size() >= value.size()); } -void EncodeStringWithLength(const string16& value, std::string* into) { +void EncodeStringWithLength(const base::string16& value, std::string* into) { EncodeVarInt(value.length(), into); EncodeString(value, into); } @@ -355,7 +355,7 @@ void EncodeIDBKeyPath(const IndexedDBKeyPath& value, std::string* into) { break; } case WebIDBKeyPathTypeArray: { - const std::vector<string16>& array = value.array(); + const std::vector<base::string16>& array = value.array(); size_t count = array.size(); EncodeVarInt(count, into); for (size_t i = 0; i < count; ++i) { @@ -421,7 +421,7 @@ bool DecodeVarInt(StringPiece* slice, int64* value) { return true; } -bool DecodeString(StringPiece* slice, string16* value) { +bool DecodeString(StringPiece* slice, base::string16* value) { if (slice->empty()) { value->clear(); return true; @@ -430,7 +430,7 @@ bool DecodeString(StringPiece* slice, string16* value) { // Backing store is UTF-16BE, convert to host endianness. DCHECK(!(slice->size() % sizeof(char16))); size_t length = slice->size() / sizeof(char16); - string16 decoded; + base::string16 decoded; decoded.reserve(length); const char16* encoded = reinterpret_cast<const char16*>(slice->begin()); for (unsigned i = 0; i < length; ++i) @@ -441,7 +441,7 @@ bool DecodeString(StringPiece* slice, string16* value) { return true; } -bool DecodeStringWithLength(StringPiece* slice, string16* value) { +bool DecodeStringWithLength(StringPiece* slice, base::string16* value) { if (slice->empty()) return false; @@ -510,7 +510,7 @@ bool DecodeIDBKey(StringPiece* slice, scoped_ptr<IndexedDBKey>* value) { return true; } case kIndexedDBKeyStringTypeByte: { - string16 s; + base::string16 s; if (!DecodeStringWithLength(slice, &s)) return false; *value = make_scoped_ptr(new IndexedDBKey(s)); @@ -551,7 +551,7 @@ bool DecodeIDBKeyPath(StringPiece* slice, IndexedDBKeyPath* value) { // always written as typed. if (slice->size() < 3 || (*slice)[0] != kIndexedDBKeyPathTypeCodedByte1 || (*slice)[1] != kIndexedDBKeyPathTypeCodedByte2) { - string16 s; + base::string16 s; if (!DecodeString(slice, &s)) return false; *value = IndexedDBKeyPath(s); @@ -569,7 +569,7 @@ bool DecodeIDBKeyPath(StringPiece* slice, IndexedDBKeyPath* value) { *value = IndexedDBKeyPath(); return true; case WebIDBKeyPathTypeString: { - string16 string; + base::string16 string; if (!DecodeStringWithLength(slice, &string)) return false; DCHECK(slice->empty()); @@ -577,13 +577,13 @@ bool DecodeIDBKeyPath(StringPiece* slice, IndexedDBKeyPath* value) { return true; } case WebIDBKeyPathTypeArray: { - std::vector<string16> array; + std::vector<base::string16> array; int64 count; if (!DecodeVarInt(slice, &count)) return false; DCHECK_GE(count, 0); while (count--) { - string16 string; + base::string16 string; if (!DecodeStringWithLength(slice, &string)) return false; array.push_back(string); @@ -1324,7 +1324,7 @@ bool DatabaseNameKey::Decode(StringPiece* slice, DatabaseNameKey* result) { } std::string DatabaseNameKey::Encode(const std::string& origin_identifier, - const string16& database_name) { + const base::string16& database_name) { std::string ret = KeyPrefix::EncodeEmpty(); ret.push_back(kDatabaseNameTypeByte); EncodeStringWithLength(base::ASCIIToUTF16(origin_identifier), &ret); @@ -1334,7 +1334,7 @@ std::string DatabaseNameKey::Encode(const std::string& origin_identifier, std::string DatabaseNameKey::EncodeMinKeyForOrigin( const std::string& origin_identifier) { - return Encode(origin_identifier, string16()); + return Encode(origin_identifier, base::string16()); } std::string DatabaseNameKey::EncodeStopKeyForOrigin( @@ -1604,8 +1604,9 @@ bool ObjectStoreNamesKey::Decode(StringPiece* slice, return true; } -std::string ObjectStoreNamesKey::Encode(int64 database_id, - const string16& object_store_name) { +std::string ObjectStoreNamesKey::Encode( + int64 database_id, + const base::string16& object_store_name) { KeyPrefix prefix(database_id); std::string ret = prefix.Encode(); ret.push_back(kObjectStoreNamesTypeByte); @@ -1641,7 +1642,7 @@ bool IndexNamesKey::Decode(StringPiece* slice, IndexNamesKey* result) { std::string IndexNamesKey::Encode(int64 database_id, int64 object_store_id, - const string16& index_name) { + const base::string16& index_name) { KeyPrefix prefix(database_id); std::string ret = prefix.Encode(); ret.push_back(kIndexNamesKeyTypeByte); diff --git a/content/browser/indexed_db/indexed_db_leveldb_coding.h b/content/browser/indexed_db/indexed_db_leveldb_coding.h index 8d0c780..d369af0 100644 --- a/content/browser/indexed_db/indexed_db_leveldb_coding.h +++ b/content/browser/indexed_db/indexed_db_leveldb_coding.h @@ -27,8 +27,9 @@ CONTENT_EXPORT void EncodeByte(unsigned char value, std::string* into); CONTENT_EXPORT void EncodeBool(bool value, std::string* into); CONTENT_EXPORT void EncodeInt(int64 value, std::string* into); CONTENT_EXPORT void EncodeVarInt(int64 value, std::string* into); -CONTENT_EXPORT void EncodeString(const string16& value, std::string* into); -CONTENT_EXPORT void EncodeStringWithLength(const string16& value, +CONTENT_EXPORT void EncodeString(const base::string16& value, + std::string* into); +CONTENT_EXPORT void EncodeStringWithLength(const base::string16& value, std::string* into); CONTENT_EXPORT void EncodeBinary(const std::string& value, std::string* into); CONTENT_EXPORT void EncodeDouble(double value, std::string* into); @@ -45,10 +46,10 @@ CONTENT_EXPORT WARN_UNUSED_RESULT bool DecodeInt(base::StringPiece* slice, CONTENT_EXPORT WARN_UNUSED_RESULT bool DecodeVarInt(base::StringPiece* slice, int64* value); CONTENT_EXPORT WARN_UNUSED_RESULT bool DecodeString(base::StringPiece* slice, - string16* value); + base::string16* value); CONTENT_EXPORT WARN_UNUSED_RESULT bool DecodeStringWithLength( base::StringPiece* slice, - string16* value); + base::string16* value); CONTENT_EXPORT WARN_UNUSED_RESULT bool DecodeBinary(base::StringPiece* slice, std::string* value); CONTENT_EXPORT WARN_UNUSED_RESULT bool DecodeDouble(base::StringPiece* slice, @@ -188,18 +189,19 @@ class DatabaseNameKey { public: static bool Decode(base::StringPiece* slice, DatabaseNameKey* result); CONTENT_EXPORT static std::string Encode(const std::string& origin_identifier, - const string16& database_name); + const base::string16& database_name); static std::string EncodeMinKeyForOrigin( const std::string& origin_identifier); static std::string EncodeStopKeyForOrigin( const std::string& origin_identifier); - string16 origin() const { return origin_; } - string16 database_name() const { return database_name_; } + base::string16 origin() const { return origin_; } + base::string16 database_name() const { return database_name_; } int Compare(const DatabaseNameKey& other); private: - string16 origin_; // TODO(jsbell): Store encoded strings, or just pointers. - string16 database_name_; + base::string16 origin_; // TODO(jsbell): Store encoded strings, or just + // pointers. + base::string16 database_name_; }; class DatabaseMetaDataKey { @@ -315,14 +317,15 @@ class ObjectStoreNamesKey { // because a mapping is kept in the IndexedDBDatabase. Can the // mapping become unreliable? Can we remove this? static bool Decode(base::StringPiece* slice, ObjectStoreNamesKey* result); - CONTENT_EXPORT static std::string Encode(int64 database_id, - const string16& object_store_name); + CONTENT_EXPORT static std::string Encode( + int64 database_id, + const base::string16& object_store_name); int Compare(const ObjectStoreNamesKey& other); - string16 object_store_name() const { return object_store_name_; } + base::string16 object_store_name() const { return object_store_name_; } private: // TODO(jsbell): Store the encoded string, or just pointers to it. - string16 object_store_name_; + base::string16 object_store_name_; }; class IndexNamesKey { @@ -333,13 +336,13 @@ class IndexNamesKey { static bool Decode(base::StringPiece* slice, IndexNamesKey* result); CONTENT_EXPORT static std::string Encode(int64 database_id, int64 object_store_id, - const string16& index_name); + const base::string16& index_name); int Compare(const IndexNamesKey& other); - string16 index_name() const { return index_name_; } + base::string16 index_name() const { return index_name_; } private: int64 object_store_id_; - string16 index_name_; + base::string16 index_name_; }; class ObjectStoreDataKey { 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 6d6ab0b..e968142 100644 --- a/content/browser/indexed_db/indexed_db_leveldb_coding_unittest.cc +++ b/content/browser/indexed_db/indexed_db_leveldb_coding_unittest.cc @@ -304,7 +304,7 @@ TEST(IndexedDBLevelDBCodingTest, DecodeVarInt) { } } -static std::string WrappedEncodeString(string16 value) { +static std::string WrappedEncodeString(base::string16 value) { std::string buffer; EncodeString(value, &buffer); return buffer; @@ -321,24 +321,24 @@ TEST(IndexedDBLevelDBCodingTest, EncodeString) { EXPECT_EQ(static_cast<size_t>(6), WrappedEncodeString(ASCIIToUTF16("foo")).size()); EXPECT_EQ(static_cast<size_t>(6), - WrappedEncodeString(string16(test_string_a)).size()); + WrappedEncodeString(base::string16(test_string_a)).size()); EXPECT_EQ(static_cast<size_t>(4), - WrappedEncodeString(string16(test_string_b)).size()); + WrappedEncodeString(base::string16(test_string_b)).size()); } TEST(IndexedDBLevelDBCodingTest, DecodeString) { const char16 test_string_a[] = {'f', 'o', 'o', '\0'}; const char16 test_string_b[] = {0xdead, 0xbeef, '\0'}; - std::vector<string16> test_cases; - test_cases.push_back(string16()); + std::vector<base::string16> test_cases; + test_cases.push_back(base::string16()); test_cases.push_back(ASCIIToUTF16("a")); test_cases.push_back(ASCIIToUTF16("foo")); test_cases.push_back(test_string_a); test_cases.push_back(test_string_b); for (size_t i = 0; i < test_cases.size(); ++i) { - const string16& test_case = test_cases[i]; + const base::string16& test_case = test_cases[i]; std::string v = WrappedEncodeString(test_case); StringPiece slice; @@ -346,7 +346,7 @@ TEST(IndexedDBLevelDBCodingTest, DecodeString) { slice = StringPiece(&*v.begin(), v.size()); } - string16 result; + base::string16 result; EXPECT_TRUE(DecodeString(&slice, &result)); EXPECT_EQ(test_case, result); EXPECT_TRUE(slice.empty()); @@ -360,7 +360,7 @@ TEST(IndexedDBLevelDBCodingTest, DecodeString) { } } -static std::string WrappedEncodeStringWithLength(string16 value) { +static std::string WrappedEncodeStringWithLength(base::string16 value) { std::string buffer; EncodeStringWithLength(value, &buffer); return buffer; @@ -371,13 +371,15 @@ TEST(IndexedDBLevelDBCodingTest, EncodeStringWithLength) { const char16 test_string_b[] = {0xdead, 0xbeef, '\0'}; EXPECT_EQ(static_cast<size_t>(1), - WrappedEncodeStringWithLength(string16()).size()); + WrappedEncodeStringWithLength(base::string16()).size()); EXPECT_EQ(static_cast<size_t>(3), WrappedEncodeStringWithLength(ASCIIToUTF16("a")).size()); EXPECT_EQ(static_cast<size_t>(7), - WrappedEncodeStringWithLength(string16(test_string_a)).size()); + WrappedEncodeStringWithLength( + base::string16(test_string_a)).size()); EXPECT_EQ(static_cast<size_t>(5), - WrappedEncodeStringWithLength(string16(test_string_b)).size()); + WrappedEncodeStringWithLength( + base::string16(test_string_b)).size()); } TEST(IndexedDBLevelDBCodingTest, DecodeStringWithLength) { @@ -390,20 +392,20 @@ TEST(IndexedDBLevelDBCodingTest, DecodeStringWithLength) { long_string[i] = i; long_string[kLongStringLen] = 0; - std::vector<string16> test_cases; + std::vector<base::string16> test_cases; test_cases.push_back(ASCIIToUTF16("")); test_cases.push_back(ASCIIToUTF16("a")); test_cases.push_back(ASCIIToUTF16("foo")); - test_cases.push_back(string16(test_string_a)); - test_cases.push_back(string16(test_string_b)); - test_cases.push_back(string16(long_string)); + test_cases.push_back(base::string16(test_string_a)); + test_cases.push_back(base::string16(test_string_b)); + test_cases.push_back(base::string16(long_string)); for (size_t i = 0; i < test_cases.size(); ++i) { - string16 s = test_cases[i]; + base::string16 s = test_cases[i]; std::string v = WrappedEncodeStringWithLength(s); ASSERT_GT(v.size(), static_cast<size_t>(0)); StringPiece slice(v); - string16 res; + base::string16 res; EXPECT_TRUE(DecodeStringWithLength(&slice, &res)); EXPECT_EQ(s, res); EXPECT_TRUE(slice.empty()); @@ -444,23 +446,23 @@ TEST(IndexedDBLevelDBCodingTest, CompareEncodedStringsWithLength) { const char16 test_string_e[] = {0xd834, 0xdd1e, '\0'}; const char16 test_string_f[] = {0xfffd, '\0'}; - std::vector<string16> test_cases; + std::vector<base::string16> test_cases; test_cases.push_back(ASCIIToUTF16("")); test_cases.push_back(ASCIIToUTF16("a")); test_cases.push_back(ASCIIToUTF16("b")); test_cases.push_back(ASCIIToUTF16("baaa")); test_cases.push_back(ASCIIToUTF16("baab")); test_cases.push_back(ASCIIToUTF16("c")); - test_cases.push_back(string16(test_string_a)); - test_cases.push_back(string16(test_string_b)); - test_cases.push_back(string16(test_string_c)); - test_cases.push_back(string16(test_string_d)); - test_cases.push_back(string16(test_string_e)); - test_cases.push_back(string16(test_string_f)); + test_cases.push_back(base::string16(test_string_a)); + test_cases.push_back(base::string16(test_string_b)); + test_cases.push_back(base::string16(test_string_c)); + test_cases.push_back(base::string16(test_string_d)); + test_cases.push_back(base::string16(test_string_e)); + test_cases.push_back(base::string16(test_string_f)); for (size_t i = 0; i < test_cases.size() - 1; ++i) { - string16 a = test_cases[i]; - string16 b = test_cases[i + 1]; + base::string16 a = test_cases[i]; + base::string16 b = test_cases[i + 1]; EXPECT_LT(a.compare(b), 0); EXPECT_GT(b.compare(a), 0); @@ -630,7 +632,7 @@ TEST(IndexedDBLevelDBCodingTest, EncodeDecodeIDBKeyPath) { } { - key_paths.push_back(IndexedDBKeyPath(string16())); + key_paths.push_back(IndexedDBKeyPath(base::string16())); char expected[] = {0, 0, // Header 1, // Type is string 0 // Length is 0 @@ -661,8 +663,8 @@ TEST(IndexedDBLevelDBCodingTest, EncodeDecodeIDBKeyPath) { } { - std::vector<string16> array; - array.push_back(string16()); + std::vector<base::string16> array; + array.push_back(base::string16()); array.push_back(ASCIIToUTF16("foo")); array.push_back(ASCIIToUTF16("foo.bar")); @@ -700,7 +702,7 @@ TEST(IndexedDBLevelDBCodingTest, DecodeLegacyIDBKeyPath) { std::vector<std::string> encoded_paths; { - key_paths.push_back(IndexedDBKeyPath(string16())); + key_paths.push_back(IndexedDBKeyPath(base::string16())); encoded_paths.push_back(std::string()); } { diff --git a/content/browser/indexed_db/indexed_db_metadata.cc b/content/browser/indexed_db/indexed_db_metadata.cc index 80d3142..47b7219 100644 --- a/content/browser/indexed_db/indexed_db_metadata.cc +++ b/content/browser/indexed_db/indexed_db_metadata.cc @@ -7,7 +7,7 @@ namespace content { IndexedDBObjectStoreMetadata::IndexedDBObjectStoreMetadata( - const string16& name, + const base::string16& name, int64 id, const IndexedDBKeyPath& key_path, bool auto_increment, @@ -23,11 +23,12 @@ IndexedDBObjectStoreMetadata::~IndexedDBObjectStoreMetadata() {} IndexedDBDatabaseMetadata::IndexedDBDatabaseMetadata() : int_version(NO_INT_VERSION) {} -IndexedDBDatabaseMetadata::IndexedDBDatabaseMetadata(const string16& name, - int64 id, - const string16& version, - int64 int_version, - int64 max_object_store_id) +IndexedDBDatabaseMetadata::IndexedDBDatabaseMetadata( + const base::string16& name, + int64 id, + const base::string16& version, + int64 int_version, + int64 max_object_store_id) : name(name), id(id), version(version), diff --git a/content/browser/indexed_db/indexed_db_metadata.h b/content/browser/indexed_db/indexed_db_metadata.h index 4e8562d..00970a6 100644 --- a/content/browser/indexed_db/indexed_db_metadata.h +++ b/content/browser/indexed_db/indexed_db_metadata.h @@ -15,7 +15,7 @@ namespace content { struct IndexedDBIndexMetadata { IndexedDBIndexMetadata() {} - IndexedDBIndexMetadata(const string16& name, + IndexedDBIndexMetadata(const base::string16& name, int64 id, const IndexedDBKeyPath& key_path, bool unique, @@ -25,7 +25,7 @@ struct IndexedDBIndexMetadata { key_path(key_path), unique(unique), multi_entry(multi_entry) {} - string16 name; + base::string16 name; int64 id; IndexedDBKeyPath key_path; bool unique; @@ -36,13 +36,13 @@ struct IndexedDBIndexMetadata { struct CONTENT_EXPORT IndexedDBObjectStoreMetadata { IndexedDBObjectStoreMetadata(); - IndexedDBObjectStoreMetadata(const string16& name, + IndexedDBObjectStoreMetadata(const base::string16& name, int64 id, const IndexedDBKeyPath& key_path, bool auto_increment, int64 max_index_id); ~IndexedDBObjectStoreMetadata(); - string16 name; + base::string16 name; int64 id; IndexedDBKeyPath key_path; bool auto_increment; @@ -64,16 +64,16 @@ struct CONTENT_EXPORT IndexedDBDatabaseMetadata { typedef std::map<int64, IndexedDBObjectStoreMetadata> ObjectStoreMap; IndexedDBDatabaseMetadata(); - IndexedDBDatabaseMetadata(const string16& name, + IndexedDBDatabaseMetadata(const base::string16& name, int64 id, - const string16& version, + const base::string16& version, int64 int_version, int64 max_object_store_id); ~IndexedDBDatabaseMetadata(); - string16 name; + base::string16 name; int64 id; - string16 version; + base::string16 version; int64 int_version; int64 max_object_store_id; diff --git a/content/browser/loader/resource_dispatcher_host_browsertest.cc b/content/browser/loader/resource_dispatcher_host_browsertest.cc index 0a763fe..011c975 100644 --- a/content/browser/loader/resource_dispatcher_host_browsertest.cc +++ b/content/browser/loader/resource_dispatcher_host_browsertest.cc @@ -59,13 +59,13 @@ class ResourceDispatcherHostBrowserTest : public ContentBrowserTest, void CheckTitleTest(const GURL& url, const std::string& expected_title) { - string16 expected_title16(ASCIIToUTF16(expected_title)); + base::string16 expected_title16(ASCIIToUTF16(expected_title)); TitleWatcher title_watcher(shell()->web_contents(), expected_title16); NavigateToURL(shell(), url); EXPECT_EQ(expected_title16, title_watcher.WaitAndGetTitle()); } - bool GetPopupTitle(const GURL& url, string16* title) { + bool GetPopupTitle(const GURL& url, base::string16* title) { NavigateToURL(shell(), url); ShellAddedObserver new_shell_observer; @@ -96,7 +96,7 @@ IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest, DynamicTitle1) { ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); GURL url(embedded_test_server()->GetURL("/dynamic1.html")); - string16 title; + base::string16 title; ASSERT_TRUE(GetPopupTitle(url, &title)); EXPECT_TRUE(StartsWith(title, ASCIIToUTF16("My Popup Title"), true)) << "Actual title: " << title; @@ -108,7 +108,7 @@ IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest, DynamicTitle2) { ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); GURL url(embedded_test_server()->GetURL("/dynamic2.html")); - string16 title; + base::string16 title; ASSERT_TRUE(GetPopupTitle(url, &title)); EXPECT_TRUE(StartsWith(title, ASCIIToUTF16("My Dynamic Title"), true)) << "Actual title: " << title; @@ -364,7 +364,7 @@ IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest, // URLs are prohibited by policy from interacting with sensitive chrome // pages of which the error page is one. Instead, use automation to kick // off the navigation, and wait to see that the tab loads. - string16 expected_title16(ASCIIToUTF16("Title Of Awesomeness")); + base::string16 expected_title16(ASCIIToUTF16("Title Of Awesomeness")); TitleWatcher title_watcher(shell()->web_contents(), expected_title16); bool success; diff --git a/content/browser/media/media_browsertest.cc b/content/browser/media/media_browsertest.cc index 215b3e7..0655823 100644 --- a/content/browser/media/media_browsertest.cc +++ b/content/browser/media/media_browsertest.cc @@ -59,13 +59,13 @@ void MediaBrowserTest::RunMediaTestPage( } void MediaBrowserTest::RunTest(const GURL& gurl, const char* expected) { - const string16 expected_title = ASCIIToUTF16(expected); + const base::string16 expected_title = ASCIIToUTF16(expected); DVLOG(1) << "Running test URL: " << gurl; TitleWatcher title_watcher(shell()->web_contents(), expected_title); AddWaitForTitles(&title_watcher); NavigateToURL(shell(), gurl); - string16 final_title = title_watcher.WaitAndGetTitle(); + base::string16 final_title = title_watcher.WaitAndGetTitle(); EXPECT_EQ(expected_title, final_title); } diff --git a/content/browser/media/media_internals.cc b/content/browser/media/media_internals.cc index 1e0538e..1ee42d1 100644 --- a/content/browser/media/media_internals.cc +++ b/content/browser/media/media_internals.cc @@ -17,8 +17,8 @@ namespace { static base::LazyInstance<content::MediaInternals>::Leaky g_media_internals = LAZY_INSTANCE_INITIALIZER; -string16 SerializeUpdate(const std::string& function, - const base::Value* value) { +base::string16 SerializeUpdate(const std::string& function, + const base::Value* value) { return content::WebUI::GetJavascriptCall( function, std::vector<const base::Value*>(1, value)); } @@ -185,7 +185,7 @@ void MediaInternals::RemoveUpdateCallback(const UpdateCallback& callback) { } void MediaInternals::SendEverything() { - string16 everything_update; + base::string16 everything_update; { base::AutoLock auto_lock(lock_); everything_update = SerializeUpdate( @@ -194,7 +194,7 @@ void MediaInternals::SendEverything() { SendUpdate(everything_update); } -void MediaInternals::SendUpdate(const string16& update) { +void MediaInternals::SendUpdate(const base::string16& update) { // SendUpdate() may be called from any thread, but must run on the IO thread. // TODO(dalecurtis): This is pretty silly since the update callbacks simply // forward the calls to the UI thread. We should avoid the extra hop. diff --git a/content/browser/media/media_internals.h b/content/browser/media/media_internals.h index 8a179e0..c0f144a 100644 --- a/content/browser/media/media_internals.h +++ b/content/browser/media/media_internals.h @@ -37,7 +37,7 @@ class CONTENT_EXPORT MediaInternals const std::vector<media::MediaLogEvent>& events); // Called with the update string. - typedef base::Callback<void(const string16&)> UpdateCallback; + typedef base::Callback<void(const base::string16&)> UpdateCallback; // Add/remove update callbacks (see above). Must be called on the IO thread. void AddUpdateCallback(const UpdateCallback& callback); @@ -59,7 +59,7 @@ class CONTENT_EXPORT MediaInternals // Sends |update| to each registered UpdateCallback. Safe to call from any // thread, but will forward to the IO thread. - void SendUpdate(const string16& update); + void SendUpdate(const base::string16& update); // Caches |value| under |cache_key| so that future SendEverything() calls will // include the current data. Calls JavaScript |function|(|value|) for each diff --git a/content/browser/media/media_internals_handler.cc b/content/browser/media/media_internals_handler.cc index a45dd4f..9a3e7be 100644 --- a/content/browser/media/media_internals_handler.cc +++ b/content/browser/media/media_internals_handler.cc @@ -38,12 +38,12 @@ void MediaInternalsMessageHandler::OnGetEverything( proxy_->GetEverything(); } -void MediaInternalsMessageHandler::OnUpdate(const string16& update) { +void MediaInternalsMessageHandler::OnUpdate(const base::string16& update) { // Don't try to execute JavaScript in a RenderView that no longer exists nor // if the chrome://media-internals page hasn't finished loading. RenderViewHost* host = web_ui()->GetWebContents()->GetRenderViewHost(); if (host && page_load_complete_) - host->ExecuteJavascriptInWebFrame(string16(), update); + host->ExecuteJavascriptInWebFrame(base::string16(), update); } } // namespace content diff --git a/content/browser/media/media_internals_handler.h b/content/browser/media/media_internals_handler.h index 8ea6f88..265c122 100644 --- a/content/browser/media/media_internals_handler.h +++ b/content/browser/media/media_internals_handler.h @@ -30,7 +30,7 @@ class MediaInternalsMessageHandler : public WebUIMessageHandler { void OnGetEverything(const base::ListValue* list); // MediaInternals message handlers. - void OnUpdate(const string16& update); + void OnUpdate(const base::string16& update); private: scoped_refptr<MediaInternalsProxy> proxy_; diff --git a/content/browser/media/media_internals_proxy.cc b/content/browser/media/media_internals_proxy.cc index d0e0622..49456ab 100644 --- a/content/browser/media/media_internals_proxy.cc +++ b/content/browser/media/media_internals_proxy.cc @@ -69,7 +69,7 @@ void MediaInternalsProxy::GetEverything() { CallJavaScriptFunctionOnUIThread("media.onReceiveConstants", GetConstants()); } -void MediaInternalsProxy::OnUpdate(const string16& update) { +void MediaInternalsProxy::OnUpdate(const base::string16& update) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); BrowserThread::PostTask( BrowserThread::UI, FROM_HERE, @@ -140,7 +140,7 @@ void MediaInternalsProxy::GetEverythingOnIOThread() { MediaInternals::GetInstance()->SendEverything(); } -void MediaInternalsProxy::UpdateUIOnUIThread(const string16& update) { +void MediaInternalsProxy::UpdateUIOnUIThread(const base::string16& update) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); // Don't forward updates to a destructed UI. if (handler_) @@ -175,7 +175,7 @@ void MediaInternalsProxy::CallJavaScriptFunctionOnUIThread( scoped_ptr<base::Value> args_value(args); std::vector<const base::Value*> args_vector; args_vector.push_back(args_value.get()); - string16 update = WebUI::GetJavascriptCall(function, args_vector); + base::string16 update = WebUI::GetJavascriptCall(function, args_vector); UpdateUIOnUIThread(update); } diff --git a/content/browser/media/media_internals_proxy.h b/content/browser/media/media_internals_proxy.h index 5d173b3..b737b85 100644 --- a/content/browser/media/media_internals_proxy.h +++ b/content/browser/media/media_internals_proxy.h @@ -49,7 +49,7 @@ class MediaInternalsProxy void GetEverything(); // MediaInternals callback. Called on the IO thread. - void OnUpdate(const string16& update); + void OnUpdate(const base::string16& update); // net::NetLog::ThreadSafeObserver implementation. Callable from any thread: virtual void OnAddEntry(const net::NetLog::Entry& entry) OVERRIDE; @@ -65,7 +65,7 @@ class MediaInternalsProxy void ObserveMediaInternalsOnIOThread(); void StopObservingMediaInternalsOnIOThread(); void GetEverythingOnIOThread(); - void UpdateUIOnUIThread(const string16& update); + void UpdateUIOnUIThread(const base::string16& update); // Put |entry| on a list of events to be sent to the page. void AddNetEventOnUIThread(base::Value* entry); diff --git a/content/browser/media/media_internals_unittest.cc b/content/browser/media/media_internals_unittest.cc index e16124b..2947104 100644 --- a/content/browser/media/media_internals_unittest.cc +++ b/content/browser/media/media_internals_unittest.cc @@ -45,7 +45,7 @@ class MediaInternalsTest protected: // Extracts and deserializes the JSON update data; merges into |update_data_|. - void UpdateCallbackImpl(const string16& update) { + void UpdateCallbackImpl(const base::string16& update) { // Each update string looks like "<JavaScript Function Name>({<JSON>});", to // use the JSON reader we need to strip out the JavaScript code. std::string utf8_update = base::UTF16ToUTF8(update); diff --git a/content/browser/media/webrtc_browsertest.cc b/content/browser/media/webrtc_browsertest.cc index bfb96e1..e63207d 100644 --- a/content/browser/media/webrtc_browsertest.cc +++ b/content/browser/media/webrtc_browsertest.cc @@ -130,7 +130,7 @@ class WebrtcBrowserTest: public ContentBrowserTest { } void ExpectTitle(const std::string& expected_title) const { - string16 expected_title16(ASCIIToUTF16(expected_title)); + base::string16 expected_title16(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 b458276..0d279b3 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 { - string16 expected_title16(ASCIIToUTF16(expected_title)); + base::string16 expected_title16(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_message_handler.cc b/content/browser/media/webrtc_internals_message_handler.cc index 2ba7522..8cf8579 100644 --- a/content/browser/media/webrtc_internals_message_handler.cc +++ b/content/browser/media/webrtc_internals_message_handler.cc @@ -68,11 +68,11 @@ void WebRTCInternalsMessageHandler::OnUpdate(const std::string& command, DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); std::vector<const base::Value*> args_vector; args_vector.push_back(args); - string16 update = WebUI::GetJavascriptCall(command, args_vector); + base::string16 update = WebUI::GetJavascriptCall(command, args_vector); RenderViewHost* host = web_ui()->GetWebContents()->GetRenderViewHost(); if (host) - host->ExecuteJavascriptInWebFrame(string16(), update); + host->ExecuteJavascriptInWebFrame(base::string16(), update); } } // namespace content diff --git a/content/browser/message_port_service.cc b/content/browser/message_port_service.cc index bc2a1ac..0d9f608 100644 --- a/content/browser/message_port_service.cc +++ b/content/browser/message_port_service.cc @@ -108,7 +108,7 @@ void MessagePortService::Entangle(int local_message_port_id, void MessagePortService::PostMessage( int sender_message_port_id, - const string16& message, + const base::string16& message, const std::vector<int>& sent_message_port_ids) { if (!message_ports_.count(sender_message_port_id)) { NOTREACHED(); @@ -130,7 +130,7 @@ void MessagePortService::PostMessage( void MessagePortService::PostMessageTo( int message_port_id, - const string16& message, + const base::string16& message, const std::vector<int>& sent_message_port_ids) { if (!message_ports_.count(message_port_id)) { NOTREACHED(); diff --git a/content/browser/message_port_service.h b/content/browser/message_port_service.h index 55e536c..6689591 100644 --- a/content/browser/message_port_service.h +++ b/content/browser/message_port_service.h @@ -19,7 +19,8 @@ class MessagePortMessageFilter; class MessagePortService { public: - typedef std::vector<std::pair<string16, std::vector<int> > > QueuedMessages; + typedef std::vector<std::pair<base::string16, std::vector<int> > > + QueuedMessages; // Returns the MessagePortService singleton. static MessagePortService* GetInstance(); @@ -31,7 +32,7 @@ class MessagePortService { void Destroy(int message_port_id); void Entangle(int local_message_port_id, int remote_message_port_id); void PostMessage(int sender_message_port_id, - const string16& message, + const base::string16& message, const std::vector<int>& sent_message_port_ids); void QueueMessages(int message_port_id); void SendQueuedMessages(int message_port_id, @@ -56,7 +57,7 @@ class MessagePortService { ~MessagePortService(); void PostMessageTo(int message_port_id, - const string16& message, + const base::string16& message, const std::vector<int>& sent_message_port_ids); // Handles the details of removing a message port id. Before calling this, diff --git a/content/browser/plugin_browsertest.cc b/content/browser/plugin_browsertest.cc index 2a846f1..204a143 100644 --- a/content/browser/plugin_browsertest.cc +++ b/content/browser/plugin_browsertest.cc @@ -83,12 +83,12 @@ class PluginTest : public ContentBrowserTest { } static void LoadAndWaitInWindow(Shell* window, const GURL& url) { - string16 expected_title(ASCIIToUTF16("OK")); + base::string16 expected_title(ASCIIToUTF16("OK")); TitleWatcher title_watcher(window->web_contents(), expected_title); title_watcher.AlsoWaitForTitle(ASCIIToUTF16("FAIL")); title_watcher.AlsoWaitForTitle(ASCIIToUTF16("plugin_not_found")); NavigateToURL(window, url); - string16 title = title_watcher.WaitAndGetTitle(); + base::string16 title = title_watcher.WaitAndGetTitle(); if (title == ASCIIToUTF16("plugin_not_found")) { const testing::TestInfo* const test_info = testing::UnitTest::GetInstance()->current_test_info(); @@ -170,7 +170,7 @@ IN_PROC_BROWSER_TEST_F(PluginTest, MAYBE(SelfDeletePluginInvokeInSynchronousMouseUp)) { NavigateToURL(shell(), GetURL("execute_script_delete_in_mouse_up.html")); - string16 expected_title(ASCIIToUTF16("OK")); + base::string16 expected_title(ASCIIToUTF16("OK")); TitleWatcher title_watcher(shell()->web_contents(), expected_title); title_watcher.AlsoWaitForTitle(ASCIIToUTF16("FAIL")); SimulateMouseClick(shell()->web_contents(), 0, @@ -201,7 +201,7 @@ IN_PROC_BROWSER_TEST_F(PluginTest, MAYBE(SelfDeletePluginInvokeAlert)) { // race condition where the alert can come up before we start watching for it. shell()->LoadURL(GetURL("self_delete_plugin_invoke_alert.html")); - string16 expected_title(ASCIIToUTF16("OK")); + base::string16 expected_title(ASCIIToUTF16("OK")); TitleWatcher title_watcher(shell()->web_contents(), expected_title); title_watcher.AlsoWaitForTitle(ASCIIToUTF16("FAIL")); @@ -408,7 +408,7 @@ IN_PROC_BROWSER_TEST_F(PluginTest, DISABLED_PluginConvertPointTest) { NavigateToURL(shell(), GetURL("convert_point.html")); - string16 expected_title(ASCIIToUTF16("OK")); + base::string16 expected_title(ASCIIToUTF16("OK")); TitleWatcher title_watcher(shell()->web_contents(), expected_title); title_watcher.AlsoWaitForTitle(ASCIIToUTF16("FAIL")); // TODO(stuartmorgan): When the automation system supports sending clicks, diff --git a/content/browser/plugin_loader_posix_unittest.cc b/content/browser/plugin_loader_posix_unittest.cc index 8f90723..13620f7 100644 --- a/content/browser/plugin_loader_posix_unittest.cc +++ b/content/browser/plugin_loader_posix_unittest.cc @@ -64,11 +64,11 @@ class PluginLoaderPosixTest : public testing::Test { public: PluginLoaderPosixTest() : plugin1_(ASCIIToUTF16("plugin1"), base::FilePath("/tmp/one.plugin"), - ASCIIToUTF16("1.0"), string16()), + ASCIIToUTF16("1.0"), base::string16()), plugin2_(ASCIIToUTF16("plugin2"), base::FilePath("/tmp/two.plugin"), - ASCIIToUTF16("2.0"), string16()), + ASCIIToUTF16("2.0"), base::string16()), plugin3_(ASCIIToUTF16("plugin3"), base::FilePath("/tmp/three.plugin"), - ASCIIToUTF16("3.0"), string16()), + ASCIIToUTF16("3.0"), base::string16()), file_thread_(BrowserThread::FILE, &message_loop_), io_thread_(BrowserThread::IO, &message_loop_), plugin_loader_(new MockPluginLoaderPosix) { diff --git a/content/browser/plugin_service_impl.cc b/content/browser/plugin_service_impl.cc index 1ddcf40..96216c1 100644 --- a/content/browser/plugin_service_impl.cc +++ b/content/browser/plugin_service_impl.cc @@ -547,9 +547,9 @@ bool PluginServiceImpl::GetPluginInfoByPath(const base::FilePath& plugin_path, return false; } -string16 PluginServiceImpl::GetPluginDisplayNameByPath( +base::string16 PluginServiceImpl::GetPluginDisplayNameByPath( const base::FilePath& path) { - string16 plugin_name = path.LossyDisplayName(); + base::string16 plugin_name = path.LossyDisplayName(); WebPluginInfo info; if (PluginService::GetInstance()->GetPluginInfoByPath(path, &info) && !info.name.empty()) { diff --git a/content/browser/plugin_service_impl.h b/content/browser/plugin_service_impl.h index 11fb257..c7d95af 100644 --- a/content/browser/plugin_service_impl.h +++ b/content/browser/plugin_service_impl.h @@ -91,7 +91,7 @@ class CONTENT_EXPORT PluginServiceImpl std::string* actual_mime_type) OVERRIDE; virtual bool GetPluginInfoByPath(const base::FilePath& plugin_path, WebPluginInfo* info) OVERRIDE; - virtual string16 GetPluginDisplayNameByPath( + virtual base::string16 GetPluginDisplayNameByPath( const base::FilePath& path) OVERRIDE; virtual void GetPlugins(const GetPluginsCallback& callback) OVERRIDE; virtual PepperPluginInfo* GetRegisteredPpapiPluginInfo( diff --git a/content/browser/power_save_blocker_win.cc b/content/browser/power_save_blocker_win.cc index fce72c6..cf9bb02 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; } - string16 wide_reason = ASCIIToUTF16(reason); + base::string16 wide_reason = 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 fbf512a..f6c9fd5 100644 --- a/content/browser/ppapi_plugin_process_host.cc +++ b/content/browser/ppapi_plugin_process_host.cc @@ -178,7 +178,7 @@ void PpapiPluginProcessHost::DidDeleteOutOfProcessInstance( // static void PpapiPluginProcessHost::FindByName( - const string16& name, + const base::string16& name, std::vector<PpapiPluginProcessHost*>* hosts) { for (PpapiPluginProcessHostIterator iter; !iter.Done(); ++iter) { if (iter->process_.get() && iter->process_->GetData().name == name) diff --git a/content/browser/ppapi_plugin_process_host.h b/content/browser/ppapi_plugin_process_host.h index 87c79c3..594c12f 100644 --- a/content/browser/ppapi_plugin_process_host.h +++ b/content/browser/ppapi_plugin_process_host.h @@ -92,7 +92,7 @@ class PpapiPluginProcessHost : public BrowserChildProcessHostDelegate, // Returns the instances that match the specified process name. // It can only be called on the IO thread. - static void FindByName(const string16& name, + static void FindByName(const base::string16& name, std::vector<PpapiPluginProcessHost*>* hosts); // IPC::Sender implementation: diff --git a/content/browser/renderer_host/clipboard_message_filter.cc b/content/browser/renderer_host/clipboard_message_filter.cc index ae365d5..6ba95f8 100644 --- a/content/browser/renderer_host/clipboard_message_filter.cc +++ b/content/browser/renderer_host/clipboard_message_filter.cc @@ -145,9 +145,10 @@ void ClipboardMessageFilter::OnGetSequenceNumber(ui::ClipboardType type, *sequence_number = GetClipboard()->GetSequenceNumber(type); } -void ClipboardMessageFilter::OnReadAvailableTypes(ui::ClipboardType type, - std::vector<string16>* types, - bool* contains_filenames) { +void ClipboardMessageFilter::OnReadAvailableTypes( + ui::ClipboardType type, + std::vector<base::string16>* types, + bool* contains_filenames) { GetClipboard()->ReadAvailableTypes(type, types, contains_filenames); } @@ -163,7 +164,7 @@ void ClipboardMessageFilter::OnClear(ui::ClipboardType type) { } void ClipboardMessageFilter::OnReadText(ui::ClipboardType type, - string16* result) { + base::string16* result) { GetClipboard()->ReadText(type, result); } @@ -173,7 +174,7 @@ void ClipboardMessageFilter::OnReadAsciiText(ui::ClipboardType type, } void ClipboardMessageFilter::OnReadHTML(ui::ClipboardType type, - string16* markup, + base::string16* markup, GURL* url, uint32* fragment_start, uint32* fragment_end) { @@ -224,8 +225,8 @@ void ClipboardMessageFilter::OnReadImageReply( } void ClipboardMessageFilter::OnReadCustomData(ui::ClipboardType clipboard_type, - const string16& type, - string16* result) { + const base::string16& type, + base::string16* result) { GetClipboard()->ReadCustomData(clipboard_type, type, result); } diff --git a/content/browser/renderer_host/clipboard_message_filter.h b/content/browser/renderer_host/clipboard_message_filter.h index 3ae7d1b..dd2784b 100644 --- a/content/browser/renderer_host/clipboard_message_filter.h +++ b/content/browser/renderer_host/clipboard_message_filter.h @@ -39,12 +39,12 @@ class ClipboardMessageFilter : public BrowserMessageFilter { bool* result); void OnClear(ui::ClipboardType type); void OnReadAvailableTypes(ui::ClipboardType type, - std::vector<string16>* types, + std::vector<base::string16>* types, bool* contains_filenames); - void OnReadText(ui::ClipboardType type, string16* result); + void OnReadText(ui::ClipboardType type, base::string16* result); void OnReadAsciiText(ui::ClipboardType type, std::string* result); void OnReadHTML(ui::ClipboardType type, - string16* markup, + base::string16* markup, GURL* url, uint32* fragment_start, uint32* fragment_end); @@ -52,13 +52,13 @@ class ClipboardMessageFilter : public BrowserMessageFilter { void OnReadImage(ui::ClipboardType type, IPC::Message* reply_msg); void OnReadImageReply(const SkBitmap& bitmap, IPC::Message* reply_msg); void OnReadCustomData(ui::ClipboardType clipboard_type, - const string16& type, - string16* result); + const base::string16& type, + base::string16* result); void OnReadData(const ui::Clipboard::FormatType& format, std::string* data); #if defined(OS_MACOSX) - void OnFindPboardWriteString(const string16& text); + void OnFindPboardWriteString(const base::string16& text); #endif // We have our own clipboard because we want to access the clipboard on the diff --git a/content/browser/renderer_host/clipboard_message_filter_mac.mm b/content/browser/renderer_host/clipboard_message_filter_mac.mm index ee8f5a3..3c59d31 100644 --- a/content/browser/renderer_host/clipboard_message_filter_mac.mm +++ b/content/browser/renderer_host/clipboard_message_filter_mac.mm @@ -40,7 +40,8 @@ class WriteFindPboardWrapper { } // namespace // Called on the IO thread. -void ClipboardMessageFilter::OnFindPboardWriteString(const string16& text) { +void ClipboardMessageFilter::OnFindPboardWriteString( + const base::string16& text) { if (text.length() <= kMaxFindPboardStringLength) { NSString* nsText = base::SysUTF16ToNSString(text); if (nsText) { diff --git a/content/browser/renderer_host/database_message_filter.cc b/content/browser/renderer_host/database_message_filter.cc index d41be65..55ea305 100644 --- a/content/browser/renderer_host/database_message_filter.cc +++ b/content/browser/renderer_host/database_message_filter.cc @@ -113,13 +113,14 @@ bool DatabaseMessageFilter::OnMessageReceived( DatabaseMessageFilter::~DatabaseMessageFilter() { } -void DatabaseMessageFilter::OnDatabaseOpenFile(const string16& vfs_file_name, - int desired_flags, - IPC::Message* reply_msg) { +void DatabaseMessageFilter::OnDatabaseOpenFile( + const base::string16& vfs_file_name, + int desired_flags, + IPC::Message* reply_msg) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); base::PlatformFile file_handle = base::kInvalidPlatformFileValue; std::string origin_identifier; - string16 database_name; + base::string16 database_name; // When in incognito mode, we want to make sure that all DB files are // removed when the incognito browser context goes away, so we add the @@ -162,16 +163,18 @@ void DatabaseMessageFilter::OnDatabaseOpenFile(const string16& vfs_file_name, Send(reply_msg); } -void DatabaseMessageFilter::OnDatabaseDeleteFile(const string16& vfs_file_name, - const bool& sync_dir, - IPC::Message* reply_msg) { +void DatabaseMessageFilter::OnDatabaseDeleteFile( + const base::string16& vfs_file_name, + const bool& sync_dir, + IPC::Message* reply_msg) { DatabaseDeleteFile(vfs_file_name, sync_dir, reply_msg, kNumDeleteRetries); } -void DatabaseMessageFilter::DatabaseDeleteFile(const string16& vfs_file_name, - bool sync_dir, - IPC::Message* reply_msg, - int reschedule_count) { +void DatabaseMessageFilter::DatabaseDeleteFile( + const base::string16& vfs_file_name, + bool sync_dir, + IPC::Message* reply_msg, + int reschedule_count) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); // Return an error if the file name is invalid or if the file could not @@ -183,8 +186,8 @@ void DatabaseMessageFilter::DatabaseDeleteFile(const string16& vfs_file_name, // 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 string16 wal_suffix(ASCIIToUTF16("-wal")); - string16 sqlite_suffix; + const base::string16 wal_suffix(ASCIIToUTF16("-wal")); + base::string16 sqlite_suffix; // WAL files can be deleted without having previously been opened. if (!db_tracker_->HasSavedIncognitoFileHandle(vfs_file_name) && @@ -215,7 +218,7 @@ void DatabaseMessageFilter::DatabaseDeleteFile(const string16& vfs_file_name, } void DatabaseMessageFilter::OnDatabaseGetFileAttributes( - const string16& vfs_file_name, + const base::string16& vfs_file_name, IPC::Message* reply_msg) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); int32 attributes = -1; @@ -230,7 +233,7 @@ void DatabaseMessageFilter::OnDatabaseGetFileAttributes( } void DatabaseMessageFilter::OnDatabaseGetFileSize( - const string16& vfs_file_name, IPC::Message* reply_msg) { + const base::string16& vfs_file_name, IPC::Message* reply_msg) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); int64 size = 0; base::FilePath db_file = @@ -278,8 +281,8 @@ void DatabaseMessageFilter::OnDatabaseGetUsageAndQuota( void DatabaseMessageFilter::OnDatabaseOpened( const std::string& origin_identifier, - const string16& database_name, - const string16& description, + const base::string16& database_name, + const base::string16& description, int64 estimated_size) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); @@ -299,7 +302,7 @@ void DatabaseMessageFilter::OnDatabaseOpened( void DatabaseMessageFilter::OnDatabaseModified( const std::string& origin_identifier, - const string16& database_name) { + const base::string16& database_name) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); if (!database_connections_.IsDatabaseOpened( origin_identifier, database_name)) { @@ -313,7 +316,7 @@ void DatabaseMessageFilter::OnDatabaseModified( void DatabaseMessageFilter::OnDatabaseClosed( const std::string& origin_identifier, - const string16& database_name) { + const base::string16& database_name) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); if (!database_connections_.IsDatabaseOpened( origin_identifier, database_name)) { @@ -328,7 +331,7 @@ void DatabaseMessageFilter::OnDatabaseClosed( void DatabaseMessageFilter::OnHandleSqliteError( const std::string& origin_identifier, - const string16& database_name, + const base::string16& database_name, int error) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); if (!DatabaseUtil::IsValidOriginIdentifier(origin_identifier)) { @@ -342,7 +345,7 @@ void DatabaseMessageFilter::OnHandleSqliteError( void DatabaseMessageFilter::OnDatabaseSizeChanged( const std::string& origin_identifier, - const string16& database_name, + const base::string16& database_name, int64 database_size) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); if (database_connections_.IsOriginUsed(origin_identifier)) { @@ -353,7 +356,7 @@ void DatabaseMessageFilter::OnDatabaseSizeChanged( void DatabaseMessageFilter::OnDatabaseScheduledForDeletion( const std::string& origin_identifier, - const string16& database_name) { + const base::string16& database_name) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); Send(new DatabaseMsg_CloseImmediately(origin_identifier, database_name)); } diff --git a/content/browser/renderer_host/database_message_filter.h b/content/browser/renderer_host/database_message_filter.h index 9e168c5..5024335 100644 --- a/content/browser/renderer_host/database_message_filter.h +++ b/content/browser/renderer_host/database_message_filter.h @@ -41,15 +41,15 @@ class DatabaseMessageFilter void RemoveObserver(); // VFS message handlers (file thread) - void OnDatabaseOpenFile(const string16& vfs_file_name, + void OnDatabaseOpenFile(const base::string16& vfs_file_name, int desired_flags, IPC::Message* reply_msg); - void OnDatabaseDeleteFile(const string16& vfs_file_name, + void OnDatabaseDeleteFile(const base::string16& vfs_file_name, const bool& sync_dir, IPC::Message* reply_msg); - void OnDatabaseGetFileAttributes(const string16& vfs_file_name, + void OnDatabaseGetFileAttributes(const base::string16& vfs_file_name, IPC::Message* reply_msg); - void OnDatabaseGetFileSize(const string16& vfs_file_name, + void OnDatabaseGetFileSize(const base::string16& vfs_file_name, IPC::Message* reply_msg); // Quota message handler (io thread) @@ -62,26 +62,26 @@ class DatabaseMessageFilter // Database tracker message handlers (file thread) void OnDatabaseOpened(const std::string& origin_identifier, - const string16& database_name, - const string16& description, + const base::string16& database_name, + const base::string16& description, int64 estimated_size); void OnDatabaseModified(const std::string& origin_identifier, - const string16& database_name); + const base::string16& database_name); void OnDatabaseClosed(const std::string& origin_identifier, - const string16& database_name); + const base::string16& database_name); void OnHandleSqliteError(const std::string& origin_identifier, - const string16& database_name, + const base::string16& database_name, int error); // DatabaseTracker::Observer callbacks (file thread) virtual void OnDatabaseSizeChanged(const std::string& origin_identifier, - const string16& database_name, + const base::string16& database_name, int64 database_size) OVERRIDE; virtual void OnDatabaseScheduledForDeletion( const std::string& origin_identifier, - const string16& database_name) OVERRIDE; + const base::string16& database_name) OVERRIDE; - void DatabaseDeleteFile(const string16& vfs_file_name, + void DatabaseDeleteFile(const base::string16& vfs_file_name, bool sync_dir, IPC::Message* reply_msg, int reschedule_count); diff --git a/content/browser/renderer_host/gtk_im_context_wrapper.cc b/content/browser/renderer_host/gtk_im_context_wrapper.cc index 7ce6558..d4b7789 100644 --- a/content/browser/renderer_host/gtk_im_context_wrapper.cc +++ b/content/browser/renderer_host/gtk_im_context_wrapper.cc @@ -477,7 +477,7 @@ void GtkIMContextWrapper::ConfirmComposition() { if (host_view_->GetRenderWidgetHost()) { RenderWidgetHostImpl::From( host_view_->GetRenderWidgetHost())->ImeConfirmComposition( - string16(), gfx::Range::InvalidRange(), false); + base::string16(), gfx::Range::InvalidRange(), false); } // Reset the input method. @@ -485,7 +485,7 @@ void GtkIMContextWrapper::ConfirmComposition() { } } -void GtkIMContextWrapper::HandleCommit(const string16& text) { +void GtkIMContextWrapper::HandleCommit(const base::string16& text) { if (suppress_next_commit_) return; diff --git a/content/browser/renderer_host/gtk_im_context_wrapper.h b/content/browser/renderer_host/gtk_im_context_wrapper.h index 1647df1..8bd027f 100644 --- a/content/browser/renderer_host/gtk_im_context_wrapper.h +++ b/content/browser/renderer_host/gtk_im_context_wrapper.h @@ -75,7 +75,7 @@ class GtkIMContextWrapper { void ProcessInputMethodResult(const GdkEventKey* event, bool filtered); // Real code of "commit" signal handler. - void HandleCommit(const string16& text); + void HandleCommit(const base::string16& text); // Real code of "preedit-start" signal handler. void HandlePreeditStart(); @@ -180,7 +180,7 @@ class GtkIMContextWrapper { // Stores a copy of the most recent commit text received by commit signal // handler. - string16 commit_text_; + base::string16 commit_text_; // If it's true then the next "commit" signal will be suppressed. // It's only used to workaround http://crbug.com/50485. diff --git a/content/browser/renderer_host/ime_adapter_android.cc b/content/browser/renderer_host/ime_adapter_android.cc index 9e7fe47..92d972f 100644 --- a/content/browser/renderer_host/ime_adapter_android.cc +++ b/content/browser/renderer_host/ime_adapter_android.cc @@ -136,7 +136,7 @@ void ImeAdapterAndroid::SetComposingText(JNIEnv* env, jobject, jstring text, if (!rwhi) return; - string16 text16 = ConvertJavaStringToUTF16(env, text); + base::string16 text16 = ConvertJavaStringToUTF16(env, text); std::vector<blink::WebCompositionUnderline> underlines; underlines.push_back( blink::WebCompositionUnderline(0, text16.length(), SK_ColorBLACK, @@ -155,7 +155,7 @@ void ImeAdapterAndroid::CommitText(JNIEnv* env, jobject, jstring text) { if (!rwhi) return; - string16 text16 = ConvertJavaStringToUTF16(env, text); + base::string16 text16 = ConvertJavaStringToUTF16(env, text); rwhi->ImeConfirmComposition(text16, gfx::Range::InvalidRange(), false); } @@ -164,7 +164,8 @@ void ImeAdapterAndroid::FinishComposingText(JNIEnv* env, jobject) { if (!rwhi) return; - rwhi->ImeConfirmComposition(string16(), gfx::Range::InvalidRange(), true); + rwhi->ImeConfirmComposition(base::string16(), gfx::Range::InvalidRange(), + true); } void ImeAdapterAndroid::AttachImeAdapter(JNIEnv* env, jobject java_object) { diff --git a/content/browser/renderer_host/java/java_bridge_dispatcher_host.cc b/content/browser/renderer_host/java/java_bridge_dispatcher_host.cc index 6d792e7..562517a 100644 --- a/content/browser/renderer_host/java/java_bridge_dispatcher_host.cc +++ b/content/browser/renderer_host/java/java_bridge_dispatcher_host.cc @@ -59,7 +59,7 @@ JavaBridgeDispatcherHost::~JavaBridgeDispatcherHost() { base::Bind(&CleanUpStubs, stubs_)); } -void JavaBridgeDispatcherHost::AddNamedObject(const string16& name, +void JavaBridgeDispatcherHost::AddNamedObject(const base::string16& name, NPObject* object) { NPVariant_Param variant_param; CreateNPVariantParam(object, &variant_param); @@ -68,7 +68,7 @@ void JavaBridgeDispatcherHost::AddNamedObject(const string16& name, render_view_host_->GetRoutingID(), name, variant_param)); } -void JavaBridgeDispatcherHost::RemoveNamedObject(const string16& name) { +void JavaBridgeDispatcherHost::RemoveNamedObject(const base::string16& name) { // On receipt of this message, the JavaBridgeDispatcher will drop its // reference to the corresponding proxy object. When the last reference is // removed, the proxy object will delete its NPObjectProxy, which will cause diff --git a/content/browser/renderer_host/java/java_bridge_dispatcher_host.h b/content/browser/renderer_host/java/java_bridge_dispatcher_host.h index 94ee632..21e47c0 100644 --- a/content/browser/renderer_host/java/java_bridge_dispatcher_host.h +++ b/content/browser/renderer_host/java/java_bridge_dispatcher_host.h @@ -42,8 +42,8 @@ class JavaBridgeDispatcherHost // to |object|, which is manipulated on the background thread. This class // holds a reference to |object| for the time that the proxy object is bound // to the window object. - void AddNamedObject(const string16& name, NPObject* object); - void RemoveNamedObject(const string16& name); + void AddNamedObject(const base::string16& name, NPObject* object); + void RemoveNamedObject(const base::string16& name); // Since this object is ref-counted, it might outlive render_view_host_. void RenderViewDeleted(); diff --git a/content/browser/renderer_host/java/java_bridge_dispatcher_host_manager.cc b/content/browser/renderer_host/java/java_bridge_dispatcher_host_manager.cc index f06d9fe..02cf4dc 100644 --- a/content/browser/renderer_host/java/java_bridge_dispatcher_host_manager.cc +++ b/content/browser/renderer_host/java/java_bridge_dispatcher_host_manager.cc @@ -31,7 +31,7 @@ JavaBridgeDispatcherHostManager::~JavaBridgeDispatcherHostManager() { DCHECK_EQ(0U, instances_.size()); } -void JavaBridgeDispatcherHostManager::AddNamedObject(const string16& name, +void JavaBridgeDispatcherHostManager::AddNamedObject(const base::string16& name, NPObject* object) { // Record this object in a map so that we can add it into RenderViewHosts // created later. The JavaBridgeDispatcherHost instances will take a @@ -67,7 +67,8 @@ void JavaBridgeDispatcherHostManager::SetRetainedObjectSet( } } -void JavaBridgeDispatcherHostManager::RemoveNamedObject(const string16& name) { +void JavaBridgeDispatcherHostManager::RemoveNamedObject( + const base::string16& name) { ObjectMap::iterator iter = objects_.find(name); if (iter == objects_.end()) { return; diff --git a/content/browser/renderer_host/java/java_bridge_dispatcher_host_manager.h b/content/browser/renderer_host/java/java_bridge_dispatcher_host_manager.h index e3d629a..29523b5 100644 --- a/content/browser/renderer_host/java/java_bridge_dispatcher_host_manager.h +++ b/content/browser/renderer_host/java/java_bridge_dispatcher_host_manager.h @@ -34,8 +34,8 @@ class JavaBridgeDispatcherHostManager // These methods add or remove the object to each JavaBridgeDispatcherHost. // Each one holds a reference to the NPObject while the object is bound to // the corresponding RenderView. See JavaBridgeDispatcherHost for details. - void AddNamedObject(const string16& name, NPObject* object); - void RemoveNamedObject(const string16& name); + void AddNamedObject(const base::string16& name, NPObject* object); + void RemoveNamedObject(const base::string16& name); void OnGetChannelHandle(RenderViewHost* render_view_host, IPC::Message* reply_msg); @@ -60,7 +60,7 @@ class JavaBridgeDispatcherHostManager typedef std::map<RenderViewHost*, scoped_refptr<JavaBridgeDispatcherHost> > InstanceMap; InstanceMap instances_; - typedef std::map<string16, NPObject*> ObjectMap; + typedef std::map<base::string16, NPObject*> ObjectMap; ObjectMap objects_; JavaObjectWeakGlobalRef retained_object_set_; 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 e5cdcc6..3530e1e 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 @@ -73,7 +73,7 @@ void GetFontsInFamily_SlowBlocking(const std::string& family, LOGFONTW logfont; memset(&logfont, 0, sizeof(logfont)); logfont.lfCharSet = DEFAULT_CHARSET; - string16 family16 = UTF8ToUTF16(family); + base::string16 family16 = 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_message_filter.cc b/content/browser/renderer_host/render_message_filter.cc index 3aca534..10a3901 100644 --- a/content/browser/renderer_host/render_message_filter.cc +++ b/content/browser/renderer_host/render_message_filter.cc @@ -843,7 +843,7 @@ void RenderMessageFilter::OnGetMonitorColorProfile(std::vector<char>* profile) { void RenderMessageFilter::OnDownloadUrl(const IPC::Message& message, const GURL& url, const Referrer& referrer, - const string16& suggested_name) { + const base::string16& suggested_name) { scoped_ptr<DownloadSaveInfo> save_info(new DownloadSaveInfo()); save_info->suggested_name = suggested_name; scoped_ptr<net::URLRequest> request( @@ -1112,7 +1112,7 @@ void RenderMessageFilter::OnDidLose3DContext( #if defined(OS_WIN) void RenderMessageFilter::OnPreCacheFontCharacters(const LOGFONT& font, - const string16& str) { + const base::string16& str) { // First, comments from FontCacheDispatcher::OnPreCacheFont do apply here too. // Except that for True Type fonts, // GetTextMetrics will not load the font in memory. diff --git a/content/browser/renderer_host/render_message_filter.h b/content/browser/renderer_host/render_message_filter.h index 526849e..23483a4 100644 --- a/content/browser/renderer_host/render_message_filter.h +++ b/content/browser/renderer_host/render_message_filter.h @@ -156,7 +156,7 @@ class RenderMessageFilter : public BrowserMessageFilter { #if defined(OS_WIN) void OnPreCacheFontCharacters(const LOGFONT& log_font, - const string16& characters); + const base::string16& characters); #endif void OnGetPlugins(bool refresh, IPC::Message* reply_msg); @@ -190,7 +190,7 @@ class RenderMessageFilter : public BrowserMessageFilter { void OnDownloadUrl(const IPC::Message& message, const GURL& url, const Referrer& referrer, - const string16& suggested_name); + const base::string16& suggested_name); void OnCheckNotificationPermission(const GURL& source_origin, int* permission_level); diff --git a/content/browser/renderer_host/render_view_host_delegate.cc b/content/browser/renderer_host/render_view_host_delegate.cc index d7b8ba5..4786909 100644 --- a/content/browser/renderer_host/render_view_host_delegate.cc +++ b/content/browser/renderer_host/render_view_host_delegate.cc @@ -24,8 +24,8 @@ bool RenderViewHostDelegate::OnMessageReceived(RenderViewHost* render_view_host, } bool RenderViewHostDelegate::AddMessageToConsole( - int32 level, const string16& message, int32 line_no, - const string16& source_id) { + int32 level, const base::string16& message, int32 line_no, + const base::string16& source_id) { return false; } diff --git a/content/browser/renderer_host/render_view_host_delegate.h b/content/browser/renderer_host/render_view_host_delegate.h index f3bf8aa..e5fa672 100644 --- a/content/browser/renderer_host/render_view_host_delegate.h +++ b/content/browser/renderer_host/render_view_host_delegate.h @@ -195,7 +195,7 @@ class CONTENT_EXPORT RenderViewHostDelegate { // The page's title was changed and should be updated. virtual void UpdateTitle(RenderViewHost* render_view_host, int32 page_id, - const string16& title, + const base::string16& title, base::i18n::TextDirection title_direction) {} // The page's encoding was changed and should be updated. @@ -281,23 +281,23 @@ class CONTENT_EXPORT RenderViewHostDelegate { // A javascript message, confirmation or prompt should be shown. virtual void RunJavaScriptMessage(RenderViewHost* rvh, - const string16& message, - const string16& default_prompt, + const base::string16& message, + const base::string16& default_prompt, const GURL& frame_url, JavaScriptMessageType type, IPC::Message* reply_msg, bool* did_suppress_message) {} virtual void RunBeforeUnloadConfirm(RenderViewHost* rvh, - const string16& message, + const base::string16& message, bool is_reload, IPC::Message* reply_msg) {} // A message was added to to the console. virtual bool AddMessageToConsole(int32 level, - const string16& message, + const base::string16& message, int32 line_no, - const string16& source_id); + const base::string16& source_id); // Return a dummy RendererPreferences object that will be used by the renderer // associated with the owning RenderViewHost. diff --git a/content/browser/renderer_host/render_view_host_impl.cc b/content/browser/renderer_host/render_view_host_impl.cc index 92d4fa5..6382706 100644 --- a/content/browser/renderer_host/render_view_host_impl.cc +++ b/content/browser/renderer_host/render_view_host_impl.cc @@ -243,7 +243,7 @@ SiteInstance* RenderViewHostImpl::GetSiteInstance() const { } bool RenderViewHostImpl::CreateRenderView( - const string16& frame_name, + const base::string16& frame_name, int opener_route_id, int32 max_page_id) { TRACE_EVENT0("renderer_host", "RenderViewHostImpl::CreateRenderView"); @@ -948,8 +948,9 @@ void RenderViewHostImpl::DesktopNotificationPostDisplay(int callback_context) { callback_context)); } -void RenderViewHostImpl::DesktopNotificationPostError(int notification_id, - const string16& message) { +void RenderViewHostImpl::DesktopNotificationPostError( + int notification_id, + const base::string16& message) { Send(new DesktopNotificationMsg_PostError( GetRoutingID(), notification_id, message)); } @@ -965,15 +966,15 @@ void RenderViewHostImpl::DesktopNotificationPostClick(int notification_id) { } void RenderViewHostImpl::ExecuteJavascriptInWebFrame( - const string16& frame_xpath, - const string16& jscript) { + const base::string16& frame_xpath, + const base::string16& jscript) { Send(new ViewMsg_ScriptEvalRequest(GetRoutingID(), frame_xpath, jscript, 0, false)); } void RenderViewHostImpl::ExecuteJavascriptInWebFrameCallbackResult( - const string16& frame_xpath, - const string16& jscript, + const base::string16& frame_xpath, + const base::string16& jscript, const JavascriptResultCallback& callback) { static int next_id = 1; int key = next_id++; @@ -982,9 +983,10 @@ void RenderViewHostImpl::ExecuteJavascriptInWebFrameCallbackResult( javascript_callbacks_.insert(std::make_pair(key, callback)); } -void RenderViewHostImpl::JavaScriptDialogClosed(IPC::Message* reply_msg, - bool success, - const string16& user_input) { +void RenderViewHostImpl::JavaScriptDialogClosed( + IPC::Message* reply_msg, + bool success, + const base::string16& user_input) { GetProcess()->SetIgnoreInputEvents(false); bool is_waiting = is_waiting_for_beforeunload_ack_ || is_waiting_for_unload_ack_; @@ -1535,7 +1537,7 @@ void RenderViewHostImpl::OnUpdateState(int32 page_id, const PageState& state) { void RenderViewHostImpl::OnUpdateTitle( int32 page_id, - const string16& title, + const base::string16& title, blink::WebTextDirection title_direction) { if (title.length() > kMaxTitleChars) { NOTREACHED() << "Renderer sent too many characters in title."; @@ -1669,7 +1671,7 @@ void RenderViewHostImpl::OnDidChangeScrollOffsetPinningForMainFrame( void RenderViewHostImpl::OnDidChangeNumWheelEvents(int count) { } -void RenderViewHostImpl::OnSelectionChanged(const string16& text, +void RenderViewHostImpl::OnSelectionChanged(const base::string16& text, size_t offset, const gfx::Range& range) { if (view_) @@ -1695,8 +1697,8 @@ void RenderViewHostImpl::OnRouteMessageEvent( } void RenderViewHostImpl::OnRunJavaScriptMessage( - const string16& message, - const string16& default_prompt, + const base::string16& message, + const base::string16& default_prompt, const GURL& frame_url, JavaScriptMessageType type, IPC::Message* reply_msg) { @@ -1710,7 +1712,7 @@ void RenderViewHostImpl::OnRunJavaScriptMessage( } void RenderViewHostImpl::OnRunBeforeUnloadConfirm(const GURL& frame_url, - const string16& message, + const base::string16& message, bool is_reload, IPC::Message* reply_msg) { // While a JS before unload dialog is showing, tabs in the same process @@ -1789,9 +1791,9 @@ void RenderViewHostImpl::OnFocusedNodeChanged(bool is_editable_node) { void RenderViewHostImpl::OnAddMessageToConsole( int32 level, - const string16& message, + const base::string16& message, int32 line_no, - const string16& source_id) { + const base::string16& source_id) { if (delegate_->AddMessageToConsole(level, message, line_no, source_id)) return; @@ -2076,12 +2078,12 @@ void RenderViewHostImpl::ReloadFrame() { } void RenderViewHostImpl::Find(int request_id, - const string16& search_text, + const base::string16& search_text, const blink::WebFindOptions& options) { Send(new ViewMsg_Find(GetRoutingID(), request_id, search_text, options)); } -void RenderViewHostImpl::InsertCSS(const string16& frame_xpath, +void RenderViewHostImpl::InsertCSS(const base::string16& frame_xpath, const std::string& css) { Send(new ViewMsg_CSSInsertRequest(GetRoutingID(), frame_xpath, css)); } diff --git a/content/browser/renderer_host/render_view_host_impl.h b/content/browser/renderer_host/render_view_host_impl.h index 424a787..6e02571 100644 --- a/content/browser/renderer_host/render_view_host_impl.h +++ b/content/browser/renderer_host/render_view_host_impl.h @@ -133,8 +133,9 @@ class CONTENT_EXPORT RenderViewHostImpl virtual void DesktopNotificationPermissionRequestDone( int callback_context) OVERRIDE; virtual void DesktopNotificationPostDisplay(int callback_context) OVERRIDE; - virtual void DesktopNotificationPostError(int notification_id, - const string16& message) OVERRIDE; + virtual void DesktopNotificationPostError( + int notification_id, + const base::string16& message) OVERRIDE; virtual void DesktopNotificationPostClose(int notification_id, bool by_user) OVERRIDE; virtual void DesktopNotificationPostClick(int notification_id) OVERRIDE; @@ -172,17 +173,18 @@ class CONTENT_EXPORT RenderViewHostImpl virtual void ExecuteMediaPlayerActionAtLocation( const gfx::Point& location, const blink::WebMediaPlayerAction& action) OVERRIDE; - virtual void ExecuteJavascriptInWebFrame(const string16& frame_xpath, - const string16& jscript) OVERRIDE; + virtual void ExecuteJavascriptInWebFrame( + const base::string16& frame_xpath, + const base::string16& jscript) OVERRIDE; virtual void ExecuteJavascriptInWebFrameCallbackResult( - const string16& frame_xpath, - const string16& jscript, + const base::string16& frame_xpath, + const base::string16& jscript, const JavascriptResultCallback& callback) OVERRIDE; virtual void ExecutePluginActionAtLocation( const gfx::Point& location, const blink::WebPluginAction& action) OVERRIDE; virtual void ExitFullscreen() OVERRIDE; - virtual void Find(int request_id, const string16& search_text, + virtual void Find(int request_id, const base::string16& search_text, const blink::WebFindOptions& options) OVERRIDE; virtual void StopFinding(StopFindAction action) OVERRIDE; virtual void FirePageBeforeUnload(bool for_cross_site_transition) OVERRIDE; @@ -192,7 +194,7 @@ class CONTENT_EXPORT RenderViewHostImpl virtual RenderViewHostDelegate* GetDelegate() const OVERRIDE; virtual int GetEnabledBindings() const OVERRIDE; virtual SiteInstance* GetSiteInstance() const OVERRIDE; - virtual void InsertCSS(const string16& frame_xpath, + virtual void InsertCSS(const base::string16& frame_xpath, const std::string& css) OVERRIDE; virtual bool IsRenderViewLive() const OVERRIDE; virtual bool IsSubframe() const OVERRIDE; @@ -233,7 +235,7 @@ class CONTENT_EXPORT RenderViewHostImpl // The |opener_route_id| parameter indicates which RenderView created this // (MSG_ROUTING_NONE if none). If |max_page_id| is larger than -1, the // RenderView is told to start issuing page IDs at |max_page_id| + 1. - virtual bool CreateRenderView(const string16& frame_name, + virtual bool CreateRenderView(const base::string16& frame_name, int opener_route_id, int32 max_page_id); @@ -348,7 +350,7 @@ class CONTENT_EXPORT RenderViewHostImpl // closed by the user. void JavaScriptDialogClosed(IPC::Message* reply_msg, bool success, - const string16& user_input); + const base::string16& user_input); // Tells the renderer view to focus the first (last if reverse is true) node. void SetInitialFocus(bool reverse); @@ -534,7 +536,7 @@ class CONTENT_EXPORT RenderViewHostImpl void OnNavigate(const IPC::Message& msg); void OnUpdateState(int32 page_id, const PageState& state); void OnUpdateTitle(int32 page_id, - const string16& title, + const base::string16& title, blink::WebTextDirection title_direction); void OnUpdateEncoding(const std::string& encoding); void OnUpdateTargetURL(int32 page_id, const GURL& url); @@ -556,7 +558,7 @@ class CONTENT_EXPORT RenderViewHostImpl void OnDidChangeScrollOffsetPinningForMainFrame(bool is_pinned_to_left, bool is_pinned_to_right); void OnDidChangeNumWheelEvents(int count); - void OnSelectionChanged(const string16& text, + void OnSelectionChanged(const base::string16& text, size_t offset, const gfx::Range& range); void OnSelectionBoundsChanged( @@ -564,13 +566,13 @@ class CONTENT_EXPORT RenderViewHostImpl void OnPasteFromSelectionClipboard(); void OnRouteCloseEvent(); void OnRouteMessageEvent(const ViewMsg_PostMessage_Params& params); - void OnRunJavaScriptMessage(const string16& message, - const string16& default_prompt, + void OnRunJavaScriptMessage(const base::string16& message, + const base::string16& default_prompt, const GURL& frame_url, JavaScriptMessageType type, IPC::Message* reply_msg); void OnRunBeforeUnloadConfirm(const GURL& frame_url, - const string16& message, + const base::string16& message, bool is_reload, IPC::Message* reply_msg); void OnStartDragging(const DropData& drop_data, @@ -583,9 +585,9 @@ class CONTENT_EXPORT RenderViewHostImpl void OnTakeFocus(bool reverse); void OnFocusedNodeChanged(bool is_editable_node); void OnAddMessageToConsole(int32 level, - const string16& message, + const base::string16& message, int32 line_no, - const string16& source_id); + const base::string16& source_id); void OnUpdateInspectorSetting(const std::string& key, const std::string& value); void OnShouldCloseACK( diff --git a/content/browser/renderer_host/render_view_host_unittest.cc b/content/browser/renderer_host/render_view_host_unittest.cc index 67e08d2..3196097 100644 --- a/content/browser/renderer_host/render_view_host_unittest.cc +++ b/content/browser/renderer_host/render_view_host_unittest.cc @@ -199,7 +199,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()), string16())); + 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_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc index 9cb8922..c792a6d 100644 --- a/content/browser/renderer_host/render_widget_host_impl.cc +++ b/content/browser/renderer_host/render_widget_host_impl.cc @@ -1321,7 +1321,7 @@ void RenderWidgetHostImpl::CandidateWindowHidden() { } void RenderWidgetHostImpl::ImeSetComposition( - const string16& text, + const base::string16& text, const std::vector<blink::WebCompositionUnderline>& underlines, int selection_start, int selection_end) { @@ -1330,7 +1330,7 @@ void RenderWidgetHostImpl::ImeSetComposition( } void RenderWidgetHostImpl::ImeConfirmComposition( - const string16& text, + const base::string16& text, const gfx::Range& replacement_range, bool keep_selection) { Send(new ViewMsg_ImeConfirmComposition( @@ -1338,7 +1338,7 @@ void RenderWidgetHostImpl::ImeConfirmComposition( } void RenderWidgetHostImpl::ImeCancelComposition() { - Send(new ViewMsg_ImeSetComposition(GetRoutingID(), string16(), + Send(new ViewMsg_ImeSetComposition(GetRoutingID(), base::string16(), std::vector<blink::WebCompositionUnderline>(), 0, 0)); } @@ -1442,7 +1442,7 @@ void RenderWidgetHostImpl::OnClose() { } void RenderWidgetHostImpl::OnSetTooltipText( - const string16& tooltip_text, + const base::string16& tooltip_text, WebTextDirection text_direction_hint) { // First, add directionality marks around tooltip text if necessary. // A naive solution would be to simply always wrap the text. However, on @@ -1457,7 +1457,7 @@ void RenderWidgetHostImpl::OnSetTooltipText( // trying to detect the directionality from the tooltip text rather than the // element direction. One could argue that would be a preferable solution // but we use the current approach to match Fx & IE's behavior. - string16 wrapped_tooltip_text = tooltip_text; + base::string16 wrapped_tooltip_text = tooltip_text; if (!tooltip_text.empty()) { if (text_direction_hint == blink::WebTextDirectionLeftToRight) { // Force the tooltip to have LTR directionality. @@ -1935,11 +1935,11 @@ void RenderWidgetHostImpl::ScrollBackingStoreRect(const gfx::Vector2d& delta, backing_store->ScrollBackingStore(delta, clip_rect, view_size); } -void RenderWidgetHostImpl::Replace(const string16& word) { +void RenderWidgetHostImpl::Replace(const base::string16& word) { Send(new InputMsg_Replace(routing_id_, word)); } -void RenderWidgetHostImpl::ReplaceMisspelling(const string16& word) { +void RenderWidgetHostImpl::ReplaceMisspelling(const base::string16& word) { Send(new InputMsg_ReplaceMisspelling(routing_id_, word)); } diff --git a/content/browser/renderer_host/render_widget_host_impl.h b/content/browser/renderer_host/render_widget_host_impl.h index 66e2e9a..9b94a44 100644 --- a/content/browser/renderer_host/render_widget_host_impl.h +++ b/content/browser/renderer_host/render_widget_host_impl.h @@ -164,8 +164,8 @@ class CONTENT_EXPORT RenderWidgetHostImpl : virtual public RenderWidgetHost, int tag, const gfx::Size& page_size, const gfx::Size& desired_size) OVERRIDE; - virtual void Replace(const string16& word) OVERRIDE; - virtual void ReplaceMisspelling(const string16& word) OVERRIDE; + virtual void Replace(const base::string16& word) OVERRIDE; + virtual void ReplaceMisspelling(const base::string16& word) OVERRIDE; virtual void ResizeRectChanged(const gfx::Rect& new_rect) OVERRIDE; virtual void RestartHangMonitorTimeout() OVERRIDE; virtual void SetIgnoreInputEvents(bool ignore_input_events) OVERRIDE; @@ -333,7 +333,7 @@ class CONTENT_EXPORT RenderWidgetHostImpl : virtual public RenderWidgetHost, // * when it receives a "preedit_changed" signal of GtkIMContext (on Linux); // * when markedText of NSTextInput is called (on Mac). void ImeSetComposition( - const string16& text, + const base::string16& text, const std::vector<blink::WebCompositionUnderline>& underlines, int selection_start, int selection_end); @@ -344,7 +344,7 @@ class CONTENT_EXPORT RenderWidgetHostImpl : virtual public RenderWidgetHost, // (on Windows); // * when it receives a "commit" signal of GtkIMContext (on Linux); // * when insertText of NSTextInput is called (on Mac). - void ImeConfirmComposition(const string16& text, + void ImeConfirmComposition(const base::string16& text, const gfx::Range& replacement_range, bool keep_selection); @@ -651,7 +651,7 @@ class CONTENT_EXPORT RenderWidgetHostImpl : virtual public RenderWidgetHost, void OnClose(); void OnUpdateScreenRectsAck(); void OnRequestMove(const gfx::Rect& pos); - void OnSetTooltipText(const string16& tooltip_text, + void OnSetTooltipText(const base::string16& tooltip_text, blink::WebTextDirection text_direction_hint); void OnPaintAtSizeAck(int tag, const gfx::Size& size); #if defined(OS_MACOSX) 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 c8c559b..0c79dbd 100644 --- a/content/browser/renderer_host/render_widget_host_view_android.cc +++ b/content/browser/renderer_host/render_widget_host_view_android.cc @@ -524,11 +524,11 @@ void RenderWidgetHostViewAndroid::Destroy() { } void RenderWidgetHostViewAndroid::SetTooltipText( - const string16& tooltip_text) { + const base::string16& tooltip_text) { // Tooltips don't makes sense on Android. } -void RenderWidgetHostViewAndroid::SelectionChanged(const string16& text, +void RenderWidgetHostViewAndroid::SelectionChanged(const base::string16& text, size_t offset, const gfx::Range& range) { RenderWidgetHostViewBase::SelectionChanged(text, offset, range); diff --git a/content/browser/renderer_host/render_widget_host_view_android.h b/content/browser/renderer_host/render_widget_host_view_android.h index c01120f..537b87b 100644 --- a/content/browser/renderer_host/render_widget_host_view_android.h +++ b/content/browser/renderer_host/render_widget_host_view_android.h @@ -112,8 +112,8 @@ class RenderWidgetHostViewAndroid virtual void RenderProcessGone(base::TerminationStatus status, int error_code) OVERRIDE; virtual void Destroy() OVERRIDE; - virtual void SetTooltipText(const string16& tooltip_text) OVERRIDE; - virtual void SelectionChanged(const string16& text, + virtual void SetTooltipText(const base::string16& tooltip_text) OVERRIDE; + virtual void SelectionChanged(const base::string16& text, size_t offset, const gfx::Range& range) OVERRIDE; virtual void SelectionBoundsChanged( diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc index de6c1ed..27db1a4 100644 --- a/content/browser/renderer_host/render_widget_host_view_aura.cc +++ b/content/browser/renderer_host/render_widget_host_view_aura.cc @@ -990,7 +990,8 @@ void RenderWidgetHostViewAura::Destroy() { delete window_; } -void RenderWidgetHostViewAura::SetTooltipText(const string16& tooltip_text) { +void RenderWidgetHostViewAura::SetTooltipText( + const base::string16& tooltip_text) { tooltip_ = tooltip_text; aura::Window* root_window = window_->GetRootWindow(); aura::client::TooltipClient* tooltip_client = @@ -1002,7 +1003,7 @@ void RenderWidgetHostViewAura::SetTooltipText(const string16& tooltip_text) { } } -void RenderWidgetHostViewAura::SelectionChanged(const string16& text, +void RenderWidgetHostViewAura::SelectionChanged(const base::string16& text, size_t offset, const gfx::Range& range) { RenderWidgetHostViewBase::SelectionChanged(text, offset, range); @@ -2180,8 +2181,10 @@ void RenderWidgetHostViewAura::SetCompositionText( } void RenderWidgetHostViewAura::ConfirmCompositionText() { - if (host_ && has_composition_text_) - host_->ImeConfirmComposition(string16(), gfx::Range::InvalidRange(), false); + if (host_ && has_composition_text_) { + host_->ImeConfirmComposition(base::string16(), gfx::Range::InvalidRange(), + false); + } has_composition_text_ = false; } @@ -2191,7 +2194,7 @@ void RenderWidgetHostViewAura::ClearCompositionText() { has_composition_text_ = false; } -void RenderWidgetHostViewAura::InsertText(const string16& text) { +void RenderWidgetHostViewAura::InsertText(const base::string16& text) { DCHECK(text_input_type_ != ui::TEXT_INPUT_TYPE_NONE); if (host_) host_->ImeConfirmComposition(text, gfx::Range::InvalidRange(), false); @@ -2326,7 +2329,7 @@ bool RenderWidgetHostViewAura::DeleteRange(const gfx::Range& range) { bool RenderWidgetHostViewAura::GetTextFromRange( const gfx::Range& range, - string16* text) const { + base::string16* text) const { gfx::Range selection_text_range(selection_text_offset_, selection_text_offset_ + selection_text_.length()); @@ -3252,8 +3255,10 @@ bool RenderWidgetHostViewAura::NeedsInputGrab() { void RenderWidgetHostViewAura::FinishImeCompositionSession() { if (!has_composition_text_) return; - if (host_) - host_->ImeConfirmComposition(string16(), gfx::Range::InvalidRange(), false); + if (host_) { + host_->ImeConfirmComposition(base::string16(), gfx::Range::InvalidRange(), + false); + } ImeCancelComposition(); } diff --git a/content/browser/renderer_host/render_widget_host_view_aura.h b/content/browser/renderer_host/render_widget_host_view_aura.h index 385495a..569209b 100644 --- a/content/browser/renderer_host/render_widget_host_view_aura.h +++ b/content/browser/renderer_host/render_widget_host_view_aura.h @@ -192,8 +192,8 @@ class CONTENT_EXPORT RenderWidgetHostViewAura virtual void RenderProcessGone(base::TerminationStatus status, int error_code) OVERRIDE; virtual void Destroy() OVERRIDE; - virtual void SetTooltipText(const string16& tooltip_text) OVERRIDE; - virtual void SelectionChanged(const string16& text, + virtual void SetTooltipText(const base::string16& tooltip_text) OVERRIDE; + virtual void SelectionChanged(const base::string16& text, size_t offset, const gfx::Range& range) OVERRIDE; virtual void SelectionBoundsChanged( @@ -258,7 +258,7 @@ class CONTENT_EXPORT RenderWidgetHostViewAura const ui::CompositionText& composition) OVERRIDE; virtual void ConfirmCompositionText() OVERRIDE; virtual void ClearCompositionText() OVERRIDE; - virtual void InsertText(const string16& text) OVERRIDE; + virtual void InsertText(const base::string16& text) OVERRIDE; virtual void InsertChar(char16 ch, int flags) OVERRIDE; virtual gfx::NativeWindow GetAttachedWindow() const OVERRIDE; virtual ui::TextInputType GetTextInputType() const OVERRIDE; @@ -274,7 +274,7 @@ class CONTENT_EXPORT RenderWidgetHostViewAura virtual bool SetSelectionRange(const gfx::Range& range) OVERRIDE; virtual bool DeleteRange(const gfx::Range& range) OVERRIDE; virtual bool GetTextFromRange(const gfx::Range& range, - string16* text) const OVERRIDE; + base::string16* text) const OVERRIDE; virtual void OnInputMethodChanged() OVERRIDE; virtual bool ChangeTextDirectionAndLayoutAlignment( base::i18n::TextDirection direction) OVERRIDE; @@ -619,7 +619,7 @@ class CONTENT_EXPORT RenderWidgetHostViewAura bool accept_return_character_; // Current tooltip text. - string16 tooltip_; + base::string16 tooltip_; std::vector<base::Closure> on_compositing_did_commit_callbacks_; diff --git a/content/browser/renderer_host/render_widget_host_view_base.cc b/content/browser/renderer_host/render_widget_host_view_base.cc index b96182c..8347b6d 100644 --- a/content/browser/renderer_host/render_widget_host_view_base.cc +++ b/content/browser/renderer_host/render_widget_host_view_base.cc @@ -118,7 +118,7 @@ LRESULT CALLBACK PluginWrapperWindowProc(HWND window, unsigned int message, bool IsPluginWrapperWindow(HWND window) { return gfx::GetClassNameW(window) == - string16(kWrapperNativeWindowClassName); + base::string16(kWrapperNativeWindowClassName); } // Create an intermediate window between the given HWND and its parent. @@ -421,7 +421,7 @@ float RenderWidgetHostViewBase::GetOverdrawBottomHeight() const { return 0.f; } -void RenderWidgetHostViewBase::SelectionChanged(const string16& text, +void RenderWidgetHostViewBase::SelectionChanged(const base::string16& text, size_t offset, const gfx::Range& range) { selection_text_ = text; @@ -439,9 +439,9 @@ void RenderWidgetHostViewBase::SetShowingContextMenu(bool showing) { showing_context_menu_ = showing; } -string16 RenderWidgetHostViewBase::GetSelectedText() const { +base::string16 RenderWidgetHostViewBase::GetSelectedText() const { if (!selection_range_.IsValid()) - return string16(); + return base::string16(); return selection_text_.substr( selection_range_.GetMin() - selection_text_offset_, selection_range_.length()); diff --git a/content/browser/renderer_host/render_widget_host_view_base.h b/content/browser/renderer_host/render_widget_host_view_base.h index 0a6fd1a..eadf92b 100644 --- a/content/browser/renderer_host/render_widget_host_view_base.h +++ b/content/browser/renderer_host/render_widget_host_view_base.h @@ -47,7 +47,7 @@ class CONTENT_EXPORT RenderWidgetHostViewBase // RenderWidgetHostViewPort implementation. virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; - virtual void SelectionChanged(const string16& text, + virtual void SelectionChanged(const base::string16& text, size_t offset, const gfx::Range& range) OVERRIDE; virtual void SetBackground(const SkBitmap& background) OVERRIDE; @@ -56,7 +56,7 @@ class CONTENT_EXPORT RenderWidgetHostViewBase virtual float GetOverdrawBottomHeight() const OVERRIDE; virtual bool IsShowingContextMenu() const OVERRIDE; virtual void SetShowingContextMenu(bool showing_menu) OVERRIDE; - virtual string16 GetSelectedText() const OVERRIDE; + virtual base::string16 GetSelectedText() const OVERRIDE; virtual bool IsMouseLocked() OVERRIDE; virtual void UnhandledWheelEvent( const blink::WebMouseWheelEvent& event) OVERRIDE; @@ -140,7 +140,7 @@ class CONTENT_EXPORT RenderWidgetHostViewBase bool showing_context_menu_; // A buffer containing the text inside and around the current selection range. - string16 selection_text_; + base::string16 selection_text_; // The offset of the text stored in |selection_text_| relative to the start of // the web page. 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 494ba38..18d3180 100644 --- a/content/browser/renderer_host/render_widget_host_view_gtk.cc +++ b/content/browser/renderer_host/render_widget_host_view_gtk.cc @@ -929,14 +929,15 @@ void RenderWidgetHostViewGtk::Destroy() { base::MessageLoop::current()->DeleteSoon(FROM_HERE, this); } -void RenderWidgetHostViewGtk::SetTooltipText(const string16& tooltip_text) { +void RenderWidgetHostViewGtk::SetTooltipText( + const base::string16& tooltip_text) { // Maximum number of characters we allow in a tooltip. const int kMaxTooltipLength = 8 << 10; // Clamp the tooltip length to kMaxTooltipLength so that we don't // accidentally DOS the user with a mega tooltip (since GTK doesn't do // this itself). // I filed https://bugzilla.gnome.org/show_bug.cgi?id=604641 upstream. - const string16 clamped_tooltip = + const base::string16 clamped_tooltip = gfx::TruncateString(tooltip_text, kMaxTooltipLength); if (clamped_tooltip.empty()) { @@ -947,7 +948,7 @@ void RenderWidgetHostViewGtk::SetTooltipText(const string16& tooltip_text) { } } -void RenderWidgetHostViewGtk::SelectionChanged(const string16& text, +void RenderWidgetHostViewGtk::SelectionChanged(const base::string16& text, size_t offset, const gfx::Range& range) { RenderWidgetHostViewBase::SelectionChanged(text, offset, range); @@ -1347,7 +1348,7 @@ bool RenderWidgetHostViewGtk::LockMouse() { } // Clear the tooltip window. - SetTooltipText(string16()); + SetTooltipText(base::string16()); // Ensure that the widget center location will be relevant for this mouse // lock session. It is updated whenever the window geometry moves @@ -1411,7 +1412,7 @@ bool RenderWidgetHostViewGtk::RetrieveSurrounding(std::string* text, *text = base::UTF16ToUTF8AndAdjustOffset( base::StringPiece16(selection_text_), &offset); - if (offset == string16::npos) { + if (offset == base::string16::npos) { NOTREACHED() << "Invalid offset in UTF16 string."; return false; } diff --git a/content/browser/renderer_host/render_widget_host_view_gtk.h b/content/browser/renderer_host/render_widget_host_view_gtk.h index 9bb2755..e01181a 100644 --- a/content/browser/renderer_host/render_widget_host_view_gtk.h +++ b/content/browser/renderer_host/render_widget_host_view_gtk.h @@ -93,8 +93,8 @@ class CONTENT_EXPORT RenderWidgetHostViewGtk int error_code) OVERRIDE; virtual void Destroy() OVERRIDE; virtual void WillDestroyRenderWidget(RenderWidgetHost* rwh) {} - virtual void SetTooltipText(const string16& tooltip_text) OVERRIDE; - virtual void SelectionChanged(const string16& text, + virtual void SetTooltipText(const base::string16& tooltip_text) OVERRIDE; + virtual void SelectionChanged(const base::string16& text, size_t offset, const gfx::Range& range) OVERRIDE; virtual void SelectionBoundsChanged( diff --git a/content/browser/renderer_host/render_widget_host_view_guest.cc b/content/browser/renderer_host/render_widget_host_view_guest.cc index 6299384..49562c8 100644 --- a/content/browser/renderer_host/render_widget_host_view_guest.cc +++ b/content/browser/renderer_host/render_widget_host_view_guest.cc @@ -169,7 +169,8 @@ void RenderWidgetHostViewGuest::Destroy() { platform_view_->Destroy(); } -void RenderWidgetHostViewGuest::SetTooltipText(const string16& tooltip_text) { +void RenderWidgetHostViewGuest::SetTooltipText( + const base::string16& tooltip_text) { platform_view_->SetTooltipText(tooltip_text); } @@ -324,7 +325,7 @@ void RenderWidgetHostViewGuest::DidUpdateBackingStore( NOTREACHED(); } -void RenderWidgetHostViewGuest::SelectionChanged(const string16& text, +void RenderWidgetHostViewGuest::SelectionChanged(const base::string16& text, size_t offset, const gfx::Range& range) { platform_view_->SelectionChanged(text, offset, range); diff --git a/content/browser/renderer_host/render_widget_host_view_guest.h b/content/browser/renderer_host/render_widget_host_view_guest.h index e406b50..ac9fa0e 100644 --- a/content/browser/renderer_host/render_widget_host_view_guest.h +++ b/content/browser/renderer_host/render_widget_host_view_guest.h @@ -98,8 +98,8 @@ class CONTENT_EXPORT RenderWidgetHostViewGuest int error_code) OVERRIDE; virtual void Destroy() OVERRIDE; virtual void WillDestroyRenderWidget(RenderWidgetHost* rwh) {} - virtual void SetTooltipText(const string16& tooltip_text) OVERRIDE; - virtual void SelectionChanged(const string16& text, + virtual void SetTooltipText(const base::string16& tooltip_text) OVERRIDE; + virtual void SelectionChanged(const base::string16& text, size_t offset, const gfx::Range& range) OVERRIDE; virtual void SelectionBoundsChanged( diff --git a/content/browser/renderer_host/render_widget_host_view_mac.h b/content/browser/renderer_host/render_widget_host_view_mac.h index 4a667b0..ffacd53 100644 --- a/content/browser/renderer_host/render_widget_host_view_mac.h +++ b/content/browser/renderer_host/render_widget_host_view_mac.h @@ -108,10 +108,10 @@ class RenderWidgetHostViewMacEditCommandHelper; NSRange selectedRange_; // Text to be inserted which was generated by handling a key down event. - string16 textToBeInserted_; + base::string16 textToBeInserted_; // Marked text which was generated by handling a key down event. - string16 markedText_; + base::string16 markedText_; // Underline information of the |markedText_|. std::vector<blink::WebCompositionUnderline> underlines_; @@ -264,8 +264,8 @@ class RenderWidgetHostViewMac : public RenderWidgetHostViewBase, virtual void RenderProcessGone(base::TerminationStatus status, int error_code) OVERRIDE; virtual void Destroy() OVERRIDE; - virtual void SetTooltipText(const string16& tooltip_text) OVERRIDE; - virtual void SelectionChanged(const string16& text, + virtual void SetTooltipText(const base::string16& tooltip_text) OVERRIDE; + virtual void SelectionChanged(const base::string16& text, size_t offset, const gfx::Range& range) OVERRIDE; virtual void SelectionBoundsChanged( @@ -338,7 +338,7 @@ class RenderWidgetHostViewMac : public RenderWidgetHostViewBase, void EnableCoreAnimation(); // Sends completed plugin IME notification and text back to the renderer. - void PluginImeCompositionCompleted(const string16& text, int plugin_id); + void PluginImeCompositionCompleted(const base::string16& text, int plugin_id); const std::string& selected_text() const { return selected_text_; } @@ -526,7 +526,7 @@ class RenderWidgetHostViewMac : public RenderWidgetHostViewBase, bool is_loading_; // The text to be shown in the tooltip, supplied by the renderer. - string16 tooltip_text_; + base::string16 tooltip_text_; // Factory used to safely scope delayed calls to ShutdownHost(). base::WeakPtrFactory<RenderWidgetHostViewMac> weak_factory_; 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 b23b5d0..0069e73 100644 --- a/content/browser/renderer_host/render_widget_host_view_mac.mm +++ b/content/browser/renderer_host/render_widget_host_view_mac.mm @@ -1019,7 +1019,8 @@ void RenderWidgetHostViewMac::Destroy() { // Called from the renderer to tell us what the tooltip text should be. It // calls us frequently so we need to cache the value to prevent doing a lot // of repeat work. -void RenderWidgetHostViewMac::SetTooltipText(const string16& tooltip_text) { +void RenderWidgetHostViewMac::SetTooltipText( + const base::string16& tooltip_text) { if (tooltip_text != tooltip_text_ && [[cocoa_view_ window] isKeyWindow]) { tooltip_text_ = tooltip_text; @@ -1027,7 +1028,7 @@ void RenderWidgetHostViewMac::SetTooltipText(const string16& tooltip_text) { // Windows; we're just trying to be polite. Don't persist the trimmed // string, as then the comparison above will always fail and we'll try to // set it again every single time the mouse moves. - string16 display_text = tooltip_text_; + base::string16 display_text = tooltip_text_; if (tooltip_text_.length() > kMaxTooltipLength) display_text = tooltip_text_.substr(0, kMaxTooltipLength); @@ -1060,7 +1061,7 @@ void RenderWidgetHostViewMac::StopSpeaking() { // RenderWidgetHostViewCocoa uses the stored selection text, // which implements NSServicesRequests protocol. // -void RenderWidgetHostViewMac::SelectionChanged(const string16& text, +void RenderWidgetHostViewMac::SelectionChanged(const base::string16& text, size_t offset, const gfx::Range& range) { if (range.is_empty() || text.empty()) { @@ -1245,7 +1246,7 @@ bool RenderWidgetHostViewMac::PostProcessEventForPluginIme( } void RenderWidgetHostViewMac::PluginImeCompositionCompleted( - const string16& text, int plugin_id) { + const base::string16& text, int plugin_id) { if (render_widget_host_) { render_widget_host_->Send(new ViewMsg_PluginImeCompositionCompleted( render_widget_host_->GetRoutingID(), text, plugin_id)); @@ -1745,7 +1746,7 @@ bool RenderWidgetHostViewMac::LockMouse() { [NSCursor hide]; // Clear the tooltip window. - SetTooltipText(string16()); + SetTooltipText(base::string16()); return true; } @@ -2399,7 +2400,7 @@ void RenderWidgetHostViewMac::FrameSwapped() { } else if (oldHasMarkedText && !hasMarkedText_ && !textInserted) { if (unmarkTextCalled_) { widgetHost->ImeConfirmComposition( - string16(), gfx::Range::InvalidRange(), false); + base::string16(), gfx::Range::InvalidRange(), false); } else { widgetHost->ImeCancelComposition(); } @@ -3512,7 +3513,7 @@ extern NSString *NSTextInputReplacementRangeAttributeName; // called in keyEvent: method. if (!handlingKeyDown_) { renderWidgetHostView_->render_widget_host_->ImeConfirmComposition( - string16(), gfx::Range::InvalidRange(), false); + base::string16(), gfx::Range::InvalidRange(), false); } else { unmarkTextCalled_ = YES; } @@ -3750,7 +3751,7 @@ extern NSString *NSTextInputReplacementRangeAttributeName; if (renderWidgetHostView_->render_widget_host_) renderWidgetHostView_->render_widget_host_->ImeConfirmComposition( - string16(), gfx::Range::InvalidRange(), false); + base::string16(), gfx::Range::InvalidRange(), false); [self cancelComposition]; } @@ -3763,7 +3764,7 @@ extern NSString *NSTextInputReplacementRangeAttributeName; if (!active) { [[ComplexTextInputPanel sharedComplexTextInputPanel] cancelComposition]; renderWidgetHostView_->PluginImeCompositionCompleted( - string16(), focusedPluginIdentifier_); + base::string16(), focusedPluginIdentifier_); } } @@ -3798,7 +3799,7 @@ extern NSString *NSTextInputReplacementRangeAttributeName; if (pluginImeActive_ && ![[ComplexTextInputPanel sharedComplexTextInputPanel] inComposition]) { renderWidgetHostView_->PluginImeCompositionCompleted( - string16(), focusedPluginIdentifier_); + base::string16(), focusedPluginIdentifier_); pluginImeActive_ = NO; } } 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 ad37bfd..0a4b795 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 @@ -318,7 +318,7 @@ TEST_F(RenderWidgetHostViewMacTest, AcceleratorDestroy) { } TEST_F(RenderWidgetHostViewMacTest, GetFirstRectForCharacterRangeCaretCase) { - const string16 kDummyString = UTF8ToUTF16("hogehoge"); + const base::string16 kDummyString = UTF8ToUTF16("hogehoge"); const size_t kDummyOffset = 0; gfx::Rect caret_rect(10, 11, 0, 10); diff --git a/content/browser/renderer_host/render_widget_host_view_win.cc b/content/browser/renderer_host/render_widget_host_view_win.cc index c07a989..8238a82 100644 --- a/content/browser/renderer_host/render_widget_host_view_win.cc +++ b/content/browser/renderer_host/render_widget_host_view_win.cc @@ -836,14 +836,15 @@ void RenderWidgetHostViewWin::Destroy() { DestroyWindow(); } -void RenderWidgetHostViewWin::SetTooltipText(const string16& tooltip_text) { +void RenderWidgetHostViewWin::SetTooltipText( + const base::string16& tooltip_text) { if (!render_widget_host_->is_hidden()) EnsureTooltip(); // Clamp the tooltip length to kMaxTooltipLength so that we don't // accidentally DOS the user with a mega tooltip (since Windows doesn't seem // to do this itself). - const string16 new_tooltip_text = + const base::string16 new_tooltip_text = gfx::TruncateString(tooltip_text, kMaxTooltipLength); if (new_tooltip_text != tooltip_text_) { @@ -1017,7 +1018,7 @@ void RenderWidgetHostViewWin::ClearCompositionText() { NOTIMPLEMENTED(); } -void RenderWidgetHostViewWin::InsertText(const string16& text) { +void RenderWidgetHostViewWin::InsertText(const base::string16& text) { if (!base::win::IsTSFAwareRequired()) { NOTREACHED(); return; @@ -1153,7 +1154,7 @@ bool RenderWidgetHostViewWin::DeleteRange(const gfx::Range& range) { } bool RenderWidgetHostViewWin::GetTextFromRange(const gfx::Range& range, - string16* text) const { + base::string16* text) const { if (!base::win::IsTSFAwareRequired()) { NOTREACHED(); return false; diff --git a/content/browser/renderer_host/render_widget_host_view_win.h b/content/browser/renderer_host/render_widget_host_view_win.h index 72b22aa..b9a87bf 100644 --- a/content/browser/renderer_host/render_widget_host_view_win.h +++ b/content/browser/renderer_host/render_widget_host_view_win.h @@ -202,7 +202,7 @@ class RenderWidgetHostViewWin // called by WebContentsImpl before DestroyWindow virtual void WillWmDestroy() OVERRIDE; virtual void Destroy() OVERRIDE; - virtual void SetTooltipText(const string16& tooltip_text) OVERRIDE; + virtual void SetTooltipText(const base::string16& tooltip_text) OVERRIDE; virtual BackingStore* AllocBackingStore(const gfx::Size& size) OVERRIDE; virtual void CopyFromCompositingSurface( const gfx::Rect& src_subrect, @@ -270,7 +270,7 @@ class RenderWidgetHostViewWin const ui::CompositionText& composition) OVERRIDE; virtual void ConfirmCompositionText() OVERRIDE; virtual void ClearCompositionText() OVERRIDE; - virtual void InsertText(const string16& text) OVERRIDE; + virtual void InsertText(const base::string16& text) OVERRIDE; virtual void InsertChar(char16 ch, int flags) OVERRIDE; virtual gfx::NativeWindow GetAttachedWindow() const OVERRIDE; virtual ui::TextInputType GetTextInputType() const OVERRIDE; @@ -286,7 +286,7 @@ class RenderWidgetHostViewWin virtual bool SetSelectionRange(const gfx::Range& range) OVERRIDE; virtual bool DeleteRange(const gfx::Range& range) OVERRIDE; virtual bool GetTextFromRange(const gfx::Range& range, - string16* text) const OVERRIDE; + base::string16* text) const OVERRIDE; virtual void OnInputMethodChanged() OVERRIDE; virtual bool ChangeTextDirectionAndLayoutAlignment( base::i18n::TextDirection direction) OVERRIDE; @@ -516,7 +516,7 @@ class RenderWidgetHostViewWin // Tooltips // The text to be shown in the tooltip, supplied by the renderer. - string16 tooltip_text_; + base::string16 tooltip_text_; // The tooltip control hwnd HWND tooltip_hwnd_; // Whether or not a tooltip is currently visible. We use this to track diff --git a/content/browser/renderer_host/test_render_view_host.cc b/content/browser/renderer_host/test_render_view_host.cc index 19d5958..4dfcf70 100644 --- a/content/browser/renderer_host/test_render_view_host.cc +++ b/content/browser/renderer_host/test_render_view_host.cc @@ -269,7 +269,7 @@ TestRenderViewHost::~TestRenderViewHost() { } bool TestRenderViewHost::CreateRenderView( - const string16& frame_name, + const base::string16& frame_name, int opener_route_id, int32 max_page_id) { DCHECK(!render_view_created_); diff --git a/content/browser/renderer_host/test_render_view_host.h b/content/browser/renderer_host/test_render_view_host.h index 97bcd6e..680f937 100644 --- a/content/browser/renderer_host/test_render_view_host.h +++ b/content/browser/renderer_host/test_render_view_host.h @@ -117,7 +117,7 @@ class TestRenderWidgetHostView : public RenderWidgetHostViewBase { int error_code) OVERRIDE; virtual void WillDestroyRenderWidget(RenderWidgetHost* rwh) { } virtual void Destroy() OVERRIDE; - virtual void SetTooltipText(const string16& tooltip_text) OVERRIDE {} + virtual void SetTooltipText(const base::string16& tooltip_text) OVERRIDE {} virtual void SelectionBoundsChanged( const ViewHostMsg_SelectionBounds_Params& params) OVERRIDE {} virtual void ScrollOffsetChanged() OVERRIDE {} @@ -312,7 +312,7 @@ class TestRenderViewHost // RenderViewHost overrides -------------------------------------------------- - virtual bool CreateRenderView(const string16& frame_name, + virtual bool CreateRenderView(const base::string16& frame_name, int opener_route_id, int32 max_page_id) OVERRIDE; virtual bool IsRenderViewLive() const OVERRIDE; diff --git a/content/browser/session_history_browsertest.cc b/content/browser/session_history_browsertest.cc index 7d006b6..bec8293 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) { - string16 expected_title16(ASCIIToUTF16(expected_title)); + base::string16 expected_title16(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/site_instance_impl_unittest.cc b/content/browser/site_instance_impl_unittest.cc index 5524091..05b3ae7 100644 --- a/content/browser/site_instance_impl_unittest.cc +++ b/content/browser/site_instance_impl_unittest.cc @@ -204,7 +204,8 @@ TEST_F(SiteInstanceTest, SiteInstanceDestructor) { EXPECT_EQ(0, site_delete_counter); NavigationEntryImpl* e1 = new NavigationEntryImpl( - instance, 0, url, Referrer(), string16(), PAGE_TRANSITION_LINK, false); + instance, 0, url, Referrer(), base::string16(), PAGE_TRANSITION_LINK, + false); // Redundantly setting e1's SiteInstance shouldn't affect the ref count. e1->set_site_instance(instance); @@ -212,7 +213,8 @@ TEST_F(SiteInstanceTest, SiteInstanceDestructor) { // Add a second reference NavigationEntryImpl* e2 = new NavigationEntryImpl( - instance, 0, url, Referrer(), string16(), PAGE_TRANSITION_LINK, false); + instance, 0, url, Referrer(), base::string16(), PAGE_TRANSITION_LINK, + false); // Now delete both entries and be sure the SiteInstance goes away. delete e1; @@ -264,7 +266,8 @@ TEST_F(SiteInstanceTest, CloneNavigationEntry) { &browsing_delete_counter); NavigationEntryImpl* e1 = new NavigationEntryImpl( - instance1, 0, url, Referrer(), string16(), PAGE_TRANSITION_LINK, false); + instance1, 0, url, Referrer(), base::string16(), PAGE_TRANSITION_LINK, + false); // Clone the entry NavigationEntryImpl* e2 = new NavigationEntryImpl(*e1); diff --git a/content/browser/site_per_process_browsertest.cc b/content/browser/site_per_process_browsertest.cc index f32e1e9..cca1df0 100644 --- a/content/browser/site_per_process_browsertest.cc +++ b/content/browser/site_per_process_browsertest.cc @@ -36,11 +36,11 @@ class SitePerProcessWebContentsObserver: public WebContentsObserver { virtual void DidFailProvisionalLoad( int64 frame_id, - const string16& frame_unique_name, + const base::string16& frame_unique_name, bool is_main_frame, const GURL& validated_url, int error_code, - const string16& error_description, + const base::string16& error_description, RenderViewHost* render_view_host) OVERRIDE { navigation_url_ = validated_url; navigation_succeeded_ = false; @@ -48,7 +48,7 @@ class SitePerProcessWebContentsObserver: public WebContentsObserver { virtual void DidCommitProvisionalLoadForFrame( int64 frame_id, - const string16& frame_unique_name, + const base::string16& frame_unique_name, bool is_main_frame, const GURL& url, PageTransition transition_type, diff --git a/content/browser/speech/google_one_shot_remote_engine.cc b/content/browser/speech/google_one_shot_remote_engine.cc index a421e79..575dd5f 100644 --- a/content/browser/speech/google_one_shot_remote_engine.cc +++ b/content/browser/speech/google_one_shot_remote_engine.cc @@ -121,7 +121,7 @@ bool ParseServerResponse(const std::string& response_body, const base::DictionaryValue* hypothesis_value = static_cast<const base::DictionaryValue*>(hypothesis); - string16 utterance; + base::string16 utterance; if (!hypothesis_value->GetString(kUtteranceString, &utterance)) { LOG(WARNING) << "ParseServerResponse: Missing utterance value."; diff --git a/content/browser/speech/speech_recognition_manager_impl.cc b/content/browser/speech/speech_recognition_manager_impl.cc index bdc9d1c..6ecfa70 100644 --- a/content/browser/speech/speech_recognition_manager_impl.cc +++ b/content/browser/speech/speech_recognition_manager_impl.cc @@ -672,7 +672,7 @@ bool SpeechRecognitionManagerImpl::HasAudioInputDevices() { return audio_manager_->HasAudioInputDevices(); } -string16 SpeechRecognitionManagerImpl::GetAudioInputDeviceModel() { +base::string16 SpeechRecognitionManagerImpl::GetAudioInputDeviceModel() { return audio_manager_->GetAudioInputDeviceModel(); } diff --git a/content/browser/speech/speech_recognition_manager_impl.h b/content/browser/speech/speech_recognition_manager_impl.h index 7db7d24..d471cf3 100644 --- a/content/browser/speech/speech_recognition_manager_impl.h +++ b/content/browser/speech/speech_recognition_manager_impl.h @@ -75,7 +75,7 @@ class CONTENT_EXPORT SpeechRecognitionManagerImpl : int render_view_id, int request_id) const OVERRIDE; virtual bool HasAudioInputDevices() OVERRIDE; - virtual string16 GetAudioInputDeviceModel() OVERRIDE; + virtual base::string16 GetAudioInputDeviceModel() OVERRIDE; virtual void ShowAudioInputSettings() OVERRIDE; // SpeechRecognitionEventListener methods. diff --git a/content/browser/speech/speech_recognizer_impl_android.cc b/content/browser/speech/speech_recognizer_impl_android.cc index c771cef..2e8c57e 100644 --- a/content/browser/speech/speech_recognizer_impl_android.cc +++ b/content/browser/speech/speech_recognizer_impl_android.cc @@ -146,7 +146,7 @@ void SpeechRecognizerImplAndroid::OnAudioEnd(JNIEnv* env, jobject obj) { void SpeechRecognizerImplAndroid::OnRecognitionResults(JNIEnv* env, jobject obj, jobjectArray strings, jfloatArray floats, jboolean provisional) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); - std::vector<string16> options; + std::vector<base::string16> options; AppendJavaStringArrayToStringVector(env, strings, &options); std::vector<float> scores(options.size(), 0.0); if (floats != NULL) diff --git a/content/browser/web_contents/touch_editable_impl_aura.cc b/content/browser/web_contents/touch_editable_impl_aura.cc index 6f85625..ed002c7 100644 --- a/content/browser/web_contents/touch_editable_impl_aura.cc +++ b/content/browser/web_contents/touch_editable_impl_aura.cc @@ -307,7 +307,7 @@ bool TouchEditableImplAura::IsCommandIdEnabled(int command_id) const { case IDS_APP_COPY: return has_selection; case IDS_APP_PASTE: { - string16 result; + base::string16 result; ui::Clipboard::GetForCurrentThread()->ReadText( ui::CLIPBOARD_TYPE_COPY_PASTE, &result); return editable && !result.empty(); diff --git a/content/browser/web_contents/web_contents_drag_win.cc b/content/browser/web_contents/web_contents_drag_win.cc index 3a59057..ffc8713 100644 --- a/content/browser/web_contents/web_contents_drag_win.cc +++ b/content/browser/web_contents/web_contents_drag_win.cc @@ -227,7 +227,7 @@ void WebContentsDragWin::PrepareDragForDownload( const GURL& page_url, const std::string& page_encoding) { // Parse the download metadata. - string16 mime_type; + base::string16 mime_type; base::FilePath file_name; GURL download_url; if (!ParseDownloadMetadata(drop_data.download_metadata, @@ -284,7 +284,7 @@ void WebContentsDragWin::PrepareDragForFileContents( // Images without ALT text will only have a file extension so we need to // synthesize one from the provided extension and URL. if (file_name.BaseName().RemoveExtension().empty()) { - const string16 extension = file_name.Extension(); + const base::string16 extension = file_name.Extension(); // Retrieve the name from the URL. file_name = base::FilePath( net::GetSuggestedFilename(drop_data.url, "", "", "", "", "")); diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc index e05cab0..7d04a60 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc @@ -348,7 +348,7 @@ WebContentsImpl::WebContentsImpl( crashed_status_(base::TERMINATION_STATUS_STILL_RUNNING), crashed_error_code_(0), waiting_for_response_(false), - load_state_(net::LOAD_STATE_IDLE, string16()), + load_state_(net::LOAD_STATE_IDLE, base::string16()), upload_size_(0), upload_position_(0), displayed_insecure_content_(false), @@ -727,7 +727,7 @@ gfx::NativeViewAccessible accessible_parent) { } #endif -const string16& WebContentsImpl::GetTitle() const { +const base::string16& WebContentsImpl::GetTitle() const { // Transient entries take precedence. They are used for interstitial pages // that are shown on top of existing pages. NavigationEntry* entry = controller_.GetTransientEntry(); @@ -744,7 +744,7 @@ const string16& WebContentsImpl::GetTitle() const { entry = controller_.GetVisibleEntry(); if (!(entry && entry->IsViewSourceMode())) { // Give the Web UI the chance to override our title. - const string16& title = our_web_ui->GetOverriddenTitle(); + const base::string16& title = our_web_ui->GetOverriddenTitle(); if (!title.empty()) return title; } @@ -832,7 +832,7 @@ const net::LoadStateWithParam& WebContentsImpl::GetLoadState() const { return load_state_; } -const string16& WebContentsImpl::GetLoadStateHost() const { +const base::string16& WebContentsImpl::GetLoadStateHost() const { return load_state_host_; } @@ -2219,7 +2219,7 @@ void WebContentsImpl::OnDidFailLoadWithError( const GURL& url, bool is_main_frame, int error_code, - const string16& error_description) { + const base::string16& error_description) { GURL validated_url(url); RenderProcessHost* render_process_host = message_source_->GetProcess(); RenderViewHost::FilterURL(render_process_host, false, &validated_url); @@ -2280,7 +2280,7 @@ void WebContentsImpl::OnJSOutOfMemory() { void WebContentsImpl::OnRegisterProtocolHandler(const std::string& protocol, const GURL& url, - const string16& title, + const base::string16& title, bool user_gesture) { if (!delegate_) return; @@ -2516,7 +2516,8 @@ void WebContentsImpl::SetIsLoading(RenderViewHost* render_view_host, return; if (!is_loading) { - load_state_ = net::LoadStateWithParam(net::LOAD_STATE_IDLE, string16()); + load_state_ = net::LoadStateWithParam(net::LOAD_STATE_IDLE, + base::string16()); load_state_host_.clear(); upload_size_ = 0; upload_position_ = 0; @@ -2618,11 +2619,11 @@ void WebContentsImpl::UpdateMaxPageIDIfNecessary(RenderViewHost* rvh) { } bool WebContentsImpl::UpdateTitleForEntry(NavigationEntryImpl* entry, - const string16& title) { + const base::string16& title) { // For file URLs without a title, use the pathname instead. In the case of a // synthesized title, we don't want the update to count toward the "one set // per page of the title to history." - string16 final_title; + base::string16 final_title; bool explicit_set; if (entry && entry->GetURL().SchemeIsFile() && title.empty()) { final_title = UTF8ToUTF16(entry->GetURL().ExtractFileName()); @@ -2975,7 +2976,7 @@ void WebContentsImpl::UpdateState(RenderViewHost* rvh, void WebContentsImpl::UpdateTitle(RenderViewHost* rvh, int32 page_id, - const string16& title, + const base::string16& title, base::i18n::TextDirection title_direction) { // If we have a title, that's a pretty good indication that we've started // getting useful data. @@ -3291,8 +3292,8 @@ void WebContentsImpl::RouteMessageEvent( void WebContentsImpl::RunJavaScriptMessage( RenderViewHost* rvh, - const string16& message, - const string16& default_prompt, + const base::string16& message, + const base::string16& default_prompt, const GURL& frame_url, JavaScriptMessageType javascript_message_type, IPC::Message* reply_msg, @@ -3330,7 +3331,7 @@ void WebContentsImpl::RunJavaScriptMessage( if (suppress_this_message) { // If we are suppressing messages, just reply as if the user immediately // pressed "Cancel". - OnDialogClosed(rvh, reply_msg, false, string16()); + OnDialogClosed(rvh, reply_msg, false, base::string16()); } // OnDialogClosed (two lines up) may have caused deletion of this object (see @@ -3338,7 +3339,7 @@ void WebContentsImpl::RunJavaScriptMessage( } void WebContentsImpl::RunBeforeUnloadConfirm(RenderViewHost* rvh, - const string16& message, + const base::string16& message, bool is_reload, IPC::Message* reply_msg) { RenderViewHostImpl* rvhi = static_cast<RenderViewHostImpl*>(rvh); @@ -3352,7 +3353,7 @@ void WebContentsImpl::RunBeforeUnloadConfirm(RenderViewHost* rvh, !delegate_->GetJavaScriptDialogManager(); if (suppress_this_message) { // The reply must be sent to the RVH that sent the request. - rvhi->JavaScriptDialogClosed(reply_msg, true, string16()); + rvhi->JavaScriptDialogClosed(reply_msg, true, base::string16()); return; } @@ -3365,9 +3366,9 @@ void WebContentsImpl::RunBeforeUnloadConfirm(RenderViewHost* rvh, } bool WebContentsImpl::AddMessageToConsole(int32 level, - const string16& message, + const base::string16& message, int32 line_no, - const string16& source_id) { + const base::string16& source_id) { if (!delegate_) return false; return delegate_->AddMessageToConsole(this, level, message, line_no, @@ -3590,7 +3591,7 @@ bool WebContentsImpl::CreateRenderViewForRenderManager( GetMaxPageIDForSiteInstance(render_view_host->GetSiteInstance()); if (!static_cast<RenderViewHostImpl*>( - render_view_host)->CreateRenderView(string16(), + render_view_host)->CreateRenderView(base::string16(), opener_route_id, max_page_id)) { return false; @@ -3618,7 +3619,7 @@ bool WebContentsImpl::CreateRenderViewForInitialEmptyDocument() { void WebContentsImpl::OnDialogClosed(RenderViewHost* rvh, IPC::Message* reply_msg, bool success, - const string16& user_input) { + const base::string16& user_input) { if (is_showing_before_unload_dialog_ && !success) { // If a beforeunload dialog is canceled, we need to stop the throbber from // spinning, since we forced it to start spinning in Navigate. diff --git a/content/browser/web_contents/web_contents_impl.h b/content/browser/web_contents/web_contents_impl.h index 7229682..d2c0483 100644 --- a/content/browser/web_contents/web_contents_impl.h +++ b/content/browser/web_contents/web_contents_impl.h @@ -193,7 +193,7 @@ class CONTENT_EXPORT WebContentsImpl virtual void SetParentNativeViewAccessible( gfx::NativeViewAccessible accessible_parent) OVERRIDE; #endif - virtual const string16& GetTitle() const OVERRIDE; + virtual const base::string16& GetTitle() const OVERRIDE; virtual int32 GetMaxPageID() OVERRIDE; virtual int32 GetMaxPageIDForSiteInstance( SiteInstance* site_instance) OVERRIDE; @@ -202,7 +202,7 @@ class CONTENT_EXPORT WebContentsImpl virtual bool IsLoading() const OVERRIDE; virtual bool IsWaitingForResponse() const OVERRIDE; virtual const net::LoadStateWithParam& GetLoadState() const OVERRIDE; - virtual const string16& GetLoadStateHost() const OVERRIDE; + virtual const base::string16& GetLoadStateHost() const OVERRIDE; virtual uint64 GetUploadSize() const OVERRIDE; virtual uint64 GetUploadPosition() const OVERRIDE; virtual std::set<GURL> GetSitesInTab() const OVERRIDE; @@ -318,7 +318,7 @@ class CONTENT_EXPORT WebContentsImpl const PageState& page_state) OVERRIDE; virtual void UpdateTitle(RenderViewHost* render_view_host, int32 page_id, - const string16& title, + const base::string16& title, base::i18n::TextDirection title_direction) OVERRIDE; virtual void UpdateEncoding(RenderViewHost* render_view_host, const std::string& encoding) OVERRIDE; @@ -359,20 +359,20 @@ class CONTENT_EXPORT WebContentsImpl RenderViewHost* rvh, const ViewMsg_PostMessage_Params& params) OVERRIDE; virtual void RunJavaScriptMessage(RenderViewHost* rvh, - const string16& message, - const string16& default_prompt, + const base::string16& message, + const base::string16& default_prompt, const GURL& frame_url, JavaScriptMessageType type, IPC::Message* reply_msg, bool* did_suppress_message) OVERRIDE; virtual void RunBeforeUnloadConfirm(RenderViewHost* rvh, - const string16& message, + const base::string16& message, bool is_reload, IPC::Message* reply_msg) OVERRIDE; virtual bool AddMessageToConsole(int32 level, - const string16& message, + const base::string16& message, int32 line_no, - const string16& source_id) OVERRIDE; + const base::string16& source_id) OVERRIDE; virtual RendererPreferences GetRendererPrefs( BrowserContext* browser_context) const OVERRIDE; virtual WebPreferences GetWebkitPrefs() OVERRIDE; @@ -594,7 +594,7 @@ class CONTENT_EXPORT WebContentsImpl void OnDialogClosed(RenderViewHost* rvh, IPC::Message* reply_msg, bool success, - const string16& user_input); + const base::string16& user_input); // Callback function when requesting permission to access the PPAPI broker. // |result| is true if permission was granted. @@ -617,7 +617,7 @@ class CONTENT_EXPORT WebContentsImpl const GURL& url, bool is_main_frame, int error_code, - const string16& error_description); + const base::string16& error_description); void OnGoToEntryAtOffset(int offset); void OnUpdateZoomLimits(int minimum_percent, int maximum_percent, @@ -627,7 +627,7 @@ class CONTENT_EXPORT WebContentsImpl void OnRegisterProtocolHandler(const std::string& protocol, const GURL& url, - const string16& title, + const base::string16& title, bool user_gesture); void OnFindReply(int request_id, int number_of_matches, @@ -714,7 +714,7 @@ class CONTENT_EXPORT WebContentsImpl // or the dedicated set title message. It returns true if the new title is // different and was therefore updated. bool UpdateTitleForEntry(NavigationEntryImpl* entry, - const string16& title); + const base::string16& title); // Causes the WebContentsImpl to navigate in the right renderer to |entry|, // which must be already part of the entries in the navigation controller. @@ -876,7 +876,7 @@ class CONTENT_EXPORT WebContentsImpl // The current load state and the URL associated with it. net::LoadStateWithParam load_state_; - string16 load_state_host_; + base::string16 load_state_host_; // Upload progress, for displaying in the status bar. // Set to zero when there is no significant upload happening. uint64 upload_size_; @@ -885,7 +885,7 @@ class CONTENT_EXPORT WebContentsImpl // Data for current page ----------------------------------------------------- // When a title cannot be taken from any entry, this title will be used. - string16 page_title_when_no_navigation_entry_; + base::string16 page_title_when_no_navigation_entry_; // When a navigation occurs, we record its contents MIME type. It can be // used to check whether we can do something for some special contents. diff --git a/content/browser/web_contents/web_contents_impl_unittest.cc b/content/browser/web_contents/web_contents_impl_unittest.cc index d5ac705..01c0191 100644 --- a/content/browser/web_contents/web_contents_impl_unittest.cc +++ b/content/browser/web_contents/web_contents_impl_unittest.cc @@ -284,7 +284,7 @@ class TestWebContentsObserver : public WebContentsObserver { const GURL& validated_url, bool is_main_frame, int error_code, - const string16& error_description, + const base::string16& error_description, RenderViewHost* render_view_host) OVERRIDE { last_url_ = validated_url; } @@ -318,12 +318,12 @@ TEST_F(WebContentsImplTest, DontUseTitleFromPendingEntry) { const GURL kGURL("chrome://blah"); controller().LoadURL( kGURL, Referrer(), PAGE_TRANSITION_TYPED, std::string()); - EXPECT_EQ(string16(), contents()->GetTitle()); + EXPECT_EQ(base::string16(), contents()->GetTitle()); } TEST_F(WebContentsImplTest, UseTitleFromPendingEntryIfSet) { const GURL kGURL("chrome://blah"); - const string16 title = ASCIIToUTF16("My Title"); + const base::string16 title = ASCIIToUTF16("My Title"); controller().LoadURL( kGURL, Referrer(), PAGE_TRANSITION_TYPED, std::string()); @@ -2152,7 +2152,7 @@ TEST_F(WebContentsImplTest, FilterURLs) { // Check that an IPC with about:whatever is correctly normalized. other_contents->TestDidFailLoadWithError( - 1, url_from_ipc, true, 1, string16()); + 1, url_from_ipc, true, 1, base::string16()); EXPECT_EQ(url_normalized, other_observer.last_url()); } diff --git a/content/browser/web_contents/web_contents_view_android.cc b/content/browser/web_contents/web_contents_view_android.cc index fc27ace..f66b5ec 100644 --- a/content/browser/web_contents/web_contents_view_android.cc +++ b/content/browser/web_contents/web_contents_view_android.cc @@ -80,7 +80,7 @@ void WebContentsViewAndroid::GetContainerBounds(gfx::Rect* out) const { *out = rwhv->GetViewBounds(); } -void WebContentsViewAndroid::SetPageTitle(const string16& title) { +void WebContentsViewAndroid::SetPageTitle(const base::string16& title) { if (content_view_core_) content_view_core_->SetTitle(title); } diff --git a/content/browser/web_contents/web_contents_view_android.h b/content/browser/web_contents/web_contents_view_android.h index bcfc0cf..849ca6d 100644 --- a/content/browser/web_contents/web_contents_view_android.h +++ b/content/browser/web_contents/web_contents_view_android.h @@ -57,7 +57,7 @@ class WebContentsViewAndroid : public WebContentsViewPort, RenderWidgetHost* render_widget_host) OVERRIDE; virtual RenderWidgetHostView* CreateViewForPopupWidget( RenderWidgetHost* render_widget_host) OVERRIDE; - virtual void SetPageTitle(const string16& title) OVERRIDE; + virtual void SetPageTitle(const base::string16& title) OVERRIDE; virtual void RenderViewCreated(RenderViewHost* host) OVERRIDE; virtual void RenderViewSwappedIn(RenderViewHost* host) OVERRIDE; virtual void SetOverscrollControllerEnabled(bool enabled) OVERRIDE; diff --git a/content/browser/web_contents/web_contents_view_aura.cc b/content/browser/web_contents/web_contents_view_aura.cc index 353da78..75ca4e6 100644 --- a/content/browser/web_contents/web_contents_view_aura.cc +++ b/content/browser/web_contents/web_contents_view_aura.cc @@ -249,7 +249,7 @@ void PrepareDragForFileContents(const DropData& drop_data, // Images without ALT text will only have a file extension so we need to // synthesize one from the provided extension and URL. if (file_name.BaseName().RemoveExtension().empty()) { - const string16 extension = file_name.Extension(); + const base::string16 extension = file_name.Extension(); // Retrieve the name from the URL. file_name = base::FilePath(net::GetSuggestedFilename( drop_data.url, "", "", "", "", "")).ReplaceExtension(extension); @@ -296,20 +296,20 @@ void PrepareDragData(const DropData& drop_data, // Utility to fill a DropData object from ui::OSExchangeData. void PrepareDropData(DropData* drop_data, const ui::OSExchangeData& data) { - string16 plain_text; + base::string16 plain_text; data.GetString(&plain_text); if (!plain_text.empty()) drop_data->text = base::NullableString16(plain_text, false); GURL url; - string16 url_title; + base::string16 url_title; data.GetURLAndTitle(&url, &url_title); if (url.is_valid()) { drop_data->url = url; drop_data->url_title = url_title; } - string16 html; + base::string16 html; GURL html_base_url; data.GetHtml(&html, &html_base_url); if (!html.empty()) @@ -1298,7 +1298,7 @@ RenderWidgetHostView* WebContentsViewAura::CreateViewForPopupWidget( return RenderWidgetHostViewPort::CreateViewForWidget(render_widget_host); } -void WebContentsViewAura::SetPageTitle(const string16& title) { +void WebContentsViewAura::SetPageTitle(const base::string16& title) { window_->set_title(title); } diff --git a/content/browser/web_contents/web_contents_view_aura.h b/content/browser/web_contents/web_contents_view_aura.h index 7d377b0..a0597d3 100644 --- a/content/browser/web_contents/web_contents_view_aura.h +++ b/content/browser/web_contents/web_contents_view_aura.h @@ -118,7 +118,7 @@ class CONTENT_EXPORT WebContentsViewAura RenderWidgetHost* render_widget_host) OVERRIDE; virtual RenderWidgetHostView* CreateViewForPopupWidget( RenderWidgetHost* render_widget_host) OVERRIDE; - virtual void SetPageTitle(const string16& title) OVERRIDE; + virtual void SetPageTitle(const base::string16& title) OVERRIDE; virtual void RenderViewCreated(RenderViewHost* host) OVERRIDE; virtual void RenderViewSwappedIn(RenderViewHost* host) OVERRIDE; virtual void SetOverscrollControllerEnabled(bool enabled) OVERRIDE; diff --git a/content/browser/web_contents/web_contents_view_aura_browsertest.cc b/content/browser/web_contents/web_contents_view_aura_browsertest.cc index 3214c13..687ce57 100644 --- a/content/browser/web_contents/web_contents_view_aura_browsertest.cc +++ b/content/browser/web_contents/web_contents_view_aura_browsertest.cc @@ -196,14 +196,14 @@ class WebContentsViewAuraTest : public ContentBrowserTest { { // Do a swipe-right now. That should navigate backwards. - string16 expected_title = ASCIIToUTF16("Title: #1"); + base::string16 expected_title = ASCIIToUTF16("Title: #1"); content::TitleWatcher title_watcher(web_contents, expected_title); generator.GestureScrollSequence( gfx::Point(bounds.x() + 2, bounds.y() + 10), gfx::Point(bounds.right() - 10, bounds.y() + 10), base::TimeDelta::FromMilliseconds(kScrollDurationMs), kScrollSteps); - string16 actual_title = title_watcher.WaitAndGetTitle(); + base::string16 actual_title = title_watcher.WaitAndGetTitle(); EXPECT_EQ(expected_title, actual_title); value = content::ExecuteScriptAndGetValue(view_host, "get_current()"); ASSERT_TRUE(value->GetAsInteger(&index)); @@ -214,14 +214,14 @@ class WebContentsViewAuraTest : public ContentBrowserTest { { // Do a fling-right now. That should navigate backwards. - string16 expected_title = ASCIIToUTF16("Title:"); + base::string16 expected_title = ASCIIToUTF16("Title:"); content::TitleWatcher title_watcher(web_contents, expected_title); generator.GestureScrollSequence( gfx::Point(bounds.x() + 2, bounds.y() + 10), gfx::Point(bounds.right() - 10, bounds.y() + 10), base::TimeDelta::FromMilliseconds(kScrollDurationMs), kScrollSteps); - string16 actual_title = title_watcher.WaitAndGetTitle(); + base::string16 actual_title = title_watcher.WaitAndGetTitle(); EXPECT_EQ(expected_title, actual_title); value = content::ExecuteScriptAndGetValue(view_host, "get_current()"); ASSERT_TRUE(value->GetAsInteger(&index)); @@ -232,14 +232,14 @@ class WebContentsViewAuraTest : public ContentBrowserTest { { // Do a swipe-left now. That should navigate forward. - string16 expected_title = ASCIIToUTF16("Title: #1"); + base::string16 expected_title = ASCIIToUTF16("Title: #1"); content::TitleWatcher title_watcher(web_contents, expected_title); generator.GestureScrollSequence( gfx::Point(bounds.right() - 10, bounds.y() + 10), gfx::Point(bounds.x() + 2, bounds.y() + 10), base::TimeDelta::FromMilliseconds(kScrollDurationMs), kScrollSteps); - string16 actual_title = title_watcher.WaitAndGetTitle(); + base::string16 actual_title = title_watcher.WaitAndGetTitle(); EXPECT_EQ(expected_title, actual_title); value = content::ExecuteScriptAndGetValue(view_host, "get_current()"); ASSERT_TRUE(value->GetAsInteger(&index)); @@ -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. - string16 expected_title = ASCIIToUTF16("Title: #2"); + base::string16 expected_title = ASCIIToUTF16("Title: #2"); content::TitleWatcher title_watcher(web_contents, expected_title); aura::Window* content = web_contents->GetView()->GetContentNativeView(); gfx::Rect bounds = content->GetBoundsInRootWindow(); @@ -448,7 +448,7 @@ IN_PROC_BROWSER_TEST_F(WebContentsViewAuraTest, OverscrollScreenshot) { gfx::Point(bounds.right() - 10, bounds.y() + 10), base::TimeDelta::FromMilliseconds(20), 1); - string16 actual_title = title_watcher.WaitAndGetTitle(); + base::string16 actual_title = title_watcher.WaitAndGetTitle(); EXPECT_EQ(expected_title, actual_title); EXPECT_EQ(2, GetCurrentIndex()); screenshot_manager()->WaitUntilScreenshotIsReady(); @@ -469,10 +469,10 @@ IN_PROC_BROWSER_TEST_F(WebContentsViewAuraTest, OverscrollScreenshot) { { // Navigate back in history. - string16 expected_title = ASCIIToUTF16("Title: #3"); + base::string16 expected_title = ASCIIToUTF16("Title: #3"); content::TitleWatcher title_watcher(web_contents, expected_title); web_contents->GetController().GoBack(); - string16 actual_title = title_watcher.WaitAndGetTitle(); + base::string16 actual_title = title_watcher.WaitAndGetTitle(); EXPECT_EQ(expected_title, actual_title); EXPECT_EQ(3, GetCurrentIndex()); screenshot_manager()->WaitUntilScreenshotIsReady(); @@ -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. - string16 expected_title = ASCIIToUTF16("Title: #2"); + base::string16 expected_title = ASCIIToUTF16("Title: #2"); content::TitleWatcher title_watcher(web_contents, expected_title); NavigationWatcher nav_watcher(web_contents); @@ -657,7 +657,7 @@ IN_PROC_BROWSER_TEST_F(WebContentsViewAuraTest, gfx::Point(bounds.right() - 10, bounds.y() + 10), base::TimeDelta::FromMilliseconds(2000), 10); - string16 actual_title = title_watcher.WaitAndGetTitle(); + base::string16 actual_title = title_watcher.WaitAndGetTitle(); EXPECT_EQ(expected_title, actual_title); EXPECT_EQ(2, GetCurrentIndex()); diff --git a/content/browser/web_contents/web_contents_view_gtk.cc b/content/browser/web_contents/web_contents_view_gtk.cc index 4e3874f..bf4dcb7f 100644 --- a/content/browser/web_contents/web_contents_view_gtk.cc +++ b/content/browser/web_contents/web_contents_view_gtk.cc @@ -246,7 +246,7 @@ RenderWidgetHostView* WebContentsViewGtk::CreateViewForPopupWidget( return RenderWidgetHostViewPort::CreateViewForWidget(render_widget_host); } -void WebContentsViewGtk::SetPageTitle(const string16& title) { +void WebContentsViewGtk::SetPageTitle(const base::string16& title) { // Set the window name to include the page title so it's easier to spot // when debugging (e.g. via xwininfo -tree). gfx::NativeView content_view = GetContentNativeView(); diff --git a/content/browser/web_contents/web_contents_view_gtk.h b/content/browser/web_contents/web_contents_view_gtk.h index 41f84ab..7a8d25e 100644 --- a/content/browser/web_contents/web_contents_view_gtk.h +++ b/content/browser/web_contents/web_contents_view_gtk.h @@ -66,7 +66,7 @@ class CONTENT_EXPORT WebContentsViewGtk RenderWidgetHost* render_widget_host) OVERRIDE; virtual RenderWidgetHostView* CreateViewForPopupWidget( RenderWidgetHost* render_widget_host) OVERRIDE; - virtual void SetPageTitle(const string16& title) OVERRIDE; + virtual void SetPageTitle(const base::string16& title) OVERRIDE; virtual void RenderViewCreated(RenderViewHost* host) OVERRIDE; virtual void RenderViewSwappedIn(RenderViewHost* host) OVERRIDE; virtual void SetOverscrollControllerEnabled(bool enabled) OVERRIDE; diff --git a/content/browser/web_contents/web_contents_view_guest.cc b/content/browser/web_contents/web_contents_view_guest.cc index ac236da..90296a9 100644 --- a/content/browser/web_contents/web_contents_view_guest.cc +++ b/content/browser/web_contents/web_contents_view_guest.cc @@ -142,7 +142,7 @@ RenderWidgetHostView* WebContentsViewGuest::CreateViewForPopupWidget( return RenderWidgetHostViewPort::CreateViewForWidget(render_widget_host); } -void WebContentsViewGuest::SetPageTitle(const string16& title) { +void WebContentsViewGuest::SetPageTitle(const base::string16& title) { } void WebContentsViewGuest::RenderViewCreated(RenderViewHost* host) { diff --git a/content/browser/web_contents/web_contents_view_guest.h b/content/browser/web_contents/web_contents_view_guest.h index 1e1d812..976a04e 100644 --- a/content/browser/web_contents/web_contents_view_guest.h +++ b/content/browser/web_contents/web_contents_view_guest.h @@ -65,7 +65,7 @@ class CONTENT_EXPORT WebContentsViewGuest RenderWidgetHost* render_widget_host) OVERRIDE; virtual RenderWidgetHostView* CreateViewForPopupWidget( RenderWidgetHost* render_widget_host) OVERRIDE; - virtual void SetPageTitle(const string16& title) OVERRIDE; + virtual void SetPageTitle(const base::string16& title) OVERRIDE; virtual void RenderViewCreated(RenderViewHost* host) OVERRIDE; virtual void RenderViewSwappedIn(RenderViewHost* host) OVERRIDE; virtual void SetOverscrollControllerEnabled(bool enabled) OVERRIDE; diff --git a/content/browser/web_contents/web_contents_view_mac.h b/content/browser/web_contents/web_contents_view_mac.h index 3d0b94f..a8ffab4 100644 --- a/content/browser/web_contents/web_contents_view_mac.h +++ b/content/browser/web_contents/web_contents_view_mac.h @@ -88,7 +88,7 @@ class WebContentsViewMac : public WebContentsViewPort, RenderWidgetHost* render_widget_host) OVERRIDE; virtual RenderWidgetHostView* CreateViewForPopupWidget( RenderWidgetHost* render_widget_host) OVERRIDE; - virtual void SetPageTitle(const string16& title) OVERRIDE; + virtual void SetPageTitle(const base::string16& title) OVERRIDE; virtual void RenderViewCreated(RenderViewHost* host) OVERRIDE; virtual void RenderViewSwappedIn(RenderViewHost* host) OVERRIDE; virtual void SetOverscrollControllerEnabled(bool enabled) OVERRIDE; diff --git a/content/browser/web_contents/web_contents_view_mac.mm b/content/browser/web_contents/web_contents_view_mac.mm index 4283ca9..e80bf99 100644 --- a/content/browser/web_contents/web_contents_view_mac.mm +++ b/content/browser/web_contents/web_contents_view_mac.mm @@ -332,7 +332,7 @@ RenderWidgetHostView* WebContentsViewMac::CreateViewForPopupWidget( return RenderWidgetHostViewPort::CreateViewForWidget(render_widget_host); } -void WebContentsViewMac::SetPageTitle(const string16& title) { +void WebContentsViewMac::SetPageTitle(const base::string16& title) { // Meaningless on the Mac; widgets don't have a "title" attribute } diff --git a/content/browser/web_contents/web_contents_view_win.cc b/content/browser/web_contents/web_contents_view_win.cc index 92548d2..8360d8c 100644 --- a/content/browser/web_contents/web_contents_view_win.cc +++ b/content/browser/web_contents/web_contents_view_win.cc @@ -228,7 +228,7 @@ RenderWidgetHostView* WebContentsViewWin::CreateViewForPopupWidget( return RenderWidgetHostViewPort::CreateViewForWidget(render_widget_host); } -void WebContentsViewWin::SetPageTitle(const string16& title) { +void WebContentsViewWin::SetPageTitle(const base::string16& title) { // It's possible to get this after the hwnd has been destroyed. if (GetNativeView()) ::SetWindowText(GetNativeView(), title.c_str()); diff --git a/content/browser/web_contents/web_contents_view_win.h b/content/browser/web_contents/web_contents_view_win.h index 505addd..9b052e2 100644 --- a/content/browser/web_contents/web_contents_view_win.h +++ b/content/browser/web_contents/web_contents_view_win.h @@ -73,7 +73,7 @@ class CONTENT_EXPORT WebContentsViewWin RenderWidgetHost* render_widget_host) OVERRIDE; virtual RenderWidgetHostView* CreateViewForPopupWidget( RenderWidgetHost* render_widget_host) OVERRIDE; - virtual void SetPageTitle(const string16& title) OVERRIDE; + virtual void SetPageTitle(const base::string16& title) OVERRIDE; virtual void RenderViewCreated(RenderViewHost* host) OVERRIDE; virtual void RenderViewSwappedIn(RenderViewHost* host) OVERRIDE; virtual void SetOverscrollControllerEnabled(bool enabled) OVERRIDE; diff --git a/content/browser/web_contents/web_drag_dest_gtk.cc b/content/browser/web_contents/web_drag_dest_gtk.cc index bb9a4d4..738d6b5 100644 --- a/content/browser/web_contents/web_drag_dest_gtk.cc +++ b/content/browser/web_contents/web_drag_dest_gtk.cc @@ -204,7 +204,8 @@ void WebDragDestGtk::OnDragDataReceived( if (url.SchemeIs(chrome::kFileScheme) && net::FileURLToFilePath(url, &file_path)) { drop_data_->filenames.push_back( - DropData::FileInfo(UTF8ToUTF16(file_path.value()), string16())); + DropData::FileInfo(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 // it to the web content. diff --git a/content/browser/web_contents/web_drag_dest_mac.mm b/content/browser/web_contents/web_drag_dest_mac.mm index b3fefca..8768bed 100644 --- a/content/browser/web_contents/web_drag_dest_mac.mm +++ b/content/browser/web_contents/web_drag_dest_mac.mm @@ -290,7 +290,7 @@ int GetModifierFlags() { if (exists) { data->filenames.push_back( DropData::FileInfo( - base::SysNSStringToUTF16(filename), string16())); + base::SysNSStringToUTF16(filename), base::string16())); } } } 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 48719de..b79c118 100644 --- a/content/browser/web_contents/web_drag_dest_mac_unittest.mm +++ b/content/browser/web_contents/web_drag_dest_mac_unittest.mm @@ -85,7 +85,7 @@ TEST_F(WebDragDestTest, URL) { NSString* url = nil; NSString* title = nil; GURL result_url; - string16 result_title; + base::string16 result_title; // Put a URL on the pasteboard and check it. pboard = [NSPasteboard pasteboardWithUniqueName]; diff --git a/content/browser/web_contents/web_drag_source_gtk.h b/content/browser/web_contents/web_drag_source_gtk.h index 577f60b..8a7c7b2 100644 --- a/content/browser/web_contents/web_drag_source_gtk.h +++ b/content/browser/web_contents/web_drag_source_gtk.h @@ -92,7 +92,7 @@ class CONTENT_EXPORT WebDragSourceGtk : GdkDragContext* drag_context_; // The file mime type for a drag-out download. - string16 wide_download_mime_type_; + base::string16 wide_download_mime_type_; // The file name to be saved to for a drag-out download. base::FilePath download_file_name_; diff --git a/content/browser/web_contents/web_drag_source_mac.mm b/content/browser/web_contents/web_drag_source_mac.mm index 805e73b..c667320 100644 --- a/content/browser/web_contents/web_drag_source_mac.mm +++ b/content/browser/web_contents/web_drag_source_mac.mm @@ -49,10 +49,10 @@ namespace { // |NSURLPboardType|. NSString* const kNSURLTitlePboardType = @"public.url-name"; -// Converts a string16 into a FilePath. Use this method instead of +// Converts a base::string16 into a FilePath. Use this method instead of // -[NSString fileSystemRepresentation] to prevent exceptions from being thrown. // See http://crbug.com/78782 for more info. -base::FilePath FilePathFromFilename(const string16& filename) { +base::FilePath FilePathFromFilename(const base::string16& filename) { NSString* str = SysUTF16ToNSString(filename); char buf[MAXPATHLEN]; if (![str getFileSystemRepresentation:buf maxLength:sizeof(buf)]) @@ -71,7 +71,7 @@ base::FilePath GetFileNameFromDragData(const DropData& drop_data) { // synthesize one from the provided extension and URL. if (file_name.empty()) { // Retrieve the name from the URL. - string16 suggested_filename = + base::string16 suggested_filename = net::GetSuggestedFilename(drop_data.url, "", "", "", "", ""); const std::string extension = file_name.Extension(); file_name = FilePathFromFilename(suggested_filename); @@ -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 string16 kHtmlHeader = ASCIIToUTF16( + const base::string16 kHtmlHeader = ASCIIToUTF16( "<meta http-equiv=\"Content-Type\" content=\"text/html;charset=UTF-8\">"); // Be extra paranoid; avoid crashing. @@ -386,7 +386,7 @@ void PromiseWriterHelper(const DropData& drop_data, downloadFileName_ = GetFileNameFromDragData(*dropData_); net::GetMimeTypeFromExtension(downloadFileName_.Extension(), &mimeType); } else { - string16 mimeType16; + base::string16 mimeType16; base::FilePath fileName; if (content::ParseDownloadMetadata( dropData_->download_metadata, diff --git a/content/browser/webui/web_ui_data_source_impl.cc b/content/browser/webui/web_ui_data_source_impl.cc index 6a5b6025..6775eb7 100644 --- a/content/browser/webui/web_ui_data_source_impl.cc +++ b/content/browser/webui/web_ui_data_source_impl.cc @@ -95,7 +95,7 @@ WebUIDataSourceImpl::~WebUIDataSourceImpl() { } void WebUIDataSourceImpl::AddString(const std::string& name, - const string16& value) { + const base::string16& value) { localized_strings_.SetString(name, value); } diff --git a/content/browser/webui/web_ui_data_source_impl.h b/content/browser/webui/web_ui_data_source_impl.h index 1f81004..91ec087 100644 --- a/content/browser/webui/web_ui_data_source_impl.h +++ b/content/browser/webui/web_ui_data_source_impl.h @@ -28,7 +28,7 @@ class CONTENT_EXPORT WebUIDataSourceImpl public: // WebUIDataSource implementation: virtual void AddString(const std::string& name, - const string16& value) OVERRIDE; + const base::string16& value) OVERRIDE; virtual void AddString(const std::string& name, const std::string& value) OVERRIDE; virtual void AddLocalizedString(const std::string& name, int ids) OVERRIDE; diff --git a/content/browser/webui/web_ui_data_source_unittest.cc b/content/browser/webui/web_ui_data_source_unittest.cc index f384a43..a5da7eb 100644 --- a/content/browser/webui/web_ui_data_source_unittest.cc +++ b/content/browser/webui/web_ui_data_source_unittest.cc @@ -25,10 +25,10 @@ class TestClient : public TestContentClient { TestClient() {} virtual ~TestClient() {} - virtual string16 GetLocalizedString(int message_id) const OVERRIDE { + virtual base::string16 GetLocalizedString(int message_id) const OVERRIDE { if (message_id == kDummyStringId) return UTF8ToUTF16(kDummyString); - return string16(); + return base::string16(); } diff --git a/content/browser/webui/web_ui_impl.cc b/content/browser/webui/web_ui_impl.cc index e54a6d8..4774e4f 100644 --- a/content/browser/webui/web_ui_impl.cc +++ b/content/browser/webui/web_ui_impl.cc @@ -27,10 +27,10 @@ namespace content { const WebUI::TypeID WebUI::kNoWebUI = NULL; // static -string16 WebUI::GetJavascriptCall( +base::string16 WebUI::GetJavascriptCall( const std::string& function_name, const std::vector<const Value*>& arg_list) { - string16 parameters; + base::string16 parameters; std::string json; for (size_t i = 0; i < arg_list.size(); ++i) { if (i > 0) @@ -106,11 +106,11 @@ ui::ScaleFactor WebUIImpl::GetDeviceScaleFactor() const { return GetScaleFactorForView(web_contents_->GetRenderWidgetHostView()); } -const string16& WebUIImpl::GetOverriddenTitle() const { +const base::string16& WebUIImpl::GetOverriddenTitle() const { return overridden_title_; } -void WebUIImpl::OverrideTitle(const string16& title) { +void WebUIImpl::OverrideTitle(const base::string16& title) { overridden_title_ = title; } @@ -144,7 +144,7 @@ void WebUIImpl::SetController(WebUIController* controller) { void WebUIImpl::CallJavascriptFunction(const std::string& function_name) { DCHECK(IsStringASCII(function_name)); - string16 javascript = ASCIIToUTF16(function_name + "();"); + base::string16 javascript = ASCIIToUTF16(function_name + "();"); ExecuteJavascript(javascript); } @@ -230,7 +230,7 @@ void WebUIImpl::AddMessageHandler(WebUIMessageHandler* handler) { handlers_.push_back(handler); } -void WebUIImpl::ExecuteJavascript(const string16& javascript) { +void WebUIImpl::ExecuteJavascript(const base::string16& javascript) { static_cast<RenderViewHostImpl*>( web_contents_->GetRenderViewHost())->ExecuteJavascriptInWebFrame( ASCIIToUTF16(frame_xpath_), javascript); diff --git a/content/browser/webui/web_ui_impl.h b/content/browser/webui/web_ui_impl.h index a359117..8715e43 100644 --- a/content/browser/webui/web_ui_impl.h +++ b/content/browser/webui/web_ui_impl.h @@ -33,8 +33,8 @@ class CONTENT_EXPORT WebUIImpl : public WebUI, virtual WebUIController* GetController() const OVERRIDE; virtual void SetController(WebUIController* controller) OVERRIDE; virtual ui::ScaleFactor GetDeviceScaleFactor() const OVERRIDE; - virtual const string16& GetOverriddenTitle() const OVERRIDE; - virtual void OverrideTitle(const string16& title) OVERRIDE; + virtual const base::string16& GetOverriddenTitle() const OVERRIDE; + virtual void OverrideTitle(const base::string16& title) OVERRIDE; virtual PageTransition GetLinkTransitionType() const OVERRIDE; virtual void SetLinkTransitionType(PageTransition type) OVERRIDE; virtual int GetBindings() const OVERRIDE; @@ -78,7 +78,7 @@ class CONTENT_EXPORT WebUIImpl : public WebUI, const base::ListValue& args); // Execute a string of raw Javascript on the page. - void ExecuteJavascript(const string16& javascript); + void ExecuteJavascript(const base::string16& javascript); // A map of message name -> message handling callback. typedef std::map<std::string, MessageCallback> MessageCallbackMap; @@ -86,7 +86,7 @@ class CONTENT_EXPORT WebUIImpl : public WebUI, // Options that may be overridden by individual Web UI implementations. The // bool options default to false. See the public getters for more information. - string16 overridden_title_; // Defaults to empty string. + base::string16 overridden_title_; // Defaults to empty string. PageTransition link_transition_type_; // Defaults to LINK. int bindings_; // The bindings from BindingsPolicy that should be enabled for // this page. diff --git a/content/browser/webui/web_ui_message_handler.cc b/content/browser/webui/web_ui_message_handler.cc index db554c0e..57b2c46 100644 --- a/content/browser/webui/web_ui_message_handler.cc +++ b/content/browser/webui/web_ui_message_handler.cc @@ -36,12 +36,12 @@ bool WebUIMessageHandler::ExtractDoubleValue(const ListValue* value, return false; } -string16 WebUIMessageHandler::ExtractStringValue(const ListValue* value) { - string16 string16_value; +base::string16 WebUIMessageHandler::ExtractStringValue(const ListValue* value) { + base::string16 string16_value; if (value->GetString(0, &string16_value)) return string16_value; NOTREACHED(); - return string16(); + return base::string16(); } } // 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 e38acd7..33cdb61 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) { ListValue list; int value, zero_value = 0, neg_value = -1234, pos_value = 1234; - string16 zero_string(UTF8ToUTF16("0")); - string16 neg_string(UTF8ToUTF16("-1234")); - string16 pos_string(UTF8ToUTF16("1234")); + base::string16 zero_string(UTF8ToUTF16("0")); + base::string16 neg_string(UTF8ToUTF16("-1234")); + base::string16 pos_string(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; - string16 zero_string(UTF8ToUTF16("0")); - string16 neg_string(UTF8ToUTF16("-1234.5")); - string16 pos_string(UTF8ToUTF16("1234.5")); + base::string16 zero_string(UTF8ToUTF16("0")); + base::string16 neg_string(UTF8ToUTF16("-1234.5")); + base::string16 pos_string(UTF8ToUTF16("1234.5")); list.Append(new base::FundamentalValue(zero_value)); EXPECT_TRUE(WebUIMessageHandler::ExtractDoubleValue(&list, &value)); @@ -87,10 +87,10 @@ TEST(WebUIMessageHandlerTest, ExtractDoubleValue) { TEST(WebUIMessageHandlerTest, ExtractStringValue) { base::ListValue list; - string16 in_string(UTF8ToUTF16( + base::string16 in_string(UTF8ToUTF16( "The facts, though interesting, are irrelevant.")); list.Append(new base::StringValue(in_string)); - string16 out_string = WebUIMessageHandler::ExtractStringValue(&list); + base::string16 out_string = WebUIMessageHandler::ExtractStringValue(&list); EXPECT_EQ(in_string, out_string); } diff --git a/content/browser/worker_host/test/worker_browsertest.cc b/content/browser/worker_host/test/worker_browsertest.cc index a71a28e..acd00fb 100644 --- a/content/browser/worker_host/test/worker_browsertest.cc +++ b/content/browser/worker_host/test/worker_browsertest.cc @@ -42,10 +42,10 @@ class WorkerTest : public ContentBrowserTest { const std::string& test_case, const std::string& query) { GURL url = GetTestURL(test_case, query); - const string16 expected_title = ASCIIToUTF16("OK"); + const base::string16 expected_title = ASCIIToUTF16("OK"); TitleWatcher title_watcher(window->web_contents(), expected_title); NavigateToURL(window, url); - string16 final_title = title_watcher.WaitAndGetTitle(); + base::string16 final_title = title_watcher.WaitAndGetTitle(); EXPECT_EQ(expected_title, final_title); } @@ -275,10 +275,10 @@ IN_PROC_BROWSER_TEST_F(WorkerTest, WebSocketSharedWorker) { // Run test. Shell* window = shell(); - const string16 expected_title = ASCIIToUTF16("OK"); + const base::string16 expected_title = ASCIIToUTF16("OK"); TitleWatcher title_watcher(window->web_contents(), expected_title); NavigateToURL(window, url); - string16 final_title = title_watcher.WaitAndGetTitle(); + base::string16 final_title = title_watcher.WaitAndGetTitle(); EXPECT_EQ(expected_title, final_title); } diff --git a/content/browser/worker_host/worker_process_host.cc b/content/browser/worker_host/worker_process_host.cc index 08277da..fae589b 100644 --- a/content/browser/worker_host/worker_process_host.cc +++ b/content/browser/worker_host/worker_process_host.cc @@ -372,8 +372,8 @@ void WorkerProcessHost::OnWorkerContextClosed(int worker_route_id) { void WorkerProcessHost::OnAllowDatabase(int worker_route_id, const GURL& url, - const string16& name, - const string16& display_name, + const base::string16& name, + const base::string16& display_name, unsigned long estimated_size, bool* result) { *result = GetContentClient()->browser()->AllowWorkerDatabase( @@ -390,7 +390,7 @@ void WorkerProcessHost::OnAllowFileSystem(int worker_route_id, void WorkerProcessHost::OnAllowIndexedDB(int worker_route_id, const GURL& url, - const string16& name, + const base::string16& name, bool* result) { *result = GetContentClient()->browser()->AllowWorkerIndexedDB( url, name, resource_context_, GetRenderViewIDsForWorker(worker_route_id)); @@ -572,7 +572,7 @@ net::URLRequestContext* WorkerProcessHost::GetRequestContext( WorkerProcessHost::WorkerInstance::WorkerInstance( const GURL& url, - const string16& name, + const base::string16& name, int worker_route_id, int parent_process_id, int64 main_resource_appcache_id, @@ -593,7 +593,7 @@ WorkerProcessHost::WorkerInstance::WorkerInstance( WorkerProcessHost::WorkerInstance::WorkerInstance( const GURL& url, bool shared, - const string16& name, + const base::string16& name, ResourceContext* resource_context, const WorkerStoragePartition& partition) : url_(url), @@ -618,7 +618,7 @@ WorkerProcessHost::WorkerInstance::~WorkerInstance() { // b) the names are both empty, and the urls are equal bool WorkerProcessHost::WorkerInstance::Matches( const GURL& match_url, - const string16& match_name, + const base::string16& match_name, const WorkerStoragePartition& partition, ResourceContext* resource_context) const { // Only match open shared workers. diff --git a/content/browser/worker_host/worker_process_host.h b/content/browser/worker_host/worker_process_host.h index 0a9ea60..c3fa64d 100644 --- a/content/browser/worker_host/worker_process_host.h +++ b/content/browser/worker_host/worker_process_host.h @@ -57,7 +57,7 @@ class WorkerProcessHost : public BrowserChildProcessHostDelegate, class WorkerInstance { public: WorkerInstance(const GURL& url, - const string16& name, + const base::string16& name, int worker_route_id, int parent_process_id, int64 main_resource_appcache_id, @@ -66,7 +66,7 @@ class WorkerProcessHost : public BrowserChildProcessHostDelegate, // Used for pending instances. Rest of the parameters are ignored. WorkerInstance(const GURL& url, bool shared, - const string16& name, + const base::string16& name, ResourceContext* resource_context, const WorkerStoragePartition& partition); ~WorkerInstance(); @@ -92,7 +92,7 @@ class WorkerProcessHost : public BrowserChildProcessHostDelegate, // applies to shared workers. bool Matches( const GURL& url, - const string16& name, + const base::string16& name, const WorkerStoragePartition& partition, ResourceContext* resource_context) const; @@ -107,7 +107,7 @@ class WorkerProcessHost : public BrowserChildProcessHostDelegate, bool closed() const { return closed_; } void set_closed(bool closed) { closed_ = closed; } const GURL& url() const { return url_; } - const string16 name() const { return name_; } + const base::string16 name() const { return name_; } int worker_route_id() const { return worker_route_id_; } int parent_process_id() const { return parent_process_id_; } int64 main_resource_appcache_id() const { @@ -127,7 +127,7 @@ class WorkerProcessHost : public BrowserChildProcessHostDelegate, // Set of all filters (clients) associated with this worker. GURL url_; bool closed_; - string16 name_; + base::string16 name_; int worker_route_id_; int parent_process_id_; int64 main_resource_appcache_id_; @@ -196,8 +196,8 @@ class WorkerProcessHost : public BrowserChildProcessHostDelegate, void OnWorkerContextClosed(int worker_route_id); void OnAllowDatabase(int worker_route_id, const GURL& url, - const string16& name, - const string16& display_name, + const base::string16& name, + const base::string16& display_name, unsigned long estimated_size, bool* result); void OnAllowFileSystem(int worker_route_id, @@ -205,7 +205,7 @@ class WorkerProcessHost : public BrowserChildProcessHostDelegate, bool* result); void OnAllowIndexedDB(int worker_route_id, const GURL& url, - const string16& name, + const base::string16& name, bool* result); void OnForceKillWorkerProcess(); diff --git a/content/browser/worker_host/worker_service_impl.cc b/content/browser/worker_host/worker_service_impl.cc index d2ab272..3ebab46 100644 --- a/content/browser/worker_host/worker_service_impl.cc +++ b/content/browser/worker_host/worker_service_impl.cc @@ -650,7 +650,7 @@ void WorkerServiceImpl::NotifyWorkerProcessCreated() { WorkerProcessHost::WorkerInstance* WorkerServiceImpl::FindSharedWorkerInstance( const GURL& url, - const string16& name, + const base::string16& name, const WorkerStoragePartition& partition, ResourceContext* resource_context) { for (WorkerProcessHostIterator iter; !iter.Done(); ++iter) { @@ -667,7 +667,7 @@ WorkerProcessHost::WorkerInstance* WorkerServiceImpl::FindSharedWorkerInstance( WorkerProcessHost::WorkerInstance* WorkerServiceImpl::FindPendingInstance( const GURL& url, - const string16& name, + const base::string16& name, const WorkerStoragePartition& partition, ResourceContext* resource_context) { // Walk the pending instances looking for a matching pending worker. @@ -684,7 +684,7 @@ WorkerProcessHost::WorkerInstance* WorkerServiceImpl::FindPendingInstance( void WorkerServiceImpl::RemovePendingInstances( const GURL& url, - const string16& name, + const base::string16& name, const WorkerStoragePartition& partition, ResourceContext* resource_context) { // Walk the pending instances looking for a matching pending worker. @@ -701,7 +701,7 @@ void WorkerServiceImpl::RemovePendingInstances( WorkerProcessHost::WorkerInstance* WorkerServiceImpl::CreatePendingInstance( const GURL& url, - const string16& name, + const base::string16& name, ResourceContext* resource_context, const WorkerStoragePartition& partition) { // Look for an existing pending shared worker. diff --git a/content/browser/worker_host/worker_service_impl.h b/content/browser/worker_host/worker_service_impl.h index 9da0d19..4d5127a 100644 --- a/content/browser/worker_host/worker_service_impl.h +++ b/content/browser/worker_host/worker_service_impl.h @@ -108,23 +108,23 @@ class CONTENT_EXPORT WorkerServiceImpl // APIs for manipulating our set of pending shared worker instances. WorkerProcessHost::WorkerInstance* CreatePendingInstance( const GURL& url, - const string16& name, + const base::string16& name, ResourceContext* resource_context, const WorkerStoragePartition& worker_partition); WorkerProcessHost::WorkerInstance* FindPendingInstance( const GURL& url, - const string16& name, + const base::string16& name, const WorkerStoragePartition& worker_partition, ResourceContext* resource_context); void RemovePendingInstances( const GURL& url, - const string16& name, + const base::string16& name, const WorkerStoragePartition& worker_partition, ResourceContext* resource_context); WorkerProcessHost::WorkerInstance* FindSharedWorkerInstance( const GURL& url, - const string16& name, + const base::string16& name, const WorkerStoragePartition& worker_partition, ResourceContext* resource_context); |