diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-04 21:00:16 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-04 21:00:16 +0000 |
commit | 969201575445f53b11562542f4d8a12d8f1a4777 (patch) | |
tree | fa491f8ec26fa6bd232e3cf5a5051acd2fea6e97 /chrome/browser | |
parent | 84a3403847df91ea351d67e2d50025fd3f0bf651 (diff) | |
download | chromium_src-969201575445f53b11562542f4d8a12d8f1a4777.zip chromium_src-969201575445f53b11562542f4d8a12d8f1a4777.tar.gz chromium_src-969201575445f53b11562542f4d8a12d8f1a4777.tar.bz2 |
Replace string16 with base::string16.
This updates portions of chrome/browser/... to use the base namespace.
BUG=
Review URL: https://codereview.chromium.org/105193002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@238766 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
274 files changed, 1335 insertions, 1279 deletions
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc index b5e024b..92272ef 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc @@ -2015,7 +2015,7 @@ std::string Experiment::NameForChoice(int index) const { base::IntToString(index); } -string16 Experiment::DescriptionForChoice(int index) const { +base::string16 Experiment::DescriptionForChoice(int index) const { DCHECK(type == Experiment::MULTI_VALUE || type == Experiment::ENABLE_DISABLE_VALUE); DCHECK_LT(index, num_choices); diff --git a/chrome/browser/about_flags.h b/chrome/browser/about_flags.h index 8ed2425..8856c9e 100644 --- a/chrome/browser/about_flags.h +++ b/chrome/browser/about_flags.h @@ -102,7 +102,7 @@ struct Experiment { std::string NameForChoice(int index) const; // Returns the human readable description for the choice at |index|. - string16 DescriptionForChoice(int index) const; + base::string16 DescriptionForChoice(int index) const; }; // A flag controlling the behavior of the |ConvertFlagsToSwitches| function - diff --git a/chrome/browser/accessibility/accessibility_extension_api.cc b/chrome/browser/accessibility/accessibility_extension_api.cc index 92046c0..f0a1ffd 100644 --- a/chrome/browser/accessibility/accessibility_extension_api.cc +++ b/chrome/browser/accessibility/accessibility_extension_api.cc @@ -281,7 +281,8 @@ bool AccessibilityGetAlertsForTabFunction::RunImpl() { infobar_service->infobar_at(i)->AsConfirmInfoBarDelegate(); if (confirm_infobar_delegate) { DictionaryValue* alert_value = new DictionaryValue; - const string16 message_text = confirm_infobar_delegate->GetMessageText(); + const base::string16 message_text = + confirm_infobar_delegate->GetMessageText(); alert_value->SetString(keys::kMessageKey, message_text); alerts_value->Append(alert_value); } diff --git a/chrome/browser/android/bookmarks/bookmarks_bridge.cc b/chrome/browser/android/bookmarks/bookmarks_bridge.cc index c386f47..e9700dc 100644 --- a/chrome/browser/android/bookmarks/bookmarks_bridge.cc +++ b/chrome/browser/android/bookmarks/bookmarks_bridge.cc @@ -280,7 +280,7 @@ int BookmarksBridge::GetBookmarkType(const BookmarkNode* node) { return kBookmarkTypeNormal; } -string16 BookmarksBridge::GetTitle(const BookmarkNode* node) const { +base::string16 BookmarksBridge::GetTitle(const BookmarkNode* node) const { if (partner_bookmarks_shim_->IsPartnerBookmark(node)) return partner_bookmarks_shim_->GetTitle(node); return node->GetTitle(); diff --git a/chrome/browser/android/bookmarks/bookmarks_bridge.h b/chrome/browser/android/bookmarks/bookmarks_bridge.h index 1afab52..dd5e86b 100644 --- a/chrome/browser/android/bookmarks/bookmarks_bridge.h +++ b/chrome/browser/android/bookmarks/bookmarks_bridge.h @@ -59,7 +59,7 @@ class BookmarksBridge : public BaseBookmarkModelObserver, bool IsEditable(const BookmarkNode* node) const; const BookmarkNode* GetParentNode(const BookmarkNode* node); int GetBookmarkType(const BookmarkNode* node); - string16 GetTitle(const BookmarkNode* node) const; + base::string16 GetTitle(const BookmarkNode* node) const; bool IsReachable(const BookmarkNode* node) const; bool IsLoaded() const; bool IsFolderAvailable(const BookmarkNode* folder) const; diff --git a/chrome/browser/android/bookmarks/managed_bookmarks_shim.cc b/chrome/browser/android/bookmarks/managed_bookmarks_shim.cc index 29dcf38..fa33665 100644 --- a/chrome/browser/android/bookmarks/managed_bookmarks_shim.cc +++ b/chrome/browser/android/bookmarks/managed_bookmarks_shim.cc @@ -69,7 +69,7 @@ void ManagedBookmarksShim::Reload() { std::string username = prefs_->GetString(prefs::kGoogleServicesUsername); if (!username.empty()) domain = gaia::ExtractDomainName(username); - string16 root_node_name; + base::string16 root_node_name; if (domain.empty()) { root_node_name = l10n_util::GetStringUTF16(IDS_POLICY_MANAGED_BOOKMARKS_DEFAULT_NAME); @@ -92,7 +92,7 @@ void ManagedBookmarksShim::Reload() { continue; } - string16 name; + base::string16 name; std::string url; if (!dict->GetString(ManagedBookmarksPolicyHandler::kName, &name) || !dict->GetString(ManagedBookmarksPolicyHandler::kUrl, &url)) { diff --git a/chrome/browser/android/bookmarks/partner_bookmarks_shim_unittest.cc b/chrome/browser/android/bookmarks/partner_bookmarks_shim_unittest.cc index 2542f23..e40c0d4 100644 --- a/chrome/browser/android/bookmarks/partner_bookmarks_shim_unittest.cc +++ b/chrome/browser/android/bookmarks/partner_bookmarks_shim_unittest.cc @@ -44,14 +44,14 @@ class PartnerBookmarksShimTest : public testing::Test { const BookmarkNode* AddBookmark(const BookmarkNode* parent, const GURL& url, - const string16& title) { + const base::string16& title) { if (!parent) parent = model_->bookmark_bar_node(); return model_->AddURL(parent, parent->child_count(), title, url); } const BookmarkNode* AddFolder(const BookmarkNode* parent, - const string16& title) { + const base::string16& title) { if (!parent) parent = model_->bookmark_bar_node(); return model_->AddFolder(parent, parent->child_count(), title); diff --git a/chrome/browser/android/dev_tools_server.cc b/chrome/browser/android/dev_tools_server.cc index 3675308..eeda18a 100644 --- a/chrome/browser/android/dev_tools_server.cc +++ b/chrome/browser/android/dev_tools_server.cc @@ -89,7 +89,7 @@ class TargetBase : public content::DevToolsTarget { last_activity_time_(web_contents->GetLastSelectedTime()) { } - TargetBase(const string16& title, const GURL& url) + TargetBase(const base::string16& title, const GURL& url) : title_(UTF16ToUTF8(title)), url_(url) {} @@ -109,7 +109,7 @@ class TabTarget : public TargetBase { } static TabTarget* CreateForUnloadedTab(int tab_id, - const string16& title, + const base::string16& title, const GURL& url) { return new TabTarget(tab_id, title, url); } @@ -174,7 +174,7 @@ class TabTarget : public TargetBase { tab_id_(tab_id) { } - TabTarget(int tab_id, const string16& title, const GURL& url) + TabTarget(int tab_id, const base::string16& title, const GURL& url) : TargetBase(title, url), tab_id_(tab_id) { } diff --git a/chrome/browser/android/intent_helper.cc b/chrome/browser/android/intent_helper.cc index 347f3fc..1a9f36b 100644 --- a/chrome/browser/android/intent_helper.cc +++ b/chrome/browser/android/intent_helper.cc @@ -17,11 +17,11 @@ using base::android::ConvertUTF16ToJavaString; namespace chrome { namespace android { -void SendEmail(const string16& d_email, - const string16& d_subject, - const string16& d_body, - const string16& d_chooser_title, - const string16& d_file_to_attach) { +void SendEmail(const base::string16& d_email, + const base::string16& d_subject, + const base::string16& d_body, + const base::string16& d_chooser_title, + const base::string16& d_file_to_attach) { JNIEnv* env = AttachCurrentThread(); ScopedJavaLocalRef<jstring> j_email = ConvertUTF16ToJavaString(env, d_email); ScopedJavaLocalRef<jstring> j_subject = diff --git a/chrome/browser/android/intent_helper.h b/chrome/browser/android/intent_helper.h index 2036903..95c2e7e 100644 --- a/chrome/browser/android/intent_helper.h +++ b/chrome/browser/android/intent_helper.h @@ -13,11 +13,11 @@ namespace chrome { namespace android { // Triggers a send email intent. -void SendEmail(const string16& data_email, - const string16& data_subject, - const string16& data_body, - const string16& data_chooser_title, - const string16& data_file_to_attach); +void SendEmail(const base::string16& data_email, + const base::string16& data_subject, + const base::string16& data_body, + const base::string16& data_chooser_title, + const base::string16& data_file_to_attach); bool RegisterIntentHelper(JNIEnv* env); diff --git a/chrome/browser/android/most_visited_sites.cc b/chrome/browser/android/most_visited_sites.cc index 682d800..21ebf37 100644 --- a/chrome/browser/android/most_visited_sites.cc +++ b/chrome/browser/android/most_visited_sites.cc @@ -49,7 +49,7 @@ class NativeCallback : public base::RefCounted<NativeCallback> { void OnMostVisitedURLsAvailable( const history::MostVisitedURLList& visited_list) { - std::vector<string16> titles; + std::vector<base::string16> titles; std::vector<std::string> urls; ExtractMostVisitedTitlesAndURLs(visited_list, &titles, &urls); @@ -67,7 +67,7 @@ class NativeCallback : public base::RefCounted<NativeCallback> { void ExtractMostVisitedTitlesAndURLs( const history::MostVisitedURLList& visited_list, - std::vector<string16>* titles, + std::vector<base::string16>* titles, std::vector<std::string>* urls) { for (size_t i = 0; i < visited_list.size() && i < num_results_; ++i) { const history::MostVisitedURL& visited = visited_list[i]; diff --git a/chrome/browser/android/password_ui_view_android.cc b/chrome/browser/android/password_ui_view_android.cc index c5db384..ec41f51 100644 --- a/chrome/browser/android/password_ui_view_android.cc +++ b/chrome/browser/android/password_ui_view_android.cc @@ -26,7 +26,7 @@ Profile* PasswordUIViewAndroid::GetProfile() { } void PasswordUIViewAndroid::ShowPassword( - size_t index, const string16& password_value) { + size_t index, const base::string16& password_value) { NOTIMPLEMENTED(); } diff --git a/chrome/browser/android/password_ui_view_android.h b/chrome/browser/android/password_ui_view_android.h index 07e03d1..1c3cc7d 100644 --- a/chrome/browser/android/password_ui_view_android.h +++ b/chrome/browser/android/password_ui_view_android.h @@ -25,7 +25,7 @@ class PasswordUIViewAndroid : public PasswordUIView { // PasswordUIView implementation. virtual Profile* GetProfile() OVERRIDE; - virtual void ShowPassword(size_t index, const string16& password_value) + virtual void ShowPassword(size_t index, const base::string16& password_value) OVERRIDE; virtual void SetPasswordList( const ScopedVector<autofill::PasswordForm>& password_list, diff --git a/chrome/browser/android/provider/chrome_browser_provider.cc b/chrome/browser/android/provider/chrome_browser_provider.cc index fdad6c8..cd0c28f 100644 --- a/chrome/browser/android/provider/chrome_browser_provider.cc +++ b/chrome/browser/android/provider/chrome_browser_provider.cc @@ -147,9 +147,10 @@ jint ConvertJIntegerToJint(JNIEnv* env, jobject integer_obj) { return env->CallIntMethod(integer_obj, int_value, NULL); } -std::vector<string16> ConvertJStringArrayToString16Array(JNIEnv* env, - jobjectArray array) { - std::vector<string16> results; +std::vector<base::string16> ConvertJStringArrayToString16Array( + JNIEnv* env, + jobjectArray array) { + std::vector<base::string16> results; if (array) { jsize len = env->GetArrayLength(array); for (int i = 0; i < len; i++) { @@ -164,11 +165,11 @@ std::vector<string16> ConvertJStringArrayToString16Array(JNIEnv* env, // Parse the given url and return a GURL, appending the default scheme // if one is not present. -GURL ParseAndMaybeAppendScheme(const string16& url, +GURL ParseAndMaybeAppendScheme(const base::string16& url, const char* default_scheme) { GURL gurl(url); if (!gurl.is_valid() && !gurl.has_scheme()) { - string16 refined_url(ASCIIToUTF16(default_scheme)); + base::string16 refined_url(ASCIIToUTF16(default_scheme)); refined_url.append(url); gurl = GURL(refined_url); } @@ -176,7 +177,7 @@ GURL ParseAndMaybeAppendScheme(const string16& url, } const BookmarkNode* GetChildFolderByTitle(const BookmarkNode* parent, - const string16& title) { + const base::string16& title) { for (int i = 0; i < parent->child_count(); ++i) { if (parent->GetChild(i)->is_folder() && parent->GetChild(i)->GetTitle() == title) { @@ -193,8 +194,8 @@ class AddBookmarkTask : public BookmarkModelTask { public: explicit AddBookmarkTask(BookmarkModel* model) : BookmarkModelTask(model) {} - int64 Run(const string16& title, - const string16& url, + int64 Run(const base::string16& title, + const base::string16& url, const bool is_folder, const int64 parent_id) { int64 result = kInvalidBookmarkId; @@ -205,8 +206,8 @@ class AddBookmarkTask : public BookmarkModelTask { } static void RunOnUIThread(BookmarkModel* model, - const string16& title, - const string16& url, + const base::string16& title, + const base::string16& url, const bool is_folder, const int64 parent_id, int64* result) { @@ -309,8 +310,8 @@ class UpdateBookmarkTask : public BookmarkModelObserverTask { virtual ~UpdateBookmarkTask() {} int Run(const int64 id, - const string16& title, - const string16& url, + const base::string16& title, + const base::string16& url, const int64 parent_id) { id_to_update_ = id; RunOnUIThreadBlocking::Run( @@ -321,8 +322,8 @@ class UpdateBookmarkTask : public BookmarkModelObserverTask { static void RunOnUIThread(BookmarkModel* model, const int64 id, - const string16& title, - const string16& url, + const base::string16& title, + const base::string16& url, const int64 parent_id) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); const BookmarkNode* node = model->GetNodeByID(id); @@ -426,7 +427,7 @@ class CreateBookmarksFolderOnceTask : public BookmarkModelTask { explicit CreateBookmarksFolderOnceTask(BookmarkModel* model) : BookmarkModelTask(model) {} - int64 Run(const string16& title, const int64 parent_id) { + int64 Run(const base::string16& title, const int64 parent_id) { int64 result = kInvalidBookmarkId; RunOnUIThreadBlocking::Run( base::Bind(&CreateBookmarksFolderOnceTask::RunOnUIThread, @@ -435,7 +436,7 @@ class CreateBookmarksFolderOnceTask : public BookmarkModelTask { } static void RunOnUIThread(BookmarkModel* model, - const string16& title, + const base::string16& title, const int64 parent_id, int64* result) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); @@ -461,7 +462,7 @@ class CreateBookmarksFolderOnceTask : public BookmarkModelTask { return; } - AddBookmarkTask::RunOnUIThread(model, title, string16(), true, + AddBookmarkTask::RunOnUIThread(model, title, base::string16(), true, parent->id(), result); } @@ -751,7 +752,7 @@ class QueryBookmarksFromAPITask : public HistoryProviderTask { history::AndroidStatement* Run( const std::vector<history::HistoryAndBookmarkRow::ColumnID>& projections, const std::string& selection, - const std::vector<string16>& selection_args, + const std::vector<base::string16>& selection_args, const std::string& sort_order) { RunAsyncRequestOnUIThreadBlocking( base::Bind(&AndroidHistoryProviderService::QueryHistoryAndBookmarks, @@ -785,7 +786,7 @@ class UpdateBookmarksFromAPITask : public HistoryProviderTask { int Run(const history::HistoryAndBookmarkRow& row, const std::string& selection, - const std::vector<string16>& selection_args) { + const std::vector<base::string16>& selection_args) { RunAsyncRequestOnUIThreadBlocking( base::Bind(&AndroidHistoryProviderService::UpdateHistoryAndBookmarks, base::Unretained(service()), row, selection, @@ -817,7 +818,7 @@ class RemoveBookmarksFromAPITask : public HistoryProviderTask { result_(0) {} int Run(const std::string& selection, - const std::vector<string16>& selection_args) { + const std::vector<base::string16>& selection_args) { RunAsyncRequestOnUIThreadBlocking( base::Bind(&AndroidHistoryProviderService::DeleteHistoryAndBookmarks, base::Unretained(service()), selection, selection_args, @@ -849,7 +850,7 @@ class RemoveHistoryFromAPITask : public HistoryProviderTask { result_(0) {} int Run(const std::string& selection, - const std::vector<string16>& selection_args) { + const std::vector<base::string16>& selection_args) { RunAsyncRequestOnUIThreadBlocking( base::Bind(&AndroidHistoryProviderService::DeleteHistory, base::Unretained(service()), selection, @@ -961,7 +962,7 @@ class QuerySearchTermsFromAPITask : public SearchTermTask { history::AndroidStatement* Run( const std::vector<history::SearchRow::ColumnID>& projections, const std::string& selection, - const std::vector<string16>& selection_args, + const std::vector<base::string16>& selection_args, const std::string& sort_order) { RunAsyncRequestOnUIThreadBlocking( base::Bind(&AndroidHistoryProviderService::QuerySearchTerms, @@ -998,7 +999,7 @@ class UpdateSearchTermsFromAPITask : public SearchTermTask { int Run(const history::SearchRow& row, const std::string& selection, - const std::vector<string16>& selection_args) { + const std::vector<base::string16>& selection_args) { RunAsyncRequestOnUIThreadBlocking( base::Bind(&UpdateSearchTermsFromAPITask::MakeRequestOnUIThread, base::Unretained(this), row, selection, selection_args)); @@ -1006,9 +1007,10 @@ class UpdateSearchTermsFromAPITask : public SearchTermTask { } private: - void MakeRequestOnUIThread(const history::SearchRow& row, - const std::string& selection, - const std::vector<string16>& selection_args) { + void MakeRequestOnUIThread( + const history::SearchRow& row, + const std::string& selection, + const std::vector<base::string16>& selection_args) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); history::SearchRow internal_row = row; BuildSearchRow(&internal_row); @@ -1043,7 +1045,7 @@ class RemoveSearchTermsFromAPITask : public SearchTermTask { : SearchTermTask(service, cancelable_consumer, profile), result_() {} int Run(const std::string& selection, - const std::vector<string16>& selection_args) { + const std::vector<base::string16>& selection_args) { RunAsyncRequestOnUIThreadBlocking( base::Bind(&AndroidHistoryProviderService::DeleteSearchTerms, base::Unretained(service()), selection, selection_args, @@ -1086,7 +1088,7 @@ void FillBookmarkRow(JNIEnv* env, DCHECK(!BrowserThread::CurrentlyOn(BrowserThread::UI)); if (url) { - string16 raw_url = ConvertJavaStringToUTF16(env, url); + base::string16 raw_url = ConvertJavaStringToUTF16(env, url); // GURL doesn't accept the URL without protocol, but the Android CTS // allows it. We are trying to prefix with 'http://' to see whether // GURL thinks it is a valid URL. The original url will be stored in @@ -1194,10 +1196,10 @@ jlong ChromeBrowserProvider::AddBookmark(JNIEnv* env, jstring jtitle, jboolean is_folder, jlong parent_id) { - string16 url; + base::string16 url; if (jurl) url = ConvertJavaStringToUTF16(env, jurl); - string16 title = ConvertJavaStringToUTF16(env, jtitle); + base::string16 title = ConvertJavaStringToUTF16(env, jtitle); AddBookmarkTask task(bookmark_model_); return task.Run(title, url, is_folder, parent_id); @@ -1214,10 +1216,10 @@ jint ChromeBrowserProvider::UpdateBookmark(JNIEnv* env, jstring jurl, jstring jtitle, jlong parent_id) { - string16 url; + base::string16 url; if (jurl) url = ConvertJavaStringToUTF16(env, jurl); - string16 title = ConvertJavaStringToUTF16(env, jtitle); + base::string16 title = ConvertJavaStringToUTF16(env, jtitle); UpdateBookmarkTask task(bookmark_model_); return task.Run(id, title, url, parent_id); @@ -1279,7 +1281,7 @@ ScopedJavaLocalRef<jobject> ChromeBrowserProvider::QueryBookmarkFromAPI( } } - std::vector<string16> where_args = + std::vector<base::string16> where_args = ConvertJStringArrayToString16Array(env, selection_args); std::string where_clause; @@ -1322,7 +1324,7 @@ jint ChromeBrowserProvider::UpdateBookmarkFromAPI(JNIEnv* env, FillBookmarkRow(env, obj, url, created, isBookmark, date, favicon, title, visits, parent_id, &row, bookmark_model_); - std::vector<string16> where_args = + std::vector<base::string16> where_args = ConvertJStringArrayToString16Array(env, selection_args); std::string where_clause; @@ -1337,7 +1339,7 @@ jint ChromeBrowserProvider::RemoveBookmarkFromAPI(JNIEnv* env, jobject obj, jstring selections, jobjectArray selection_args) { - std::vector<string16> where_args = + std::vector<base::string16> where_args = ConvertJStringArrayToString16Array(env, selection_args); std::string where_clause; @@ -1352,7 +1354,7 @@ jint ChromeBrowserProvider::RemoveHistoryFromAPI(JNIEnv* env, jobject obj, jstring selections, jobjectArray selection_args) { - std::vector<string16> where_args = + std::vector<base::string16> where_args = ConvertJStringArrayToString16Array(env, selection_args); std::string where_clause; @@ -1413,7 +1415,7 @@ ScopedJavaLocalRef<jobject> ChromeBrowserProvider::QuerySearchTermFromAPI( } } - std::vector<string16> where_args = + std::vector<base::string16> where_args = ConvertJStringArrayToString16Array(env, selection_args); std::string where_clause; @@ -1446,7 +1448,7 @@ jint ChromeBrowserProvider::UpdateSearchTermFromAPI( history::SearchRow row; FillSearchRow(env, obj, search_term, date, &row); - std::vector<string16> where_args = ConvertJStringArrayToString16Array( + std::vector<base::string16> where_args = ConvertJStringArrayToString16Array( env, selection_args); std::string where_clause; @@ -1460,7 +1462,7 @@ jint ChromeBrowserProvider::UpdateSearchTermFromAPI( jint ChromeBrowserProvider::RemoveSearchTermFromAPI( JNIEnv* env, jobject obj, jstring selections, jobjectArray selection_args) { - std::vector<string16> where_args = + std::vector<base::string16> where_args = ConvertJStringArrayToString16Array(env, selection_args); std::string where_clause; @@ -1487,7 +1489,7 @@ jlong ChromeBrowserProvider::CreateBookmarksFolderOnce( jobject obj, jstring jtitle, jlong parent_id) { - string16 title = ConvertJavaStringToUTF16(env, jtitle); + base::string16 title = ConvertJavaStringToUTF16(env, jtitle); if (title.empty()) return kInvalidBookmarkId; diff --git a/chrome/browser/android/shortcut_helper.cc b/chrome/browser/android/shortcut_helper.cc index 8025b93..ea767cd 100644 --- a/chrome/browser/android/shortcut_helper.cc +++ b/chrome/browser/android/shortcut_helper.cc @@ -29,7 +29,7 @@ #include "url/gurl.h" ShortcutBuilder::ShortcutBuilder(content::WebContents* web_contents, - const string16& title, + const base::string16& title, int launcher_large_icon_size) : launcher_large_icon_size_(launcher_large_icon_size), shortcut_type_(BOOKMARK) { @@ -125,7 +125,7 @@ void ShortcutBuilder::Destroy() { } void ShortcutHelper::AddShortcut(content::WebContents* web_contents, - const string16& title, + const base::string16& title, int launcher_large_icon_size) { // The ShortcutBuilder deletes itself when it's done. new ShortcutBuilder(web_contents, title, launcher_large_icon_size); @@ -137,7 +137,7 @@ bool ShortcutHelper::RegisterShortcutHelper(JNIEnv* env) { void ShortcutHelper::AddShortcutInBackground( const GURL& url, - const string16& title, + const base::string16& title, ShortcutBuilder::ShortcutType shortcut_type, const chrome::FaviconBitmapResult& bitmap_result) { DCHECK(base::WorkerPool::RunsTasksOnCurrentThread()); diff --git a/chrome/browser/android/shortcut_helper.h b/chrome/browser/android/shortcut_helper.h index 323b409..e9059ae 100644 --- a/chrome/browser/android/shortcut_helper.h +++ b/chrome/browser/android/shortcut_helper.h @@ -43,7 +43,7 @@ class ShortcutBuilder : public content::WebContentsObserver { }; explicit ShortcutBuilder(content::WebContents* web_contents, - const string16& title, + const base::string16& title, int launcher_large_icon_size); virtual ~ShortcutBuilder() {} @@ -63,7 +63,7 @@ class ShortcutBuilder : public content::WebContentsObserver { void Destroy(); GURL url_; - string16 title_; + base::string16 title_; int launcher_large_icon_size_; ShortcutType shortcut_type_; CancelableTaskTracker cancelable_task_tracker_; @@ -76,7 +76,7 @@ class ShortcutHelper { // Adds a shortcut to the current URL to the Android home screen, firing // background tasks to pull all the data required. static void AddShortcut(content::WebContents* web_contents, - const string16& title, + const base::string16& title, int launcher_larger_icon_size); // Adds a shortcut to the launcher. Must be called from a WorkerPool task. diff --git a/chrome/browser/android/tab_android.cc b/chrome/browser/android/tab_android.cc index dbf8a01..0a7348c 100644 --- a/chrome/browser/android/tab_android.cc +++ b/chrome/browser/android/tab_android.cc @@ -175,11 +175,11 @@ int TabAndroid::GetSyncId() const { return Java_TabBase_getSyncId(env, obj.obj()); } -string16 TabAndroid::GetTitle() const { +base::string16 TabAndroid::GetTitle() const { JNIEnv* env = base::android::AttachCurrentThread(); ScopedJavaLocalRef<jobject> obj = weak_java_tab_.get(env); if (obj.is_null()) - return string16(); + return base::string16(); return base::android::ConvertJavaStringToUTF16( Java_TabBase_getTitle(env, obj.obj())); } @@ -385,7 +385,7 @@ void TabAndroid::SetActiveNavigationEntryTitleForUrl(JNIEnv* env, jstring jtitle) { DCHECK(web_contents()); - string16 title; + base::string16 title; if (jtitle) title = base::android::ConvertJavaStringToUTF16(env, jtitle); diff --git a/chrome/browser/android/tab_android.h b/chrome/browser/android/tab_android.h index 86af479..fc69465 100644 --- a/chrome/browser/android/tab_android.h +++ b/chrome/browser/android/tab_android.h @@ -60,7 +60,7 @@ class TabAndroid : public CoreTabHelperDelegate, int GetSyncId() const; // Return the tab title. - string16 GetTitle() const; + base::string16 GetTitle() const; // Return the tab url. GURL GetURL() const; @@ -79,8 +79,8 @@ class TabAndroid : public CoreTabHelperDelegate, virtual void HandlePopupNavigation(chrome::NavigateParams* params) = 0; virtual void OnReceivedHttpAuthRequest(jobject auth_handler, - const string16& host, - const string16& realm) = 0; + const base::string16& host, + const base::string16& realm) = 0; // Called to show the regular context menu that is triggered by a long press. virtual void ShowContextMenu(const content::ContextMenuParams& params) = 0; @@ -93,7 +93,7 @@ class TabAndroid : public CoreTabHelperDelegate, // Called when context menu option to create the bookmark shortcut on // homescreen is called. virtual void AddShortcutToBookmark( - const GURL& url, const string16& title, const SkBitmap& skbitmap, + const GURL& url, const base::string16& title, const SkBitmap& skbitmap, int r_value, int g_value, int b_value) = 0; // Called when a bookmark node should be edited. diff --git a/chrome/browser/app_controller_mac.mm b/chrome/browser/app_controller_mac.mm index 46685ce..41b3e30 100644 --- a/chrome/browser/app_controller_mac.mm +++ b/chrome/browser/app_controller_mac.mm @@ -232,8 +232,9 @@ class AppControllerProfileObserver : public ProfileInfoCacheObserver { virtual void OnProfileAdded(const base::FilePath& profile_path) OVERRIDE { } - virtual void OnProfileWasRemoved(const base::FilePath& profile_path, - const string16& profile_name) OVERRIDE { + virtual void OnProfileWasRemoved( + const base::FilePath& profile_path, + const base::string16& profile_name) OVERRIDE { // When a profile is deleted we need to notify the AppController, // so it can correctly update its pointer to the last used profile. [app_controller_ profileWasRemoved:profile_path]; @@ -243,8 +244,9 @@ class AppControllerProfileObserver : public ProfileInfoCacheObserver { const base::FilePath& profile_path) OVERRIDE { } - virtual void OnProfileNameChanged(const base::FilePath& profile_path, - const string16& old_profile_name) OVERRIDE { + virtual void OnProfileNameChanged( + const base::FilePath& profile_path, + const base::string16& old_profile_name) OVERRIDE { } virtual void OnProfileAvatarChanged( @@ -1316,8 +1318,8 @@ class AppControllerProfileObserver : public ProfileInfoCacheObserver { NSString* printTitle = [[paramList descriptorAtIndex:3] stringValue]; NSString* printTicket = [[paramList descriptorAtIndex:4] stringValue]; // Convert the title to UTF 16 as required. - string16 title16 = base::SysNSStringToUTF16(printTitle); - string16 printTicket16 = base::SysNSStringToUTF16(printTicket); + base::string16 title16 = base::SysNSStringToUTF16(printTitle); + base::string16 printTicket16 = base::SysNSStringToUTF16(printTicket); print_dialog_cloud::CreatePrintDialogForFile( ProfileManager::GetDefaultProfile(), NULL, base::FilePath([inputPath UTF8String]), title16, diff --git a/chrome/browser/apps/app_url_redirector_browsertest.cc b/chrome/browser/apps/app_url_redirector_browsertest.cc index b81c715..c540614 100644 --- a/chrome/browser/apps/app_url_redirector_browsertest.cc +++ b/chrome/browser/apps/app_url_redirector_browsertest.cc @@ -155,7 +155,7 @@ void PlatformAppUrlRedirectorBrowserTest::TestMismatchingNavigationInTab( InstallPlatformApp(handler); - const string16 success_title = ASCIIToUTF16(success_tab_title); + const base::string16 success_title = ASCIIToUTF16(success_tab_title); content::WebContents* tab = browser()->tab_strip_model()->GetActiveWebContents(); content::TitleWatcher title_watcher(tab, success_title); @@ -181,8 +181,8 @@ void PlatformAppUrlRedirectorBrowserTest::TestNegativeXhrInTab( InstallPlatformApp(handler); - const string16 success_title = ASCIIToUTF16(success_tab_title); - const string16 failure_title = ASCIIToUTF16(failure_tab_title); + const base::string16 success_title = ASCIIToUTF16(success_tab_title); + const base::string16 failure_title = ASCIIToUTF16(failure_tab_title); content::WebContents* tab = browser()->tab_strip_model()->GetActiveWebContents(); content::TitleWatcher title_watcher(tab, success_title); @@ -297,7 +297,7 @@ void PlatformAppUrlRedirectorBrowserTest::TestNegativeNavigationInBrowser( InstallPlatformApp(handler); - const string16 success_title = ASCIIToUTF16(success_tab_title); + const base::string16 success_title = ASCIIToUTF16(success_tab_title); content::WebContents* tab = browser()->tab_strip_model()->GetActiveWebContents(); content::TitleWatcher title_watcher(tab, success_title); diff --git a/chrome/browser/apps/shortcut_manager.cc b/chrome/browser/apps/shortcut_manager.cc index 0cc6f8e..4d46305 100644 --- a/chrome/browser/apps/shortcut_manager.cc +++ b/chrome/browser/apps/shortcut_manager.cc @@ -126,7 +126,7 @@ void AppShortcutManager::Observe(int type, base::Callback<void(const ShellIntegration::ShortcutInfo&)> create_or_update; if (installed_info->is_update) { - string16 old_title = UTF8ToUTF16(installed_info->old_name); + base::string16 old_title = UTF8ToUTF16(installed_info->old_name); create_or_update = base::Bind(&web_app::UpdateAllShortcuts, old_title); } else { diff --git a/chrome/browser/apps/web_view_browsertest.cc b/chrome/browser/apps/web_view_browsertest.cc index bcbfdd7..fd5adba 100644 --- a/chrome/browser/apps/web_view_browsertest.cc +++ b/chrome/browser/apps/web_view_browsertest.cc @@ -449,8 +449,8 @@ class WebViewTest : public extensions::PlatformAppBrowserTest { void ExecuteScriptWaitForTitle(content::WebContents* web_contents, const char* script, const char* title) { - string16 expected_title(ASCIIToUTF16(title)); - string16 error_title(ASCIIToUTF16("error")); + base::string16 expected_title(ASCIIToUTF16(title)); + base::string16 error_title(ASCIIToUTF16("error")); content::TitleWatcher title_watcher(web_contents, expected_title); title_watcher.AlsoWaitForTitle(error_title); @@ -1539,8 +1539,8 @@ IN_PROC_BROWSER_TEST_F(WebViewTest, SpeechRecognition) { // way that this will trigger clicking on speech recognition input mic. SimulateMouseClick(guest_web_contents, 0, blink::WebMouseEvent::ButtonLeft); - string16 expected_title(ASCIIToUTF16("PASSED")); - string16 error_title(ASCIIToUTF16("FAILED")); + base::string16 expected_title(ASCIIToUTF16("PASSED")); + base::string16 error_title(ASCIIToUTF16("FAILED")); content::TitleWatcher title_watcher(guest_web_contents, expected_title); title_watcher.AlsoWaitForTitle(error_title); EXPECT_EQ(expected_title, title_watcher.WaitAndGetTitle()); diff --git a/chrome/browser/apps/web_view_interactive_browsertest.cc b/chrome/browser/apps/web_view_interactive_browsertest.cc index 4e79775..15a1bba 100644 --- a/chrome/browser/apps/web_view_interactive_browsertest.cc +++ b/chrome/browser/apps/web_view_interactive_browsertest.cc @@ -297,8 +297,8 @@ class WebViewInteractiveTest }; void WaitForTitle(const char* title) { - string16 expected_title(ASCIIToUTF16(title)); - string16 error_title(ASCIIToUTF16("FAILED")); + base::string16 expected_title(ASCIIToUTF16(title)); + base::string16 error_title(ASCIIToUTF16("FAILED")); content::TitleWatcher title_watcher(guest_web_contents(), expected_title); title_watcher.AlsoWaitForTitle(error_title); ASSERT_EQ(expected_title, title_watcher.WaitAndGetTitle()); @@ -324,8 +324,8 @@ class WebViewInteractiveTest ASSERT_TRUE(!popup_rwh->IsRenderView()); ASSERT_TRUE(popup_rwh->GetView()); - string16 expected_title = ASCIIToUTF16("PASSED2"); - string16 error_title = ASCIIToUTF16("FAILED"); + base::string16 expected_title = ASCIIToUTF16("PASSED2"); + base::string16 error_title = ASCIIToUTF16("FAILED"); content::TitleWatcher title_watcher(guest_web_contents(), expected_title); title_watcher.AlsoWaitForTitle(error_title); EXPECT_TRUE(content::ExecuteScript(guest_web_contents(), diff --git a/chrome/browser/autocomplete/autocomplete_browsertest.cc b/chrome/browser/autocomplete/autocomplete_browsertest.cc index 732920a..eb0a59f 100644 --- a/chrome/browser/autocomplete/autocomplete_browsertest.cc +++ b/chrome/browser/autocomplete/autocomplete_browsertest.cc @@ -36,7 +36,7 @@ namespace { -string16 AutocompleteResultAsString(const AutocompleteResult& result) { +base::string16 AutocompleteResultAsString(const AutocompleteResult& result) { std::string output(base::StringPrintf("{%" PRIuS "} ", result.size())); for (size_t i = 0; i < result.size(); ++i) { AutocompleteMatch match = result.match_at(i); @@ -137,7 +137,7 @@ IN_PROC_BROWSER_TEST_F(AutocompleteBrowserTest, MAYBE_Autocomplete) { { omnibox_view->model()->SetInputInProgress(true); autocomplete_controller->Start(AutocompleteInput( - ASCIIToUTF16("chrome"), string16::npos, string16(), GURL(), + ASCIIToUTF16("chrome"), base::string16::npos, base::string16(), GURL(), AutocompleteInput::NTP, true, false, true, AutocompleteInput::SYNCHRONOUS_MATCHES)); @@ -179,7 +179,7 @@ IN_PROC_BROWSER_TEST_F(AutocompleteBrowserTest, TabAwayRevertSelect) { LocationBar* location_bar = GetLocationBar(); OmniboxView* omnibox_view = location_bar->GetOmniboxView(); EXPECT_EQ(UTF8ToUTF16(content::kAboutBlankURL), omnibox_view->GetText()); - omnibox_view->SetUserText(string16()); + omnibox_view->SetUserText(base::string16()); content::WindowedNotificationObserver observer( content::NOTIFICATION_LOAD_STOP, content::NotificationService::AllSources()); diff --git a/chrome/browser/autocomplete/autocomplete_classifier.cc b/chrome/browser/autocomplete/autocomplete_classifier.cc index 49fc6cc..b8169ad 100644 --- a/chrome/browser/autocomplete/autocomplete_classifier.cc +++ b/chrome/browser/autocomplete/autocomplete_classifier.cc @@ -33,7 +33,7 @@ AutocompleteClassifier::~AutocompleteClassifier() { DCHECK(!controller_.get()); } -void AutocompleteClassifier::Classify(const string16& text, +void AutocompleteClassifier::Classify(const base::string16& text, bool prefer_keyword, bool allow_exact_keyword_match, AutocompleteMatch* match, @@ -41,7 +41,7 @@ void AutocompleteClassifier::Classify(const string16& text, DCHECK(!inside_classify_); base::AutoReset<bool> reset(&inside_classify_, true); controller_->Start(AutocompleteInput( - text, string16::npos, string16(), GURL(), + text, base::string16::npos, base::string16(), GURL(), AutocompleteInput::INVALID_SPEC, true, prefer_keyword, allow_exact_keyword_match, AutocompleteInput::BEST_MATCH)); DCHECK(controller_->done()); diff --git a/chrome/browser/autocomplete/autocomplete_classifier.h b/chrome/browser/autocomplete/autocomplete_classifier.h index dc0833e..8e9c760 100644 --- a/chrome/browser/autocomplete/autocomplete_classifier.h +++ b/chrome/browser/autocomplete/autocomplete_classifier.h @@ -39,7 +39,7 @@ class AutocompleteClassifier : public BrowserContextKeyedService { // non-NULL, will be set to the navigational URL (if any) in case of an // accidental search; see comments on // AutocompleteResult::alternate_nav_url_ in autocomplete.h. - void Classify(const string16& text, + void Classify(const base::string16& text, bool prefer_keyword, bool allow_exact_keyword_match, AutocompleteMatch* match, diff --git a/chrome/browser/autocomplete/autocomplete_controller.cc b/chrome/browser/autocomplete/autocomplete_controller.cc index a2bbfff..999d60e 100644 --- a/chrome/browser/autocomplete/autocomplete_controller.cc +++ b/chrome/browser/autocomplete/autocomplete_controller.cc @@ -50,7 +50,7 @@ void AutocompleteMatchToAssistedQuery( // This type indicates a native chrome suggestion. *type = 69; // Default value, indicating no subtype. - *subtype = string16::npos; + *subtype = base::string16::npos; switch (match) { case AutocompleteMatchType::SEARCH_SUGGEST: { @@ -112,7 +112,7 @@ void AppendAvailableAutocompletion(size_t type, autocompletions->append("j"); base::StringAppendF(autocompletions, "%" PRIuS, type); // Subtype is optional - string16::npos indicates no subtype. - if (subtype != string16::npos) + if (subtype != base::string16::npos) base::StringAppendF(autocompletions, "i%" PRIuS, subtype); if (count > 1) base::StringAppendF(autocompletions, "l%d", count); @@ -215,7 +215,7 @@ AutocompleteController::~AutocompleteController() { } void AutocompleteController::Start(const AutocompleteInput& input) { - const string16 old_input_text(input_.text()); + const base::string16 old_input_text(input_.text()); const AutocompleteInput::MatchesRequested old_matches_requested = input_.matches_requested(); input_ = input; @@ -306,7 +306,7 @@ void AutocompleteController::Stop(bool clear_result) { void AutocompleteController::StartZeroSuggest( const GURL& url, AutocompleteInput::PageClassification page_classification, - const string16& permanent_text) { + const base::string16& permanent_text) { if (zero_suggest_provider_ != NULL) { DCHECK(!in_start_); // We should not be already running a query. in_zero_suggest_ = true; @@ -407,7 +407,7 @@ void AutocompleteController::UpdateResult( const bool last_default_was_valid = result_.default_match() != result_.end(); // The following three variables are only set and used if // |last_default_was_valid|. - string16 last_default_fill_into_edit, last_default_keyword, + base::string16 last_default_fill_into_edit, last_default_keyword, last_default_associated_keyword; if (last_default_was_valid) { last_default_fill_into_edit = result_.default_match()->fill_into_edit; @@ -447,7 +447,7 @@ void AutocompleteController::UpdateResult( UpdateAssistedQueryStats(&result_); const bool default_is_valid = result_.default_match() != result_.end(); - string16 default_associated_keyword; + base::string16 default_associated_keyword; if (default_is_valid && (result_.default_match()->associated_keyword != NULL)) { default_associated_keyword = @@ -480,10 +480,11 @@ void AutocompleteController::UpdateAssociatedKeywords( if (!keyword_provider_) return; - std::set<string16> keywords; + std::set<base::string16> keywords; for (ACMatches::iterator match(result->begin()); match != result->end(); ++match) { - string16 keyword(match->GetSubstitutingExplicitlyInvokedKeyword(profile_)); + base::string16 keyword( + match->GetSubstitutingExplicitlyInvokedKeyword(profile_)); if (!keyword.empty()) { keywords.insert(keyword); continue; @@ -509,7 +510,7 @@ void AutocompleteController::UpdateAssociatedKeywords( void AutocompleteController::UpdateKeywordDescriptions( AutocompleteResult* result) { - string16 last_keyword; + base::string16 last_keyword; for (AutocompleteResult::iterator i(result->begin()); i != result->end(); ++i) { if ((i->provider->type() == AutocompleteProvider::TYPE_KEYWORD && @@ -549,14 +550,14 @@ void AutocompleteController::UpdateAssistedQueryStats( // Build the impressions string (the AQS part after "."). std::string autocompletions; int count = 0; - size_t last_type = string16::npos; - size_t last_subtype = string16::npos; + size_t last_type = base::string16::npos; + size_t last_subtype = base::string16::npos; for (ACMatches::iterator match(result->begin()); match != result->end(); ++match) { - size_t type = string16::npos; - size_t subtype = string16::npos; + size_t type = base::string16::npos; + size_t subtype = base::string16::npos; AutocompleteMatchToAssistedQuery(match->type, &type, &subtype); - if (last_type != string16::npos && + if (last_type != base::string16::npos && (type != last_type || subtype != last_subtype)) { AppendAvailableAutocompletion( last_type, last_subtype, count, &autocompletions); diff --git a/chrome/browser/autocomplete/autocomplete_controller.h b/chrome/browser/autocomplete/autocomplete_controller.h index c95b4c9..73ba1ef 100644 --- a/chrome/browser/autocomplete/autocomplete_controller.h +++ b/chrome/browser/autocomplete/autocomplete_controller.h @@ -83,7 +83,7 @@ class AutocompleteController : public AutocompleteProviderListener { void StartZeroSuggest( const GURL& url, AutocompleteInput::PageClassification page_classification, - const string16& permanent_text); + const base::string16& permanent_text); // Cancels any pending zero-suggest fetch. void StopZeroSuggest(); diff --git a/chrome/browser/autocomplete/autocomplete_input.cc b/chrome/browser/autocomplete/autocomplete_input.cc index 2de3f96..40d98fa 100644 --- a/chrome/browser/autocomplete/autocomplete_input.cc +++ b/chrome/browser/autocomplete/autocomplete_input.cc @@ -19,7 +19,7 @@ namespace { void AdjustCursorPositionIfNecessary(size_t num_leading_chars_removed, size_t* cursor_position) { - if (*cursor_position == string16::npos) + if (*cursor_position == base::string16::npos) return; if (num_leading_chars_removed < *cursor_position) *cursor_position -= num_leading_chars_removed; @@ -30,7 +30,7 @@ void AdjustCursorPositionIfNecessary(size_t num_leading_chars_removed, } // namespace AutocompleteInput::AutocompleteInput() - : cursor_position_(string16::npos), + : cursor_position_(base::string16::npos), current_page_classification_(AutocompleteInput::INVALID_SPEC), type_(INVALID), prevent_inline_autocomplete_(false), @@ -40,9 +40,9 @@ AutocompleteInput::AutocompleteInput() } AutocompleteInput::AutocompleteInput( - const string16& text, + const base::string16& text, size_t cursor_position, - const string16& desired_tld, + const base::string16& desired_tld, const GURL& current_url, AutocompleteInput::PageClassification current_page_classification, bool prevent_inline_autocomplete, @@ -56,7 +56,8 @@ AutocompleteInput::AutocompleteInput( prefer_keyword_(prefer_keyword), allow_exact_keyword_match_(allow_exact_keyword_match), matches_requested_(matches_requested) { - DCHECK(cursor_position <= text.length() || cursor_position == string16::npos) + DCHECK(cursor_position <= text.length() || + cursor_position == base::string16::npos) << "Text: '" << text << "', cp: " << cursor_position; // None of the providers care about leading white space so we always trim it. // Providers that care about trailing white space handle trimming themselves. @@ -81,7 +82,7 @@ AutocompleteInput::AutocompleteInput( AdjustCursorPositionIfNecessary(chars_removed, &cursor_position_); if (chars_removed) { // Remove spaces between opening question mark and first actual character. - string16 trimmed_text; + base::string16 trimmed_text; if ((TrimWhitespace(text_, TRIM_LEADING, &trimmed_text) & TRIM_LEADING) != 0) { AdjustCursorPositionIfNecessary(text_.length() - trimmed_text.length(), @@ -95,8 +96,9 @@ AutocompleteInput::~AutocompleteInput() { } // static -size_t AutocompleteInput::RemoveForcedQueryStringIfNecessary(Type type, - string16* text) { +size_t AutocompleteInput::RemoveForcedQueryStringIfNecessary( + Type type, + base::string16* text) { if (type != FORCED_QUERY || text->empty() || (*text)[0] != L'?') return 0; // Drop the leading '?'. @@ -127,7 +129,7 @@ AutocompleteInput::Type AutocompleteInput::Parse( base::string16* scheme, GURL* canonicalized_url) { size_t first_non_white = text.find_first_not_of(base::kWhitespaceUTF16, 0); - if (first_non_white == string16::npos) + if (first_non_white == base::string16::npos) return INVALID; // All whitespace. if (text.at(first_non_white) == L'?') { @@ -143,7 +145,7 @@ AutocompleteInput::Type AutocompleteInput::Parse( url_parse::Parsed local_parts; if (!parts) parts = &local_parts; - const string16 parsed_scheme(URLFixerUpper::SegmentURL(text, parts)); + const base::string16 parsed_scheme(URLFixerUpper::SegmentURL(text, parts)); if (scheme) *scheme = parsed_scheme; if (canonicalized_url) { @@ -208,11 +210,11 @@ AutocompleteInput::Type AutocompleteInput::Parse( default: { // We don't know about this scheme. It might be that the user typed a // URL of the form "username:password@foo.com". - const string16 http_scheme_prefix = + const base::string16 http_scheme_prefix = ASCIIToUTF16(std::string(content::kHttpScheme) + content::kStandardSchemeSeparator); url_parse::Parsed http_parts; - string16 http_scheme; + base::string16 http_scheme; GURL http_canonicalized_url; Type http_type = Parse(http_scheme_prefix + text, desired_tld, &http_parts, &http_scheme, @@ -269,7 +271,7 @@ AutocompleteInput::Type AutocompleteInput::Parse( // Likewise, the RCDS can reject certain obviously-invalid hosts. (We also // use the registry length later below.) - const string16 host(text.substr(parts->host.begin, parts->host.len)); + const base::string16 host(text.substr(parts->host.begin, parts->host.len)); const size_t registry_length = net::registry_controlled_domains::GetRegistryLength( UTF16ToUTF8(host), @@ -278,7 +280,7 @@ AutocompleteInput::Type AutocompleteInput::Parse( if (registry_length == std::string::npos) { // Try to append the desired_tld. if (!desired_tld.empty()) { - string16 host_with_tld(host); + base::string16 host_with_tld(host); if (host[host.length() - 1] != '.') host_with_tld += '.'; host_with_tld += desired_tld; @@ -324,8 +326,8 @@ AutocompleteInput::Type AutocompleteInput::Parse( // TLD // These are rare, though probably possible in intranets. return (parts->scheme.is_nonempty() || - ((registry_length != 0) && (host.find(' ') == string16::npos))) ? - UNKNOWN : QUERY; + ((registry_length != 0) && + (host.find(' ') == base::string16::npos))) ? UNKNOWN : QUERY; } // A port number is a good indicator that this is a URL. However, it might @@ -423,12 +425,12 @@ AutocompleteInput::Type AutocompleteInput::Parse( // static void AutocompleteInput::ParseForEmphasizeComponents( - const string16& text, + const base::string16& text, url_parse::Component* scheme, url_parse::Component* host) { url_parse::Parsed parts; - string16 scheme_str; - Parse(text, string16(), &parts, &scheme_str, NULL); + base::string16 scheme_str; + Parse(text, base::string16(), &parts, &scheme_str, NULL); *scheme = parts.scheme; *host = parts.host; @@ -439,9 +441,9 @@ void AutocompleteInput::ParseForEmphasizeComponents( if (LowerCaseEqualsASCII(scheme_str, content::kViewSourceScheme) && (static_cast<int>(text.length()) > after_scheme_and_colon)) { // Obtain the URL prefixed by view-source and parse it. - string16 real_url(text.substr(after_scheme_and_colon)); + base::string16 real_url(text.substr(after_scheme_and_colon)); url_parse::Parsed real_parts; - AutocompleteInput::Parse(real_url, string16(), &real_parts, NULL, NULL); + AutocompleteInput::Parse(real_url, base::string16(), &real_parts, NULL, NULL); if (real_parts.scheme.is_nonempty() || real_parts.host.is_nonempty()) { if (real_parts.scheme.is_nonempty()) { *scheme = url_parse::Component( @@ -465,15 +467,15 @@ void AutocompleteInput::ParseForEmphasizeComponents( } // static -string16 AutocompleteInput::FormattedStringWithEquivalentMeaning( +base::string16 AutocompleteInput::FormattedStringWithEquivalentMeaning( const GURL& url, - const string16& formatted_url) { + const base::string16& formatted_url) { if (!net::CanStripTrailingSlash(url)) return formatted_url; - const string16 url_with_path(formatted_url + char16('/')); - return (AutocompleteInput::Parse(formatted_url, string16(), NULL, NULL, + const base::string16 url_with_path(formatted_url + char16('/')); + return (AutocompleteInput::Parse(formatted_url, base::string16(), NULL, NULL, NULL) == - AutocompleteInput::Parse(url_with_path, string16(), NULL, NULL, + AutocompleteInput::Parse(url_with_path, base::string16(), NULL, NULL, NULL)) ? formatted_url : url_with_path; } @@ -499,7 +501,7 @@ int AutocompleteInput::NumNonHostComponents(const url_parse::Parsed& parts) { } // static -bool AutocompleteInput::HasHTTPScheme(const string16& input) { +bool AutocompleteInput::HasHTTPScheme(const base::string16& input) { std::string utf8_input(UTF16ToUTF8(input)); url_parse::Component scheme; if (url_util::FindAndCompareScheme(utf8_input, content::kViewSourceScheme, @@ -508,10 +510,11 @@ bool AutocompleteInput::HasHTTPScheme(const string16& input) { return url_util::FindAndCompareScheme(utf8_input, content::kHttpScheme, NULL); } -void AutocompleteInput::UpdateText(const string16& text, +void AutocompleteInput::UpdateText(const base::string16& text, size_t cursor_position, const url_parse::Parsed& parts) { - DCHECK(cursor_position <= text.length() || cursor_position == string16::npos) + DCHECK(cursor_position <= text.length() || + cursor_position == base::string16::npos) << "Text: '" << text << "', cp: " << cursor_position; text_ = text; cursor_position_ = cursor_position; @@ -520,7 +523,7 @@ void AutocompleteInput::UpdateText(const string16& text, void AutocompleteInput::Clear() { text_.clear(); - cursor_position_ = string16::npos; + cursor_position_ = base::string16::npos; current_url_ = GURL(); current_page_classification_ = AutocompleteInput::INVALID_SPEC; type_ = INVALID; diff --git a/chrome/browser/autocomplete/autocomplete_input.h b/chrome/browser/autocomplete/autocomplete_input.h index 1e1a64d..fde6aa8 100644 --- a/chrome/browser/autocomplete/autocomplete_input.h +++ b/chrome/browser/autocomplete/autocomplete_input.h @@ -133,9 +133,9 @@ class AutocompleteInput { // If |matches_requested| is BEST_MATCH or SYNCHRONOUS_MATCHES the controller // asks the providers to only return matches which are synchronously // available, which should mean that all providers will be done immediately. - AutocompleteInput(const string16& text, + AutocompleteInput(const base::string16& text, size_t cursor_position, - const string16& desired_tld, + const base::string16& desired_tld, const GURL& current_url, PageClassification current_page_classification, bool prevent_inline_autocomplete, @@ -146,7 +146,8 @@ class AutocompleteInput { // If type is |FORCED_QUERY| and |text| starts with '?', it is removed. // Returns number of leading characters removed. - static size_t RemoveForcedQueryStringIfNecessary(Type type, string16* text); + static size_t RemoveForcedQueryStringIfNecessary(Type type, + base::string16* text); // Converts |type| to a string representation. Used in logging. static std::string TypeToString(Type type); @@ -156,17 +157,17 @@ class AutocompleteInput { // it is non-NULL. The scheme is stored in |scheme| if it is non-NULL. The // canonicalized URL is stored in |canonicalized_url|; however, this URL is // not guaranteed to be valid, especially if the parsed type is, e.g., QUERY. - static Type Parse(const string16& text, - const string16& desired_tld, + static Type Parse(const base::string16& text, + const base::string16& desired_tld, url_parse::Parsed* parts, - string16* scheme, + base::string16* scheme, GURL* canonicalized_url); // Parses |text| and fill |scheme| and |host| by the positions of them. // The results are almost as same as the result of Parse(), but if the scheme // is view-source, this function returns the positions of scheme and host // in the URL qualified by "view-source:" prefix. - static void ParseForEmphasizeComponents(const string16& text, + static void ParseForEmphasizeComponents(const base::string16& text, url_parse::Component* scheme, url_parse::Component* host); @@ -176,18 +177,18 @@ class AutocompleteInput { // function with the URL and its formatted string, and it will return a // formatted string with the same meaning as the original URL (i.e. it will // re-append a slash if necessary). - static string16 FormattedStringWithEquivalentMeaning( + static base::string16 FormattedStringWithEquivalentMeaning( const GURL& url, - const string16& formatted_url); + const base::string16& formatted_url); // Returns the number of non-empty components in |parts| besides the host. static int NumNonHostComponents(const url_parse::Parsed& parts); // Returns whether |text| begins "http:" or "view-source:http:". - static bool HasHTTPScheme(const string16& text); + static bool HasHTTPScheme(const base::string16& text); // User-provided text to be completed. - const string16& text() const { return text_; } + const base::string16& text() const { return text_; } // Returns 0-based cursor position within |text_| or string16::npos if not // used. @@ -196,7 +197,7 @@ class AutocompleteInput { // Use of this setter is risky, since no other internal state is updated // besides |text_|, |cursor_position_| and |parts_|. Only callers who know // that they're not changing the type/scheme/etc. should use this. - void UpdateText(const string16& text, + void UpdateText(const base::string16& text, size_t cursor_position, const url_parse::Parsed& parts); @@ -217,7 +218,7 @@ class AutocompleteInput { // The scheme parsed from the provided text; only meaningful when type_ is // URL. - const string16& scheme() const { return scheme_; } + const base::string16& scheme() const { return scheme_; } // The input as an URL to navigate to, if possible. const GURL& canonicalized_url() const { return canonicalized_url_; } @@ -247,13 +248,13 @@ class AutocompleteInput { // NOTE: Whenever adding a new field here, please make sure to update Clear() // method. - string16 text_; + base::string16 text_; size_t cursor_position_; GURL current_url_; AutocompleteInput::PageClassification current_page_classification_; Type type_; url_parse::Parsed parts_; - string16 scheme_; + base::string16 scheme_; GURL canonicalized_url_; bool prevent_inline_autocomplete_; bool prefer_keyword_; diff --git a/chrome/browser/autocomplete/autocomplete_input_unittest.cc b/chrome/browser/autocomplete/autocomplete_input_unittest.cc index 9d7fcfd..f3110a9 100644 --- a/chrome/browser/autocomplete/autocomplete_input_unittest.cc +++ b/chrome/browser/autocomplete/autocomplete_input_unittest.cc @@ -13,10 +13,10 @@ TEST(AutocompleteInputTest, InputType) { struct test_data { - const string16 input; + const base::string16 input; const AutocompleteInput::Type type; } input_cases[] = { - { string16(), AutocompleteInput::INVALID }, + { base::string16(), AutocompleteInput::INVALID }, { ASCIIToUTF16("?"), AutocompleteInput::FORCED_QUERY }, { ASCIIToUTF16("?foo"), AutocompleteInput::FORCED_QUERY }, { ASCIIToUTF16("?foo bar"), AutocompleteInput::FORCED_QUERY }, @@ -121,16 +121,17 @@ TEST(AutocompleteInputTest, InputType) { for (size_t i = 0; i < ARRAYSIZE_UNSAFE(input_cases); ++i) { SCOPED_TRACE(input_cases[i].input); - AutocompleteInput input(input_cases[i].input, string16::npos, string16(), - GURL(), AutocompleteInput::INVALID_SPEC, true, - false, true, AutocompleteInput::ALL_MATCHES); + AutocompleteInput input(input_cases[i].input, base::string16::npos, + base::string16(), GURL(), + AutocompleteInput::INVALID_SPEC, true, false, true, + AutocompleteInput::ALL_MATCHES); EXPECT_EQ(input_cases[i].type, input.type()); } } TEST(AutocompleteInputTest, InputTypeWithDesiredTLD) { struct test_data { - const string16 input; + const base::string16 input; const AutocompleteInput::Type type; const std::string spec; // Unused if not a URL. } input_cases[] = { @@ -149,7 +150,7 @@ TEST(AutocompleteInputTest, InputTypeWithDesiredTLD) { for (size_t i = 0; i < ARRAYSIZE_UNSAFE(input_cases); ++i) { SCOPED_TRACE(input_cases[i].input); - AutocompleteInput input(input_cases[i].input, string16::npos, + AutocompleteInput input(input_cases[i].input, base::string16::npos, ASCIIToUTF16("com"), GURL(), AutocompleteInput::INVALID_SPEC, true, false, true, AutocompleteInput::ALL_MATCHES); @@ -162,8 +163,9 @@ TEST(AutocompleteInputTest, InputTypeWithDesiredTLD) { // This tests for a regression where certain input in the omnibox caused us to // crash. As long as the test completes without crashing, we're fine. TEST(AutocompleteInputTest, InputCrash) { - AutocompleteInput input(WideToUTF16(L"\uff65@s"), string16::npos, string16(), - GURL(), AutocompleteInput::INVALID_SPEC, true, false, + AutocompleteInput input(WideToUTF16(L"\uff65@s"), base::string16::npos, + base::string16(), GURL(), + AutocompleteInput::INVALID_SPEC, true, false, true, AutocompleteInput::ALL_MATCHES); } @@ -171,11 +173,11 @@ TEST(AutocompleteInputTest, ParseForEmphasizeComponent) { using url_parse::Component; Component kInvalidComponent(0, -1); struct test_data { - const string16 input; + const base::string16 input; const Component scheme; const Component host; } input_cases[] = { - { string16(), kInvalidComponent, kInvalidComponent }, + { base::string16(), kInvalidComponent, kInvalidComponent }, { ASCIIToUTF16("?"), kInvalidComponent, kInvalidComponent }, { ASCIIToUTF16("?http://foo.com/bar"), kInvalidComponent, kInvalidComponent }, @@ -205,8 +207,9 @@ TEST(AutocompleteInputTest, ParseForEmphasizeComponent) { AutocompleteInput::ParseForEmphasizeComponents(input_cases[i].input, &scheme, &host); - AutocompleteInput input(input_cases[i].input, string16::npos, string16(), - GURL(), AutocompleteInput::INVALID_SPEC, true, + AutocompleteInput input(input_cases[i].input, base::string16::npos, + base::string16(), GURL(), + AutocompleteInput::INVALID_SPEC, true, false, true, AutocompleteInput::ALL_MATCHES); EXPECT_EQ(input_cases[i].scheme.begin, scheme.begin); EXPECT_EQ(input_cases[i].scheme.len, scheme.len); @@ -217,13 +220,13 @@ TEST(AutocompleteInputTest, ParseForEmphasizeComponent) { TEST(AutocompleteInputTest, InputTypeWithCursorPosition) { struct test_data { - const string16 input; + const base::string16 input; size_t cursor_position; - const string16 normalized_input; + const base::string16 normalized_input; size_t normalized_cursor_position; } input_cases[] = { - { ASCIIToUTF16("foo bar"), string16::npos, - ASCIIToUTF16("foo bar"), string16::npos }, + { ASCIIToUTF16("foo bar"), base::string16::npos, + ASCIIToUTF16("foo bar"), base::string16::npos }, // regular case, no changes. { ASCIIToUTF16("foo bar"), 3, ASCIIToUTF16("foo bar"), 3 }, @@ -244,7 +247,8 @@ TEST(AutocompleteInputTest, InputTypeWithCursorPosition) { SCOPED_TRACE(input_cases[i].input); AutocompleteInput input(input_cases[i].input, input_cases[i].cursor_position, - string16(), GURL(), AutocompleteInput::INVALID_SPEC, + base::string16(), GURL(), + AutocompleteInput::INVALID_SPEC, true, false, true, AutocompleteInput::ALL_MATCHES); EXPECT_EQ(input_cases[i].normalized_input, input.text()); EXPECT_EQ(input_cases[i].normalized_cursor_position, diff --git a/chrome/browser/autocomplete/autocomplete_match.cc b/chrome/browser/autocomplete/autocomplete_match.cc index 6d5544d..5c1c194 100644 --- a/chrome/browser/autocomplete/autocomplete_match.cc +++ b/chrome/browser/autocomplete/autocomplete_match.cc @@ -196,8 +196,8 @@ bool AutocompleteMatch::DestinationsEqual(const AutocompleteMatch& elem1, // static void AutocompleteMatch::ClassifyMatchInString( - const string16& find_text, - const string16& text, + const base::string16& find_text, + const base::string16& text, int style, ACMatchClassifications* classification) { ClassifyLocationInString(text.find(find_text), find_text.length(), @@ -224,7 +224,7 @@ void AutocompleteMatch::ClassifyLocationInString( } // Mark matching portion of string. - if (match_location == string16::npos) { + if (match_location == base::string16::npos) { // No match, above classification will suffice for whole string. return; } @@ -320,10 +320,10 @@ void AutocompleteMatch::AddLastClassificationIfNecessary( } // static -string16 AutocompleteMatch::SanitizeString(const string16& text) { +base::string16 AutocompleteMatch::SanitizeString(const base::string16& text) { // NOTE: This logic is mirrored by |sanitizeString()| in // omnibox_custom_bindings.js. - string16 result; + base::string16 result; TrimWhitespace(text, TRIM_LEADING, &result); base::RemoveChars(result, kInvalidChars, &result); return result; @@ -349,7 +349,7 @@ void AutocompleteMatch::ComputeStrippedDestinationURL(Profile* profile) { // provider matches. TemplateURL* template_url = GetTemplateURL(profile, true); if (template_url != NULL && template_url->SupportsReplacement()) { - string16 search_terms; + base::string16 search_terms; if (template_url->ExtractSearchTermsFromURL(stripped_destination_url, &search_terms)) { stripped_destination_url = @@ -389,19 +389,19 @@ void AutocompleteMatch::ComputeStrippedDestinationURL(Profile* profile) { } void AutocompleteMatch::GetKeywordUIState(Profile* profile, - string16* keyword, + base::string16* keyword, bool* is_keyword_hint) const { *is_keyword_hint = associated_keyword.get() != NULL; keyword->assign(*is_keyword_hint ? associated_keyword->keyword : GetSubstitutingExplicitlyInvokedKeyword(profile)); } -string16 AutocompleteMatch::GetSubstitutingExplicitlyInvokedKeyword( +base::string16 AutocompleteMatch::GetSubstitutingExplicitlyInvokedKeyword( Profile* profile) const { if (transition != content::PAGE_TRANSITION_KEYWORD) - return string16(); + return base::string16(); const TemplateURL* t_url = GetTemplateURL(profile, false); - return (t_url && t_url->SupportsReplacement()) ? keyword : string16(); + return (t_url && t_url->SupportsReplacement()) ? keyword : base::string16(); } TemplateURL* AutocompleteMatch::GetTemplateURL( @@ -461,7 +461,7 @@ void AutocompleteMatch::Validate() const { } void AutocompleteMatch::ValidateClassifications( - const string16& text, + const base::string16& text, const ACMatchClassifications& classifications) const { if (text.empty()) { DCHECK(classifications.empty()); diff --git a/chrome/browser/autocomplete/autocomplete_match.h b/chrome/browser/autocomplete/autocomplete_match.h index 38108dd..ad91c259a 100644 --- a/chrome/browser/autocomplete/autocomplete_match.h +++ b/chrome/browser/autocomplete/autocomplete_match.h @@ -117,8 +117,8 @@ struct AutocompleteMatch { // Fills in the classifications for |text|, using |style| as the base style // and marking the first instance of |find_text| as a match. (This match // will also not be dimmed, if |style| has DIM set.) - static void ClassifyMatchInString(const string16& find_text, - const string16& text, + static void ClassifyMatchInString(const base::string16& find_text, + const base::string16& text, int style, ACMatchClassifications* classifications); @@ -156,7 +156,7 @@ struct AutocompleteMatch { // Removes invalid characters from |text|. Should be called on strings coming // from external sources (such as extensions) before assigning to |contents| // or |description|. - static string16 SanitizeString(const string16& text); + static base::string16 SanitizeString(const base::string16& text); // Convenience function to check if |type| is a search (as opposed to a URL or // an extension). @@ -187,7 +187,7 @@ struct AutocompleteMatch { // represent searches using the default search engine. See also // GetSubstitutingExplicitlyInvokedKeyword(). void GetKeywordUIState(Profile* profile, - string16* keyword, + base::string16* keyword, bool* is_keyword_hint) const; // Returns |keyword|, but only if it represents a substituting keyword that @@ -196,7 +196,8 @@ struct AutocompleteMatch { // invoke its keyword), this returns the empty string. The result is that // this function returns a non-empty string in the same cases as when the UI // should show up as being "in keyword mode". - string16 GetSubstitutingExplicitlyInvokedKeyword(Profile* profile) const; + base::string16 GetSubstitutingExplicitlyInvokedKeyword( + Profile* profile) const; // Returns the TemplateURL associated with this match. This may be NULL if // the match has no keyword OR if the keyword no longer corresponds to a valid @@ -254,11 +255,11 @@ struct AutocompleteMatch { // This string is loaded into the location bar when the item is selected // by pressing the arrow keys. This may be different than a URL, for example, // for search suggestions, this would just be the search terms. - string16 fill_into_edit; + base::string16 fill_into_edit; // The inline autocompletion to display after the user's typing in the // omnibox, if this match becomes the default match. It may be empty. - string16 inline_autocompletion; + base::string16 inline_autocompletion; // If false, the omnibox should prevent this match from being the // default match. Providers should set this to true only if the @@ -280,11 +281,11 @@ struct AutocompleteMatch { GURL stripped_destination_url; // The main text displayed in the address bar dropdown. - string16 contents; + base::string16 contents; ACMatchClassifications contents_class; // Additional helper text for each entry, such as a title or description. - string16 description; + base::string16 description; ACMatchClassifications description_class; // The transition type to use when the user opens this match. By default @@ -315,7 +316,7 @@ struct AutocompleteMatch { // modified while the AutocompleteMatch is alive. This means anyone who // accesses it must perform any necessary sanity checks before blindly using // it! - string16 keyword; + base::string16 keyword; // True if the user has starred the destination URL. bool starred; @@ -342,7 +343,7 @@ struct AutocompleteMatch { // Checks one text/classifications pair for valid values. void ValidateClassifications( - const string16& text, + const base::string16& text, const ACMatchClassifications& classifications) const; #endif }; diff --git a/chrome/browser/autocomplete/autocomplete_provider.cc b/chrome/browser/autocomplete/autocomplete_provider.cc index 859b7e4..c97e1cc 100644 --- a/chrome/browser/autocomplete/autocomplete_provider.cc +++ b/chrome/browser/autocomplete/autocomplete_provider.cc @@ -107,7 +107,7 @@ void AutocompleteProvider::AddProviderInfo(ProvidersInfo* provider_info) const { void AutocompleteProvider::ResetSession() { } -string16 AutocompleteProvider::StringForURLDisplay(const GURL& url, +base::string16 AutocompleteProvider::StringForURLDisplay(const GURL& url, bool check_accept_lang, bool trim_http) const { std::string languages = (check_accept_lang && profile_) ? diff --git a/chrome/browser/autocomplete/autocomplete_provider.h b/chrome/browser/autocomplete/autocomplete_provider.h index 02668b7..76d289c 100644 --- a/chrome/browser/autocomplete/autocomplete_provider.h +++ b/chrome/browser/autocomplete/autocomplete_provider.h @@ -210,9 +210,9 @@ class AutocompleteProvider // A convenience function to call net::FormatUrl() with the current set of // "Accept Languages" when check_accept_lang is true. Otherwise, it's called // with an empty list. - string16 StringForURLDisplay(const GURL& url, - bool check_accept_lang, - bool trim_http) const; + base::string16 StringForURLDisplay(const GURL& url, + bool check_accept_lang, + bool trim_http) const; // Returns the set of matches for the current query. const ACMatches& matches() const { return matches_; } diff --git a/chrome/browser/autocomplete/autocomplete_provider_unittest.cc b/chrome/browser/autocomplete/autocomplete_provider_unittest.cc index 2c118a1..c5dff86 100644 --- a/chrome/browser/autocomplete/autocomplete_provider_unittest.cc +++ b/chrome/browser/autocomplete/autocomplete_provider_unittest.cc @@ -44,9 +44,9 @@ const char kTestTemplateURLKeyword[] = "t"; // refcounted so that it can also be a task on the message loop. class TestProvider : public AutocompleteProvider { public: - TestProvider(int relevance, const string16& prefix, + TestProvider(int relevance, const base::string16& prefix, Profile* profile, - const string16 match_keyword) + const base::string16 match_keyword) : AutocompleteProvider(NULL, profile, AutocompleteProvider::TYPE_SEARCH), relevance_(relevance), prefix_(prefix), @@ -73,8 +73,8 @@ class TestProvider : public AutocompleteProvider { const TemplateURLRef::SearchTermsArgs& search_terms_args); int relevance_; - const string16 prefix_; - const string16 match_keyword_; + const base::string16 prefix_; + const base::string16 match_keyword_; }; void TestProvider::Start(const AutocompleteInput& input, @@ -115,7 +115,8 @@ void TestProvider::AddResults(int start_at, int num) { AddResultsWithSearchTermsArgs(start_at, num, AutocompleteMatchType::URL_WHAT_YOU_TYPED, - TemplateURLRef::SearchTermsArgs(string16())); + TemplateURLRef::SearchTermsArgs( + base::string16())); } void TestProvider::AddResultsWithSearchTermsArgs( @@ -151,8 +152,8 @@ class AutocompleteProviderTest : public testing::Test, public content::NotificationObserver { protected: struct KeywordTestData { - const string16 fill_into_edit; - const string16 keyword; + const base::string16 fill_into_edit; + const base::string16 keyword; const bool expected_keyword_result; }; @@ -163,7 +164,7 @@ class AutocompleteProviderTest : public testing::Test, protected: // Registers a test TemplateURL under the given keyword. - void RegisterTemplateURL(const string16 keyword, + void RegisterTemplateURL(const base::string16 keyword, const std::string& template_url); // Resets |controller_| with two TestProviders. |provider1_ptr| and @@ -182,7 +183,7 @@ class AutocompleteProviderTest : public testing::Test, const AssistedQueryStatsTestData* aqs_test_data, size_t size); - void RunQuery(const string16 query); + void RunQuery(const base::string16 query); void ResetControllerWithKeywordAndSearchProviders(); void ResetControllerWithKeywordProvider(); @@ -210,7 +211,7 @@ class AutocompleteProviderTest : public testing::Test, }; void AutocompleteProviderTest::RegisterTemplateURL( - const string16 keyword, + const base::string16 keyword, const std::string& template_url) { TemplateURLServiceFactory::GetInstance()->SetTestingFactoryAndUse( &profile_, &TemplateURLServiceFactory::BuildInstanceFor); @@ -259,7 +260,7 @@ void AutocompleteProviderTest::ResetControllerWithTestProviders( kResultsPerProvider * 2, same_destinations ? ASCIIToUTF16("http://a") : ASCIIToUTF16("http://b"), &profile_, - string16()); + base::string16()); provider2->AddRef(); providers.push_back(provider2); @@ -381,7 +382,7 @@ void AutocompleteProviderTest::RunAssistedQueryStatsTest( match.allowed_to_be_default_match = true; match.keyword = ASCIIToUTF16(kTestTemplateURLKeyword); match.search_terms_args.reset( - new TemplateURLRef::SearchTermsArgs(string16())); + new TemplateURLRef::SearchTermsArgs(base::string16())); matches.push_back(match); } result_.Reset(); @@ -397,10 +398,10 @@ void AutocompleteProviderTest::RunAssistedQueryStatsTest( } } -void AutocompleteProviderTest::RunQuery(const string16 query) { +void AutocompleteProviderTest::RunQuery(const base::string16 query) { result_.Reset(); controller_->Start(AutocompleteInput( - query, string16::npos, string16(), GURL(), + query, base::string16::npos, base::string16(), GURL(), AutocompleteInput::INVALID_SPEC, true, false, true, AutocompleteInput::ALL_MATCHES)); @@ -419,7 +420,7 @@ void AutocompleteProviderTest::RunExactKeymatchTest( // be from SearchProvider. (It provides all verbatim search matches, // keyword or not.) controller_->Start(AutocompleteInput( - ASCIIToUTF16("k test"), string16::npos, string16(), GURL(), + ASCIIToUTF16("k test"), base::string16::npos, base::string16(), GURL(), AutocompleteInput::INVALID_SPEC, true, false, allow_exact_keyword_match, AutocompleteInput::SYNCHRONOUS_MATCHES)); EXPECT_TRUE(controller_->done()); @@ -527,9 +528,9 @@ TEST_F(AutocompleteProviderTest, RedundantKeywordsIgnoredInResult) { { KeywordTestData duplicate_url[] = { - { ASCIIToUTF16("fo"), string16(), false }, - { ASCIIToUTF16("foo.com"), string16(), true }, - { ASCIIToUTF16("foo.com"), string16(), false } + { ASCIIToUTF16("fo"), base::string16(), false }, + { ASCIIToUTF16("foo.com"), base::string16(), true }, + { ASCIIToUTF16("foo.com"), base::string16(), false } }; SCOPED_TRACE("Duplicate url"); @@ -539,7 +540,7 @@ TEST_F(AutocompleteProviderTest, RedundantKeywordsIgnoredInResult) { { KeywordTestData keyword_match[] = { { ASCIIToUTF16("foo.com"), ASCIIToUTF16("foo.com"), false }, - { ASCIIToUTF16("foo.com"), string16(), false } + { ASCIIToUTF16("foo.com"), base::string16(), false } }; SCOPED_TRACE("Duplicate url with keyword match"); @@ -548,10 +549,10 @@ TEST_F(AutocompleteProviderTest, RedundantKeywordsIgnoredInResult) { { KeywordTestData multiple_keyword[] = { - { ASCIIToUTF16("fo"), string16(), false }, - { ASCIIToUTF16("foo.com"), string16(), true }, - { ASCIIToUTF16("foo.com"), string16(), false }, - { ASCIIToUTF16("bar.com"), string16(), true }, + { ASCIIToUTF16("fo"), base::string16(), false }, + { ASCIIToUTF16("foo.com"), base::string16(), true }, + { ASCIIToUTF16("foo.com"), base::string16(), false }, + { ASCIIToUTF16("bar.com"), base::string16(), true }, }; SCOPED_TRACE("Duplicate url with multiple keywords"); @@ -628,7 +629,7 @@ TEST_F(AutocompleteProviderTest, GetDestinationURL) { // search_terms_args needs to be set. match.search_terms_args.reset( - new TemplateURLRef::SearchTermsArgs(string16())); + new TemplateURLRef::SearchTermsArgs(base::string16())); url = GetDestinationURL(match, base::TimeDelta::FromMilliseconds(2456)); EXPECT_TRUE(url.path().empty()); diff --git a/chrome/browser/autocomplete/autocomplete_result.cc b/chrome/browser/autocomplete/autocomplete_result.cc index 7078f55..675a96c 100644 --- a/chrome/browser/autocomplete/autocomplete_result.cc +++ b/chrome/browser/autocomplete/autocomplete_result.cc @@ -194,10 +194,10 @@ void AutocompleteResult::SortAndCull(const AutocompleteInput& input, default_match_ = matches_.begin(); if (default_match_ != matches_.end()) { - const string16 debug_info = ASCIIToUTF16("fill_into_edit=") + + const base::string16 debug_info = ASCIIToUTF16("fill_into_edit=") + default_match_->fill_into_edit + ASCIIToUTF16(", provider=") + ((default_match_->provider != NULL) ? - ASCIIToUTF16(default_match_->provider->GetName()) : string16()) + + ASCIIToUTF16(default_match_->provider->GetName()) : base::string16()) + ASCIIToUTF16(", input=") + input.text(); DCHECK(default_match_->allowed_to_be_default_match) << debug_info; // We shouldn't get query matches for URL inputs, or non-query matches diff --git a/chrome/browser/autocomplete/autocomplete_result_unittest.cc b/chrome/browser/autocomplete/autocomplete_result_unittest.cc index ab152fb..e3fa9bc 100644 --- a/chrome/browser/autocomplete/autocomplete_result_unittest.cc +++ b/chrome/browser/autocomplete/autocomplete_result_unittest.cc @@ -131,7 +131,8 @@ void AutocompleteResultTest::RunCopyOldMatchesTest( const TestData* last, size_t last_size, const TestData* current, size_t current_size, const TestData* expected, size_t expected_size) { - AutocompleteInput input(ASCIIToUTF16("a"), string16::npos, string16(), GURL(), + AutocompleteInput input(ASCIIToUTF16("a"), base::string16::npos, + base::string16(), GURL(), AutocompleteInput::INVALID_SPEC, false, false, false, AutocompleteInput::ALL_MATCHES); @@ -166,7 +167,8 @@ TEST_F(AutocompleteResultTest, Swap) { AutocompleteMatch match; match.relevance = 1; match.allowed_to_be_default_match = true; - AutocompleteInput input(ASCIIToUTF16("a"), string16::npos, string16(), GURL(), + AutocompleteInput input(ASCIIToUTF16("a"), base::string16::npos, + base::string16(), GURL(), AutocompleteInput::INVALID_SPEC, false, false, false, AutocompleteInput::ALL_MATCHES); matches.push_back(match); @@ -248,7 +250,8 @@ TEST_F(AutocompleteResultTest, SortAndCullEmptyDestinationURLs) { AutocompleteResult result; result.AppendMatches(matches); - AutocompleteInput input(string16(), string16::npos, string16(), GURL(), + AutocompleteInput input(base::string16(), base::string16::npos, + base::string16(), GURL(), AutocompleteInput::INVALID_SPEC, false, false, false, AutocompleteInput::ALL_MATCHES); result.SortAndCull(input, test_util_.profile()); @@ -293,7 +296,8 @@ TEST_F(AutocompleteResultTest, SortAndCullDuplicateSearchURLs) { AutocompleteResult result; result.AppendMatches(matches); - AutocompleteInput input(string16(), string16::npos, string16(), GURL(), + AutocompleteInput input(base::string16(), base::string16::npos, + base::string16(), GURL(), AutocompleteInput::INVALID_SPEC, false, false, false, AutocompleteInput::ALL_MATCHES); result.SortAndCull(input, test_util_.profile()); @@ -360,7 +364,8 @@ TEST_F(AutocompleteResultTest, SortAndCullWithDemotionsByType) { AutocompleteResult result; result.AppendMatches(matches); - AutocompleteInput input(string16(), string16::npos, string16(), GURL(), + AutocompleteInput input(base::string16(), base::string16::npos, + base::string16(), GURL(), AutocompleteInput::HOME_PAGE, false, false, false, AutocompleteInput::ALL_MATCHES); result.SortAndCull(input, test_util_.profile()); @@ -409,7 +414,8 @@ TEST_F(AutocompleteResultTest, SortAndCullWithUndemotableTypes) { AutocompleteResult result; result.AppendMatches(matches); - AutocompleteInput input(string16(), string16::npos, string16(), GURL(), + AutocompleteInput input(base::string16(), base::string16::npos, + base::string16(), GURL(), AutocompleteInput::HOME_PAGE, false, false, false, AutocompleteInput::ALL_MATCHES); result.SortAndCull(input, test_util_.profile()); @@ -452,7 +458,8 @@ TEST_F(AutocompleteResultTest, SortAndCullReorderForDefaultMatch) { PopulateAutocompleteMatches(data, arraysize(data), &matches); AutocompleteResult result; result.AppendMatches(matches); - AutocompleteInput input(string16(), string16::npos, string16(), GURL(), + AutocompleteInput input(base::string16(), base::string16::npos, + base::string16(), GURL(), AutocompleteInput::HOME_PAGE, false, false, false, AutocompleteInput::ALL_MATCHES); result.SortAndCull(input, test_util_.profile()); @@ -467,7 +474,8 @@ TEST_F(AutocompleteResultTest, SortAndCullReorderForDefaultMatch) { matches[1].allowed_to_be_default_match = false; AutocompleteResult result; result.AppendMatches(matches); - AutocompleteInput input(string16(), string16::npos, string16(), GURL(), + AutocompleteInput input(base::string16(), base::string16::npos, + base::string16(), GURL(), AutocompleteInput::HOME_PAGE, false, false, false, AutocompleteInput::ALL_MATCHES); result.SortAndCull(input, test_util_.profile()); diff --git a/chrome/browser/autocomplete/bookmark_provider.cc b/chrome/browser/autocomplete/bookmark_provider.cc index 0ed0f22..227afac 100644 --- a/chrome/browser/autocomplete/bookmark_provider.cc +++ b/chrome/browser/autocomplete/bookmark_provider.cc @@ -164,7 +164,7 @@ AutocompleteMatch BookmarkProvider::TitleMatchToACMatch( // unlikely to be what the user intends. AutocompleteMatch match(this, 0, false, AutocompleteMatchType::BOOKMARK_TITLE); - const string16& title(title_match.node->GetTitle()); + const base::string16& title(title_match.node->GetTitle()); DCHECK(!title.empty()); const GURL& url(title_match.node->url()); match.destination_url = url; diff --git a/chrome/browser/autocomplete/bookmark_provider_unittest.cc b/chrome/browser/autocomplete/bookmark_provider_unittest.cc index b48bf39..8035ed3 100644 --- a/chrome/browser/autocomplete/bookmark_provider_unittest.cc +++ b/chrome/browser/autocomplete/bookmark_provider_unittest.cc @@ -115,8 +115,8 @@ std::string TestBookmarkPositionsAsString( // Return the positions in |matches| as a formatted string for unit test // diagnostic output. -string16 MatchesAsString16(const ACMatches& matches) { - string16 matches_string; +base::string16 MatchesAsString16(const ACMatches& matches) { + base::string16 matches_string; for (ACMatches::const_iterator i = matches.begin(); i != matches.end(); ++i) { matches_string.append(ASCIIToUTF16(" '")); matches_string.append(i->description); @@ -243,7 +243,7 @@ TEST_F(BookmarkProviderTest, Positions) { for (size_t i = 0; i < ARRAYSIZE_UNSAFE(query_data); ++i) { AutocompleteInput input(ASCIIToUTF16(query_data[i].query), - string16::npos, string16(), GURL(), + base::string16::npos, base::string16(), GURL(), AutocompleteInput::INVALID_SPEC, false, false, false, AutocompleteInput::ALL_MATCHES); provider_->Start(input, false); @@ -317,7 +317,7 @@ TEST_F(BookmarkProviderTest, Rankings) { for (size_t i = 0; i < ARRAYSIZE_UNSAFE(query_data); ++i) { AutocompleteInput input(ASCIIToUTF16(query_data[i].query), - string16::npos, string16(), GURL(), + base::string16::npos, base::string16(), GURL(), AutocompleteInput::INVALID_SPEC, false, false, false, AutocompleteInput::ALL_MATCHES); provider_->Start(input, false); diff --git a/chrome/browser/autocomplete/builtin_provider.cc b/chrome/browser/autocomplete/builtin_provider.cc index 533f117..f66be07 100644 --- a/chrome/browser/autocomplete/builtin_provider.cc +++ b/chrome/browser/autocomplete/builtin_provider.cc @@ -47,8 +47,8 @@ BuiltinProvider::BuiltinProvider(AutocompleteProviderListener* listener, for (std::vector<std::string>::iterator i(builtins.begin()); i != builtins.end(); ++i) builtins_.push_back(ASCIIToUTF16(*i)); - string16 settings(ASCIIToUTF16(chrome::kChromeUISettingsHost) + - ASCIIToUTF16("/")); + base::string16 settings(ASCIIToUTF16(chrome::kChromeUISettingsHost) + + ASCIIToUTF16("/")); for (size_t i = 0; i < arraysize(kChromeSettingsSubPages); i++) builtins_.push_back(settings + ASCIIToUTF16(kChromeSettingsSubPages[i])); } @@ -61,15 +61,15 @@ void BuiltinProvider::Start(const AutocompleteInput& input, (input.type() == AutocompleteInput::QUERY)) return; - const string16 kAbout = ASCIIToUTF16(chrome::kAboutScheme) + + const base::string16 kAbout = ASCIIToUTF16(chrome::kAboutScheme) + ASCIIToUTF16(content::kStandardSchemeSeparator); - const string16 kChrome = ASCIIToUTF16(chrome::kChromeUIScheme) + + const base::string16 kChrome = ASCIIToUTF16(chrome::kChromeUIScheme) + ASCIIToUTF16(content::kStandardSchemeSeparator); const int kUrl = ACMatchClassification::URL; const int kMatch = kUrl | ACMatchClassification::MATCH; - string16 text = input.text(); + base::string16 text = input.text(); bool starting_chrome = StartsWith(kChrome, text, false); if (starting_chrome || StartsWith(kAbout, text, false)) { ACMatchClassifications styles; @@ -82,9 +82,12 @@ void BuiltinProvider::Start(const AutocompleteInput& input, if (highlight) styles.push_back(ACMatchClassification(offset, kUrl)); // Include some common builtin chrome URLs as the user types the scheme. - AddMatch(ASCIIToUTF16(chrome::kChromeUIChromeURLsURL), string16(), styles); - AddMatch(ASCIIToUTF16(chrome::kChromeUISettingsURL), string16(), styles); - AddMatch(ASCIIToUTF16(chrome::kChromeUIVersionURL), string16(), styles); + AddMatch(ASCIIToUTF16(chrome::kChromeUIChromeURLsURL), base::string16(), + styles); + AddMatch(ASCIIToUTF16(chrome::kChromeUISettingsURL), base::string16(), + styles); + AddMatch(ASCIIToUTF16(chrome::kChromeUIVersionURL), base::string16(), + styles); } else { // Match input about: or chrome: URL input against builtin chrome URLs. GURL url = URLFixerUpper::FixupURL(UTF16ToUTF8(text), std::string()); @@ -93,7 +96,7 @@ void BuiltinProvider::Start(const AutocompleteInput& input, if (url.SchemeIs(chrome::kChromeUIScheme) && url.has_host() && !url.has_query() && !url.has_ref()) { // Include the path for sub-pages (e.g. "chrome://settings/browser"). - string16 host_and_path = UTF8ToUTF16(url.host() + url.path()); + base::string16 host_and_path = UTF8ToUTF16(url.host() + url.path()); base::TrimString(host_and_path, ASCIIToUTF16("/").c_str(), &host_and_path); size_t match_length = kChrome.length() + host_and_path.length(); @@ -103,7 +106,7 @@ void BuiltinProvider::Start(const AutocompleteInput& input, ACMatchClassifications styles; // Highlight the "chrome://" scheme, even for input "about:foo". styles.push_back(ACMatchClassification(0, kMatch)); - string16 match_string = kChrome + *i; + base::string16 match_string = kChrome + *i; if (match_string.length() > match_length) styles.push_back(ACMatchClassification(match_length, kUrl)); AddMatch(match_string, match_string.substr(match_length), styles); @@ -125,8 +128,8 @@ void BuiltinProvider::Start(const AutocompleteInput& input, BuiltinProvider::~BuiltinProvider() {} -void BuiltinProvider::AddMatch(const string16& match_string, - const string16& inline_completion, +void BuiltinProvider::AddMatch(const base::string16& match_string, + const base::string16& inline_completion, const ACMatchClassifications& styles) { AutocompleteMatch match(this, kRelevance, false, AutocompleteMatchType::NAVSUGGEST); diff --git a/chrome/browser/autocomplete/builtin_provider.h b/chrome/browser/autocomplete/builtin_provider.h index 260a3aa..2d544ab 100644 --- a/chrome/browser/autocomplete/builtin_provider.h +++ b/chrome/browser/autocomplete/builtin_provider.h @@ -26,12 +26,12 @@ class BuiltinProvider : public AutocompleteProvider { private: virtual ~BuiltinProvider(); - typedef std::vector<string16> Builtins; + typedef std::vector<base::string16> Builtins; static const int kRelevance; - void AddMatch(const string16& match_string, - const string16& inline_completion, + void AddMatch(const base::string16& match_string, + const base::string16& inline_completion, const ACMatchClassifications& styles); Builtins builtins_; diff --git a/chrome/browser/autocomplete/builtin_provider_unittest.cc b/chrome/browser/autocomplete/builtin_provider_unittest.cc index b5693ba..5cfa008 100644 --- a/chrome/browser/autocomplete/builtin_provider_unittest.cc +++ b/chrome/browser/autocomplete/builtin_provider_unittest.cc @@ -14,6 +14,8 @@ #include "testing/gtest/include/gtest/gtest.h" #include "url/gurl.h" +using base::string16; + class BuiltinProviderTest : public testing::Test { protected: template<class ResultType> diff --git a/chrome/browser/autocomplete/contact_provider_chromeos.cc b/chrome/browser/autocomplete/contact_provider_chromeos.cc index afa14ba..9def30b 100644 --- a/chrome/browser/autocomplete/contact_provider_chromeos.cc +++ b/chrome/browser/autocomplete/contact_provider_chromeos.cc @@ -33,9 +33,9 @@ int kAffinityRelevanceBoost = 200; // Returns true if |word_to_find| is a prefix of |name_to_search| and marks the // matching text in |classifications| (which corresponds to the contact's full // name). |name_index_in_full_name| contains |name_to_search|'s index within -// the full name or string16::npos if it doesn't appear in it. -bool WordIsNamePrefix(const string16& word_to_find, - const string16& name_to_search, +// the full name or base::string16::npos if it doesn't appear in it. +bool WordIsNamePrefix(const base::string16& word_to_find, + const base::string16& name_to_search, size_t name_index_in_full_name, size_t full_name_length, ACMatchClassifications* classifications) { @@ -47,7 +47,7 @@ bool WordIsNamePrefix(const string16& word_to_find, name_to_search, &match_index, &match_length) || (match_index != 0)) return false; - if (name_index_in_full_name != string16::npos) { + if (name_index_in_full_name != base::string16::npos) { AutocompleteMatch::ACMatchClassifications new_class; AutocompleteMatch::ClassifyLocationInString(name_index_in_full_name, match_length, full_name_length, 0, &new_class); @@ -65,16 +65,16 @@ const char ContactProvider::kMatchContactIdKey[] = "contact_id"; // Cached information about a contact. struct ContactProvider::ContactData { - ContactData(const string16& full_name, - const string16& given_name, - const string16& family_name, + ContactData(const base::string16& full_name, + const base::string16& given_name, + const base::string16& family_name, const std::string& contact_id, float affinity) : full_name(full_name), given_name(given_name), family_name(family_name), - given_name_index(string16::npos), - family_name_index(string16::npos), + given_name_index(base::string16::npos), + family_name_index(base::string16::npos), contact_id(contact_id), affinity(affinity) { base::i18n::StringSearchIgnoringCaseAndAccents( @@ -83,12 +83,12 @@ struct ContactProvider::ContactData { family_name, full_name, &family_name_index, NULL); } - string16 full_name; - string16 given_name; - string16 family_name; + base::string16 full_name; + base::string16 given_name; + base::string16 family_name; // Indices into |full_name| where |given_name| and |family_name| first appear, - // or string16::npos if they don't appear in it. + // or base::string16::npos if they don't appear in it. size_t given_name_index; size_t family_name_index; @@ -121,7 +121,7 @@ void ContactProvider::Start(const AutocompleteInput& input, input.type() != AutocompleteInput::FORCED_QUERY) return; - std::vector<string16> input_words; + std::vector<base::string16> input_words; base::i18n::BreakIterator break_iterator( input.text(), base::i18n::BreakIterator::BREAK_WORD); @@ -171,11 +171,11 @@ void ContactProvider::RefreshContacts() { for (contacts::ContactPointers::const_iterator it = contacts->begin(); it != contacts->end(); ++it) { const contacts::Contact& contact = **it; - string16 full_name = + base::string16 full_name = AutocompleteMatch::SanitizeString(UTF8ToUTF16(contact.full_name())); - string16 given_name = + base::string16 given_name = AutocompleteMatch::SanitizeString(UTF8ToUTF16(contact.given_name())); - string16 family_name = + base::string16 family_name = AutocompleteMatch::SanitizeString(UTF8ToUTF16(contact.family_name())); float affinity = contact.has_affinity() ? contact.affinity() : kDefaultAffinity; @@ -191,7 +191,7 @@ void ContactProvider::RefreshContacts() { void ContactProvider::AddContactIfMatched( const AutocompleteInput& input, - const std::vector<string16>& input_words, + const std::vector<base::string16>& input_words, const ContactData& contact) { // First, check if the whole input string is a prefix of the full name. // TODO(derat): Consider additionally segmenting the full name so we can match @@ -209,7 +209,7 @@ void ContactProvider::AddContactIfMatched( // don't overlap (e.g. the query "bob b" against a contact with full name // "Bob G. Bryson", given name "Bob", and family name "Bryson" should result // in classifications "_Bob_ G. _B_ryson" rather than "_Bob_ G. Bryson". - for (std::vector<string16>::const_iterator it = input_words.begin(); + for (std::vector<base::string16>::const_iterator it = input_words.begin(); it != input_words.end(); ++it) { if (!WordIsNamePrefix(*it, contact.given_name, contact.given_name_index, contact.full_name.size(), &classifications) && diff --git a/chrome/browser/autocomplete/contact_provider_chromeos.h b/chrome/browser/autocomplete/contact_provider_chromeos.h index 1a14a38..9ecb9db 100644 --- a/chrome/browser/autocomplete/contact_provider_chromeos.h +++ b/chrome/browser/autocomplete/contact_provider_chromeos.h @@ -59,7 +59,7 @@ class ContactProvider : public AutocompleteProvider, // is matched by |input|. |input_words| is |input.text()| split on word // boundaries. void AddContactIfMatched(const AutocompleteInput& input, - const std::vector<string16>& input_words, + const std::vector<base::string16>& input_words, const ContactData& contact); // Returns an AutocompleteMatch object corresponding to the passed-in data. diff --git a/chrome/browser/autocomplete/contact_provider_chromeos_unittest.cc b/chrome/browser/autocomplete/contact_provider_chromeos_unittest.cc index 0978210..e3b0df8 100644 --- a/chrome/browser/autocomplete/contact_provider_chromeos_unittest.cc +++ b/chrome/browser/autocomplete/contact_provider_chromeos_unittest.cc @@ -66,8 +66,8 @@ class ContactProviderTest : public testing::Test { void StartQuery(const std::string& utf8_text) { contact_provider_->Start( AutocompleteInput(UTF8ToUTF16(utf8_text), - string16::npos, - string16(), + base::string16::npos, + base::string16(), GURL(), AutocompleteInput::INVALID_SPEC, false, diff --git a/chrome/browser/autocomplete/extension_app_provider.cc b/chrome/browser/autocomplete/extension_app_provider.cc index 176e747..e51bfbe 100644 --- a/chrome/browser/autocomplete/extension_app_provider.cc +++ b/chrome/browser/autocomplete/extension_app_provider.cc @@ -93,7 +93,7 @@ AutocompleteMatch ExtensionAppProvider::CreateAutocompleteMatch( match.relevance = CalculateRelevance( input.type(), input.text().length(), - name_match_index != string16::npos ? + name_match_index != base::string16::npos ? app.name.length() : app.launch_url.length(), match.destination_url); return match; @@ -113,25 +113,27 @@ void ExtensionAppProvider::Start(const AutocompleteInput& input, for (ExtensionApps::const_iterator app = extension_apps_.begin(); app != extension_apps_.end(); ++app) { // See if the input matches this extension application. - const string16& name = app->name; - string16::const_iterator name_iter = std::search(name.begin(), name.end(), - input.text().begin(), input.text().end(), - base::CaseInsensitiveCompare<char16>()); + const base::string16& name = app->name; + base::string16::const_iterator name_iter = + std::search(name.begin(), name.end(), + input.text().begin(), input.text().end(), + base::CaseInsensitiveCompare<char16>()); bool matches_name = name_iter != name.end(); size_t name_match_index = matches_name ? - static_cast<size_t>(name_iter - name.begin()) : string16::npos; + static_cast<size_t>(name_iter - name.begin()) : base::string16::npos; bool matches_url = false; - size_t url_match_index = string16::npos; + size_t url_match_index = base::string16::npos; if (app->should_match_against_launch_url) { - const string16& url = app->launch_url; - string16::const_iterator url_iter = std::search(url.begin(), url.end(), - input.text().begin(), input.text().end(), - base::CaseInsensitiveCompare<char16>()); + const base::string16& url = app->launch_url; + base::string16::const_iterator url_iter = + std::search(url.begin(), url.end(), + input.text().begin(), input.text().end(), + base::CaseInsensitiveCompare<char16>()); matches_url = url_iter != url.end() && input.type() != AutocompleteInput::FORCED_QUERY; url_match_index = matches_url ? - static_cast<size_t>(url_iter - url.begin()) : string16::npos; + static_cast<size_t>(url_iter - url.begin()) : base::string16::npos; } if (matches_name || matches_url) { diff --git a/chrome/browser/autocomplete/extension_app_provider.h b/chrome/browser/autocomplete/extension_app_provider.h index 8202b4a..5dbcc26 100644 --- a/chrome/browser/autocomplete/extension_app_provider.h +++ b/chrome/browser/autocomplete/extension_app_provider.h @@ -46,10 +46,10 @@ class ExtensionAppProvider : public AutocompleteProvider, // eligible apps. struct ExtensionApp { // App's name. - string16 name; + base::string16 name; // App's launch URL (for platform apps, which don't have a launch URL, this // just points to the app's origin). - string16 launch_url; + base::string16 launch_url; // If false, then the launch_url will not be considered for matching, // not shown next to the match, and not displayed as the editable text if // the user selects the match with the arrow keys. diff --git a/chrome/browser/autocomplete/extension_app_provider_unittest.cc b/chrome/browser/autocomplete/extension_app_provider_unittest.cc index d66dcf7..24e8bd7 100644 --- a/chrome/browser/autocomplete/extension_app_provider_unittest.cc +++ b/chrome/browser/autocomplete/extension_app_provider_unittest.cc @@ -17,7 +17,7 @@ class ExtensionAppProviderTest : public testing::Test { protected: struct test_data { - const string16 input; + const base::string16 input; const size_t num_results; const GURL output[3]; }; @@ -86,8 +86,9 @@ void ExtensionAppProviderTest::RunTest( int num_cases) { ACMatches matches; for (int i = 0; i < num_cases; ++i) { - AutocompleteInput input(keyword_cases[i].input, string16::npos, string16(), - GURL(), AutocompleteInput::INVALID_SPEC, true, + AutocompleteInput input(keyword_cases[i].input, base::string16::npos, + base::string16(), GURL(), + AutocompleteInput::INVALID_SPEC, true, false, true, AutocompleteInput::ALL_MATCHES); app_provider_->Start(input, false); EXPECT_TRUE(app_provider_->done()); @@ -136,10 +137,11 @@ TEST_F(ExtensionAppProviderTest, CreateMatchSanitize) { { "Test\r\t\nTest", "TestTest" }, }; - AutocompleteInput input(ASCIIToUTF16("Test"), string16::npos, string16(), - GURL(), AutocompleteInput::INVALID_SPEC, true, true, + AutocompleteInput input(ASCIIToUTF16("Test"), base::string16::npos, + base::string16(), GURL(), + AutocompleteInput::INVALID_SPEC, true, true, true, AutocompleteInput::BEST_MATCH); - string16 url(ASCIIToUTF16("http://example.com")); + base::string16 url(ASCIIToUTF16("http://example.com")); for (size_t i = 0; i < ARRAYSIZE_UNSAFE(cases); ++i) { ExtensionAppProvider::ExtensionApp extension_app = {ASCIIToUTF16(cases[i].name), url, true}; @@ -147,7 +149,7 @@ TEST_F(ExtensionAppProviderTest, CreateMatchSanitize) { app_provider_->CreateAutocompleteMatch(input, extension_app, 0, - string16::npos); + base::string16::npos); EXPECT_EQ(ASCIIToUTF16(cases[i].match_contents), match.contents); } } diff --git a/chrome/browser/autocomplete/history_provider.cc b/chrome/browser/autocomplete/history_provider.cc index efd6bb9..7474ce7 100644 --- a/chrome/browser/autocomplete/history_provider.cc +++ b/chrome/browser/autocomplete/history_provider.cc @@ -65,7 +65,7 @@ void HistoryProvider::DeleteMatchFromMatches(const AutocompleteMatch& match) { // static bool HistoryProvider::FixupUserInput(AutocompleteInput* input) { - const string16& input_text = input->text(); + const base::string16& input_text = input->text(); // Fixup and canonicalize user input. const GURL canonical_gurl(URLFixerUpper::FixupURL(UTF16ToUTF8(input_text), std::string())); @@ -93,7 +93,7 @@ bool HistoryProvider::FixupUserInput(AutocompleteInput* input) { canonical_gurl_str.replace(parts.host.begin, parts.host.len, original_hostname); } - string16 output = UTF8ToUTF16(canonical_gurl_str); + base::string16 output = UTF8ToUTF16(canonical_gurl_str); // Don't prepend a scheme when the user didn't have one. Since the fixer // upper only prepends the "http" scheme, that's all we need to check for. if (!AutocompleteInput::HasHTTPScheme(input_text)) @@ -115,12 +115,13 @@ bool HistoryProvider::FixupUserInput(AutocompleteInput* input) { // harm in making sure. const size_t last_input_nonslash = input_text.find_last_not_of(ASCIIToUTF16("/\\")); - const size_t num_input_slashes = (last_input_nonslash == string16::npos) ? + const size_t num_input_slashes = + (last_input_nonslash == base::string16::npos) ? input_text.length() : (input_text.length() - 1 - last_input_nonslash); const size_t last_output_nonslash = output.find_last_not_of(ASCIIToUTF16("/\\")); const size_t num_output_slashes = - (last_output_nonslash == string16::npos) ? + (last_output_nonslash == base::string16::npos) ? output.length() : (output.length() - 1 - last_output_nonslash); if (num_output_slashes < num_input_slashes) output.append(num_input_slashes - num_output_slashes, '/'); @@ -129,18 +130,18 @@ bool HistoryProvider::FixupUserInput(AutocompleteInput* input) { url_parse::Parsed parts; URLFixerUpper::SegmentURL(output, &parts); - input->UpdateText(output, string16::npos, parts); + input->UpdateText(output, base::string16::npos, parts); return !output.empty(); } // static -size_t HistoryProvider::TrimHttpPrefix(string16* url) { +size_t HistoryProvider::TrimHttpPrefix(base::string16* url) { // Find any "http:". if (!AutocompleteInput::HasHTTPScheme(*url)) return 0; size_t scheme_pos = url->find(ASCIIToUTF16(content::kHttpScheme) + char16(':')); - DCHECK_NE(string16::npos, scheme_pos); + DCHECK_NE(base::string16::npos, scheme_pos); // Erase scheme plus up to two slashes. size_t prefix_end = scheme_pos + strlen(content::kHttpScheme) + 1; diff --git a/chrome/browser/autocomplete/history_provider.h b/chrome/browser/autocomplete/history_provider.h index 9a72b86..705ab4c 100644 --- a/chrome/browser/autocomplete/history_provider.h +++ b/chrome/browser/autocomplete/history_provider.h @@ -46,7 +46,7 @@ class HistoryProvider : public AutocompleteProvider { // number of characters that were trimmed. // NOTE: For a view-source: URL, this will trim from after "view-source:" and // return 0. - static size_t TrimHttpPrefix(string16* url); + static size_t TrimHttpPrefix(base::string16* url); // Returns true if inline autocompletion should be prevented. Use this instead // of |input.prevent_inline_autocomplete| if the input is passed through diff --git a/chrome/browser/autocomplete/history_provider_util.cc b/chrome/browser/autocomplete/history_provider_util.cc index 371d7b9..439248d 100644 --- a/chrome/browser/autocomplete/history_provider_util.cc +++ b/chrome/browser/autocomplete/history_provider_util.cc @@ -10,7 +10,7 @@ namespace history { HistoryMatch::HistoryMatch() : url_info(), - input_location(string16::npos), + input_location(base::string16::npos), match_in_scheme(false), innermost_match(true), promoted(false) { diff --git a/chrome/browser/autocomplete/history_quick_provider_unittest.cc b/chrome/browser/autocomplete/history_quick_provider_unittest.cc index e33533f..d571bfa 100644 --- a/chrome/browser/autocomplete/history_quick_provider_unittest.cc +++ b/chrome/browser/autocomplete/history_quick_provider_unittest.cc @@ -132,10 +132,10 @@ class HistoryQuickProviderTest : public testing::Test, // Runs an autocomplete query on |text| and checks to see that the returned // results' destination URLs match those provided. |expected_urls| does not // need to be in sorted order. - void RunTest(const string16 text, + void RunTest(const base::string16 text, std::vector<std::string> expected_urls, bool can_inline_top_result, - string16 expected_fill_into_edit); + base::string16 expected_fill_into_edit); base::MessageLoopForUI message_loop_; content::TestBrowserThread ui_thread_; @@ -237,15 +237,15 @@ void HistoryQuickProviderTest::SetShouldContain::operator()( } -void HistoryQuickProviderTest::RunTest(const string16 text, +void HistoryQuickProviderTest::RunTest(const base::string16 text, std::vector<std::string> expected_urls, bool can_inline_top_result, - string16 expected_fill_into_edit) { + base::string16 expected_fill_into_edit) { SCOPED_TRACE(text); // Minimal hint to query being run. base::MessageLoop::current()->RunUntilIdle(); - AutocompleteInput input(text, string16::npos, string16(), GURL(), - AutocompleteInput::INVALID_SPEC, false, false, true, - AutocompleteInput::ALL_MATCHES); + AutocompleteInput input(text, base::string16::npos, base::string16(), + GURL(), AutocompleteInput::INVALID_SPEC, false, + false, true, AutocompleteInput::ALL_MATCHES); provider_->Start(input, false); EXPECT_TRUE(provider_->done()); @@ -294,7 +294,7 @@ void HistoryQuickProviderTest::RunTest(const string16 text, << "fill_into_edit was: '" << ac_matches_[0].fill_into_edit << "' but we expected '" << expected_fill_into_edit << "'."; size_t text_pos = expected_fill_into_edit.find(text); - ASSERT_NE(string16::npos, text_pos); + ASSERT_NE(base::string16::npos, text_pos); EXPECT_EQ(ac_matches_[0].fill_into_edit.substr(text_pos + text.size()), ac_matches_[0].inline_autocompletion); } else { @@ -555,7 +555,7 @@ TEST_F(HistoryQuickProviderTest, CullSearchResults) { // A search results page should not be returned when typing a query. std::vector<std::string> expected_urls; expected_urls.push_back("http://anotherengine.com/?q=thequery"); - RunTest(ASCIIToUTF16("thequery"), expected_urls, false, string16()); + RunTest(ASCIIToUTF16("thequery"), expected_urls, false, base::string16()); // A search results page should not be returned when typing the engine URL. expected_urls.clear(); diff --git a/chrome/browser/autocomplete/history_url_provider.cc b/chrome/browser/autocomplete/history_url_provider.cc index 45c660b..b85e499 100644 --- a/chrome/browser/autocomplete/history_url_provider.cc +++ b/chrome/browser/autocomplete/history_url_provider.cc @@ -86,7 +86,7 @@ bool CreateOrPromoteMatch(const history::URLRow& info, // URL to just a host. If this host still matches the user input, return it. // Returns the empty string on failure. GURL ConvertToHostOnly(const history::HistoryMatch& match, - const string16& input) { + const base::string16& input) { // See if we should try to do host-only suggestions for this URL. Nonstandard // schemes means there's no authority section, so suggesting the host name // is useless. File URLs are standard, but host suggestion is not useful for @@ -101,7 +101,7 @@ GURL ConvertToHostOnly(const history::HistoryMatch& match, if ((host.spec().length() < (match.input_location + input.length()))) return GURL(); // User typing is longer than this host suggestion. - const string16 spec = UTF8ToUTF16(host.spec()); + const base::string16 spec = UTF8ToUTF16(host.spec()); if (spec.compare(match.input_location, input.length(), input)) return GURL(); // User typing is no longer a prefix. @@ -204,7 +204,7 @@ class SearchTermsDataSnapshot : public SearchTermsData { virtual std::string GoogleBaseURLValue() const OVERRIDE; virtual std::string GetApplicationLocale() const OVERRIDE; - virtual string16 GetRlzParameterValue() const OVERRIDE; + virtual base::string16 GetRlzParameterValue() const OVERRIDE; virtual std::string GetSearchClient() const OVERRIDE; virtual std::string ForceInstantResultsParam( bool for_prerender) const OVERRIDE; @@ -214,7 +214,7 @@ class SearchTermsDataSnapshot : public SearchTermsData { private: std::string google_base_url_value_; std::string application_locale_; - string16 rlz_parameter_value_; + base::string16 rlz_parameter_value_; std::string search_client_; std::string force_instant_results_param_; std::string instant_extended_enabled_param_; @@ -246,7 +246,7 @@ std::string SearchTermsDataSnapshot::GetApplicationLocale() const { return application_locale_; } -string16 SearchTermsDataSnapshot::GetRlzParameterValue() const { +base::string16 SearchTermsDataSnapshot::GetRlzParameterValue() const { return rlz_parameter_value_; } @@ -399,7 +399,7 @@ void HistoryURLProvider::Stop(bool clear_cached_results) { } AutocompleteMatch HistoryURLProvider::SuggestExactInput( - const string16& text, + const base::string16& text, const GURL& destination_url, bool trim_http) { AutocompleteMatch match(this, 0, false, @@ -415,7 +415,8 @@ AutocompleteMatch HistoryURLProvider::SuggestExactInput( // slightly different behavior as well (the latter will strip even without // two slashes after the scheme). DCHECK(!trim_http || !AutocompleteInput::HasHTTPScheme(text)); - string16 display_string(StringForURLDisplay(destination_url, false, false)); + base::string16 display_string( + StringForURLDisplay(destination_url, false, false)); const size_t offset = trim_http ? TrimHttpPrefix(&display_string) : 0; match.fill_into_edit = AutocompleteInput::FormattedStringWithEquivalentMeaning(destination_url, @@ -527,7 +528,8 @@ void HistoryURLProvider::DoAutocomplete(history::HistoryBackend* backend, for (history::URLRows::const_iterator j(url_matches.begin()); j != url_matches.end(); ++j) { const URLPrefix* best_prefix = - URLPrefix::BestURLPrefix(UTF8ToUTF16(j->url().spec()), string16()); + URLPrefix::BestURLPrefix(UTF8ToUTF16(j->url().spec()), + base::string16()); DCHECK(best_prefix != NULL); history_matches.push_back(history::HistoryMatch(*j, i->prefix.length(), i->num_components == 0, @@ -825,8 +827,8 @@ bool HistoryURLProvider::FixupExactSuggestion( return false; // Put it on the front of the HistoryMatches for redirect culling. - CreateOrPromoteMatch(classifier.url_row(), string16::npos, false, matches, - true, true); + CreateOrPromoteMatch(classifier.url_row(), base::string16::npos, false, + matches, true, true); return true; } @@ -1060,7 +1062,7 @@ AutocompleteMatch HistoryURLProvider::HistoryMatchToACMatch( net::UnescapeRule::SPACES, NULL, NULL, &inline_autocomplete_offset)); if (!params.prevent_inline_autocomplete && - (inline_autocomplete_offset != string16::npos)) { + (inline_autocomplete_offset != base::string16::npos)) { DCHECK(inline_autocomplete_offset <= match.fill_into_edit.length()); match.inline_autocompletion = match.fill_into_edit.substr(inline_autocomplete_offset); @@ -1068,21 +1070,21 @@ AutocompleteMatch HistoryURLProvider::HistoryMatchToACMatch( // The latter part of the test effectively asks "is the inline completion // empty?" (i.e., is this match effectively the what-you-typed match?). match.allowed_to_be_default_match = !params.prevent_inline_autocomplete || - ((inline_autocomplete_offset != string16::npos) && + ((inline_autocomplete_offset != base::string16::npos) && (inline_autocomplete_offset >= match.fill_into_edit.length())); size_t match_start = history_match.input_location; match.contents = net::FormatUrl(info.url(), languages, format_types, net::UnescapeRule::SPACES, NULL, NULL, &match_start); - if ((match_start != string16::npos) && - (inline_autocomplete_offset != string16::npos) && + if ((match_start != base::string16::npos) && + (inline_autocomplete_offset != base::string16::npos) && (inline_autocomplete_offset != match_start)) { DCHECK(inline_autocomplete_offset > match_start); AutocompleteMatch::ClassifyLocationInString(match_start, inline_autocomplete_offset - match_start, match.contents.length(), ACMatchClassification::URL, &match.contents_class); } else { - AutocompleteMatch::ClassifyLocationInString(string16::npos, 0, + AutocompleteMatch::ClassifyLocationInString(base::string16::npos, 0, match.contents.length(), ACMatchClassification::URL, &match.contents_class); } @@ -1095,9 +1097,9 @@ AutocompleteMatch HistoryURLProvider::HistoryMatchToACMatch( // static ACMatchClassifications HistoryURLProvider::ClassifyDescription( - const string16& input_text, - const string16& description) { - string16 clean_description = history::CleanUpTitleForMatching(description); + const base::string16& input_text, + const base::string16& description) { + base::string16 clean_description = history::CleanUpTitleForMatching(description); history::TermMatches description_matches(SortAndDeoverlapMatches( history::MatchTermInString(input_text, clean_description, 0))); history::WordStarts description_word_starts; diff --git a/chrome/browser/autocomplete/history_url_provider.h b/chrome/browser/autocomplete/history_url_provider.h index 610d35b..3926e03 100644 --- a/chrome/browser/autocomplete/history_url_provider.h +++ b/chrome/browser/autocomplete/history_url_provider.h @@ -173,7 +173,7 @@ class HistoryURLProvider : public HistoryProvider { // set to true if |text| contains an http prefix. // NOTE: This does not set the relevance of the returned match, as different // callers want different behavior. Callers must set this manually. - AutocompleteMatch SuggestExactInput(const string16& text, + AutocompleteMatch SuggestExactInput(const base::string16& text, const GURL& destination_url, bool trim_http); @@ -294,8 +294,8 @@ class HistoryURLProvider : public HistoryProvider { // Returns a set of classifications that highlight all the occurrences // of |input_text| at word breaks in |description|. static ACMatchClassifications ClassifyDescription( - const string16& input_text, - const string16& description); + const base::string16& input_text, + const base::string16& description); // Params for the current query. The provider should not free this directly; // instead, it is passed as a parameter through the history backend, and the diff --git a/chrome/browser/autocomplete/search_provider.h b/chrome/browser/autocomplete/search_provider.h index 256d3f3..adf3004 100644 --- a/chrome/browser/autocomplete/search_provider.h +++ b/chrome/browser/autocomplete/search_provider.h @@ -85,14 +85,14 @@ class SearchProvider : public AutocompleteProvider, static AutocompleteMatch CreateSearchSuggestion( AutocompleteProvider* autocomplete_provider, const AutocompleteInput& input, - const string16& input_text, + const base::string16& input_text, int relevance, AutocompleteMatch::Type type, bool is_keyword, - const string16& match_contents, - const string16& annotation, + const base::string16& match_contents, + const base::string16& annotation, const TemplateURL* template_url, - const string16& query_string, + const base::string16& query_string, const std::string& suggest_query_params, int accepted_suggestion, int omnibox_start_margin, @@ -151,22 +151,22 @@ class SearchProvider : public AutocompleteProvider, // Returns true if the specified providers match the two providers cached // by this class. - bool equal(const string16& default_provider, - const string16& keyword_provider) const { + bool equal(const base::string16& default_provider, + const base::string16& keyword_provider) const { return (default_provider == default_provider_) && (keyword_provider == keyword_provider_); } // Resets the cached providers. - void set(const string16& default_provider, - const string16& keyword_provider) { + void set(const base::string16& default_provider, + const base::string16& keyword_provider) { default_provider_ = default_provider; keyword_provider_ = keyword_provider; } TemplateURLService* template_url_service() { return template_url_service_; } - const string16& default_provider() const { return default_provider_; } - const string16& keyword_provider() const { return keyword_provider_; } + const base::string16& default_provider() const { return default_provider_; } + const base::string16& keyword_provider() const { return keyword_provider_; } // NOTE: These may return NULL even if the provider members are nonempty! const TemplateURL* GetDefaultProviderURL() const; @@ -180,8 +180,8 @@ class SearchProvider : public AutocompleteProvider, // Cached across the life of a query so we behave consistently even if the // user changes their default while the query is running. - string16 default_provider_; - string16 keyword_provider_; + base::string16 default_provider_; + base::string16 keyword_provider_; DISALLOW_COPY_AND_ASSIGN(Providers); }; @@ -212,7 +212,7 @@ class SearchProvider : public AutocompleteProvider, // Returns if this result is inlineable against the current input |input|. // Non-inlineable results are stale. - virtual bool IsInlineable(const string16& input) const = 0; + virtual bool IsInlineable(const base::string16& input) const = 0; // Returns the default relevance value for this result (which may // be left over from a previous omnibox input) given the current @@ -239,9 +239,9 @@ class SearchProvider : public AutocompleteProvider, class SuggestResult : public Result { public: - SuggestResult(const string16& suggestion, - const string16& match_contents, - const string16& annotation, + SuggestResult(const base::string16& suggestion, + const base::string16& match_contents, + const base::string16& annotation, const std::string& suggest_query_params, const std::string& deletion_url, bool from_keyword_provider, @@ -250,9 +250,9 @@ class SearchProvider : public AutocompleteProvider, bool should_prefetch); virtual ~SuggestResult(); - const string16& suggestion() const { return suggestion_; } - const string16& match_contents() const { return match_contents_; } - const string16& annotation() const { return annotation_; } + const base::string16& suggestion() const { return suggestion_; } + const base::string16& match_contents() const { return match_contents_; } + const base::string16& annotation() const { return annotation_; } const std::string& suggest_query_params() const { return suggest_query_params_; } @@ -260,22 +260,22 @@ class SearchProvider : public AutocompleteProvider, bool should_prefetch() const { return should_prefetch_; } // Result: - virtual bool IsInlineable(const string16& input) const OVERRIDE; + virtual bool IsInlineable(const base::string16& input) const OVERRIDE; virtual int CalculateRelevance( const AutocompleteInput& input, bool keyword_provider_requested) const OVERRIDE; private: // The search terms to be used for this suggestion. - string16 suggestion_; + base::string16 suggestion_; // The contents to be displayed in the autocomplete match. - string16 match_contents_; + base::string16 match_contents_; // Optional annotation for the |match_contents_| for disambiguation. // This may be displayed in the autocomplete match contents, but is defined // separately to facilitate different formatting. - string16 annotation_; + base::string16 annotation_; // Optional additional parameters to be added to the search URL. std::string suggest_query_params_; @@ -295,18 +295,18 @@ class SearchProvider : public AutocompleteProvider, // compute |formatted_url_|. NavigationResult(const AutocompleteProvider& provider, const GURL& url, - const string16& description, + const base::string16& description, bool from_keyword_provider, int relevance, bool relevance_from_server); virtual ~NavigationResult(); const GURL& url() const { return url_; } - const string16& description() const { return description_; } - const string16& formatted_url() const { return formatted_url_; } + const base::string16& description() const { return description_; } + const base::string16& formatted_url() const { return formatted_url_; } // Result: - virtual bool IsInlineable(const string16& input) const OVERRIDE; + virtual bool IsInlineable(const base::string16& input) const OVERRIDE; virtual int CalculateRelevance( const AutocompleteInput& input, bool keyword_provider_requested) const OVERRIDE; @@ -317,10 +317,10 @@ class SearchProvider : public AutocompleteProvider, // The properly formatted ("fixed up") URL string with equivalent meaning // to the one in |url_|. - string16 formatted_url_; + base::string16 formatted_url_; // The suggested navigational result description; generally the site name. - string16 description_; + base::string16 description_; }; class CompareScoredResults; @@ -369,7 +369,7 @@ class SearchProvider : public AutocompleteProvider, // Removes non-inlineable results until either the top result can inline // autocomplete the current input or verbatim outscores the top result. - static void RemoveStaleResults(const string16& input, + static void RemoveStaleResults(const base::string16& input, int verbatim_relevance, SuggestResults* suggest_results, NavigationResults* navigation_results); @@ -493,7 +493,7 @@ class SearchProvider : public AutocompleteProvider, SuggestResults ScoreHistoryResults(const HistoryResults& results, bool base_prevent_inline_autocomplete, bool input_multiple_words, - const string16& input_text, + const base::string16& input_text, bool is_keyword); // Adds matches for |results| to |map|. @@ -540,16 +540,16 @@ class SearchProvider : public AutocompleteProvider, // Creates an AutocompleteMatch for "Search <engine> for |query_string|" with // the supplied relevance. Adds this match to |map|; if such a match already // exists, whichever one has lower relevance is eliminated. - void AddMatchToMap(const string16& input_text, + void AddMatchToMap(const base::string16& input_text, int relevance, bool relevance_from_server, bool should_prefetch, const std::string& metadata, AutocompleteMatch::Type type, bool is_keyword, - const string16& match_contents, - const string16& annotation, - const string16& query_string, + const base::string16& match_contents, + const base::string16& annotation, + const base::string16& query_string, int accepted_suggestion, const std::string& suggest_query_params, const std::string& deletion_url, diff --git a/chrome/browser/autocomplete/search_provider_unittest.cc b/chrome/browser/autocomplete/search_provider_unittest.cc index 7a13b44b..f064792 100644 --- a/chrome/browser/autocomplete/search_provider_unittest.cc +++ b/chrome/browser/autocomplete/search_provider_unittest.cc @@ -109,7 +109,7 @@ class SearchProviderTest : public testing::Test, ResultInfo(GURL gurl, AutocompleteMatch::Type result_type, bool allowed_to_be_default_match, - string16 fill_into_edit) + base::string16 fill_into_edit) : gurl(gurl), result_type(result_type), allowed_to_be_default_match(allowed_to_be_default_match), @@ -119,11 +119,11 @@ class SearchProviderTest : public testing::Test, const GURL gurl; const AutocompleteMatch::Type result_type; const bool allowed_to_be_default_match; - const string16 fill_into_edit; + const base::string16 fill_into_edit; }; struct TestData { - const string16 input; + const base::string16 input; const size_t num_results; const ResultInfo output[3]; }; @@ -152,11 +152,11 @@ class SearchProviderTest : public testing::Test, // Adds a search for |term|, using the engine |t_url| to the history, and // returns the URL for that search. - GURL AddSearchToHistory(TemplateURL* t_url, string16 term, int visit_count); + GURL AddSearchToHistory(TemplateURL* t_url, base::string16 term, int visit_count); // Looks for a match in |provider_| with |contents| equal to |contents|. // Sets |match| to it if found. Returns whether |match| was set. - bool FindMatchWithContents(const string16& contents, + bool FindMatchWithContents(const base::string16& contents, AutocompleteMatch* match); // Looks for a match in |provider_| with destination |url|. Sets |match| to @@ -172,13 +172,13 @@ class SearchProviderTest : public testing::Test, void RunTillProviderDone(); // Invokes Start on provider_, then runs all pending tasks. - void QueryForInput(const string16& text, + void QueryForInput(const base::string16& text, bool prevent_inline_autocomplete, bool prefer_keyword); // Calls QueryForInput(), finishes any suggest query, then if |wyt_match| is // non-NULL, sets it to the "what you typed" entry for |text|. - void QueryForInputAndSetWYTMatch(const string16& text, + void QueryForInputAndSetWYTMatch(const base::string16& text, AutocompleteMatch* wyt_match); // Notifies the URLFetcher for the suggest query corresponding to the default @@ -202,10 +202,10 @@ class SearchProviderTest : public testing::Test, // See description above class for details of these fields. TemplateURL* default_t_url_; - const string16 term1_; + const base::string16 term1_; GURL term1_url_; TemplateURL* keyword_t_url_; - const string16 keyword_term_; + const base::string16 keyword_term_; GURL keyword_url_; content::TestBrowserThreadBundle thread_bundle_; @@ -291,13 +291,13 @@ void SearchProviderTest::RunTest(TestData* cases, bool prefer_keyword) { ACMatches matches; for (int i = 0; i < num_cases; ++i) { - AutocompleteInput input(cases[i].input, string16::npos, string16(), GURL(), + AutocompleteInput input(cases[i].input, base::string16::npos, base::string16(), GURL(), AutocompleteInput::INVALID_SPEC, false, prefer_keyword, true, AutocompleteInput::ALL_MATCHES); provider_->Start(input, false); matches = provider_->matches(); - string16 diagnostic_details = ASCIIToUTF16("Input was: ") + cases[i].input + + base::string16 diagnostic_details = ASCIIToUTF16("Input was: ") + cases[i].input + ASCIIToUTF16("; prefer_keyword was: ") + (prefer_keyword ? ASCIIToUTF16("true") : ASCIIToUTF16("false")); EXPECT_EQ(cases[i].num_results, matches.size()) << diagnostic_details; @@ -332,11 +332,11 @@ void SearchProviderTest::RunTillProviderDone() { run_loop.Run(); } -void SearchProviderTest::QueryForInput(const string16& text, +void SearchProviderTest::QueryForInput(const base::string16& text, bool prevent_inline_autocomplete, bool prefer_keyword) { // Start a query. - AutocompleteInput input(text, string16::npos, string16(), GURL(), + AutocompleteInput input(text, base::string16::npos, base::string16(), GURL(), AutocompleteInput::INVALID_SPEC, prevent_inline_autocomplete, prefer_keyword, true, AutocompleteInput::ALL_MATCHES); @@ -348,7 +348,7 @@ void SearchProviderTest::QueryForInput(const string16& text, } void SearchProviderTest::QueryForInputAndSetWYTMatch( - const string16& text, + const base::string16& text, AutocompleteMatch* wyt_match) { QueryForInput(text, false, false); profile_.BlockUntilHistoryProcessesPendingRequests(); @@ -363,7 +363,7 @@ void SearchProviderTest::QueryForInputAndSetWYTMatch( } GURL SearchProviderTest::AddSearchToHistory(TemplateURL* t_url, - string16 term, + base::string16 term, int visit_count) { HistoryService* history = HistoryServiceFactory::GetForProfile(&profile_, @@ -373,13 +373,13 @@ GURL SearchProviderTest::AddSearchToHistory(TemplateURL* t_url, static base::Time last_added_time; last_added_time = std::max(base::Time::Now(), last_added_time + base::TimeDelta::FromMicroseconds(1)); - history->AddPageWithDetails(search, string16(), visit_count, visit_count, + history->AddPageWithDetails(search, base::string16(), visit_count, visit_count, last_added_time, false, history::SOURCE_BROWSED); history->SetKeywordSearchTermsForURL(search, t_url->id(), term); return search; } -bool SearchProviderTest::FindMatchWithContents(const string16& contents, +bool SearchProviderTest::FindMatchWithContents(const base::string16& contents, AutocompleteMatch* match) { for (ACMatches::const_iterator i = provider_->matches().begin(); i != provider_->matches().end(); ++i) { @@ -464,7 +464,7 @@ void SearchProviderTest::ClearAllResults() { // Make sure we query history for the default provider and a URLFetcher is // created for the default provider suggest results. TEST_F(SearchProviderTest, QueryDefaultProvider) { - string16 term = term1_.substr(0, term1_.length() - 1); + base::string16 term = term1_.substr(0, term1_.length() - 1); QueryForInput(term, false, false); // Make sure the default providers suggest service was queried. @@ -507,7 +507,7 @@ TEST_F(SearchProviderTest, QueryDefaultProvider) { } TEST_F(SearchProviderTest, HonorPreventInlineAutocomplete) { - string16 term = term1_.substr(0, term1_.length() - 1); + base::string16 term = term1_.substr(0, term1_.length() - 1); QueryForInput(term, true, false); ASSERT_FALSE(provider_->matches().empty()); @@ -519,7 +519,7 @@ TEST_F(SearchProviderTest, HonorPreventInlineAutocomplete) { // Issues a query that matches the registered keyword and makes sure history // is queried as well as URLFetchers getting created. TEST_F(SearchProviderTest, QueryKeywordProvider) { - string16 term = keyword_term_.substr(0, keyword_term_.length() - 1); + base::string16 term = keyword_term_.substr(0, keyword_term_.length() - 1); QueryForInput(keyword_t_url_->keyword() + ASCIIToUTF16(" ") + term, false, false); @@ -625,7 +625,7 @@ TEST_F(SearchProviderTest, DontAutocompleteURLLikeTerms) { // Add the term as a url. HistoryServiceFactory::GetForProfile(&profile_, Profile::EXPLICIT_ACCESS)-> - AddPageWithDetails(GURL("http://docs.google.com"), string16(), 1, 1, + AddPageWithDetails(GURL("http://docs.google.com"), base::string16(), 1, 1, base::Time::Now(), false, history::SOURCE_BROWSED); profile_.BlockUntilHistoryProcessesPendingRequests(); @@ -857,7 +857,7 @@ TEST_F(SearchProviderTest, KeywordOrderingAndDescriptions) { AutocompleteController controller(&profile_, NULL, AutocompleteProvider::TYPE_SEARCH); controller.Start(AutocompleteInput( - ASCIIToUTF16("k t"), string16::npos, string16(), GURL(), + ASCIIToUTF16("k t"), base::string16::npos, base::string16(), GURL(), AutocompleteInput::INVALID_SPEC, false, false, true, AutocompleteInput::ALL_MATCHES)); const AutocompleteResult& result = controller.result(); @@ -2642,13 +2642,13 @@ TEST_F(SearchProviderTest, LocalAndRemoteRelevances) { // We hardcode the string "term1" below, so ensure that the search term that // got added to history already is that string. ASSERT_EQ(ASCIIToUTF16("term1"), term1_); - string16 term = term1_.substr(0, term1_.length() - 1); + base::string16 term = term1_.substr(0, term1_.length() - 1); AddSearchToHistory(default_t_url_, term + ASCIIToUTF16("2"), 2); profile_.BlockUntilHistoryProcessesPendingRequests(); struct { - const string16 input; + const base::string16 input; const std::string json; const std::string matches[6]; } cases[] = { @@ -3177,7 +3177,7 @@ TEST_F(SearchProviderTest, NavigationInline) { QueryForInput(ASCIIToUTF16(cases[i].input), false, false); AutocompleteMatch match( provider_->NavigationToMatch(SearchProvider::NavigationResult( - *provider_.get(), GURL(cases[i].url), string16(), false, 0, + *provider_.get(), GURL(cases[i].url), base::string16(), false, 0, false))); EXPECT_EQ(ASCIIToUTF16(cases[i].inline_autocompletion), match.inline_autocompletion); @@ -3189,10 +3189,10 @@ TEST_F(SearchProviderTest, NavigationInline) { // Verifies that "http://" is not trimmed for input that is a leading substring. TEST_F(SearchProviderTest, NavigationInlineSchemeSubstring) { - const string16 input(ASCIIToUTF16("ht")); - const string16 url(ASCIIToUTF16("http://a.com")); + const base::string16 input(ASCIIToUTF16("ht")); + const base::string16 url(ASCIIToUTF16("http://a.com")); const SearchProvider::NavigationResult result( - *provider_.get(), GURL(url), string16(), false, 0, false); + *provider_.get(), GURL(url), base::string16(), false, 0, false); // Check the offset and strings when inline autocompletion is allowed. QueryForInput(input, false, false); @@ -3216,7 +3216,7 @@ TEST_F(SearchProviderTest, NavigationInlineDomainClassify) { QueryForInput(ASCIIToUTF16("w"), false, false); AutocompleteMatch match( provider_->NavigationToMatch(SearchProvider::NavigationResult( - *provider_.get(), GURL("http://www.wow.com"), string16(), false, 0, + *provider_.get(), GURL("http://www.wow.com"), base::string16(), false, 0, false))); EXPECT_EQ(ASCIIToUTF16("ow.com"), match.inline_autocompletion); EXPECT_TRUE(match.allowed_to_be_default_match); @@ -3379,12 +3379,12 @@ TEST_F(SearchProviderTest, RemoveStaleResultsTest) { if (cases[i].results[j].is_navigation_result) { provider_->default_results_.navigation_results.push_back( SearchProvider::NavigationResult( - *provider_.get(), GURL(suggestion), string16(), false, + *provider_.get(), GURL(suggestion), base::string16(), false, cases[i].results[j].relevance, false)); } else { provider_->default_results_.suggest_results.push_back( - SearchProvider::SuggestResult(ASCIIToUTF16(suggestion), string16(), - string16(), std::string(), + SearchProvider::SuggestResult(ASCIIToUTF16(suggestion), base::string16(), + base::string16(), std::string(), std::string(), false, cases[i].results[j].relevance, false, false)); @@ -3392,7 +3392,7 @@ TEST_F(SearchProviderTest, RemoveStaleResultsTest) { } provider_->input_ = AutocompleteInput( - ASCIIToUTF16(cases[i].omnibox_input), string16::npos, string16(), + ASCIIToUTF16(cases[i].omnibox_input), base::string16::npos, base::string16(), GURL(), AutocompleteInput::INVALID_SPEC, false, false, true, AutocompleteInput::ALL_MATCHES); provider_->RemoveAllStaleResults(); @@ -3972,7 +3972,7 @@ TEST_F(SearchProviderTest, ParseDeletionUrl) { TEST_F(SearchProviderTest, ReflectsBookmarkBarState) { profile_.GetPrefs()->SetBoolean(prefs::kShowBookmarkBar, false); - string16 term = term1_.substr(0, term1_.length() - 1); + base::string16 term = term1_.substr(0, term1_.length() - 1); QueryForInput(term, true, false); ASSERT_FALSE(provider_->matches().empty()); EXPECT_EQ(AutocompleteMatchType::SEARCH_WHAT_YOU_TYPED, diff --git a/chrome/browser/autocomplete/shortcuts_provider.cc b/chrome/browser/autocomplete/shortcuts_provider.cc index f28b1fc..b973edf 100644 --- a/chrome/browser/autocomplete/shortcuts_provider.cc +++ b/chrome/browser/autocomplete/shortcuts_provider.cc @@ -134,7 +134,7 @@ void ShortcutsProvider::GetMatches(const AutocompleteInput& input) { return; // Get the URLs from the shortcuts database with keys that partially or // completely match the search term. - string16 term_string(base::i18n::ToLower(input.text())); + base::string16 term_string(base::i18n::ToLower(input.text())); DCHECK(!term_string.empty()); int max_relevance; @@ -183,7 +183,7 @@ void ShortcutsProvider::GetMatches(const AutocompleteInput& input) { AutocompleteMatch ShortcutsProvider::ShortcutToACMatch( int relevance, - const string16& term_string, + const base::string16& term_string, const history::ShortcutsBackend::Shortcut& shortcut) { DCHECK(!term_string.empty()); AutocompleteMatch match(shortcut.match_core.ToMatch()); @@ -209,7 +209,7 @@ AutocompleteMatch ShortcutsProvider::ShortcutToACMatch( // static ShortcutsProvider::WordMap ShortcutsProvider::CreateWordMapForString( - const string16& text) { + const base::string16& text) { // First, convert |text| to a vector of the unique words in it. WordMap word_map; base::i18n::BreakIterator word_iter(text, @@ -240,9 +240,9 @@ ShortcutsProvider::WordMap ShortcutsProvider::CreateWordMapForString( // static ACMatchClassifications ShortcutsProvider::ClassifyAllMatchesInString( - const string16& find_text, + const base::string16& find_text, const WordMap& find_words, - const string16& text, + const base::string16& text, const ACMatchClassifications& original_class) { DCHECK(!find_text.empty()); DCHECK(!find_words.empty()); @@ -256,7 +256,7 @@ ACMatchClassifications ShortcutsProvider::ClassifyAllMatchesInString( // First check whether |text| begins with |find_text| and mark that whole // section as a match if so. - string16 text_lowercase(base::i18n::ToLower(text)); + base::string16 text_lowercase(base::i18n::ToLower(text)); ACMatchClassifications match_class; size_t last_position = 0; if (StartsWith(text_lowercase, find_text, true)) { @@ -290,7 +290,7 @@ ACMatchClassifications ShortcutsProvider::ClassifyAllMatchesInString( find_words.equal_range(text_lowercase[last_position])); size_t next_character = last_position + 1; for (WordMap::const_iterator i(range.first); i != range.second; ++i) { - const string16& word = i->second; + const base::string16& word = i->second; size_t word_end = last_position + word.length(); if ((word_end <= text_lowercase.length()) && !text_lowercase.compare(last_position, word.length(), word)) { @@ -315,7 +315,7 @@ ACMatchClassifications ShortcutsProvider::ClassifyAllMatchesInString( } history::ShortcutsBackend::ShortcutMap::const_iterator - ShortcutsProvider::FindFirstMatch(const string16& keyword, + ShortcutsProvider::FindFirstMatch(const base::string16& keyword, history::ShortcutsBackend* backend) { DCHECK(backend); history::ShortcutsBackend::ShortcutMap::const_iterator it = @@ -328,7 +328,7 @@ history::ShortcutsBackend::ShortcutMap::const_iterator } int ShortcutsProvider::CalculateScore( - const string16& terms, + const base::string16& terms, const history::ShortcutsBackend::Shortcut& shortcut, int max_relevance) { DCHECK(!terms.empty()); diff --git a/chrome/browser/autocomplete/shortcuts_provider.h b/chrome/browser/autocomplete/shortcuts_provider.h index fd56522..27f9d7f 100644 --- a/chrome/browser/autocomplete/shortcuts_provider.h +++ b/chrome/browser/autocomplete/shortcuts_provider.h @@ -40,7 +40,7 @@ class ShortcutsProvider friend class ClassifyTest; friend class history::ShortcutsProviderTest; - typedef std::multimap<char16, string16> WordMap; + typedef std::multimap<char16, base::string16> WordMap; virtual ~ShortcutsProvider(); @@ -52,14 +52,14 @@ class ShortcutsProvider AutocompleteMatch ShortcutToACMatch( int relevance, - const string16& terms, + const base::string16& terms, const history::ShortcutsBackend::Shortcut& shortcut); // Returns a map mapping characters to groups of words from |text| that start // with those characters, ordered lexicographically descending so that longer // words appear before their prefixes (if any) within a particular // equal_range(). - static WordMap CreateWordMapForString(const string16& text); + static WordMap CreateWordMapForString(const base::string16& text); // Given |text| and a corresponding base set of classifications // |original_class|, adds ACMatchClassification::MATCH markers for all @@ -82,19 +82,19 @@ class ShortcutsProvider // |find_text| (and thus |find_words|) are expected to be lowercase. |text| // will be lowercased in this function. static ACMatchClassifications ClassifyAllMatchesInString( - const string16& find_text, + const base::string16& find_text, const WordMap& find_words, - const string16& text, + const base::string16& text, const ACMatchClassifications& original_class); // Returns iterator to first item in |shortcuts_map_| matching |keyword|. // Returns shortcuts_map_.end() if there are no matches. history::ShortcutsBackend::ShortcutMap::const_iterator FindFirstMatch( - const string16& keyword, + const base::string16& keyword, history::ShortcutsBackend* backend); int CalculateScore( - const string16& terms, + const base::string16& terms, const history::ShortcutsBackend::Shortcut& shortcut, int max_relevance); diff --git a/chrome/browser/autocomplete/shortcuts_provider_unittest.cc b/chrome/browser/autocomplete/shortcuts_provider_unittest.cc index 3e9513d..889d521 100644 --- a/chrome/browser/autocomplete/shortcuts_provider_unittest.cc +++ b/chrome/browser/autocomplete/shortcuts_provider_unittest.cc @@ -155,17 +155,17 @@ struct TestShortcutInfo { // convenient. class ClassifyTest { public: - ClassifyTest(const string16& text, ACMatchClassifications matches); + ClassifyTest(const base::string16& text, ACMatchClassifications matches); ~ClassifyTest(); - ACMatchClassifications RunTest(const string16& find_text); + ACMatchClassifications RunTest(const base::string16& find_text); private: - const string16 text_; + const base::string16 text_; const ACMatchClassifications matches_; }; -ClassifyTest::ClassifyTest(const string16& text, ACMatchClassifications matches) +ClassifyTest::ClassifyTest(const base::string16& text, ACMatchClassifications matches) : text_(text), matches_(matches) { } @@ -173,7 +173,7 @@ ClassifyTest::ClassifyTest(const string16& text, ACMatchClassifications matches) ClassifyTest::~ClassifyTest() { } -ACMatchClassifications ClassifyTest::RunTest(const string16& find_text) { +ACMatchClassifications ClassifyTest::RunTest(const base::string16& find_text) { return ShortcutsProvider::ClassifyAllMatchesInString(find_text, ShortcutsProvider::CreateWordMapForString(find_text), text_, matches_); } @@ -215,7 +215,7 @@ class ShortcutsProviderTest : public testing::Test, // Runs an autocomplete query on |text| and checks to see that the returned // results' destination URLs match those provided. |expected_urls| does not // need to be in sorted order. - void RunTest(const string16 text, + void RunTest(const base::string16 text, const URLs& expected_urls, std::string expected_top_result); @@ -293,11 +293,11 @@ void ShortcutsProviderTest::SetShouldContain::operator()( EXPECT_EQ(1U, matches_.erase(expected)); } -void ShortcutsProviderTest::RunTest(const string16 text, +void ShortcutsProviderTest::RunTest(const base::string16 text, const URLs& expected_urls, std::string expected_top_result) { base::MessageLoop::current()->RunUntilIdle(); - AutocompleteInput input(text, string16::npos, string16(), GURL(), + AutocompleteInput input(text, base::string16::npos, base::string16(), GURL(), AutocompleteInput::INVALID_SPEC, false, false, true, AutocompleteInput::ALL_MATCHES); provider_->Start(input, false); @@ -345,7 +345,7 @@ int ShortcutsProviderTest::CalculateScore( // Actual tests --------------------------------------------------------------- TEST_F(ShortcutsProviderTest, SimpleSingleMatch) { - string16 text(ASCIIToUTF16("go")); + base::string16 text(ASCIIToUTF16("go")); std::string expected_url("http://www.google.com/"); URLs expected_urls; expected_urls.push_back(expected_url); @@ -353,7 +353,7 @@ TEST_F(ShortcutsProviderTest, SimpleSingleMatch) { } TEST_F(ShortcutsProviderTest, MultiMatch) { - string16 text(ASCIIToUTF16("NEWS")); + base::string16 text(ASCIIToUTF16("NEWS")); URLs expected_urls; // Scores high because of completion length. expected_urls.push_back("http://slashdot.org/"); @@ -366,7 +366,7 @@ TEST_F(ShortcutsProviderTest, MultiMatch) { } TEST_F(ShortcutsProviderTest, TypedCountMatches) { - string16 text(ASCIIToUTF16("just")); + base::string16 text(ASCIIToUTF16("just")); URLs expected_urls; expected_urls.push_back("http://www.testsite.com/b.html"); expected_urls.push_back("http://www.testsite.com/a.html"); @@ -375,7 +375,7 @@ TEST_F(ShortcutsProviderTest, TypedCountMatches) { } TEST_F(ShortcutsProviderTest, FragmentLengthMatches) { - string16 text(ASCIIToUTF16("just a")); + base::string16 text(ASCIIToUTF16("just a")); URLs expected_urls; expected_urls.push_back("http://www.testsite.com/d.html"); expected_urls.push_back("http://www.testsite.com/e.html"); @@ -384,7 +384,7 @@ TEST_F(ShortcutsProviderTest, FragmentLengthMatches) { } TEST_F(ShortcutsProviderTest, DaysAgoMatches) { - string16 text(ASCIIToUTF16("ago")); + base::string16 text(ASCIIToUTF16("ago")); URLs expected_urls; expected_urls.push_back("http://www.daysagotest.com/a.html"); expected_urls.push_back("http://www.daysagotest.com/b.html"); @@ -496,7 +496,7 @@ TEST_F(ShortcutsProviderTest, CalculateScore) { ASCIIToUTF16("A test"), AutocompleteMatch::ClassificationsFromString("0,0,2,2"), content::PAGE_TRANSITION_TYPED, AutocompleteMatchType::HISTORY_URL, - string16()), + base::string16()), base::Time::Now(), 1); // Maximal score. @@ -601,7 +601,7 @@ TEST_F(ShortcutsProviderTest, DeleteMatch) { TEST_F(ShortcutsProviderTest, Extension) { // Try an input string that matches an extension URL. - string16 text(ASCIIToUTF16("echo")); + base::string16 text(ASCIIToUTF16("echo")); std::string expected_url( "chrome-extension://cedabbhfglmiikkmdgcpjdkocfcmbkee/?q=echo"); URLs expected_urls; diff --git a/chrome/browser/autocomplete/url_prefix.cc b/chrome/browser/autocomplete/url_prefix.cc index 9174bd56..d48ee35 100644 --- a/chrome/browser/autocomplete/url_prefix.cc +++ b/chrome/browser/autocomplete/url_prefix.cc @@ -8,7 +8,7 @@ #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" -URLPrefix::URLPrefix(const string16& prefix, size_t num_components) +URLPrefix::URLPrefix(const base::string16& prefix, size_t num_components) : prefix(prefix), num_components(num_components) { } @@ -30,7 +30,7 @@ const URLPrefixes& URLPrefix::GetURLPrefixes() { } // static -bool URLPrefix::IsURLPrefix(const string16& prefix) { +bool URLPrefix::IsURLPrefix(const base::string16& prefix) { const URLPrefixes& list = GetURLPrefixes(); for (URLPrefixes::const_iterator i = list.begin(); i != list.end(); ++i) if (i->prefix == prefix) @@ -39,8 +39,8 @@ bool URLPrefix::IsURLPrefix(const string16& prefix) { } // static -const URLPrefix* URLPrefix::BestURLPrefix(const string16& text, - const string16& prefix_suffix) { +const URLPrefix* URLPrefix::BestURLPrefix(const base::string16& text, + const base::string16& prefix_suffix) { const URLPrefixes& list = GetURLPrefixes(); for (URLPrefixes::const_iterator i = list.begin(); i != list.end(); ++i) if (StartsWith(text, i->prefix + prefix_suffix, false)) diff --git a/chrome/browser/autocomplete/url_prefix.h b/chrome/browser/autocomplete/url_prefix.h index a893f3a..962e73e 100644 --- a/chrome/browser/autocomplete/url_prefix.h +++ b/chrome/browser/autocomplete/url_prefix.h @@ -15,22 +15,22 @@ typedef std::vector<URLPrefix> URLPrefixes; // A URL prefix; combinations of schemes and (least significant) domain labels // that may be inferred from certain URL-like input strings. struct URLPrefix { - URLPrefix(const string16& prefix, size_t num_components); + URLPrefix(const base::string16& prefix, size_t num_components); // Returns a vector of URL prefixes sorted by descending number of components. static const URLPrefixes& GetURLPrefixes(); // Returns if the argument is a valid URL prefix. - static bool IsURLPrefix(const string16& prefix); + static bool IsURLPrefix(const base::string16& prefix); // Returns the URL prefix of |text| with the most components, or NULL. // |prefix_suffix| (which may be empty) is appended to every attempted prefix, // which is useful for finding the innermost match of user input in a URL. // Performs case insensitive string comparison. - static const URLPrefix* BestURLPrefix(const string16& text, - const string16& prefix_suffix); + static const URLPrefix* BestURLPrefix(const base::string16& text, + const base::string16& prefix_suffix); - string16 prefix; + base::string16 prefix; // The number of URL components (scheme, domain label, etc.) in the prefix. // For example, "http://foo.com" and "www.bar.com" each have one component, diff --git a/chrome/browser/autocomplete/zero_suggest_provider.cc b/chrome/browser/autocomplete/zero_suggest_provider.cc index 0d73acc..8366ab9 100644 --- a/chrome/browser/autocomplete/zero_suggest_provider.cc +++ b/chrome/browser/autocomplete/zero_suggest_provider.cc @@ -147,7 +147,7 @@ void ZeroSuggestProvider::OnURLFetchComplete(const net::URLFetcher* source) { void ZeroSuggestProvider::StartZeroSuggest( const GURL& current_page_url, AutocompleteInput::PageClassification page_classification, - const string16& permanent_text) { + const base::string16& permanent_text) { Stop(true); field_trial_triggered_ = false; field_trial_triggered_in_session_ = false; @@ -160,7 +160,7 @@ void ZeroSuggestProvider::StartZeroSuggest( template_url_service_->GetDefaultSearchProvider(); if (default_provider == NULL) return; - string16 prefix; + base::string16 prefix; TemplateURLRef::SearchTermsArgs search_term_args(prefix); search_term_args.current_page_url = current_query_; GURL suggest_url(default_provider->suggestions_url_ref(). @@ -200,7 +200,7 @@ void ZeroSuggestProvider::FillResults( int* verbatim_relevance, SearchProvider::SuggestResults* suggest_results, SearchProvider::NavigationResults* navigation_results) { - string16 query; + base::string16 query; const ListValue* root_list = NULL; const ListValue* results = NULL; const ListValue* relevances = NULL; @@ -242,7 +242,7 @@ void ZeroSuggestProvider::FillResults( suggest_results->clear(); navigation_results->clear(); - string16 result, title; + base::string16 result, title; std::string type; for (size_t index = 0; results->GetString(index, &result); ++index) { // Google search may return empty suggestions for weird input characters, @@ -266,7 +266,7 @@ void ZeroSuggestProvider::FillResults( } } else { suggest_results->push_back(SearchProvider::SuggestResult( - result, result, string16(), std::string(), std::string(), false, + result, result, base::string16(), std::string(), std::string(), false, relevance, relevances != NULL, false)); } } @@ -285,7 +285,7 @@ void ZeroSuggestProvider::AddSuggestResultsToMap( void ZeroSuggestProvider::AddMatchToMap(int relevance, AutocompleteMatch::Type type, const TemplateURL* template_url, - const string16& query_string, + const base::string16& query_string, int accepted_suggestion, SearchProvider::MatchMap* map) { // Pass in query_string as the input_text since we don't want any bolding. @@ -293,7 +293,7 @@ void ZeroSuggestProvider::AddMatchToMap(int relevance, // of passing in -1. AutocompleteMatch match = SearchProvider::CreateSearchSuggestion( this, AutocompleteInput(), query_string, relevance, type, false, - query_string, string16(), template_url, query_string, std::string(), + query_string, base::string16(), template_url, query_string, std::string(), accepted_suggestion, -1, true); if (!match.destination_url.is_valid()) return; @@ -443,7 +443,7 @@ void ZeroSuggestProvider::ConvertResultsToAutocompleteMatches() { } AutocompleteMatch ZeroSuggestProvider::MatchForCurrentURL() { - AutocompleteInput input(permanent_text_, string16::npos, string16(), + AutocompleteInput input(permanent_text_, base::string16::npos, base::string16(), GURL(current_query_), current_page_classification_, false, false, true, AutocompleteInput::ALL_MATCHES); diff --git a/chrome/browser/autocomplete/zero_suggest_provider.h b/chrome/browser/autocomplete/zero_suggest_provider.h index 5fb9bec..41d6b04 100644 --- a/chrome/browser/autocomplete/zero_suggest_provider.h +++ b/chrome/browser/autocomplete/zero_suggest_provider.h @@ -76,7 +76,7 @@ class ZeroSuggestProvider : public AutocompleteProvider, void StartZeroSuggest( const GURL& curent_page_url, AutocompleteInput::PageClassification page_classification, - const string16& permanent_text); + const base::string16& permanent_text); bool field_trial_triggered_in_session() const { return field_trial_triggered_in_session_; @@ -117,7 +117,7 @@ class ZeroSuggestProvider : public AutocompleteProvider, void AddMatchToMap(int relevance, AutocompleteMatch::Type type, const TemplateURL* template_url, - const string16& query_string, + const base::string16& query_string, int accepted_suggestion, SearchProvider::MatchMap* map); @@ -157,7 +157,7 @@ class ZeroSuggestProvider : public AutocompleteProvider, AutocompleteInput::PageClassification current_page_classification_; // Copy of OmniboxEditModel::permanent_text_. - string16 permanent_text_; + base::string16 permanent_text_; // Fetcher used to retrieve results. scoped_ptr<net::URLFetcher> fetcher_; diff --git a/chrome/browser/autofill/autofill_browsertest.cc b/chrome/browser/autofill/autofill_browsertest.cc index 75e7262..cbc132e 100644 --- a/chrome/browser/autofill/autofill_browsertest.cc +++ b/chrome/browser/autofill/autofill_browsertest.cc @@ -499,10 +499,10 @@ IN_PROC_BROWSER_TEST_F(AutofillTest, SubmitCreditCard("Jane Doe", "4417-1234-5678-9113", "10", "2013"); ASSERT_EQ(2u, personal_data_manager()->GetCreditCards().size()); - string16 cc1 = personal_data_manager()->GetCreditCards()[0]->GetRawInfo( + base::string16 cc1 = personal_data_manager()->GetCreditCards()[0]->GetRawInfo( CREDIT_CARD_NUMBER); ASSERT_TRUE(autofill::IsValidCreditCardNumber(cc1)); - string16 cc2 = personal_data_manager()->GetCreditCards()[1]->GetRawInfo( + base::string16 cc2 = personal_data_manager()->GetCreditCards()[1]->GetRawInfo( CREDIT_CARD_NUMBER); ASSERT_TRUE(autofill::IsValidCreditCardNumber(cc2)); } @@ -640,7 +640,7 @@ IN_PROC_BROWSER_TEST_F(AutofillTest, AppendCountryCodeForAggregatedPhones) { FillFormAndSubmit("autofill_test_form.html", data); ASSERT_EQ(1u, personal_data_manager()->GetProfiles().size()); - string16 phone = personal_data_manager()->GetProfiles()[0]->GetRawInfo( + base::string16 phone = personal_data_manager()->GetProfiles()[0]->GetRawInfo( PHONE_HOME_WHOLE_NUMBER); ASSERT_TRUE(StartsWith(phone, ASCIIToUTF16("+49"), true)); } diff --git a/chrome/browser/autofill/autofill_cc_infobar_delegate.cc b/chrome/browser/autofill/autofill_cc_infobar_delegate.cc index 91842cd..997577d 100644 --- a/chrome/browser/autofill/autofill_cc_infobar_delegate.cc +++ b/chrome/browser/autofill/autofill_cc_infobar_delegate.cc @@ -73,11 +73,12 @@ bool AutofillCCInfoBarDelegate::ShouldExpireInternal( return false; } -string16 AutofillCCInfoBarDelegate::GetMessageText() const { +base::string16 AutofillCCInfoBarDelegate::GetMessageText() const { return l10n_util::GetStringUTF16(IDS_AUTOFILL_CC_INFOBAR_TEXT); } -string16 AutofillCCInfoBarDelegate::GetButtonLabel(InfoBarButton button) const { +base::string16 AutofillCCInfoBarDelegate::GetButtonLabel( + InfoBarButton button) const { return l10n_util::GetStringUTF16((button == BUTTON_OK) ? IDS_AUTOFILL_CC_INFOBAR_ACCEPT : IDS_AUTOFILL_CC_INFOBAR_DENY); } @@ -94,7 +95,7 @@ bool AutofillCCInfoBarDelegate::Cancel() { return true; } -string16 AutofillCCInfoBarDelegate::GetLinkText() const { +base::string16 AutofillCCInfoBarDelegate::GetLinkText() const { return l10n_util::GetStringUTF16(IDS_LEARN_MORE); } diff --git a/chrome/browser/autofill/autofill_cc_infobar_delegate.h b/chrome/browser/autofill/autofill_cc_infobar_delegate.h index 6e36e2b..d0dff50 100644 --- a/chrome/browser/autofill/autofill_cc_infobar_delegate.h +++ b/chrome/browser/autofill/autofill_cc_infobar_delegate.h @@ -56,11 +56,11 @@ class AutofillCCInfoBarDelegate : public ConfirmInfoBarDelegate { virtual Type GetInfoBarType() const OVERRIDE; virtual bool ShouldExpireInternal( const content::LoadCommittedDetails& details) const OVERRIDE; - virtual string16 GetMessageText() const OVERRIDE; - virtual string16 GetButtonLabel(InfoBarButton button) const OVERRIDE; + virtual base::string16 GetMessageText() const OVERRIDE; + virtual base::string16 GetButtonLabel(InfoBarButton button) const OVERRIDE; virtual bool Accept() OVERRIDE; virtual bool Cancel() OVERRIDE; - virtual string16 GetLinkText() const OVERRIDE; + virtual base::string16 GetLinkText() const OVERRIDE; virtual bool LinkClicked(WindowOpenDisposition disposition) OVERRIDE; // For logging UMA metrics. diff --git a/chrome/browser/autofill/autofill_driver_impl_browsertest.cc b/chrome/browser/autofill/autofill_driver_impl_browsertest.cc index c868cc6..4fe1b88 100644 --- a/chrome/browser/autofill/autofill_driver_impl_browsertest.cc +++ b/chrome/browser/autofill/autofill_driver_impl_browsertest.cc @@ -41,9 +41,9 @@ class MockAutofillManagerDelegate MOCK_METHOD7(ShowAutofillPopup, void(const gfx::RectF& element_bounds, base::i18n::TextDirection text_direction, - const std::vector<string16>& values, - const std::vector<string16>& labels, - const std::vector<string16>& icons, + const std::vector<base::string16>& values, + const std::vector<base::string16>& labels, + const std::vector<base::string16>& icons, const std::vector<int>& identifiers, base::WeakPtr<AutofillPopupDelegate> delegate)); diff --git a/chrome/browser/autofill/autofill_interactive_uitest.cc b/chrome/browser/autofill/autofill_interactive_uitest.cc index dcc3810..5ea8a0d 100644 --- a/chrome/browser/autofill/autofill_interactive_uitest.cc +++ b/chrome/browser/autofill/autofill_interactive_uitest.cc @@ -1023,13 +1023,13 @@ IN_PROC_BROWSER_TEST_F(AutofillInteractiveTest, std::vector<AutofillProfile> profiles; for (int i = 0; i < kNumProfiles; i++) { AutofillProfile profile; - string16 name(base::IntToString16(i)); - string16 email(name + ASCIIToUTF16("@example.com")); - string16 street = ASCIIToUTF16( + base::string16 name(base::IntToString16(i)); + base::string16 email(name + ASCIIToUTF16("@example.com")); + base::string16 street = ASCIIToUTF16( base::IntToString(base::RandInt(0, 10000)) + " " + streets[base::RandInt(0, streets.size() - 1)]); - string16 city = ASCIIToUTF16(cities[base::RandInt(0, cities.size() - 1)]); - string16 zip(base::IntToString16(base::RandInt(0, 10000))); + base::string16 city = ASCIIToUTF16(cities[base::RandInt(0, cities.size() - 1)]); + base::string16 zip(base::IntToString16(base::RandInt(0, 10000))); profile.SetRawInfo(NAME_FIRST, name); profile.SetRawInfo(EMAIL_ADDRESS, email); profile.SetRawInfo(ADDRESS_HOME_LINE1, street); diff --git a/chrome/browser/automation/automation_provider.cc b/chrome/browser/automation/automation_provider.cc index 6905cf5..85807f6 100644 --- a/chrome/browser/automation/automation_provider.cc +++ b/chrome/browser/automation/automation_provider.cc @@ -512,7 +512,7 @@ void AutomationProvider::HandleFindRequest( void AutomationProvider::SendFindRequest( WebContents* web_contents, bool with_json, - const string16& search_string, + const base::string16& search_string, bool forward, bool match_case, bool find_next, diff --git a/chrome/browser/automation/automation_provider.h b/chrome/browser/automation/automation_provider.h index a97b6d2..27bde33 100644 --- a/chrome/browser/automation/automation_provider.h +++ b/chrome/browser/automation/automation_provider.h @@ -200,7 +200,7 @@ class AutomationProvider void SendFindRequest( content::WebContents* web_contents, bool with_json, - const string16& search_string, + const base::string16& search_string, bool forward, bool match_case, bool find_next, diff --git a/chrome/browser/automation/testing_automation_provider.cc b/chrome/browser/automation/testing_automation_provider.cc index 9aab860..e5d403e 100644 --- a/chrome/browser/automation/testing_automation_provider.cc +++ b/chrome/browser/automation/testing_automation_provider.cc @@ -900,7 +900,7 @@ void TestingAutomationProvider::DragAndDropFilePaths( // Emulate drag and drop to set the file paths to the file upload control. content::DropData drop_data; for (size_t path_index = 0; path_index < paths->GetSize(); ++path_index) { - string16 path; + base::string16 path; if (!paths->GetString(path_index, &path)) { AutomationJSONReply(this, reply_message) .SendError("'paths' contains a non-string type"); @@ -908,7 +908,7 @@ void TestingAutomationProvider::DragAndDropFilePaths( } drop_data.filenames.push_back( - content::DropData::FileInfo(path, string16())); + content::DropData::FileInfo(path, base::string16())); } const gfx::Point client(x, y); @@ -1001,8 +1001,8 @@ void TestingAutomationProvider::GetTabURL(int handle, } void TestingAutomationProvider::ExecuteJavascriptInRenderViewFrame( - const string16& frame_xpath, - const string16& script, + const base::string16& frame_xpath, + const base::string16& script, IPC::Message* reply_message, RenderViewHost* render_view_host) { // Set the routing id of this message with the controller. @@ -1041,7 +1041,7 @@ void TestingAutomationProvider::OpenNewBrowserWindowWithNewProfile( ProfileManager* profile_manager = g_browser_process->profile_manager(); new BrowserOpenedWithNewProfileNotificationObserver(this, reply_message); profile_manager->CreateMultiProfileAsync( - string16(), string16(), ProfileManager::CreateCallback(), std::string()); + base::string16(), base::string16(), ProfileManager::CreateCallback(), std::string()); } // Sample json input: { "command": "GetMultiProfileInfo" } @@ -1298,7 +1298,7 @@ void TestingAutomationProvider::AddBookmark( AutomationJSONReply reply(this, reply_message); Browser* browser; std::string error_msg, url; - string16 title; + base::string16 title; int parent_id, index; bool folder; if (!GetBrowserFromJSONArgs(args, &browser, &error_msg)) { @@ -1396,7 +1396,7 @@ void TestingAutomationProvider::SetBookmarkTitle(DictionaryValue* args, AutomationJSONReply reply(this, reply_message); Browser* browser; std::string error_msg; - string16 title; + base::string16 title; int id; if (!GetBrowserFromJSONArgs(args, &browser, &error_msg)) { reply.SendError(error_msg); @@ -2417,7 +2417,7 @@ void TestingAutomationProvider::GetHistoryInfo(Browser* browser, IPC::Message* reply_message) { consumer_.CancelAllRequests(); - string16 search_text; + base::string16 search_text; args->GetString("search_text", &search_text); // Fetch history. @@ -2706,8 +2706,8 @@ void TestingAutomationProvider::AddOrEditSearchEngine( IPC::Message* reply_message) { TemplateURLService* url_model = TemplateURLServiceFactory::GetForProfile(browser->profile()); - string16 new_title; - string16 new_keyword; + base::string16 new_title; + base::string16 new_keyword; std::string new_url; std::string keyword; if (!args->GetString("new_title", &new_title) || @@ -2923,7 +2923,7 @@ void TestingAutomationProvider::GetOmniboxInfo(Browser* browser, void TestingAutomationProvider::SetOmniboxText(Browser* browser, DictionaryValue* args, IPC::Message* reply_message) { - string16 text; + base::string16 text; AutomationJSONReply reply(this, reply_message); if (!args->GetString("text", &text)) { reply.SendError("text missing"); @@ -3162,16 +3162,16 @@ autofill::PasswordForm GetPasswordFormFromDict( time = base::Time::FromDoubleT(dt); std::string signon_realm; - string16 username_value; - string16 password_value; - string16 origin_url_text; - string16 username_element; - string16 password_element; - string16 submit_element; - string16 action_target_text; + base::string16 username_value; + base::string16 password_value; + base::string16 origin_url_text; + base::string16 username_element; + base::string16 password_element; + base::string16 submit_element; + base::string16 action_target_text; bool blacklist; - string16 old_password_element; - string16 old_password_value; + base::string16 old_password_element; + base::string16 old_password_value; // We don't care if any of these fail - they are either optional or checked // before this function is called. @@ -3351,7 +3351,7 @@ void TestingAutomationProvider::FindInPage( AutomationJSONReply(this, reply_message).SendError(error_message); return; } - string16 search_string; + base::string16 search_string; bool forward; bool match_case; bool find_next; @@ -4077,7 +4077,7 @@ bool TestingAutomationProvider::BuildWebKeyEventFromArgs( NativeWebKeyboardEvent* event) { int type, modifiers; bool is_system_key; - string16 unmodified_text, text; + base::string16 unmodified_text, text; std::string key_identifier; if (!args->GetInteger("type", &type)) { *error = "'type' missing or invalid."; @@ -4129,12 +4129,12 @@ bool TestingAutomationProvider::BuildWebKeyEventFromArgs( return false; } - string16 unmodified_text_truncated = unmodified_text.substr( + base::string16 unmodified_text_truncated = unmodified_text.substr( 0, blink::WebKeyboardEvent::textLengthCap - 1); memcpy(event->unmodifiedText, unmodified_text_truncated.c_str(), unmodified_text_truncated.length() + 1); - string16 text_truncated = text.substr( + base::string16 text_truncated = text.substr( 0, blink::WebKeyboardEvent::textLengthCap - 1); memcpy(event->text, text_truncated.c_str(), text_truncated.length() + 1); @@ -4721,7 +4721,7 @@ void TestingAutomationProvider::ExecuteJavascriptJSON( if (SendErrorIfModalDialogActive(this, reply_message)) return; - string16 frame_xpath, javascript; + base::string16 frame_xpath, javascript; std::string error; RenderViewHost* render_view; if (!GetRenderViewFromJSONArgs(args, profile(), &render_view, &error)) { @@ -4747,7 +4747,7 @@ void TestingAutomationProvider::ExecuteJavascriptJSON( void TestingAutomationProvider::ExecuteJavascriptInRenderView( DictionaryValue* args, IPC::Message* reply_message) { - string16 frame_xpath, javascript, extension_id, url_text; + base::string16 frame_xpath, javascript, extension_id, url_text; int render_process_id, render_view_id; if (!args->GetString("frame_xpath", &frame_xpath)) { AutomationJSONReply(this, reply_message) diff --git a/chrome/browser/automation/testing_automation_provider.h b/chrome/browser/automation/testing_automation_provider.h index 5129527..05ff049 100644 --- a/chrome/browser/automation/testing_automation_provider.h +++ b/chrome/browser/automation/testing_automation_provider.h @@ -1334,7 +1334,7 @@ class TestingAutomationProvider : public AutomationProvider, // Execute Javascript in the context of a specific render view. void ExecuteJavascriptInRenderViewFrame( - const string16& frame_xpath, const string16& script, + const base::string16& frame_xpath, const base::string16& script, IPC::Message* reply_message, content::RenderViewHost* render_view_host); // Selects the given |tab| if not selected already. diff --git a/chrome/browser/automation/testing_automation_provider_chromeos.cc b/chrome/browser/automation/testing_automation_provider_chromeos.cc index 3491c7c..23ba941 100644 --- a/chrome/browser/automation/testing_automation_provider_chromeos.cc +++ b/chrome/browser/automation/testing_automation_provider_chromeos.cc @@ -513,9 +513,9 @@ void TestingAutomationProvider::GetTimeInfo(Browser* browser, prefs::kUse24HourClock); base::HourClockType hour_clock_type = use_24hour_clock ? base::k24HourClock : base::k12HourClock; - string16 display_time = base::TimeFormatTimeOfDayWithHourClockType( + base::string16 display_time = base::TimeFormatTimeOfDayWithHourClockType( time, hour_clock_type, base::kDropAmPm); - string16 timezone = + base::string16 timezone = chromeos::system::TimezoneSettings::GetInstance()->GetCurrentTimezoneID(); return_value->SetString("display_time", display_time); return_value->SetString("display_date", base::TimeFormatFriendlyDate(time)); diff --git a/chrome/browser/background/background_application_list_model.cc b/chrome/browser/background/background_application_list_model.cc index 0d950d6..0157956 100644 --- a/chrome/browser/background/background_application_list_model.cc +++ b/chrome/browser/background/background_application_list_model.cc @@ -316,7 +316,7 @@ bool BackgroundApplicationListModel::IsBackgroundApp( BackgroundContentsService* service = BackgroundContentsServiceFactory::GetForProfile(profile); - string16 app_id = ASCIIToUTF16(extension.id()); + base::string16 app_id = ASCIIToUTF16(extension.id()); // If we have an active or registered background contents for this app, then // it's a background app. This covers the cases where the app has created its // background contents, but it hasn't navigated yet, or the background diff --git a/chrome/browser/background/background_contents_service.cc b/chrome/browser/background/background_contents_service.cc index 8fe6d771..4579cbd 100644 --- a/chrome/browser/background/background_contents_service.cc +++ b/chrome/browser/background/background_contents_service.cc @@ -158,7 +158,7 @@ class CrashNotificationDelegate : public NotificationDelegate { #if defined(ENABLE_NOTIFICATIONS) void NotificationImageReady( const std::string extension_name, - const string16 message, + const base::string16 message, const GURL extension_url, scoped_refptr<CrashNotificationDelegate> delegate, Profile* profile, @@ -168,12 +168,12 @@ void NotificationImageReady( ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); notification_icon = rb.GetImageNamed(IDR_EXTENSION_DEFAULT_ICON); } - string16 title; // no notification title + base::string16 title; // no notification title DesktopNotificationService::AddIconNotification(extension_url, title, message, notification_icon, - string16(), + base::string16(), delegate.get(), profile); } @@ -183,7 +183,7 @@ void NotificationImageReady( // extension. void ShowBalloon(const Extension* extension, Profile* profile) { #if defined(ENABLE_NOTIFICATIONS) - const string16 message = l10n_util::GetStringFUTF16( + const base::string16 message = l10n_util::GetStringFUTF16( extension->is_app() ? IDS_BACKGROUND_CRASHED_APP_BALLOON_MESSAGE : IDS_BACKGROUND_CRASHED_EXTENSION_BALLOON_MESSAGE, UTF8ToUTF16(extension->name())); @@ -362,7 +362,7 @@ void BackgroundContentsService::Observe( BackgroundContents* bgcontents = content::Details<BackgroundContents>(details).ptr(); Profile* profile = content::Source<Profile>(source).ptr(); - const string16& appid = GetParentApplicationId(bgcontents); + const base::string16& appid = GetParentApplicationId(bgcontents); ExtensionService* extension_service = extensions::ExtensionSystem::Get(profile)->extension_service(); // extension_service can be NULL when running tests. @@ -573,7 +573,7 @@ void BackgroundContentsService::LoadBackgroundContentsFromDictionary( dict == NULL) return; - string16 frame_name; + base::string16 frame_name; std::string url; dict->GetString(kUrlKey, &url); dict->GetString(kFrameNameKey, &frame_name); @@ -603,8 +603,8 @@ void BackgroundContentsService::LoadBackgroundContentsFromManifests( void BackgroundContentsService::LoadBackgroundContents( Profile* profile, const GURL& url, - const string16& frame_name, - const string16& application_id) { + const base::string16& frame_name, + const base::string16& application_id) { // We are depending on the fact that we will initialize before any user // actions or session restore can take place, so no BackgroundContents should // be running yet for the passed application_id. @@ -632,8 +632,8 @@ BackgroundContents* BackgroundContentsService::CreateBackgroundContents( SiteInstance* site, int routing_id, Profile* profile, - const string16& frame_name, - const string16& application_id, + const base::string16& frame_name, + const base::string16& application_id, const std::string& partition_id, content::SessionStorageNamespace* session_storage_namespace) { BackgroundContents* contents = new BackgroundContents( @@ -667,7 +667,7 @@ void BackgroundContentsService::RegisterBackgroundContents( // feedback (http://crbug.com/47118). DictionaryPrefUpdate update(prefs_, prefs::kRegisteredBackgroundContents); DictionaryValue* pref = update.Get(); - const string16& appid = GetParentApplicationId(background_contents); + const base::string16& appid = GetParentApplicationId(background_contents); DictionaryValue* current; if (pref->GetDictionaryWithoutPathExpansion(UTF16ToUTF8(appid), ¤t)) return; @@ -680,7 +680,7 @@ void BackgroundContentsService::RegisterBackgroundContents( } bool BackgroundContentsService::HasRegisteredBackgroundContents( - const string16& app_id) { + const base::string16& app_id) { if (!prefs_) return false; std::string app = UTF16ToUTF8(app_id); @@ -694,13 +694,13 @@ void BackgroundContentsService::UnregisterBackgroundContents( if (!prefs_) return; DCHECK(IsTracked(background_contents)); - const string16 appid = GetParentApplicationId(background_contents); + const base::string16 appid = GetParentApplicationId(background_contents); DictionaryPrefUpdate update(prefs_, prefs::kRegisteredBackgroundContents); update.Get()->RemoveWithoutPathExpansion(UTF16ToUTF8(appid), NULL); } void BackgroundContentsService::ShutdownAssociatedBackgroundContents( - const string16& appid) { + const base::string16& appid) { BackgroundContents* contents = GetAppBackgroundContents(appid); if (contents) { UnregisterBackgroundContents(contents); @@ -731,17 +731,17 @@ void BackgroundContentsService::BackgroundContentsShutdown( BackgroundContents* background_contents) { // Remove the passed object from our list. DCHECK(IsTracked(background_contents)); - string16 appid = GetParentApplicationId(background_contents); + base::string16 appid = GetParentApplicationId(background_contents); contents_map_.erase(appid); } BackgroundContents* BackgroundContentsService::GetAppBackgroundContents( - const string16& application_id) { + const base::string16& application_id) { BackgroundContentsMap::const_iterator it = contents_map_.find(application_id); return (it != contents_map_.end()) ? it->second.contents : NULL; } -const string16& BackgroundContentsService::GetParentApplicationId( +const base::string16& BackgroundContentsService::GetParentApplicationId( BackgroundContents* contents) const { for (BackgroundContentsMap::const_iterator it = contents_map_.begin(); it != contents_map_.end(); ++it) { diff --git a/chrome/browser/background/background_contents_service.h b/chrome/browser/background/background_contents_service.h index 85f8288..cfbf927 100644 --- a/chrome/browser/background/background_contents_service.h +++ b/chrome/browser/background/background_contents_service.h @@ -63,13 +63,13 @@ class BackgroundContentsService : private content::NotificationObserver, // Returns the BackgroundContents associated with the passed application id, // or NULL if none. - BackgroundContents* GetAppBackgroundContents(const string16& appid); + BackgroundContents* GetAppBackgroundContents(const base::string16& appid); // Returns true if there's a registered BackgroundContents for this app. It // is possible for this routine to return true when GetAppBackgroundContents() // returns false, if the BackgroundContents closed due to the render process // crashing. - bool HasRegisteredBackgroundContents(const string16& appid); + bool HasRegisteredBackgroundContents(const base::string16& appid); // Returns all currently opened BackgroundContents (used by the task manager). std::vector<BackgroundContents*> GetBackgroundContents() const; @@ -84,7 +84,7 @@ class BackgroundContentsService : private content::NotificationObserver, // Gets the parent application id for the passed BackgroundContents. Returns // an empty string if no parent application found (e.g. passed // BackgroundContents has already shut down). - const string16& GetParentApplicationId(BackgroundContents* contents) const; + const base::string16& GetParentApplicationId(BackgroundContents* contents) const; // Creates a new BackgroundContents using the passed |site| and // the |route_id| and begins tracking the object internally so it can be @@ -96,8 +96,8 @@ class BackgroundContentsService : private content::NotificationObserver, content::SiteInstance* site, int route_id, Profile* profile, - const string16& frame_name, - const string16& application_id, + const base::string16& frame_name, + const base::string16& application_id, const std::string& partition_id, content::SessionStorageNamespace* session_storage_namespace); @@ -154,8 +154,8 @@ class BackgroundContentsService : private content::NotificationObserver, // and navigates to the passed |url|. void LoadBackgroundContents(Profile* profile, const GURL& url, - const string16& frame_name, - const string16& appid); + const base::string16& frame_name, + const base::string16& appid); // Invoked when a new BackgroundContents is opened. void BackgroundContentsOpened(BackgroundContentsOpenedDetails* details); @@ -174,7 +174,7 @@ class BackgroundContentsService : private content::NotificationObserver, // Unregisters and deletes the BackgroundContents associated with the // passed extension. - void ShutdownAssociatedBackgroundContents(const string16& appid); + void ShutdownAssociatedBackgroundContents(const base::string16& appid); // Returns true if this BackgroundContents is in the contents_list_. bool IsTracked(BackgroundContents* contents) const; @@ -197,7 +197,7 @@ class BackgroundContentsService : private content::NotificationObserver, // The BackgroundContents whose information we are tracking. BackgroundContents* contents; // The name of the top level frame for this BackgroundContents. - string16 frame_name; + base::string16 frame_name; }; // Map associating currently loaded BackgroundContents with their parent diff --git a/chrome/browser/background/background_contents_service_unittest.cc b/chrome/browser/background/background_contents_service_unittest.cc index 41228c4c..30e0f0a 100644 --- a/chrome/browser/background/background_contents_service_unittest.cc +++ b/chrome/browser/background/background_contents_service_unittest.cc @@ -37,7 +37,7 @@ class BackgroundContentsServiceTest : public testing::Test { } // Returns the stored pref URL for the passed app id. - std::string GetPrefURLForApp(Profile* profile, const string16& appid) { + std::string GetPrefURLForApp(Profile* profile, const base::string16& appid) { const DictionaryValue* pref = GetPrefs(profile); EXPECT_TRUE(pref->HasKey(UTF16ToUTF8(appid))); const DictionaryValue* value; @@ -62,7 +62,7 @@ class MockBackgroundContents : public BackgroundContents { } void SendOpenedNotification(BackgroundContentsService* service) { - string16 frame_name = ASCIIToUTF16("background"); + base::string16 frame_name = ASCIIToUTF16("background"); BackgroundContentsOpenedDetails details = { this, frame_name, appid_ }; service->BackgroundContentsOpened(&details); @@ -92,13 +92,13 @@ class MockBackgroundContents : public BackgroundContents { content::Details<BackgroundContents>(this)); } - const string16& appid() { return appid_; } + const base::string16& appid() { return appid_; } private: GURL url_; // The ID of our parent application - string16 appid_; + base::string16 appid_; // Parent profile Profile* profile_; diff --git a/chrome/browser/background/background_mode_manager.cc b/chrome/browser/background/background_mode_manager.cc index 505d6f4..82b88de 100644 --- a/chrome/browser/background/background_mode_manager.cc +++ b/chrome/browser/background/background_mode_manager.cc @@ -153,7 +153,7 @@ void BackgroundModeManager::BackgroundModeData::BuildProfileMenu( } void BackgroundModeManager::BackgroundModeData::SetName( - const string16& new_profile_name) { + const base::string16& new_profile_name) { name_ = new_profile_name; } @@ -268,7 +268,7 @@ void BackgroundModeManager::RegisterProfile(Profile* profile) { // Initially set the name for this background mode data. size_t index = profile_cache_->GetIndexOfProfileWithPath(profile->GetPath()); - string16 name = l10n_util::GetStringUTF16(IDS_PROFILES_DEFAULT_NAME); + base::string16 name = l10n_util::GetStringUTF16(IDS_PROFILES_DEFAULT_NAME); if (index != std::string::npos) name = profile_cache_->GetNameOfProfileAtIndex(index); bmd->SetName(name); @@ -431,7 +431,7 @@ void BackgroundModeManager::OnApplicationListChanged(Profile* profile) { void BackgroundModeManager::OnProfileAdded(const base::FilePath& profile_path) { ProfileInfoCache& cache = g_browser_process->profile_manager()->GetProfileInfoCache(); - string16 profile_name = cache.GetNameOfProfileAtIndex( + base::string16 profile_name = cache.GetNameOfProfileAtIndex( cache.GetIndexOfProfileWithPath(profile_path)); // At this point, the profile should be registered with the background mode // manager, but when it's actually added to the cache is when its name is @@ -452,7 +452,7 @@ void BackgroundModeManager::OnProfileWillBeRemoved( const base::FilePath& profile_path) { ProfileInfoCache& cache = g_browser_process->profile_manager()->GetProfileInfoCache(); - string16 profile_name = cache.GetNameOfProfileAtIndex( + base::string16 profile_name = cache.GetNameOfProfileAtIndex( cache.GetIndexOfProfileWithPath(profile_path)); // Remove the profile from our map of profiles. BackgroundModeInfoMap::iterator it = @@ -466,10 +466,10 @@ void BackgroundModeManager::OnProfileWillBeRemoved( void BackgroundModeManager::OnProfileNameChanged( const base::FilePath& profile_path, - const string16& old_profile_name) { + const base::string16& old_profile_name) { ProfileInfoCache& cache = g_browser_process->profile_manager()->GetProfileInfoCache(); - string16 new_profile_name = cache.GetNameOfProfileAtIndex( + base::string16 new_profile_name = cache.GetNameOfProfileAtIndex( cache.GetIndexOfProfileWithPath(profile_path)); BackgroundModeInfoMap::const_iterator it = GetBackgroundModeIterator(old_profile_name); @@ -803,7 +803,7 @@ BackgroundModeManager::GetBackgroundModeData(Profile* const profile) const { BackgroundModeManager::BackgroundModeInfoMap::iterator BackgroundModeManager::GetBackgroundModeIterator( - const string16& profile_name) { + const base::string16& profile_name) { BackgroundModeInfoMap::iterator profile_it = background_mode_data_.end(); for (BackgroundModeInfoMap::iterator it = diff --git a/chrome/browser/background/background_mode_manager.h b/chrome/browser/background/background_mode_manager.h index c0b4bfb..b86f12a5 100644 --- a/chrome/browser/background/background_mode_manager.h +++ b/chrome/browser/background/background_mode_manager.h @@ -139,11 +139,11 @@ class BackgroundModeManager // Set the name associated with this background mode data for displaying in // the status tray. - void SetName(const string16& new_profile_name); + void SetName(const base::string16& new_profile_name); // The name associated with this background mode data. This should match // the name in the ProfileInfoCache for this profile. - string16 name(); + base::string16 name(); // Used for sorting BackgroundModeData*s. static bool BackgroundModeDataCompare(const BackgroundModeData* bmd1, @@ -151,7 +151,7 @@ class BackgroundModeManager private: // Name associated with this profile which is used to label its submenu. - string16 name_; + base::string16 name_; // The profile associated with this background app data. Profile* profile_; @@ -191,8 +191,9 @@ class BackgroundModeManager virtual void OnProfileAdded(const base::FilePath& profile_path) OVERRIDE; virtual void OnProfileWillBeRemoved( const base::FilePath& profile_path) OVERRIDE; - virtual void OnProfileNameChanged(const base::FilePath& profile_path, - const string16& old_profile_name) OVERRIDE; + virtual void OnProfileNameChanged( + const base::FilePath& profile_path, + const base::string16& old_profile_name) OVERRIDE; // Overrides from StatusIconMenuModel::Delegate implementation. virtual void ExecuteCommand(int command_id, int event_flags) OVERRIDE; @@ -242,7 +243,7 @@ class BackgroundModeManager // Return an appropriate name for a Preferences menu entry. Preferences is // sometimes called Options or Settings. - string16 GetPreferencesMenuLabel(); + base::string16 GetPreferencesMenuLabel(); // Create a status tray icon to allow the user to shutdown Chrome when running // in background mode. Virtual to enable testing. @@ -267,7 +268,7 @@ class BackgroundModeManager // This should not be used to iterate over the background mode data. It is // used to efficiently delete an item from the background mode data map. BackgroundModeInfoMap::iterator GetBackgroundModeIterator( - const string16& profile_name); + const base::string16& profile_name); // Returns true if the "Let chrome run in the background" pref is checked. // (virtual to allow overriding in tests). diff --git a/chrome/browser/background/background_mode_manager_aura.cc b/chrome/browser/background/background_mode_manager_aura.cc index d87377c..459a7cb 100644 --- a/chrome/browser/background/background_mode_manager_aura.cc +++ b/chrome/browser/background/background_mode_manager_aura.cc @@ -19,6 +19,6 @@ void BackgroundModeManager::DisplayAppInstalledNotification( NOTIMPLEMENTED(); } -string16 BackgroundModeManager::GetPreferencesMenuLabel() { +base::string16 BackgroundModeManager::GetPreferencesMenuLabel() { return l10n_util::GetStringUTF16(IDS_SETTINGS); } diff --git a/chrome/browser/background/background_mode_manager_chromeos.cc b/chrome/browser/background/background_mode_manager_chromeos.cc index 8f69efb..9c83dbd 100644 --- a/chrome/browser/background/background_mode_manager_chromeos.cc +++ b/chrome/browser/background/background_mode_manager_chromeos.cc @@ -18,6 +18,6 @@ void BackgroundModeManager::DisplayAppInstalledNotification( // the time anyway. } -string16 BackgroundModeManager::GetPreferencesMenuLabel() { +base::string16 BackgroundModeManager::GetPreferencesMenuLabel() { return l10n_util::GetStringUTF16(IDS_SETTINGS); } diff --git a/chrome/browser/background/background_mode_manager_gtk.cc b/chrome/browser/background/background_mode_manager_gtk.cc index 8b3a3f8..a1ef1d9 100644 --- a/chrome/browser/background/background_mode_manager_gtk.cc +++ b/chrome/browser/background/background_mode_manager_gtk.cc @@ -77,8 +77,8 @@ void BackgroundModeManager::DisplayAppInstalledNotification( // http://crbug.com/74970 } -string16 BackgroundModeManager::GetPreferencesMenuLabel() { - string16 result = gtk_util::GetStockPreferencesMenuLabel(); +base::string16 BackgroundModeManager::GetPreferencesMenuLabel() { + base::string16 result = gtk_util::GetStockPreferencesMenuLabel(); if (!result.empty()) return result; return l10n_util::GetStringUTF16(IDS_PREFERENCES); diff --git a/chrome/browser/background/background_mode_manager_mac.mm b/chrome/browser/background/background_mode_manager_mac.mm index 655b34c..68fa906 100644 --- a/chrome/browser/background/background_mode_manager_mac.mm +++ b/chrome/browser/background/background_mode_manager_mac.mm @@ -155,6 +155,6 @@ void BackgroundModeManager::DisplayAppInstalledNotification( // http://crbug.com/74970 } -string16 BackgroundModeManager::GetPreferencesMenuLabel() { +base::string16 BackgroundModeManager::GetPreferencesMenuLabel() { return l10n_util::GetStringUTF16(IDS_OPTIONS); } diff --git a/chrome/browser/background/background_mode_manager_unittest.cc b/chrome/browser/background/background_mode_manager_unittest.cc index 3e0e352..9eb09d2 100644 --- a/chrome/browser/background/background_mode_manager_unittest.cc +++ b/chrome/browser/background/background_mode_manager_unittest.cc @@ -120,10 +120,10 @@ class TestBackgroundModeManager : public BackgroundModeManager { class TestStatusIcon : public StatusIcon { virtual void SetImage(const gfx::ImageSkia& image) OVERRIDE {} virtual void SetPressedImage(const gfx::ImageSkia& image) OVERRIDE {} - virtual void SetToolTip(const string16& tool_tip) OVERRIDE {} + virtual void SetToolTip(const base::string16& tool_tip) OVERRIDE {} virtual void DisplayBalloon(const gfx::ImageSkia& icon, - const string16& title, - const string16& contents) OVERRIDE {} + const base::string16& title, + const base::string16& contents) OVERRIDE {} virtual void UpdatePlatformContextMenu( StatusIconMenuModel* menu) OVERRIDE {} }; diff --git a/chrome/browser/background/background_mode_manager_win.cc b/chrome/browser/background/background_mode_manager_win.cc index 954f3d1..e8865e9 100644 --- a/chrome/browser/background/background_mode_manager_win.cc +++ b/chrome/browser/background/background_mode_manager_win.cc @@ -46,6 +46,6 @@ void BackgroundModeManager::DisplayAppInstalledNotification( l10n_util::GetStringUTF16(IDS_PRODUCT_NAME))); } -string16 BackgroundModeManager::GetPreferencesMenuLabel() { +base::string16 BackgroundModeManager::GetPreferencesMenuLabel() { return l10n_util::GetStringUTF16(IDS_OPTIONS); } diff --git a/chrome/browser/bookmarks/bookmark_codec.cc b/chrome/browser/bookmarks/bookmark_codec.cc index fe1d227..97bc56c 100644 --- a/chrome/browser/bookmarks/bookmark_codec.cc +++ b/chrome/browser/bookmarks/bookmark_codec.cc @@ -113,7 +113,7 @@ Value* BookmarkCodec::EncodeNode(const BookmarkNode* node) { DictionaryValue* value = new DictionaryValue(); std::string id = base::Int64ToString(node->id()); value->SetString(kIdKey, id); - const string16& title = node->GetTitle(); + const base::string16& title = node->GetTitle(); value->SetString(kNameKey, title); value->SetString(kDateAddedKey, base::Int64ToString(node->date_added().ToInternalValue())); @@ -282,7 +282,7 @@ bool BookmarkCodec::DecodeNode(const DictionaryValue& value, maximum_id_ = std::max(maximum_id_, id); - string16 title; + base::string16 title; value.GetString(kNameKey, &title); std::string date_added_string; @@ -450,7 +450,7 @@ void BookmarkCodec::UpdateChecksum(const std::string& str) { base::MD5Update(&md5_context_, str); } -void BookmarkCodec::UpdateChecksum(const string16& str) { +void BookmarkCodec::UpdateChecksum(const base::string16& str) { base::MD5Update(&md5_context_, base::StringPiece( reinterpret_cast<const char*>(str.data()), @@ -458,7 +458,7 @@ void BookmarkCodec::UpdateChecksum(const string16& str) { } void BookmarkCodec::UpdateChecksumWithUrlNode(const std::string& id, - const string16& title, + const base::string16& title, const std::string& url) { DCHECK(IsStringUTF8(url)); UpdateChecksum(id); @@ -468,7 +468,7 @@ void BookmarkCodec::UpdateChecksumWithUrlNode(const std::string& id, } void BookmarkCodec::UpdateChecksumWithFolderNode(const std::string& id, - const string16& title) { + const base::string16& title) { UpdateChecksum(id); UpdateChecksum(title); UpdateChecksum(kTypeFolder); diff --git a/chrome/browser/bookmarks/bookmark_codec.h b/chrome/browser/bookmarks/bookmark_codec.h index ce88617..d35c735 100644 --- a/chrome/browser/bookmarks/bookmark_codec.h +++ b/chrome/browser/bookmarks/bookmark_codec.h @@ -157,7 +157,7 @@ class BookmarkCodec { // Updates the check-sum with the given string. void UpdateChecksum(const std::string& str); - void UpdateChecksum(const string16& str); + void UpdateChecksum(const base::string16& str); // Updates the check-sum with the given contents of URL/folder bookmark node. // NOTE: These functions take in individual properties of a bookmark node @@ -166,10 +166,10 @@ class BookmarkCodec { // and once for computing the check-sum. // The url parameter should be a valid UTF8 string. void UpdateChecksumWithUrlNode(const std::string& id, - const string16& title, + const base::string16& title, const std::string& url); void UpdateChecksumWithFolderNode(const std::string& id, - const string16& title); + const base::string16& title); // Initializes/Finalizes the checksum. void InitializeChecksum(); diff --git a/chrome/browser/bookmarks/bookmark_html_writer_unittest.cc b/chrome/browser/bookmarks/bookmark_html_writer_unittest.cc index 2b70053..09bae52 100644 --- a/chrome/browser/bookmarks/bookmark_html_writer_unittest.cc +++ b/chrome/browser/bookmarks/bookmark_html_writer_unittest.cc @@ -57,8 +57,8 @@ class BookmarkHTMLWriterTest : public testing::Test { // Converts an ImportedBookmarkEntry to a string suitable for assertion // testing. - string16 BookmarkEntryToString(const ImportedBookmarkEntry& entry) { - string16 result; + base::string16 BookmarkEntryToString(const ImportedBookmarkEntry& entry) { + base::string16 result; result.append(ASCIIToUTF16("on_toolbar=")); if (entry.in_toolbar) result.append(ASCIIToUTF16("true")); @@ -83,13 +83,13 @@ class BookmarkHTMLWriterTest : public testing::Test { } // Creates a set of bookmark values to a string for assertion testing. - string16 BookmarkValuesToString(bool on_toolbar, + base::string16 BookmarkValuesToString(bool on_toolbar, const GURL& url, - const string16& title, + const base::string16& title, base::Time creation_time, - const string16& f1, - const string16& f2, - const string16& f3) { + const base::string16& f1, + const base::string16& f2, + const base::string16& f3) { ImportedBookmarkEntry entry; entry.in_toolbar = on_toolbar; entry.url = url; @@ -109,11 +109,11 @@ class BookmarkHTMLWriterTest : public testing::Test { void AssertBookmarkEntryEquals(const ImportedBookmarkEntry& entry, bool on_toolbar, const GURL& url, - const string16& title, + const base::string16& title, base::Time creation_time, - const string16& f1, - const string16& f2, - const string16& f3) { + const base::string16& f1, + const base::string16& f2, + const base::string16& f3) { EXPECT_EQ(BookmarkValuesToString(on_toolbar, url, title, creation_time, f1, f2, f3), BookmarkEntryToString(entry)); @@ -177,15 +177,15 @@ TEST_F(BookmarkHTMLWriterTest, Test) { // Mobile // url1 // <bookmark without a title.> - string16 f1_title = ASCIIToUTF16("F\"&;<1\""); - string16 f2_title = ASCIIToUTF16("F2"); - string16 f3_title = ASCIIToUTF16("F 3"); - string16 f4_title = ASCIIToUTF16("F4"); - string16 url1_title = ASCIIToUTF16("url 1"); - string16 url2_title = ASCIIToUTF16("url&2"); - string16 url3_title = ASCIIToUTF16("url\"3"); - string16 url4_title = ASCIIToUTF16("url\"&;"); - string16 unnamed_bookmark_title = ASCIIToUTF16(""); + base::string16 f1_title = ASCIIToUTF16("F\"&;<1\""); + base::string16 f2_title = ASCIIToUTF16("F2"); + base::string16 f3_title = ASCIIToUTF16("F 3"); + base::string16 f4_title = ASCIIToUTF16("F4"); + base::string16 url1_title = ASCIIToUTF16("url 1"); + base::string16 url2_title = ASCIIToUTF16("url&2"); + base::string16 url3_title = ASCIIToUTF16("url\"3"); + base::string16 url4_title = ASCIIToUTF16("url\"&;"); + base::string16 unnamed_bookmark_title = ASCIIToUTF16(""); GURL url1("http://url1"); GURL url1_favicon("http://url1/icon.ico"); GURL url2("http://url2"); @@ -257,25 +257,31 @@ TEST_F(BookmarkHTMLWriterTest, Test) { // Verify we got back what we wrote. ASSERT_EQ(9U, parsed_bookmarks.size()); // Windows and ChromeOS builds use Sentence case. - string16 bookmark_folder_name = + base::string16 bookmark_folder_name = l10n_util::GetStringUTF16(IDS_BOOKMARK_BAR_FOLDER_NAME); AssertBookmarkEntryEquals(parsed_bookmarks[0], true, url1, url1_title, t1, - bookmark_folder_name, f1_title, string16()); + bookmark_folder_name, f1_title, base::string16()); AssertBookmarkEntryEquals(parsed_bookmarks[1], true, url2, url2_title, t2, bookmark_folder_name, f1_title, f2_title); AssertBookmarkEntryEquals(parsed_bookmarks[2], true, url3, url3_title, t3, - bookmark_folder_name, string16(), string16()); + bookmark_folder_name, base::string16(), + base::string16()); AssertBookmarkEntryEquals(parsed_bookmarks[3], true, url4, url4_title, t4, - bookmark_folder_name, string16(), string16()); + bookmark_folder_name, base::string16(), + base::string16()); AssertBookmarkEntryEquals(parsed_bookmarks[4], false, url1, url1_title, t1, - string16(), string16(), string16()); + base::string16(), base::string16(), + base::string16()); AssertBookmarkEntryEquals(parsed_bookmarks[5], false, url2, url2_title, t2, - string16(), string16(), string16()); + base::string16(), base::string16(), + base::string16()); AssertBookmarkEntryEquals(parsed_bookmarks[6], false, url1, url1_title, t1, - f3_title, f4_title, string16()); + f3_title, f4_title, base::string16()); AssertBookmarkEntryEquals(parsed_bookmarks[7], false, url1, url1_title, t1, - string16(), string16(), string16()); + base::string16(), base::string16(), + base::string16()); AssertBookmarkEntryEquals(parsed_bookmarks[8], false, unnamed_bookmark_url, unnamed_bookmark_title, t2, - string16(), string16(), string16()); + base::string16(), base::string16(), + base::string16()); } diff --git a/chrome/browser/bookmarks/bookmark_index.cc b/chrome/browser/bookmarks/bookmark_index.cc index 3af121e..81c2416 100644 --- a/chrome/browser/bookmarks/bookmark_index.cc +++ b/chrome/browser/bookmarks/bookmark_index.cc @@ -76,7 +76,7 @@ void BookmarkIndex::Remove(const BookmarkNode* node) { } void BookmarkIndex::GetBookmarksWithTitlesMatching( - const string16& query, + const base::string16& query, size_t max_count, std::vector<BookmarkTitleMatch>* results) { std::vector<string16> terms = ExtractQueryWords(query); @@ -163,7 +163,7 @@ void BookmarkIndex::AddMatchToResults( } } -bool BookmarkIndex::GetBookmarksWithTitleMatchingTerm(const string16& term, +bool BookmarkIndex::GetBookmarksWithTitleMatchingTerm(const base::string16& term, bool first_term, Matches* matches) { Index::const_iterator i = index_.lower_bound(term); @@ -245,7 +245,7 @@ void BookmarkIndex::CombineMatches(const Index::const_iterator& index_i, } } -std::vector<string16> BookmarkIndex::ExtractQueryWords(const string16& query) { +std::vector<string16> BookmarkIndex::ExtractQueryWords(const base::string16& query) { std::vector<string16> terms; if (query.empty()) return std::vector<string16>(); @@ -256,12 +256,12 @@ std::vector<string16> BookmarkIndex::ExtractQueryWords(const string16& query) { return terms; } -void BookmarkIndex::RegisterNode(const string16& term, +void BookmarkIndex::RegisterNode(const base::string16& term, const BookmarkNode* node) { index_[term].insert(node); } -void BookmarkIndex::UnregisterNode(const string16& term, +void BookmarkIndex::UnregisterNode(const base::string16& term, const BookmarkNode* node) { Index::iterator i = index_.find(term); if (i == index_.end()) { diff --git a/chrome/browser/bookmarks/bookmark_index.h b/chrome/browser/bookmarks/bookmark_index.h index 84a2861..a1d0867 100644 --- a/chrome/browser/bookmarks/bookmark_index.h +++ b/chrome/browser/bookmarks/bookmark_index.h @@ -45,7 +45,7 @@ class BookmarkIndex { // Returns up to |max_count| of bookmarks containing the text |query|. void GetBookmarksWithTitlesMatching( - const string16& query, + const base::string16& query, size_t max_count, std::vector<BookmarkTitleMatch>* results); @@ -90,7 +90,7 @@ class BookmarkIndex { // Populates |matches| for the specified term. If |first_term| is true, this // is the first term in the query. Returns true if there is at least one node // matching the term. - bool GetBookmarksWithTitleMatchingTerm(const string16& term, + bool GetBookmarksWithTitleMatchingTerm(const base::string16& term, bool first_term, Matches* matches); @@ -116,13 +116,13 @@ class BookmarkIndex { Matches* result); // Returns the set of query words from |query|. - std::vector<string16> ExtractQueryWords(const string16& query); + std::vector<string16> ExtractQueryWords(const base::string16& query); // Adds |node| to |index_|. - void RegisterNode(const string16& term, const BookmarkNode* node); + void RegisterNode(const base::string16& term, const BookmarkNode* node); // Removes |node| from |index_|. - void UnregisterNode(const string16& term, const BookmarkNode* node); + void UnregisterNode(const base::string16& term, const BookmarkNode* node); Index index_; diff --git a/chrome/browser/bookmarks/bookmark_model.cc b/chrome/browser/bookmarks/bookmark_model.cc index 433309e..9912694 100644 --- a/chrome/browser/bookmarks/bookmark_model.cc +++ b/chrome/browser/bookmarks/bookmark_model.cc @@ -70,10 +70,10 @@ BookmarkNode::BookmarkNode(int64 id, const GURL& url) BookmarkNode::~BookmarkNode() { } -void BookmarkNode::SetTitle(const string16& title) { +void BookmarkNode::SetTitle(const base::string16& title) { // Replace newlines and other problematic whitespace characters in // folder/bookmark names with spaces. - string16 trimmed_title; + base::string16 trimmed_title; base::ReplaceChars(title, kInvalidChars, ASCIIToUTF16(" "), &trimmed_title); ui::TreeNode<BookmarkNode>::SetTitle(trimmed_title); } @@ -398,7 +398,7 @@ const gfx::Image& BookmarkModel::GetFavicon(const BookmarkNode* node) { return node->favicon(); } -void BookmarkModel::SetTitle(const BookmarkNode* node, const string16& title) { +void BookmarkModel::SetTitle(const BookmarkNode* node, const base::string16& title) { if (!node) { NOTREACHED(); return; @@ -602,7 +602,7 @@ const BookmarkNode* BookmarkModel::GetNodeByID(int64 id) const { const BookmarkNode* BookmarkModel::AddFolder(const BookmarkNode* parent, int index, - const string16& title) { + const base::string16& title) { if (!loaded_ || is_root_node(parent) || !IsValidIndex(parent, index, true)) { // Can't add to the root. NOTREACHED(); @@ -620,7 +620,7 @@ const BookmarkNode* BookmarkModel::AddFolder(const BookmarkNode* parent, const BookmarkNode* BookmarkModel::AddURL(const BookmarkNode* parent, int index, - const string16& title, + const base::string16& title, const GURL& url) { return AddURLWithCreationTime(parent, index, CollapseWhitespace(title, false), @@ -630,7 +630,7 @@ const BookmarkNode* BookmarkModel::AddURL(const BookmarkNode* parent, const BookmarkNode* BookmarkModel::AddURLWithCreationTime( const BookmarkNode* parent, int index, - const string16& title, + const base::string16& title, const GURL& url, const Time& creation_time) { if (!loaded_ || !url.is_valid() || is_root_node(parent) || @@ -717,7 +717,7 @@ void BookmarkModel::ResetDateFolderModified(const BookmarkNode* node) { } void BookmarkModel::GetBookmarksWithTitlesMatching( - const string16& text, + const base::string16& text, size_t max_count, std::vector<BookmarkTitleMatch>* matches) { if (!loaded_) diff --git a/chrome/browser/bookmarks/bookmark_model.h b/chrome/browser/bookmarks/bookmark_model.h index d4603a8..bde83cb 100644 --- a/chrome/browser/bookmarks/bookmark_model.h +++ b/chrome/browser/bookmarks/bookmark_model.h @@ -77,7 +77,7 @@ class BookmarkNode : public ui::TreeNode<BookmarkNode> { // Set the node's internal title. Note that this neither invokes observers // nor updates any bookmark model this node may be in. For that functionality, // BookmarkModel::SetTitle(..) should be used instead. - virtual void SetTitle(const string16& title) OVERRIDE; + virtual void SetTitle(const base::string16& title) OVERRIDE; // Returns an unique id for this node. // For bookmark nodes that are managed by the bookmark model, the IDs are @@ -322,7 +322,7 @@ class BookmarkModel : public content::NotificationObserver, const gfx::Image& GetFavicon(const BookmarkNode* node); // Sets the title of |node|. - void SetTitle(const BookmarkNode* node, const string16& title); + void SetTitle(const BookmarkNode* node, const base::string16& title); // Sets the URL of |node|. void SetURL(const BookmarkNode* node, const GURL& url); @@ -362,18 +362,18 @@ class BookmarkModel : public content::NotificationObserver, // Adds a new folder node at the specified position. const BookmarkNode* AddFolder(const BookmarkNode* parent, int index, - const string16& title); + const base::string16& title); // Adds a url at the specified position. const BookmarkNode* AddURL(const BookmarkNode* parent, int index, - const string16& title, + const base::string16& title, const GURL& url); // Adds a url with a specific creation date. const BookmarkNode* AddURLWithCreationTime(const BookmarkNode* parent, int index, - const string16& title, + const base::string16& title, const GURL& url, const base::Time& creation_time); @@ -397,7 +397,7 @@ class BookmarkModel : public content::NotificationObserver, void ResetDateFolderModified(const BookmarkNode* node); void GetBookmarksWithTitlesMatching( - const string16& text, + const base::string16& text, size_t max_count, std::vector<BookmarkTitleMatch>* matches); diff --git a/chrome/browser/bookmarks/bookmark_model_unittest.cc b/chrome/browser/bookmarks/bookmark_model_unittest.cc index 10ff1c3..cb6d20f 100644 --- a/chrome/browser/bookmarks/bookmark_model_unittest.cc +++ b/chrome/browser/bookmarks/bookmark_model_unittest.cc @@ -308,7 +308,7 @@ TEST_F(BookmarkModelTest, InitialState) { TEST_F(BookmarkModelTest, AddURL) { const BookmarkNode* root = model_.bookmark_bar_node(); - const string16 title(ASCIIToUTF16("foo")); + const base::string16 title(ASCIIToUTF16("foo")); const GURL url("http://foo.com"); const BookmarkNode* new_node = model_.AddURL(root, 0, title, url); @@ -328,7 +328,7 @@ TEST_F(BookmarkModelTest, AddURL) { TEST_F(BookmarkModelTest, AddURLWithUnicodeTitle) { const BookmarkNode* root = model_.bookmark_bar_node(); - const string16 title(WideToUTF16( + const base::string16 title(WideToUTF16( L"\u767e\u5ea6\u4e00\u4e0b\uff0c\u4f60\u5c31\u77e5\u9053")); const GURL url("https://www.baidu.com/"); @@ -350,7 +350,7 @@ TEST_F(BookmarkModelTest, AddURLWithUnicodeTitle) { TEST_F(BookmarkModelTest, AddURLWithWhitespaceTitle) { for (size_t i = 0; i < ARRAYSIZE_UNSAFE(url_whitespace_test_cases); ++i) { const BookmarkNode* root = model_.bookmark_bar_node(); - const string16 title( + const base::string16 title( ASCIIToUTF16(url_whitespace_test_cases[i].input_title)); const GURL url("http://foo.com"); @@ -366,7 +366,7 @@ TEST_F(BookmarkModelTest, AddURLWithWhitespaceTitle) { TEST_F(BookmarkModelTest, AddURLToMobileBookmarks) { const BookmarkNode* root = model_.mobile_node(); - const string16 title(ASCIIToUTF16("foo")); + const base::string16 title(ASCIIToUTF16("foo")); const GURL url("http://foo.com"); const BookmarkNode* new_node = model_.AddURL(root, 0, title, url); @@ -386,7 +386,7 @@ TEST_F(BookmarkModelTest, AddURLToMobileBookmarks) { TEST_F(BookmarkModelTest, AddFolder) { const BookmarkNode* root = model_.bookmark_bar_node(); - const string16 title(ASCIIToUTF16("foo")); + const base::string16 title(ASCIIToUTF16("foo")); const BookmarkNode* new_node = model_.AddFolder(root, 0, title); AssertObserverCount(1, 0, 0, 0, 0, 0, 0, 0, 0); @@ -410,7 +410,7 @@ TEST_F(BookmarkModelTest, AddFolder) { TEST_F(BookmarkModelTest, AddFolderWithWhitespaceTitle) { for (size_t i = 0; i < ARRAYSIZE_UNSAFE(title_whitespace_test_cases); ++i) { const BookmarkNode* root = model_.bookmark_bar_node(); - const string16 title( + const base::string16 title( ASCIIToUTF16(title_whitespace_test_cases[i].input_title)); const BookmarkNode* new_node = model_.AddFolder(root, i, title); @@ -425,7 +425,7 @@ TEST_F(BookmarkModelTest, AddFolderWithWhitespaceTitle) { TEST_F(BookmarkModelTest, RemoveURL) { const BookmarkNode* root = model_.bookmark_bar_node(); - const string16 title(ASCIIToUTF16("foo")); + const base::string16 title(ASCIIToUTF16("foo")); const GURL url("http://foo.com"); model_.AddURL(root, 0, title, url); ClearCounts(); @@ -446,7 +446,7 @@ TEST_F(BookmarkModelTest, RemoveFolder) { ClearCounts(); // Add a URL as a child. - const string16 title(ASCIIToUTF16("foo")); + const base::string16 title(ASCIIToUTF16("foo")); const GURL url("http://foo.com"); model_.AddURL(folder, 0, title, url); @@ -468,7 +468,7 @@ TEST_F(BookmarkModelTest, RemoveAll) { ClearCounts(); // Add a url to bookmark bar. - string16 title(ASCIIToUTF16("foo")); + base::string16 title(ASCIIToUTF16("foo")); GURL url("http://foo.com"); model_.AddURL(bookmark_bar_node, 0, title, url); @@ -491,7 +491,7 @@ TEST_F(BookmarkModelTest, RemoveAll) { TEST_F(BookmarkModelTest, SetTitle) { const BookmarkNode* root = model_.bookmark_bar_node(); - string16 title(ASCIIToUTF16("foo")); + base::string16 title(ASCIIToUTF16("foo")); const GURL url("http://foo.com"); const BookmarkNode* node = model_.AddURL(root, 0, title, url); @@ -507,7 +507,7 @@ TEST_F(BookmarkModelTest, SetTitle) { TEST_F(BookmarkModelTest, SetTitleWithWhitespace) { for (size_t i = 0; i < ARRAYSIZE_UNSAFE(title_whitespace_test_cases); ++i) { const BookmarkNode* root = model_.bookmark_bar_node(); - string16 title(ASCIIToUTF16("dummy")); + base::string16 title(ASCIIToUTF16("dummy")); const GURL url("http://foo.com"); const BookmarkNode* node = model_.AddURL(root, 0, title, url); @@ -520,7 +520,7 @@ TEST_F(BookmarkModelTest, SetTitleWithWhitespace) { TEST_F(BookmarkModelTest, SetURL) { const BookmarkNode* root = model_.bookmark_bar_node(); - const string16 title(ASCIIToUTF16("foo")); + const base::string16 title(ASCIIToUTF16("foo")); GURL url("http://foo.com"); const BookmarkNode* node = model_.AddURL(root, 0, title, url); @@ -535,7 +535,7 @@ TEST_F(BookmarkModelTest, SetURL) { TEST_F(BookmarkModelTest, SetDateAdded) { const BookmarkNode* root = model_.bookmark_bar_node(); - const string16 title(ASCIIToUTF16("foo")); + const base::string16 title(ASCIIToUTF16("foo")); GURL url("http://foo.com"); const BookmarkNode* node = model_.AddURL(root, 0, title, url); @@ -550,7 +550,7 @@ TEST_F(BookmarkModelTest, SetDateAdded) { TEST_F(BookmarkModelTest, Move) { const BookmarkNode* root = model_.bookmark_bar_node(); - const string16 title(ASCIIToUTF16("foo")); + const base::string16 title(ASCIIToUTF16("foo")); const GURL url("http://foo.com"); const BookmarkNode* node = model_.AddURL(root, 0, title, url); const BookmarkNode* folder1 = model_.AddFolder(root, 0, ASCIIToUTF16("foo")); @@ -577,7 +577,7 @@ TEST_F(BookmarkModelTest, Move) { TEST_F(BookmarkModelTest, NonMovingMoveCall) { const BookmarkNode* root = model_.bookmark_bar_node(); - const string16 title(ASCIIToUTF16("foo")); + const base::string16 title(ASCIIToUTF16("foo")); const GURL url("http://foo.com"); const base::Time old_date(base::Time::Now() - base::TimeDelta::FromDays(1)); @@ -650,7 +650,7 @@ TEST_F(BookmarkModelTest, Copy) { TEST_F(BookmarkModelTest, ParentForNewNodes) { ASSERT_EQ(model_.bookmark_bar_node(), model_.GetParentForNewNodes()); - const string16 title(ASCIIToUTF16("foo")); + const base::string16 title(ASCIIToUTF16("foo")); const GURL url("http://foo.com"); model_.AddURL(model_.other_node(), 0, title, url); @@ -661,7 +661,7 @@ TEST_F(BookmarkModelTest, ParentForNewNodes) { TEST_F(BookmarkModelTest, ParentForNewMobileNodes) { ASSERT_EQ(model_.bookmark_bar_node(), model_.GetParentForNewNodes()); - const string16 title(ASCIIToUTF16("foo")); + const base::string16 title(ASCIIToUTF16("foo")); const GURL url("http://foo.com"); model_.AddURL(model_.mobile_node(), 0, title, url); @@ -759,7 +759,7 @@ TEST_F(BookmarkModelTest, GetMostRecentlyAddedNodeForURL) { // Makes sure GetBookmarks removes duplicates. TEST_F(BookmarkModelTest, GetBookmarksWithDups) { const GURL url("http://foo.com/0"); - const string16 title(ASCIIToUTF16("blah")); + const base::string16 title(ASCIIToUTF16("blah")); model_.AddURL(model_.bookmark_bar_node(), 0, title, url); model_.AddURL(model_.bookmark_bar_node(), 1, title, url); @@ -1053,7 +1053,7 @@ TEST_F(BookmarkModelTest, NodeVisibility) { TEST_F(BookmarkModelTest, MobileNodeVisibileWithChildren) { const BookmarkNode* root = model_.mobile_node(); - const string16 title(ASCIIToUTF16("foo")); + const base::string16 title(ASCIIToUTF16("foo")); const GURL url("http://foo.com"); model_.AddURL(root, 0, title, url); diff --git a/chrome/browser/bookmarks/bookmark_node_data.cc b/chrome/browser/bookmarks/bookmark_node_data.cc index b78dbb0..873a247 100644 --- a/chrome/browser/bookmarks/bookmark_node_data.cc +++ b/chrome/browser/bookmarks/bookmark_node_data.cc @@ -115,7 +115,7 @@ bool BookmarkNodeData::ReadFromVector( return true; } -bool BookmarkNodeData::ReadFromTuple(const GURL& url, const string16& title) { +bool BookmarkNodeData::ReadFromTuple(const GURL& url, const base::string16& title) { Clear(); if (!url.is_valid()) @@ -140,7 +140,7 @@ void BookmarkNodeData::WriteToClipboard(ui::ClipboardType type) { // If there is only one element and it is a URL, write the URL to the // clipboard. if (elements.size() == 1 && elements[0].is_url) { - const string16& title = elements[0].title; + const base::string16& title = elements[0].title; const std::string url = elements[0].url.spec(); scw.WriteBookmark(title, url); @@ -176,7 +176,7 @@ bool BookmarkNodeData::ReadFromClipboard(ui::ClipboardType type) { return true; } - string16 title; + base::string16 title; std::string url; clipboard->ReadBookmark(&title, &url); if (!url.empty()) { diff --git a/chrome/browser/bookmarks/bookmark_node_data.h b/chrome/browser/bookmarks/bookmark_node_data.h index b85ef1b..fb3364d 100644 --- a/chrome/browser/bookmarks/bookmark_node_data.h +++ b/chrome/browser/bookmarks/bookmark_node_data.h @@ -54,7 +54,7 @@ struct BookmarkNodeData { GURL url; // Title of the entry, used for both urls and folders. - string16 title; + base::string16 title; // Date of when this node was created. base::Time date_added; @@ -99,7 +99,7 @@ struct BookmarkNodeData { bool ReadFromVector(const std::vector<const BookmarkNode*>& nodes); // Creates a single-bookmark DragData from url/title pair. - bool ReadFromTuple(const GURL& url, const string16& title); + bool ReadFromTuple(const GURL& url, const base::string16& title); // Writes bookmarks to the specified clipboard. void WriteToClipboard(ui::ClipboardType type); diff --git a/chrome/browser/bookmarks/bookmark_node_data_unittest.cc b/chrome/browser/bookmarks/bookmark_node_data_unittest.cc index e726571..9bccb202 100644 --- a/chrome/browser/bookmarks/bookmark_node_data_unittest.cc +++ b/chrome/browser/bookmarks/bookmark_node_data_unittest.cc @@ -50,7 +50,7 @@ TEST_F(BookmarkNodeDataTest, BogusRead) { // read it. TEST_F(BookmarkNodeDataTest, JustURL) { const GURL url("http://google.com"); - const string16 title(ASCIIToUTF16("google.com")); + const base::string16 title(ASCIIToUTF16("google.com")); ui::OSExchangeData data; data.SetURL(url, title); @@ -76,7 +76,7 @@ TEST_F(BookmarkNodeDataTest, URL) { test::WaitForBookmarkModelToLoad(model); const BookmarkNode* root = model->bookmark_bar_node(); GURL url(GURL("http://foo.com")); - const string16 title(ASCIIToUTF16("foo.com")); + const base::string16 title(ASCIIToUTF16("foo.com")); const BookmarkNode* node = model->AddURL(root, 0, title, url); BookmarkNodeData drag_data(node); EXPECT_TRUE(drag_data.is_valid()); @@ -109,7 +109,7 @@ TEST_F(BookmarkNodeDataTest, URL) { // Writing should also put the URL and title on the clipboard. GURL read_url; - string16 read_title; + base::string16 read_title; EXPECT_TRUE(data2.GetURLAndTitle(&read_url, &read_title)); EXPECT_EQ(url, read_url); EXPECT_EQ(title, read_title); @@ -174,7 +174,7 @@ TEST_F(BookmarkNodeDataTest, FolderWithChild) { const BookmarkNode* folder = model->AddFolder(root, 0, ASCIIToUTF16("g1")); GURL url(GURL("http://foo.com")); - const string16 title(ASCIIToUTF16("blah2")); + const base::string16 title(ASCIIToUTF16("blah2")); model->AddURL(folder, 0, title, url); @@ -217,7 +217,7 @@ TEST_F(BookmarkNodeDataTest, MultipleNodes) { const BookmarkNode* folder = model->AddFolder(root, 0, ASCIIToUTF16("g1")); GURL url(GURL("http://foo.com")); - const string16 title(ASCIIToUTF16("blah2")); + const base::string16 title(ASCIIToUTF16("blah2")); const BookmarkNode* url_node = model->AddURL(folder, 0, title, url); diff --git a/chrome/browser/bookmarks/bookmark_node_data_views.cc b/chrome/browser/bookmarks/bookmark_node_data_views.cc index 70d15e9..9bc87ea 100644 --- a/chrome/browser/bookmarks/bookmark_node_data_views.cc +++ b/chrome/browser/bookmarks/bookmark_node_data_views.cc @@ -55,7 +55,7 @@ bool BookmarkNodeData::Read(const ui::OSExchangeData& data) { // See if there is a URL on the clipboard. Element element; GURL url; - string16 title; + base::string16 title; if (data.GetURLAndTitle(&url, &title)) ReadFromTuple(url, title); } diff --git a/chrome/browser/bookmarks/bookmark_pasteboard_helper_mac.mm b/chrome/browser/bookmarks/bookmark_pasteboard_helper_mac.mm index c6ca0ea..7ec2fb6 100644 --- a/chrome/browser/bookmarks/bookmark_pasteboard_helper_mac.mm +++ b/chrome/browser/bookmarks/bookmark_pasteboard_helper_mac.mm @@ -100,7 +100,7 @@ bool ReadWebURLsWithTitlesPboardType( NSUInteger len = [titlesArr count]; for (NSUInteger i = 0; i < len; ++i) { - string16 title = base::SysNSStringToUTF16([titlesArr objectAtIndex:i]); + base::string16 title = base::SysNSStringToUTF16([titlesArr objectAtIndex:i]); std::string url = base::SysNSStringToUTF8([urlsArr objectAtIndex:i]); if (!url.empty()) { BookmarkNodeData::Element element; diff --git a/chrome/browser/bookmarks/bookmark_service.h b/chrome/browser/bookmarks/bookmark_service.h index 8233565..f3f5fe1 100644 --- a/chrome/browser/bookmarks/bookmark_service.h +++ b/chrome/browser/bookmarks/bookmark_service.h @@ -23,7 +23,7 @@ class BookmarkService { public: struct URLAndTitle { GURL url; - string16 title; + base::string16 title; }; static BookmarkService* FromBrowserContext( diff --git a/chrome/browser/bookmarks/bookmark_tag_model.cc b/chrome/browser/bookmarks/bookmark_tag_model.cc index 9a7dec2..abc5ff5 100644 --- a/chrome/browser/bookmarks/bookmark_tag_model.cc +++ b/chrome/browser/bookmarks/bookmark_tag_model.cc @@ -144,7 +144,7 @@ const gfx::Image& BookmarkTagModel::GetFavicon(const BookmarkNode* bookmark) { } void BookmarkTagModel::SetTitle(const BookmarkNode* bookmark, - const string16& title) { + const base::string16& title) { DCHECK(bookmark_model_); DCHECK(loaded_); bookmark_model_->SetTitle(bookmark, title); @@ -173,7 +173,7 @@ const BookmarkNode* // Tags specific code. const BookmarkNode* BookmarkTagModel::AddURL( - const string16& title, + const base::string16& title, const GURL& url, const std::set<BookmarkTag>& tags) { DCHECK(bookmark_model_); diff --git a/chrome/browser/bookmarks/bookmark_tag_model.h b/chrome/browser/bookmarks/bookmark_tag_model.h index b30e565..01fcbf2 100644 --- a/chrome/browser/bookmarks/bookmark_tag_model.h +++ b/chrome/browser/bookmarks/bookmark_tag_model.h @@ -10,7 +10,7 @@ class BookmarkTagModelObserver; -typedef string16 BookmarkTag; +typedef base::string16 BookmarkTag; // BookmarTagModel provides a way to access and manipulate bookmarks in a // non-hierarchical way. BookmarkTagModel view the bookmarks as a flat list, @@ -76,7 +76,7 @@ class BookmarkTagModel : public BookmarkModelObserver { const gfx::Image& GetFavicon(const BookmarkNode* bookmark); // Sets the title of |node|. - void SetTitle(const BookmarkNode* bookmark, const string16& title); + void SetTitle(const BookmarkNode* bookmark, const base::string16& title); // Sets the URL of |node|. void SetURL(const BookmarkNode* bookmark, const GURL& url); @@ -89,7 +89,7 @@ class BookmarkTagModel : public BookmarkModelObserver { const BookmarkNode* GetMostRecentlyAddedBookmarkForURL(const GURL& url); // Creates a new bookmark. - const BookmarkNode* AddURL(const string16& title, + const BookmarkNode* AddURL(const base::string16& title, const GURL& url, const std::set<BookmarkTag>& tags); diff --git a/chrome/browser/bookmarks/bookmark_tag_model_unittest.cc b/chrome/browser/bookmarks/bookmark_tag_model_unittest.cc index fa5cc98..ccdf19f 100644 --- a/chrome/browser/bookmarks/bookmark_tag_model_unittest.cc +++ b/chrome/browser/bookmarks/bookmark_tag_model_unittest.cc @@ -193,7 +193,7 @@ class BookmarkTagModelTest const BookmarkNode* AddURLWithTags( const std::string& name, const std::set<BookmarkTag>& tags) { - const string16 title(ASCIIToUTF16(name)); + const base::string16 title(ASCIIToUTF16(name)); const GURL url("http://" + name + ".com"); return tag_model_->AddURL(title, url, tags); diff --git a/chrome/browser/bookmarks/bookmark_utils.cc b/chrome/browser/bookmarks/bookmark_utils.cc index b8e7434..9d480fe 100644 --- a/chrome/browser/bookmarks/bookmark_utils.cc +++ b/chrome/browser/bookmarks/bookmark_utils.cc @@ -60,7 +60,7 @@ bool MoreRecentlyModified(const BookmarkNode* n1, const BookmarkNode* n2) { // Returns true if |text| contains each string in |words|. This is used when // searching for bookmarks. -bool DoesBookmarkTextContainWords(const string16& text, +bool DoesBookmarkTextContainWords(const base::string16& text, const std::vector<string16>& words) { for (size_t i = 0; i < words.size(); ++i) { if (!base::i18n::StringSearchIgnoringCaseAndAccents( @@ -215,7 +215,7 @@ bool MoreRecentlyAdded(const BookmarkNode* n1, const BookmarkNode* n2) { } void GetBookmarksContainingText(BookmarkModel* model, - const string16& text, + const base::string16& text, size_t max_count, const std::string& languages, std::vector<const BookmarkNode*>* nodes) { @@ -293,7 +293,7 @@ void DeleteBookmarkFolders(BookmarkModel* model, void AddIfNotBookmarked(BookmarkModel* model, const GURL& url, - const string16& title) { + const base::string16& title) { std::vector<const BookmarkNode*> bookmarks; model->GetNodesByURL(url, &bookmarks); if (!bookmarks.empty()) diff --git a/chrome/browser/bookmarks/bookmark_utils.h b/chrome/browser/bookmarks/bookmark_utils.h index e813975..49272f9 100644 --- a/chrome/browser/bookmarks/bookmark_utils.h +++ b/chrome/browser/bookmarks/bookmark_utils.h @@ -67,7 +67,7 @@ bool MoreRecentlyAdded(const BookmarkNode* n1, const BookmarkNode* n2); // the text |text|. |languages| is user's accept-language setting to decode // IDN. void GetBookmarksContainingText(BookmarkModel* model, - const string16& text, + const base::string16& text, size_t max_count, const std::string& languages, std::vector<const BookmarkNode*>* nodes); @@ -90,7 +90,7 @@ void DeleteBookmarkFolders(BookmarkModel* model, const std::vector<int64>& ids); // If there are no bookmarks for url, a bookmark is created. void AddIfNotBookmarked(BookmarkModel* model, const GURL& url, - const string16& title); + const base::string16& title); // Removes all bookmarks for the given |url|. void RemoveAllBookmarks(BookmarkModel* model, const GURL& url); diff --git a/chrome/browser/browsing_data/browsing_data_database_helper_browsertest.cc b/chrome/browser/browsing_data/browsing_data_database_helper_browsertest.cc index f9ad7e4..6037323 100644 --- a/chrome/browser/browsing_data/browsing_data_database_helper_browsertest.cc +++ b/chrome/browser/browsing_data/browsing_data_database_helper_browsertest.cc @@ -33,8 +33,8 @@ class BrowsingDataDatabaseHelperTest : public InProcessBrowserTest { webkit_database::DatabaseTracker* db_tracker = BrowserContext::GetDefaultStoragePartition(browser()->profile())-> GetDatabaseTracker(); - string16 db_name = ASCIIToUTF16("db"); - string16 description = ASCIIToUTF16("db_description"); + base::string16 db_name = ASCIIToUTF16("db"); + base::string16 description = ASCIIToUTF16("db_description"); int64 size; db_tracker->DatabaseOpened(kTestIdentifier1, db_name, description, 1, &size); diff --git a/chrome/browser/browsing_data/browsing_data_indexed_db_helper.cc b/chrome/browser/browsing_data/browsing_data_indexed_db_helper.cc index 1252aa4..afbd30d 100644 --- a/chrome/browser/browsing_data/browsing_data_indexed_db_helper.cc +++ b/chrome/browser/browsing_data/browsing_data_indexed_db_helper.cc @@ -143,7 +143,7 @@ BrowsingDataIndexedDBHelper* BrowsingDataIndexedDBHelper::Create( CannedBrowsingDataIndexedDBHelper:: PendingIndexedDBInfo::PendingIndexedDBInfo(const GURL& origin, - const string16& name) + const base::string16& name) : origin(origin), name(name) { } @@ -176,7 +176,7 @@ CannedBrowsingDataIndexedDBHelper* CannedBrowsingDataIndexedDBHelper::Clone() { } void CannedBrowsingDataIndexedDBHelper::AddIndexedDB( - const GURL& origin, const string16& name) { + const GURL& origin, const base::string16& name) { if (!BrowsingDataHelper::HasWebScheme(origin)) return; // Non-websafe state is not considered browsing data. diff --git a/chrome/browser/browsing_data/browsing_data_indexed_db_helper.h b/chrome/browser/browsing_data/browsing_data_indexed_db_helper.h index bdcd036..614f24b 100644 --- a/chrome/browser/browsing_data/browsing_data_indexed_db_helper.h +++ b/chrome/browser/browsing_data/browsing_data_indexed_db_helper.h @@ -55,13 +55,13 @@ class CannedBrowsingDataIndexedDBHelper public: // Contains information about an indexed database. struct PendingIndexedDBInfo { - PendingIndexedDBInfo(const GURL& origin, const string16& name); + PendingIndexedDBInfo(const GURL& origin, const base::string16& name); ~PendingIndexedDBInfo(); bool operator<(const PendingIndexedDBInfo& other) const; GURL origin; - string16 name; + base::string16 name; }; CannedBrowsingDataIndexedDBHelper(); @@ -74,7 +74,7 @@ class CannedBrowsingDataIndexedDBHelper // Add a indexed database to the set of canned indexed databases that is // returned by this helper. void AddIndexedDB(const GURL& origin, - const string16& name); + const base::string16& name); // Clear the list of canned indexed databases. void Reset(); diff --git a/chrome/browser/browsing_data/browsing_data_indexed_db_helper_browsertest.cc b/chrome/browser/browsing_data/browsing_data_indexed_db_helper_browsertest.cc index fc6e080..b851f50 100644 --- a/chrome/browser/browsing_data/browsing_data_indexed_db_helper_browsertest.cc +++ b/chrome/browser/browsing_data/browsing_data_indexed_db_helper_browsertest.cc @@ -27,7 +27,7 @@ typedef InProcessBrowserTest BrowsingDataIndexedDBHelperTest; IN_PROC_BROWSER_TEST_F(BrowsingDataIndexedDBHelperTest, CannedAddIndexedDB) { const GURL origin1("http://host1:1/"); const GURL origin2("http://host2:1/"); - const string16 description(ASCIIToUTF16("description")); + const base::string16 description(ASCIIToUTF16("description")); scoped_refptr<CannedBrowsingDataIndexedDBHelper> helper( new CannedBrowsingDataIndexedDBHelper()); @@ -52,7 +52,7 @@ IN_PROC_BROWSER_TEST_F(BrowsingDataIndexedDBHelperTest, CannedAddIndexedDB) { IN_PROC_BROWSER_TEST_F(BrowsingDataIndexedDBHelperTest, CannedUnique) { const GURL origin("http://host1:1/"); - const string16 description(ASCIIToUTF16("description")); + const base::string16 description(ASCIIToUTF16("description")); scoped_refptr<CannedBrowsingDataIndexedDBHelper> helper( new CannedBrowsingDataIndexedDBHelper()); diff --git a/chrome/browser/browsing_data/browsing_data_indexed_db_helper_unittest.cc b/chrome/browser/browsing_data/browsing_data_indexed_db_helper_unittest.cc index 3049a72..ae5bcc4 100644 --- a/chrome/browser/browsing_data/browsing_data_indexed_db_helper_unittest.cc +++ b/chrome/browser/browsing_data/browsing_data_indexed_db_helper_unittest.cc @@ -14,7 +14,7 @@ typedef testing::Test CannedBrowsingDataIndexedDBHelperTest; TEST_F(CannedBrowsingDataIndexedDBHelperTest, Empty) { const GURL origin("http://host1:1/"); - const string16 description(ASCIIToUTF16("description")); + const base::string16 description(ASCIIToUTF16("description")); scoped_refptr<CannedBrowsingDataIndexedDBHelper> helper( new CannedBrowsingDataIndexedDBHelper()); @@ -29,7 +29,7 @@ TEST_F(CannedBrowsingDataIndexedDBHelperTest, Empty) { TEST_F(CannedBrowsingDataIndexedDBHelperTest, IgnoreExtensionsAndDevTools) { const GURL origin1("chrome-extension://abcdefghijklmnopqrstuvwxyz/"); const GURL origin2("chrome-devtools://abcdefghijklmnopqrstuvwxyz/"); - const string16 description(ASCIIToUTF16("description")); + const base::string16 description(ASCIIToUTF16("description")); scoped_refptr<CannedBrowsingDataIndexedDBHelper> helper( new CannedBrowsingDataIndexedDBHelper()); diff --git a/chrome/browser/browsing_data/cookies_tree_model.cc b/chrome/browser/browsing_data/cookies_tree_model.cc index 756956c..59386c2 100644 --- a/chrome/browser/browsing_data/cookies_tree_model.cc +++ b/chrome/browser/browsing_data/cookies_tree_model.cc @@ -938,7 +938,7 @@ void CookiesTreeModel::DeleteCookieNode(CookieTreeNode* cookie_node) { DeleteCookieNode(parent_node); } -void CookiesTreeModel::UpdateSearchResults(const string16& filter) { +void CookiesTreeModel::UpdateSearchResults(const base::string16& filter) { CookieTreeNode* root = GetRoot(); ScopedBatchUpdateNotifier notifier(this, root); int num_children = root->child_count(); @@ -985,61 +985,61 @@ void CookiesTreeModel::RemoveCookiesTreeObserver(Observer* observer) { void CookiesTreeModel::PopulateAppCacheInfo(LocalDataContainer* container) { ScopedBatchUpdateNotifier notifier(this, GetRoot()); - PopulateAppCacheInfoWithFilter(container, ¬ifier, string16()); + PopulateAppCacheInfoWithFilter(container, ¬ifier, base::string16()); } void CookiesTreeModel::PopulateCookieInfo(LocalDataContainer* container) { ScopedBatchUpdateNotifier notifier(this, GetRoot()); - PopulateCookieInfoWithFilter(container, ¬ifier, string16()); + PopulateCookieInfoWithFilter(container, ¬ifier, base::string16()); } void CookiesTreeModel::PopulateDatabaseInfo(LocalDataContainer* container) { ScopedBatchUpdateNotifier notifier(this, GetRoot()); - PopulateDatabaseInfoWithFilter(container, ¬ifier, string16()); + PopulateDatabaseInfoWithFilter(container, ¬ifier, base::string16()); } void CookiesTreeModel::PopulateLocalStorageInfo(LocalDataContainer* container) { ScopedBatchUpdateNotifier notifier(this, GetRoot()); - PopulateLocalStorageInfoWithFilter(container, ¬ifier, string16()); + PopulateLocalStorageInfoWithFilter(container, ¬ifier, base::string16()); } void CookiesTreeModel::PopulateSessionStorageInfo( LocalDataContainer* container) { ScopedBatchUpdateNotifier notifier(this, GetRoot()); - PopulateSessionStorageInfoWithFilter(container, ¬ifier, string16()); + PopulateSessionStorageInfoWithFilter(container, ¬ifier, base::string16()); } void CookiesTreeModel::PopulateIndexedDBInfo(LocalDataContainer* container){ ScopedBatchUpdateNotifier notifier(this, GetRoot()); - PopulateIndexedDBInfoWithFilter(container, ¬ifier, string16()); + PopulateIndexedDBInfoWithFilter(container, ¬ifier, base::string16()); } void CookiesTreeModel::PopulateFileSystemInfo(LocalDataContainer* container) { ScopedBatchUpdateNotifier notifier(this, GetRoot()); - PopulateFileSystemInfoWithFilter(container, ¬ifier, string16()); + PopulateFileSystemInfoWithFilter(container, ¬ifier, base::string16()); } void CookiesTreeModel::PopulateQuotaInfo(LocalDataContainer* container) { ScopedBatchUpdateNotifier notifier(this, GetRoot()); - PopulateQuotaInfoWithFilter(container, ¬ifier, string16()); + PopulateQuotaInfoWithFilter(container, ¬ifier, base::string16()); } void CookiesTreeModel::PopulateServerBoundCertInfo( LocalDataContainer* container) { ScopedBatchUpdateNotifier notifier(this, GetRoot()); - PopulateServerBoundCertInfoWithFilter(container, ¬ifier, string16()); + PopulateServerBoundCertInfoWithFilter(container, ¬ifier, base::string16()); } void CookiesTreeModel::PopulateFlashLSOInfo( LocalDataContainer* container) { ScopedBatchUpdateNotifier notifier(this, GetRoot()); - PopulateFlashLSOInfoWithFilter(container, ¬ifier, string16()); + PopulateFlashLSOInfoWithFilter(container, ¬ifier, base::string16()); } void CookiesTreeModel::PopulateAppCacheInfoWithFilter( LocalDataContainer* container, ScopedBatchUpdateNotifier* notifier, - const string16& filter) { + const base::string16& filter) { using appcache::AppCacheInfo; typedef std::map<GURL, std::list<AppCacheInfo> > InfoByOrigin; CookieTreeRootNode* root = static_cast<CookieTreeRootNode*>(GetRoot()); @@ -1050,9 +1050,9 @@ void CookiesTreeModel::PopulateAppCacheInfoWithFilter( notifier->StartBatchUpdate(); for (InfoByOrigin::iterator origin = container->appcache_info_.begin(); origin != container->appcache_info_.end(); ++origin) { - string16 host_node_name = UTF8ToUTF16(origin->first.host()); + base::string16 host_node_name = UTF8ToUTF16(origin->first.host()); if (filter.empty() || - (host_node_name.find(filter) != string16::npos)) { + (host_node_name.find(filter) != base::string16::npos)) { CookieTreeHostNode* host_node = root->GetOrCreateHostNode(origin->first); CookieTreeAppCachesNode* appcaches_node = host_node->GetOrCreateAppCachesNode(); @@ -1069,7 +1069,7 @@ void CookiesTreeModel::PopulateAppCacheInfoWithFilter( void CookiesTreeModel::PopulateCookieInfoWithFilter( LocalDataContainer* container, ScopedBatchUpdateNotifier* notifier, - const string16& filter) { + const base::string16& filter) { CookieTreeRootNode* root = static_cast<CookieTreeRootNode*>(GetRoot()); notifier->StartBatchUpdate(); @@ -1089,7 +1089,7 @@ void CookiesTreeModel::PopulateCookieInfoWithFilter( GURL source(source_string); if (!filter.size() || (CookieTreeHostNode::TitleForUrl(source).find(filter) != - string16::npos)) { + base::string16::npos)) { CookieTreeHostNode* host_node = root->GetOrCreateHostNode(source); CookieTreeCookiesNode* cookies_node = host_node->GetOrCreateCookiesNode(); @@ -1102,7 +1102,7 @@ void CookiesTreeModel::PopulateCookieInfoWithFilter( void CookiesTreeModel::PopulateDatabaseInfoWithFilter( LocalDataContainer* container, ScopedBatchUpdateNotifier* notifier, - const string16& filter) { + const base::string16& filter) { CookieTreeRootNode* root = static_cast<CookieTreeRootNode*>(GetRoot()); if (container->database_info_list_.empty()) @@ -1117,7 +1117,7 @@ void CookiesTreeModel::PopulateDatabaseInfoWithFilter( if (!filter.size() || (CookieTreeHostNode::TitleForUrl(origin).find(filter) != - string16::npos)) { + base::string16::npos)) { CookieTreeHostNode* host_node = root->GetOrCreateHostNode(origin); CookieTreeDatabasesNode* databases_node = host_node->GetOrCreateDatabasesNode(); @@ -1130,7 +1130,7 @@ void CookiesTreeModel::PopulateDatabaseInfoWithFilter( void CookiesTreeModel::PopulateLocalStorageInfoWithFilter( LocalDataContainer* container, ScopedBatchUpdateNotifier* notifier, - const string16& filter) { + const base::string16& filter) { CookieTreeRootNode* root = static_cast<CookieTreeRootNode*>(GetRoot()); if (container->local_storage_info_list_.empty()) @@ -1158,7 +1158,7 @@ void CookiesTreeModel::PopulateLocalStorageInfoWithFilter( void CookiesTreeModel::PopulateSessionStorageInfoWithFilter( LocalDataContainer* container, ScopedBatchUpdateNotifier* notifier, - const string16& filter) { + const base::string16& filter) { CookieTreeRootNode* root = static_cast<CookieTreeRootNode*>(GetRoot()); if (container->session_storage_info_list_.empty()) @@ -1173,7 +1173,7 @@ void CookiesTreeModel::PopulateSessionStorageInfoWithFilter( if (!filter.size() || (CookieTreeHostNode::TitleForUrl(origin).find(filter) != - string16::npos)) { + base::string16::npos)) { CookieTreeHostNode* host_node = root->GetOrCreateHostNode(origin); CookieTreeSessionStoragesNode* session_storages_node = host_node->GetOrCreateSessionStoragesNode(); @@ -1186,7 +1186,7 @@ void CookiesTreeModel::PopulateSessionStorageInfoWithFilter( void CookiesTreeModel::PopulateIndexedDBInfoWithFilter( LocalDataContainer* container, ScopedBatchUpdateNotifier* notifier, - const string16& filter) { + const base::string16& filter) { CookieTreeRootNode* root = static_cast<CookieTreeRootNode*>(GetRoot()); if (container->indexed_db_info_list_.empty()) @@ -1201,7 +1201,7 @@ void CookiesTreeModel::PopulateIndexedDBInfoWithFilter( if (!filter.size() || (CookieTreeHostNode::TitleForUrl(origin).find(filter) != - string16::npos)) { + base::string16::npos)) { CookieTreeHostNode* host_node = root->GetOrCreateHostNode(origin); CookieTreeIndexedDBsNode* indexed_dbs_node = host_node->GetOrCreateIndexedDBsNode(); @@ -1214,7 +1214,7 @@ void CookiesTreeModel::PopulateIndexedDBInfoWithFilter( void CookiesTreeModel::PopulateServerBoundCertInfoWithFilter( LocalDataContainer* container, ScopedBatchUpdateNotifier* notifier, - const string16& filter) { + const base::string16& filter) { CookieTreeRootNode* root = static_cast<CookieTreeRootNode*>(GetRoot()); if (container->server_bound_cert_list_.empty()) @@ -1233,8 +1233,8 @@ void CookiesTreeModel::PopulateServerBoundCertInfoWithFilter( content::kStandardSchemeSeparator + cert_info->server_identifier() + "/"); } - string16 title = CookieTreeHostNode::TitleForUrl(origin); - if (!filter.size() || title.find(filter) != string16::npos) { + base::string16 title = CookieTreeHostNode::TitleForUrl(origin); + if (!filter.size() || title.find(filter) != base::string16::npos) { CookieTreeHostNode* host_node = root->GetOrCreateHostNode(origin); CookieTreeServerBoundCertsNode* server_bound_certs_node = host_node->GetOrCreateServerBoundCertsNode(); @@ -1247,7 +1247,7 @@ void CookiesTreeModel::PopulateServerBoundCertInfoWithFilter( void CookiesTreeModel::PopulateFileSystemInfoWithFilter( LocalDataContainer* container, ScopedBatchUpdateNotifier* notifier, - const string16& filter) { + const base::string16& filter) { CookieTreeRootNode* root = static_cast<CookieTreeRootNode*>(GetRoot()); if (container->file_system_info_list_.empty()) @@ -1262,7 +1262,7 @@ void CookiesTreeModel::PopulateFileSystemInfoWithFilter( if (!filter.size() || (CookieTreeHostNode::TitleForUrl(origin).find(filter) != - string16::npos)) { + base::string16::npos)) { CookieTreeHostNode* host_node = root->GetOrCreateHostNode(origin); CookieTreeFileSystemsNode* file_systems_node = host_node->GetOrCreateFileSystemsNode(); @@ -1275,7 +1275,7 @@ void CookiesTreeModel::PopulateFileSystemInfoWithFilter( void CookiesTreeModel::PopulateQuotaInfoWithFilter( LocalDataContainer* container, ScopedBatchUpdateNotifier* notifier, - const string16& filter) { + const base::string16& filter) { CookieTreeRootNode* root = static_cast<CookieTreeRootNode*>(GetRoot()); if (container->quota_info_list_.empty()) @@ -1286,7 +1286,7 @@ void CookiesTreeModel::PopulateQuotaInfoWithFilter( quota_info != container->quota_info_list_.end(); ++quota_info) { if (!filter.size() || - (UTF8ToUTF16(quota_info->host).find(filter) != string16::npos)) { + (UTF8ToUTF16(quota_info->host).find(filter) != base::string16::npos)) { CookieTreeHostNode* host_node = root->GetOrCreateHostNode(GURL("http://" + quota_info->host)); host_node->UpdateOrCreateQuotaNode(quota_info); @@ -1297,7 +1297,7 @@ void CookiesTreeModel::PopulateQuotaInfoWithFilter( void CookiesTreeModel::PopulateFlashLSOInfoWithFilter( LocalDataContainer* container, ScopedBatchUpdateNotifier* notifier, - const string16& filter) { + const base::string16& filter) { CookieTreeRootNode* root = static_cast<CookieTreeRootNode*>(GetRoot()); if (container->flash_lso_domain_list_.empty()) diff --git a/chrome/browser/browsing_data/cookies_tree_model.h b/chrome/browser/browsing_data/cookies_tree_model.h index 8c8330f..eb5c6cf 100644 --- a/chrome/browser/browsing_data/cookies_tree_model.h +++ b/chrome/browser/browsing_data/cookies_tree_model.h @@ -135,7 +135,7 @@ class CookieTreeNode : public ui::TreeNode<CookieTreeNode> { }; CookieTreeNode() {} - explicit CookieTreeNode(const string16& title) + explicit CookieTreeNode(const base::string16& title) : ui::TreeNode<CookieTreeNode>(title) {} virtual ~CookieTreeNode() {} @@ -180,7 +180,7 @@ class CookieTreeRootNode : public CookieTreeNode { class CookieTreeHostNode : public CookieTreeNode { public: // Returns the host node's title to use for a given URL. - static string16 TitleForUrl(const GURL& url); + static base::string16 TitleForUrl(const GURL& url); explicit CookieTreeHostNode(const GURL& url); virtual ~CookieTreeHostNode(); @@ -635,7 +635,7 @@ class CookiesTreeModel : public ui::TreeNodeModel<CookieTreeNode> { void DeleteCookieNode(CookieTreeNode* cookie_node); // Filter the origins to only display matched results. - void UpdateSearchResults(const string16& filter); + void UpdateSearchResults(const base::string16& filter); // Returns the set of extensions which protect the data item represented by // this node from deletion. @@ -681,35 +681,35 @@ class CookiesTreeModel : public ui::TreeNodeModel<CookieTreeNode> { void PopulateAppCacheInfoWithFilter(LocalDataContainer* container, ScopedBatchUpdateNotifier* notifier, - const string16& filter); + const base::string16& filter); void PopulateCookieInfoWithFilter(LocalDataContainer* container, ScopedBatchUpdateNotifier* notifier, - const string16& filter); + const base::string16& filter); void PopulateDatabaseInfoWithFilter(LocalDataContainer* container, ScopedBatchUpdateNotifier* notifier, - const string16& filter); + const base::string16& filter); void PopulateLocalStorageInfoWithFilter(LocalDataContainer* container, ScopedBatchUpdateNotifier* notifier, - const string16& filter); + const base::string16& filter); void PopulateSessionStorageInfoWithFilter(LocalDataContainer* container, ScopedBatchUpdateNotifier* notifier, - const string16& filter); + const base::string16& filter); void PopulateIndexedDBInfoWithFilter(LocalDataContainer* container, ScopedBatchUpdateNotifier* notifier, - const string16& filter); + const base::string16& filter); void PopulateFileSystemInfoWithFilter(LocalDataContainer* container, ScopedBatchUpdateNotifier* notifier, - const string16& filter); + const base::string16& filter); void PopulateQuotaInfoWithFilter(LocalDataContainer* container, ScopedBatchUpdateNotifier* notifier, - const string16& filter); + const base::string16& filter); void PopulateServerBoundCertInfoWithFilter( LocalDataContainer* container, ScopedBatchUpdateNotifier* notifier, - const string16& filter); + const base::string16& filter); void PopulateFlashLSOInfoWithFilter(LocalDataContainer* container, ScopedBatchUpdateNotifier* notifier, - const string16& filter); + const base::string16& filter); // Map of app ids to LocalDataContainer objects to use when retrieving // locally stored data. diff --git a/chrome/browser/browsing_data/cookies_tree_model_unittest.cc b/chrome/browser/browsing_data/cookies_tree_model_unittest.cc index 6b6825d..e1ac03a 100644 --- a/chrome/browser/browsing_data/cookies_tree_model_unittest.cc +++ b/chrome/browser/browsing_data/cookies_tree_model_unittest.cc @@ -396,7 +396,7 @@ TEST_F(CookiesTreeModelTest, RemoveAll) { // Make sure the nodes are also deleted from the model's cache. // http://crbug.com/43249 - cookies_model->UpdateSearchResults(string16()); + cookies_model->UpdateSearchResults(base::string16()); { // 2 nodes - root and app @@ -1147,7 +1147,7 @@ TEST_F(CookiesTreeModelTest, FileSystemFilter) { EXPECT_EQ("http://fshost3:3/", GetDisplayedFileSystems(cookies_model.get())); - cookies_model->UpdateSearchResults(string16()); + cookies_model->UpdateSearchResults(base::string16()); EXPECT_EQ("http://fshost1:1/,http://fshost2:2/,http://fshost3:3/", GetDisplayedFileSystems(cookies_model.get())); } @@ -1178,16 +1178,16 @@ TEST_F(CookiesTreeModelTest, CookiesFilter) { mock_browsing_data_cookie_helper_->Notify(); EXPECT_EQ("A,B,C,D", GetDisplayedCookies(&cookies_model)); - cookies_model.UpdateSearchResults(string16(ASCIIToUTF16("foo"))); + cookies_model.UpdateSearchResults(base::string16(ASCIIToUTF16("foo"))); EXPECT_EQ("B,C,D", GetDisplayedCookies(&cookies_model)); - cookies_model.UpdateSearchResults(string16(ASCIIToUTF16("2"))); + cookies_model.UpdateSearchResults(base::string16(ASCIIToUTF16("2"))); EXPECT_EQ("A,C", GetDisplayedCookies(&cookies_model)); - cookies_model.UpdateSearchResults(string16(ASCIIToUTF16("foo3"))); + cookies_model.UpdateSearchResults(base::string16(ASCIIToUTF16("foo3"))); EXPECT_EQ("D", GetDisplayedCookies(&cookies_model)); - cookies_model.UpdateSearchResults(string16()); + cookies_model.UpdateSearchResults(base::string16()); EXPECT_EQ("A,B,C,D", GetDisplayedCookies(&cookies_model)); } diff --git a/chrome/browser/captive_portal/captive_portal_browsertest.cc b/chrome/browser/captive_portal/captive_portal_browsertest.cc index d591c36..413b12f 100644 --- a/chrome/browser/captive_portal/captive_portal_browsertest.cc +++ b/chrome/browser/captive_portal/captive_portal_browsertest.cc @@ -1319,7 +1319,7 @@ void CaptivePortalBrowserTest::NavigateLoginTab(Browser* browser, // Do the navigation. content::RenderViewHost* render_view_host = tab_strip_model->GetActiveWebContents()->GetRenderViewHost(); - render_view_host->ExecuteJavascriptInWebFrame(string16(), + render_view_host->ExecuteJavascriptInWebFrame(base::string16(), ASCIIToUTF16("submitForm()")); portal_observer.WaitForResults(1); @@ -1367,7 +1367,7 @@ void CaptivePortalBrowserTest::Login(Browser* browser, // Trigger a navigation. content::RenderViewHost* render_view_host = tab_strip_model->GetActiveWebContents()->GetRenderViewHost(); - render_view_host->ExecuteJavascriptInWebFrame(string16(), + render_view_host->ExecuteJavascriptInWebFrame(base::string16(), ASCIIToUTF16("submitForm()")); portal_observer.WaitForResults(1); @@ -1722,7 +1722,7 @@ IN_PROC_BROWSER_TEST_F(CaptivePortalBrowserTest, SSLCertErrorLogin) { content::RenderViewHost* render_view_host = tab_strip_model->GetActiveWebContents()->GetRenderViewHost(); render_view_host->ExecuteJavascriptInWebFrame( - string16(), + base::string16(), ASCIIToUTF16("submitForm()")); // The captive portal tab navigation will trigger a captive portal check, diff --git a/chrome/browser/captive_portal/captive_portal_tab_helper.cc b/chrome/browser/captive_portal/captive_portal_tab_helper.cc index d28f275..9b32a0c 100644 --- a/chrome/browser/captive_portal/captive_portal_tab_helper.cc +++ b/chrome/browser/captive_portal/captive_portal_tab_helper.cc @@ -98,7 +98,7 @@ void CaptivePortalTabHelper::DidStartProvisionalLoadForFrame( void CaptivePortalTabHelper::DidCommitProvisionalLoadForFrame( int64 frame_id, - const string16& frame_unique_name, + const base::string16& frame_unique_name, bool is_main_frame, const GURL& url, content::PageTransition transition_type, @@ -128,11 +128,11 @@ void CaptivePortalTabHelper::DidCommitProvisionalLoadForFrame( void CaptivePortalTabHelper::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, content::RenderViewHost* render_view_host) { DCHECK(CalledOnValidThread()); diff --git a/chrome/browser/captive_portal/captive_portal_tab_helper.h b/chrome/browser/captive_portal/captive_portal_tab_helper.h index 5e0a989..c2abe57 100644 --- a/chrome/browser/captive_portal/captive_portal_tab_helper.h +++ b/chrome/browser/captive_portal/captive_portal_tab_helper.h @@ -79,7 +79,7 @@ class CaptivePortalTabHelper virtual void DidCommitProvisionalLoadForFrame( int64 frame_id, - const string16& frame_unique_name, + const base::string16& frame_unique_name, bool is_main_frame, const GURL& url, content::PageTransition transition_type, @@ -87,11 +87,11 @@ class CaptivePortalTabHelper 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, content::RenderViewHost* render_view_host) OVERRIDE; virtual void DidStopLoading( diff --git a/chrome/browser/captive_portal/captive_portal_tab_helper_unittest.cc b/chrome/browser/captive_portal/captive_portal_tab_helper_unittest.cc index c4c156d..02653ed 100644 --- a/chrome/browser/captive_portal/captive_portal_tab_helper_unittest.cc +++ b/chrome/browser/captive_portal/captive_portal_tab_helper_unittest.cc @@ -91,7 +91,7 @@ class CaptivePortalTabHelperTest : public ChromeRenderViewHostTestHarness { EXPECT_CALL(mock_reloader(), OnLoadCommitted(net::OK)).Times(1); tab_helper().DidCommitProvisionalLoadForFrame( - 1, string16(), true, url, content::PAGE_TRANSITION_LINK, + 1, base::string16(), true, url, content::PAGE_TRANSITION_LINK, render_view_host); } @@ -103,7 +103,7 @@ class CaptivePortalTabHelperTest : public ChromeRenderViewHostTestHarness { 1, -1, true, url, false, false, render_view_host); tab_helper().DidFailProvisionalLoad( - 1, string16(), true, url, net::ERR_TIMED_OUT, string16(), + 1, base::string16(), true, url, net::ERR_TIMED_OUT, base::string16(), render_view_host); // Provisional load starts for the error page. @@ -112,8 +112,8 @@ class CaptivePortalTabHelperTest : public ChromeRenderViewHostTestHarness { EXPECT_CALL(mock_reloader(), OnLoadCommitted(net::ERR_TIMED_OUT)).Times(1); tab_helper().DidCommitProvisionalLoadForFrame( - 1, string16(), true, GURL(kErrorPageUrl), content::PAGE_TRANSITION_LINK, - render_view_host); + 1, base::string16(), true, GURL(kErrorPageUrl), + content::PAGE_TRANSITION_LINK, render_view_host); } // Simulates an abort while requesting |url|. @@ -127,7 +127,7 @@ class CaptivePortalTabHelperTest : public ChromeRenderViewHostTestHarness { EXPECT_CALL(mock_reloader(), OnAbort()).Times(1); if (navigation_type == kSameProcess) { tab_helper().DidFailProvisionalLoad( - 1, string16(), true, url, net::ERR_ABORTED, string16(), + 1, base::string16(), true, url, net::ERR_ABORTED, base::string16(), render_view_host); } else { // For interrupted provisional cross-process navigations, the @@ -150,7 +150,7 @@ class CaptivePortalTabHelperTest : public ChromeRenderViewHostTestHarness { 1, -1, true, url, false, false, render_view_host); tab_helper().DidFailProvisionalLoad( - 1, string16(), true, url, net::ERR_TIMED_OUT, string16(), + 1, base::string16(), true, url, net::ERR_TIMED_OUT, base::string16(), render_view_host); // Start event for the error page. @@ -160,7 +160,7 @@ class CaptivePortalTabHelperTest : public ChromeRenderViewHostTestHarness { EXPECT_CALL(mock_reloader(), OnAbort()).Times(1); if (navigation_type == kSameProcess) { tab_helper().DidFailProvisionalLoad( - 1, string16(), true, url, net::ERR_ABORTED, string16(), + 1, base::string16(), true, url, net::ERR_ABORTED, base::string16(), render_view_host); } else { // For interrupted provisional cross-process navigations, the @@ -249,8 +249,8 @@ TEST_F(CaptivePortalTabHelperTest, HttpTimeoutLinkDoctor) { EXPECT_CALL(mock_reloader(), OnLoadCommitted(net::OK)).Times(1); tab_helper().DidCommitProvisionalLoadForFrame( - 1, string16(), true, GURL(kErrorPageUrl), content::PAGE_TRANSITION_LINK, - render_view_host1()); + 1, base::string16(), true, GURL(kErrorPageUrl), + content::PAGE_TRANSITION_LINK, render_view_host1()); tab_helper().DidStopLoading(render_view_host1()); } @@ -332,13 +332,13 @@ TEST_F(CaptivePortalTabHelperTest, UnexpectedProvisionalLoad) { // The cross-process navigation fails. tab_helper().DidFailProvisionalLoad( - 1, string16(), true, cross_process_url, net::ERR_FAILED, string16(), - render_view_host2()); + 1, base::string16(), true, cross_process_url, net::ERR_FAILED, + base::string16(), render_view_host2()); // The same-site navigation finally is aborted. tab_helper().DidFailProvisionalLoad( - 1, string16(), true, same_site_url, net::ERR_ABORTED, string16(), - render_view_host1()); + 1, base::string16(), true, same_site_url, net::ERR_ABORTED, + base::string16(), render_view_host1()); // The provisional load starts for the error page for the cross-process // navigation. @@ -347,8 +347,8 @@ TEST_F(CaptivePortalTabHelperTest, UnexpectedProvisionalLoad) { EXPECT_CALL(mock_reloader(), OnLoadCommitted(net::ERR_FAILED)).Times(1); tab_helper().DidCommitProvisionalLoadForFrame( - 1, string16(), true, GURL(kErrorPageUrl), content::PAGE_TRANSITION_TYPED, - render_view_host2()); + 1, base::string16(), true, GURL(kErrorPageUrl), + content::PAGE_TRANSITION_TYPED, render_view_host2()); } // Similar to the above test, except the original RenderViewHost manages to @@ -374,7 +374,8 @@ TEST_F(CaptivePortalTabHelperTest, UnexpectedCommit) { // The cross-process navigation fails. tab_helper().DidFailProvisionalLoad( - 1, string16(), true, cross_process_url, net::ERR_FAILED, string16(), + 1, base::string16(), true, cross_process_url, net::ERR_FAILED, + base::string16(), render_view_host2()); // The same-site navigation succeeds. @@ -383,7 +384,7 @@ TEST_F(CaptivePortalTabHelperTest, UnexpectedCommit) { OnLoadStart(same_site_url.SchemeIsSecure())).Times(1); EXPECT_CALL(mock_reloader(), OnLoadCommitted(net::OK)).Times(1); tab_helper().DidCommitProvisionalLoadForFrame( - 1, string16(), true, same_site_url, content::PAGE_TRANSITION_LINK, + 1, base::string16(), true, same_site_url, content::PAGE_TRANSITION_LINK, render_view_host1()); } @@ -395,26 +396,26 @@ TEST_F(CaptivePortalTabHelperTest, HttpsSubframe) { tab_helper().DidStartProvisionalLoadForFrame( 1, -1, false, url, false, false, render_view_host1()); tab_helper().DidCommitProvisionalLoadForFrame( - 1, string16(), false, url, content::PAGE_TRANSITION_LINK, + 1, base::string16(), false, url, content::PAGE_TRANSITION_LINK, render_view_host1()); // Timeout. tab_helper().DidStartProvisionalLoadForFrame( 2, -1, false, url, false, false, render_view_host1()); tab_helper().DidFailProvisionalLoad( - 2, string16(), false, url, net::ERR_TIMED_OUT, string16(), + 2, base::string16(), false, url, net::ERR_TIMED_OUT, base::string16(), render_view_host1()); tab_helper().DidStartProvisionalLoadForFrame( 2, -1, false, url, true, false, render_view_host1()); tab_helper().DidFailProvisionalLoad( - 2, string16(), false, url, net::ERR_ABORTED, string16(), + 2, base::string16(), false, url, net::ERR_ABORTED, base::string16(), render_view_host1()); // Abort. tab_helper().DidStartProvisionalLoadForFrame( 3, -1, false, url, false, false, render_view_host1()); tab_helper().DidFailProvisionalLoad( - 3, string16(), false, url, net::ERR_ABORTED, string16(), + 3, base::string16(), false, url, net::ERR_ABORTED, base::string16(), render_view_host1()); } @@ -437,11 +438,11 @@ TEST_F(CaptivePortalTabHelperTest, HttpsSubframeParallelError) { // Loads return errors. tab_helper().DidFailProvisionalLoad( - frame_id, string16(), true, url, net::ERR_UNEXPECTED, string16(), - render_view_host1()); + frame_id, base::string16(), true, url, net::ERR_UNEXPECTED, + base::string16(), render_view_host1()); tab_helper().DidFailProvisionalLoad( - subframe_id, string16(), false, url, net::ERR_TIMED_OUT, string16(), - render_view_host1()); + subframe_id, base::string16(), false, url, net::ERR_TIMED_OUT, + base::string16(), render_view_host1()); // Provisional load starts for the error pages. tab_helper().DidStartProvisionalLoadForFrame( @@ -451,11 +452,11 @@ TEST_F(CaptivePortalTabHelperTest, HttpsSubframeParallelError) { // Error page load finishes. tab_helper().DidCommitProvisionalLoadForFrame( - subframe_id, string16(), false, url, + subframe_id, base::string16(), false, url, content::PAGE_TRANSITION_AUTO_SUBFRAME, render_view_host1()); EXPECT_CALL(mock_reloader(), OnLoadCommitted(net::ERR_UNEXPECTED)).Times(1); tab_helper().DidCommitProvisionalLoadForFrame( - frame_id, string16(), true, url, content::PAGE_TRANSITION_LINK, + frame_id, base::string16(), true, url, content::PAGE_TRANSITION_LINK, render_view_host1()); } @@ -472,8 +473,8 @@ TEST_F(CaptivePortalTabHelperTest, HttpToHttpsRedirectTimeout) { render_view_host1()->GetProcess()->GetID()); tab_helper().DidFailProvisionalLoad( - 1, string16(), true, https_url, net::ERR_TIMED_OUT, string16(), - render_view_host1()); + 1, base::string16(), true, https_url, net::ERR_TIMED_OUT, + base::string16(), render_view_host1()); // Provisional load starts for the error page. tab_helper().DidStartProvisionalLoadForFrame( @@ -481,8 +482,8 @@ TEST_F(CaptivePortalTabHelperTest, HttpToHttpsRedirectTimeout) { EXPECT_CALL(mock_reloader(), OnLoadCommitted(net::ERR_TIMED_OUT)).Times(1); tab_helper().DidCommitProvisionalLoadForFrame( - 1, string16(), true, GURL(kErrorPageUrl), content::PAGE_TRANSITION_LINK, - render_view_host1()); + 1, base::string16(), true, GURL(kErrorPageUrl), + content::PAGE_TRANSITION_LINK, render_view_host1()); } // Simulates an HTTPS to HTTP redirect. @@ -500,7 +501,7 @@ TEST_F(CaptivePortalTabHelperTest, HttpsToHttpRedirect) { EXPECT_CALL(mock_reloader(), OnLoadCommitted(net::OK)).Times(1); tab_helper().DidCommitProvisionalLoadForFrame( - 1, string16(), true, http_url, content::PAGE_TRANSITION_LINK, + 1, base::string16(), true, http_url, content::PAGE_TRANSITION_LINK, render_view_host1()); } @@ -518,7 +519,7 @@ TEST_F(CaptivePortalTabHelperTest, HttpToHttpRedirect) { EXPECT_CALL(mock_reloader(), OnLoadCommitted(net::OK)).Times(1); tab_helper().DidCommitProvisionalLoadForFrame( - 1, string16(), true, http_url, content::PAGE_TRANSITION_LINK, + 1, base::string16(), true, http_url, content::PAGE_TRANSITION_LINK, render_view_host1()); } @@ -535,8 +536,8 @@ TEST_F(CaptivePortalTabHelperTest, SubframeRedirect) { EXPECT_CALL(mock_reloader(), OnLoadCommitted(net::OK)).Times(1); tab_helper().DidCommitProvisionalLoadForFrame( - 1, string16(), true, GURL(kErrorPageUrl), content::PAGE_TRANSITION_LINK, - render_view_host1()); + 1, base::string16(), true, GURL(kErrorPageUrl), + content::PAGE_TRANSITION_LINK, render_view_host1()); } // Simulates a redirect, for another RenderViewHost. @@ -553,8 +554,8 @@ TEST_F(CaptivePortalTabHelperTest, OtherRenderViewHostRedirect) { render_view_host2()->GetProcess()->GetID()); tab_helper().DidFailProvisionalLoad( - 1, string16(), true, https_url, net::ERR_TIMED_OUT, string16(), - render_view_host1()); + 1, base::string16(), true, https_url, net::ERR_TIMED_OUT, + base::string16(), render_view_host1()); // Provisional load starts for the error page. tab_helper().DidStartProvisionalLoadForFrame( @@ -562,8 +563,8 @@ TEST_F(CaptivePortalTabHelperTest, OtherRenderViewHostRedirect) { EXPECT_CALL(mock_reloader(), OnLoadCommitted(net::ERR_TIMED_OUT)).Times(1); tab_helper().DidCommitProvisionalLoadForFrame( - 1, string16(), true, GURL(kErrorPageUrl), content::PAGE_TRANSITION_LINK, - render_view_host1()); + 1, base::string16(), true, GURL(kErrorPageUrl), + content::PAGE_TRANSITION_LINK, render_view_host1()); } TEST_F(CaptivePortalTabHelperTest, LoginTabLogin) { diff --git a/chrome/browser/certificate_manager_model.cc b/chrome/browser/certificate_manager_model.cc index 1b66dee..afdd026 100644 --- a/chrome/browser/certificate_manager_model.cc +++ b/chrome/browser/certificate_manager_model.cc @@ -66,10 +66,10 @@ void CertificateManagerModel::FilterAndBuildOrgGroupingMap( } } -string16 CertificateManagerModel::GetColumnText( +base::string16 CertificateManagerModel::GetColumnText( const net::X509Certificate& cert, Column column) const { - string16 rv; + base::string16 rv; switch (column) { case COL_SUBJECT_NAME: rv = UTF8ToUTF16( @@ -103,7 +103,7 @@ string16 CertificateManagerModel::GetColumnText( int CertificateManagerModel::ImportFromPKCS12(net::CryptoModule* module, const std::string& data, - const string16& password, + const base::string16& password, bool is_extractable) { int result = cert_db_->ImportFromPKCS12(module, data, password, is_extractable, NULL); diff --git a/chrome/browser/certificate_manager_model.h b/chrome/browser/certificate_manager_model.h index b0fc264..9467c59 100644 --- a/chrome/browser/certificate_manager_model.h +++ b/chrome/browser/certificate_manager_model.h @@ -54,14 +54,14 @@ class CertificateManagerModel { OrgGroupingMap* map) const; // Get the data to be displayed in |column| for the given |cert|. - string16 GetColumnText(const net::X509Certificate& cert, Column column) const; + base::string16 GetColumnText(const net::X509Certificate& cert, Column column) const; // Import private keys and certificates from PKCS #12 encoded // |data|, using the given |password|. If |is_extractable| is false, // mark the private key as unextractable from the module. // Returns a net error code on failure. int ImportFromPKCS12(net::CryptoModule* module, const std::string& data, - const string16& password, bool is_extractable); + const base::string16& password, bool is_extractable); // Import CA certificates. // Tries to import all the certificates given. The root will be trusted diff --git a/chrome/browser/character_encoding.cc b/chrome/browser/character_encoding.cc index 7c8fef0..4483a43 100644 --- a/chrome/browser/character_encoding.cc +++ b/chrome/browser/character_encoding.cc @@ -252,7 +252,7 @@ void ParseEncodingListSeparatedWithComma( string16 GetEncodingDisplayName(const std::string& encoding_name, int category_string_id) { - string16 category_name = l10n_util::GetStringUTF16(category_string_id); + base::string16 category_name = l10n_util::GetStringUTF16(category_string_id); if (category_string_id != IDS_ENCODING_KOREAN && category_string_id != IDS_ENCODING_THAI && category_string_id != IDS_ENCODING_TURKISH) { @@ -334,7 +334,7 @@ string16 CharacterEncoding::GetCanonicalEncodingDisplayNameByCommandId( if (found_name != map->end()) return GetEncodingDisplayName(found_name->second.first, found_name->second.second); - return string16(); + return base::string16(); } // Static. @@ -356,7 +356,7 @@ string16 CharacterEncoding::GetCanonicalEncodingDisplayNameByIndex( if (index < kCanonicalEncodingNamesLength) return GetEncodingDisplayName(kCanonicalEncodingNames[index].name, kCanonicalEncodingNames[index].category_string_id); - return string16(); + return base::string16(); } // Static. diff --git a/chrome/browser/character_encoding.h b/chrome/browser/character_encoding.h index e043012..6730b07 100644 --- a/chrome/browser/character_encoding.h +++ b/chrome/browser/character_encoding.h @@ -24,14 +24,14 @@ class CharacterEncoding { // l10n_util::SortVectorWithStringKey to sort the encoding menu items // by current locale character sequence. We need to keep the order within // encoding category name, that's why we use category name as key. - const string16& GetStringKey() const { return encoding_category_name; } + const base::string16& GetStringKey() const { return encoding_category_name; } // Encoding command id. int encoding_id; // Encoding display name. - string16 encoding_display_name; + base::string16 encoding_display_name; // Encoding category name. - string16 encoding_category_name; + base::string16 encoding_category_name; }; // Return canonical encoding name according to the command ID. @@ -42,7 +42,7 @@ class CharacterEncoding { // Return display name of canonical encoding according to the command // ID. THIS FUNCTION IS NOT THREADSAFE. You must run this function // only in UI thread. - static string16 GetCanonicalEncodingDisplayNameByCommandId(int id); + static base::string16 GetCanonicalEncodingDisplayNameByCommandId(int id); // Return count number of all supported canonical encoding. static int GetSupportCanonicalEncodingCount(); @@ -56,7 +56,7 @@ class CharacterEncoding { // which starts from zero to GetSupportCanonicalEncodingCount() - 1. // THIS FUNCTION IS NOT THREADSAFE. You must run this function // only in UI thread. - static string16 GetCanonicalEncodingDisplayNameByIndex(int index); + static base::string16 GetCanonicalEncodingDisplayNameByIndex(int index); // Return encoding command id according to the index, which starts from // zero to GetSupportCanonicalEncodingCount() - 1. Otherwise returns 0. diff --git a/chrome/browser/chrome_browser_main_win.cc b/chrome/browser/chrome_browser_main_win.cc index 48696c6..4756b6b 100644 --- a/chrome/browser/chrome_browser_main_win.cc +++ b/chrome/browser/chrome_browser_main_win.cc @@ -84,7 +84,7 @@ int GetMinimumFontSize() { class TranslationDelegate : public installer::TranslationDelegate { public: - virtual string16 GetLocalizedString(int installer_string_id) OVERRIDE; + virtual base::string16 GetLocalizedString(int installer_string_id) OVERRIDE; }; bool IsSafeModeStart() { @@ -178,7 +178,7 @@ ChromeBrowserMainPartsWin::ChromeBrowserMainPartsWin( GetProcAddress(base::win::GetMetroModule(), "GetMetroCommandLineSwitches")); if (metro_switches_proc) { - string16 metro_switches = (*metro_switches_proc)(); + base::string16 metro_switches = (*metro_switches_proc)(); if (!metro_switches.empty()) { CommandLine extra_switches(CommandLine::NO_PROGRAM); extra_switches.ParseFromString(metro_switches); @@ -274,9 +274,9 @@ void ChromeBrowserMainPartsWin::PrepareRestartOnCrashEnviroment( // The encoding we use for the info is "title|context|direction" where // direction is either env_vars::kRtlLocale or env_vars::kLtrLocale depending // on the current locale. - string16 dlg_strings(l10n_util::GetStringUTF16(IDS_CRASH_RECOVERY_TITLE)); + base::string16 dlg_strings(l10n_util::GetStringUTF16(IDS_CRASH_RECOVERY_TITLE)); dlg_strings.push_back('|'); - string16 adjusted_string( + base::string16 adjusted_string( l10n_util::GetStringUTF16(IDS_CRASH_RECOVERY_CONTENT)); base::i18n::AdjustStringForLocaleDirection(&adjusted_string); dlg_strings.append(adjusted_string); @@ -326,7 +326,7 @@ void ChromeBrowserMainPartsWin::RegisterApplicationRestart( int ChromeBrowserMainPartsWin::HandleIconsCommands( const CommandLine& parsed_command_line) { if (parsed_command_line.HasSwitch(switches::kHideIcons)) { - string16 cp_applet; + base::string16 cp_applet; base::win::Version version = base::win::GetVersion(); if (version >= base::win::VERSION_VISTA) { cp_applet.assign(L"Programs and Features"); // Windows Vista and later. @@ -336,9 +336,9 @@ int ChromeBrowserMainPartsWin::HandleIconsCommands( return chrome::RESULT_CODE_UNSUPPORTED_PARAM; // Not supported } - const string16 msg = + const base::string16 msg = l10n_util::GetStringFUTF16(IDS_HIDE_ICONS_NOT_SUPPORTED, cp_applet); - const string16 caption = l10n_util::GetStringUTF16(IDS_PRODUCT_NAME); + const base::string16 caption = l10n_util::GetStringUTF16(IDS_PRODUCT_NAME); const UINT flags = MB_OKCANCEL | MB_ICONWARNING | MB_TOPMOST; if (IDOK == ui::MessageBox(NULL, msg, caption, flags)) ShellExecute(NULL, NULL, L"appwiz.cpl", NULL, NULL, SW_SHOWNORMAL); @@ -369,9 +369,9 @@ bool ChromeBrowserMainPartsWin::CheckMachineLevelInstall() { // an invisible dialog. // TODO (gab): Get rid of this dialog altogether and auto-launch // system-level Chrome instead. - const string16 text = + const base::string16 text = l10n_util::GetStringUTF16(IDS_MACHINE_LEVEL_INSTALL_CONFLICT); - const string16 caption = l10n_util::GetStringUTF16(IDS_PRODUCT_NAME); + const base::string16 caption = l10n_util::GetStringUTF16(IDS_PRODUCT_NAME); const UINT flags = MB_OK | MB_ICONERROR | MB_TOPMOST; ui::MessageBox(NULL, text, caption, flags); } @@ -384,7 +384,7 @@ bool ChromeBrowserMainPartsWin::CheckMachineLevelInstall() { installer::switches::kDoNotRemoveSharedItems); const base::FilePath setup_exe(uninstall_cmd.GetProgram()); - const string16 params(uninstall_cmd.GetArgumentsString()); + const base::string16 params(uninstall_cmd.GetArgumentsString()); SHELLEXECUTEINFO sei = { sizeof(sei) }; sei.fMask = SEE_MASK_NOASYNC; @@ -421,7 +421,7 @@ string16 TranslationDelegate::GetLocalizedString(int installer_string_id) { } if (resource_id) return l10n_util::GetStringUTF16(resource_id); - return string16(); + return base::string16(); } // static diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc index 7a215a0..e6295a4 100644 --- a/chrome/browser/chrome_content_browser_client.cc +++ b/chrome/browser/chrome_content_browser_client.cc @@ -1680,8 +1680,8 @@ bool ChromeContentBrowserClient::AllowSaveLocalState( bool ChromeContentBrowserClient::AllowWorkerDatabase( const GURL& url, - const string16& name, - const string16& display_name, + const base::string16& name, + const base::string16& display_name, unsigned long estimated_size, content::ResourceContext* context, const std::vector<std::pair<int, int> >& render_views) { @@ -1725,7 +1725,7 @@ bool ChromeContentBrowserClient::AllowWorkerFileSystem( bool ChromeContentBrowserClient::AllowWorkerIndexedDB( const GURL& url, - const string16& name, + const base::string16& name, content::ResourceContext* context, const std::vector<std::pair<int, int> >& render_views) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); diff --git a/chrome/browser/chrome_content_browser_client.h b/chrome/browser/chrome_content_browser_client.h index 3d596cb..cd468d9 100644 --- a/chrome/browser/chrome_content_browser_client.h +++ b/chrome/browser/chrome_content_browser_client.h @@ -134,8 +134,8 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient { virtual bool AllowSaveLocalState(content::ResourceContext* context) OVERRIDE; virtual bool AllowWorkerDatabase( const GURL& url, - const string16& name, - const string16& display_name, + const base::string16& name, + const base::string16& display_name, unsigned long estimated_size, content::ResourceContext* context, const std::vector<std::pair<int, int> >& render_views) OVERRIDE; @@ -145,7 +145,7 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient { const std::vector<std::pair<int, int> >& render_views) OVERRIDE; virtual bool AllowWorkerIndexedDB( const GURL& url, - const string16& name, + const base::string16& name, content::ResourceContext* context, const std::vector<std::pair<int, int> >& render_views) OVERRIDE; virtual net::URLRequestContext* OverrideRequestContextForURL( diff --git a/chrome/browser/chrome_plugin_browsertest.cc b/chrome/browser/chrome_plugin_browsertest.cc index e9f3be6..4cddad3 100644 --- a/chrome/browser/chrome_plugin_browsertest.cc +++ b/chrome/browser/chrome_plugin_browsertest.cc @@ -85,7 +85,7 @@ class ChromePluginTest : public InProcessBrowserTest { static void LoadAndWait(Browser* window, const GURL& url, bool pass) { content::WebContents* web_contents = window->tab_strip_model()->GetActiveWebContents(); - string16 expected_title(ASCIIToUTF16(pass ? "OK" : "plugin_not_found")); + base::string16 expected_title(ASCIIToUTF16(pass ? "OK" : "plugin_not_found")); content::TitleWatcher title_watcher(web_contents, expected_title); title_watcher.AlsoWaitForTitle(ASCIIToUTF16("FAIL")); title_watcher.AlsoWaitForTitle(ASCIIToUTF16( diff --git a/chrome/browser/chrome_process_finder_win.cc b/chrome/browser/chrome_process_finder_win.cc index 6959071..594d251 100644 --- a/chrome/browser/chrome_process_finder_win.cc +++ b/chrome/browser/chrome_process_finder_win.cc @@ -119,7 +119,7 @@ NotifyChromeResult AttemptToNotifyRunningChrome(HWND remote_window, // the other chrome must be desktop chrome and this must be a search charm // activation. This scenario is unique; other cases should be properly // handled by the delegate_execute which will not activate a second chrome. - string16 terms; + base::string16 terms; base::win::MetroLaunchType launch = base::win::GetMetroLaunchParams(&terms); if (launch != base::win::METRO_SEARCH) { LOG(WARNING) << "In metro mode, but and launch is " << launch; diff --git a/chrome/browser/chrome_quota_permission_context.cc b/chrome/browser/chrome_quota_permission_context.cc index 804fa24..968ac4a 100644 --- a/chrome/browser/chrome_quota_permission_context.cc +++ b/chrome/browser/chrome_quota_permission_context.cc @@ -54,7 +54,7 @@ class RequestQuotaInfoBarDelegate : public ConfirmInfoBarDelegate { // ConfirmInfoBarDelegate: virtual bool ShouldExpireInternal( const content::LoadCommittedDetails& details) const OVERRIDE; - virtual string16 GetMessageText() const OVERRIDE; + virtual base::string16 GetMessageText() const OVERRIDE; virtual bool Accept() OVERRIDE; virtual bool Cancel() OVERRIDE; diff --git a/chrome/browser/chromeos/bluetooth/bluetooth_pairing_dialog.cc b/chrome/browser/chromeos/bluetooth/bluetooth_pairing_dialog.cc index 0e95b34..4d9eae2 100644 --- a/chrome/browser/chromeos/bluetooth/bluetooth_pairing_dialog.cc +++ b/chrome/browser/chromeos/bluetooth/bluetooth_pairing_dialog.cc @@ -55,7 +55,7 @@ ui::ModalType BluetoothPairingDialog::GetDialogModalType() const { return ui::MODAL_TYPE_SYSTEM; } -string16 BluetoothPairingDialog::GetDialogTitle() const { +base::string16 BluetoothPairingDialog::GetDialogTitle() const { return l10n_util::GetStringUTF16( IDS_OPTIONS_SETTINGS_BLUETOOTH_ADD_DEVICE_TITLE); } diff --git a/chrome/browser/chromeos/bluetooth/bluetooth_pairing_dialog.h b/chrome/browser/chromeos/bluetooth/bluetooth_pairing_dialog.h index 624a7e7..928c2b3 100644 --- a/chrome/browser/chromeos/bluetooth/bluetooth_pairing_dialog.h +++ b/chrome/browser/chromeos/bluetooth/bluetooth_pairing_dialog.h @@ -30,7 +30,7 @@ class BluetoothPairingDialog : public ui::WebDialogDelegate { protected: // ui::WebDialogDelegate implementation. virtual ui::ModalType GetDialogModalType() const OVERRIDE; - virtual string16 GetDialogTitle() const OVERRIDE; + virtual base::string16 GetDialogTitle() const OVERRIDE; virtual GURL GetDialogContentURL() const OVERRIDE; virtual void GetWebUIMessageHandlers( std::vector<content::WebUIMessageHandler*>* handlers) const OVERRIDE; diff --git a/chrome/browser/chromeos/choose_mobile_network_dialog.cc b/chrome/browser/chromeos/choose_mobile_network_dialog.cc index 567d2c6..e3e77c4 100644 --- a/chrome/browser/chromeos/choose_mobile_network_dialog.cc +++ b/chrome/browser/chromeos/choose_mobile_network_dialog.cc @@ -37,8 +37,8 @@ ui::ModalType ChooseMobileNetworkDialog::GetDialogModalType() const { return ui::MODAL_TYPE_SYSTEM; } -string16 ChooseMobileNetworkDialog::GetDialogTitle() const { - return string16(); +base::string16 ChooseMobileNetworkDialog::GetDialogTitle() const { + return base::string16(); } GURL ChooseMobileNetworkDialog::GetDialogContentURL() const { diff --git a/chrome/browser/chromeos/choose_mobile_network_dialog.h b/chrome/browser/chromeos/choose_mobile_network_dialog.h index 84d4208..aef226b 100644 --- a/chrome/browser/chromeos/choose_mobile_network_dialog.h +++ b/chrome/browser/chromeos/choose_mobile_network_dialog.h @@ -23,7 +23,7 @@ class ChooseMobileNetworkDialog : public ui::WebDialogDelegate { // Overridden from ui::WebDialogDelegate: virtual ui::ModalType GetDialogModalType() const OVERRIDE; - virtual string16 GetDialogTitle() const OVERRIDE; + virtual base::string16 GetDialogTitle() const OVERRIDE; virtual GURL GetDialogContentURL() const OVERRIDE; virtual void GetWebUIMessageHandlers( std::vector<content::WebUIMessageHandler*>* handlers) const OVERRIDE; diff --git a/chrome/browser/chromeos/drive/file_system_util_unittest.cc b/chrome/browser/chromeos/drive/file_system_util_unittest.cc index a85359a..29333b8 100644 --- a/chrome/browser/chromeos/drive/file_system_util_unittest.cc +++ b/chrome/browser/chromeos/drive/file_system_util_unittest.cc @@ -39,7 +39,7 @@ TEST(FileSystemUtilTest, FilePathToDriveURL) { EXPECT_EQ(path, DriveURLToFilePath(FilePathToDriveURL(path))); // Path with multi byte characters. - string16 utf16_string; + base::string16 utf16_string; utf16_string.push_back(0x307b); // HIRAGANA_LETTER_HO utf16_string.push_back(0x3052); // HIRAGANA_LETTER_GE path = GetDriveMyDriveRootPath().Append( diff --git a/chrome/browser/chromeos/drive/search_metadata.cc b/chrome/browser/chromeos/drive/search_metadata.cc index 01e3325..2e4a1d6 100644 --- a/chrome/browser/chromeos/drive/search_metadata.cc +++ b/chrome/browser/chromeos/drive/search_metadata.cc @@ -318,15 +318,15 @@ bool FindAndHighlight( DCHECK(highlighted_text); highlighted_text->clear(); - string16 text16 = base::UTF8ToUTF16(text); + base::string16 text16 = base::UTF8ToUTF16(text); size_t match_start = 0; size_t match_length = 0; if (!query->Search(text16, &match_start, &match_length)) return false; - string16 pre = text16.substr(0, match_start); - string16 match = text16.substr(match_start, match_length); - string16 post = text16.substr(match_start + match_length); + base::string16 pre = text16.substr(0, match_start); + base::string16 match = text16.substr(match_start, match_length); + base::string16 post = text16.substr(match_start + match_length); highlighted_text->append(net::EscapeForHTML(base::UTF16ToUTF8(pre))); highlighted_text->append("<b>"); highlighted_text->append(net::EscapeForHTML(base::UTF16ToUTF8(match))); diff --git a/chrome/browser/chromeos/enrollment_dialog_view.cc b/chrome/browser/chromeos/enrollment_dialog_view.cc index 83feb24..9fb4714 100644 --- a/chrome/browser/chromeos/enrollment_dialog_view.cc +++ b/chrome/browser/chromeos/enrollment_dialog_view.cc @@ -49,11 +49,12 @@ class EnrollmentDialogView : public views::DialogDelegateView { virtual int GetDialogButtons() const OVERRIDE; virtual bool Accept() OVERRIDE; virtual void OnClosed() OVERRIDE; - virtual string16 GetDialogButtonLabel(ui::DialogButton button) const OVERRIDE; + virtual base::string16 GetDialogButtonLabel( + ui::DialogButton button) const OVERRIDE; // views::WidgetDelegate overrides virtual ui::ModalType GetModalType() const OVERRIDE; - virtual string16 GetWindowTitle() const OVERRIDE; + virtual base::string16 GetWindowTitle() const OVERRIDE; // views::View overrides virtual gfx::Size GetPreferredSize() OVERRIDE; @@ -126,7 +127,7 @@ void EnrollmentDialogView::OnClosed() { chrome::Navigate(¶ms); } -string16 EnrollmentDialogView::GetDialogButtonLabel( +base::string16 EnrollmentDialogView::GetDialogButtonLabel( ui::DialogButton button) const { if (button == ui::DIALOG_BUTTON_OK) return l10n_util::GetStringUTF16(IDS_NETWORK_ENROLLMENT_HANDLER_BUTTON); @@ -137,7 +138,7 @@ ui::ModalType EnrollmentDialogView::GetModalType() const { return ui::MODAL_TYPE_SYSTEM; } -string16 EnrollmentDialogView::GetWindowTitle() const { +base::string16 EnrollmentDialogView::GetWindowTitle() const { return l10n_util::GetStringUTF16(IDS_NETWORK_ENROLLMENT_HANDLER_TITLE); } diff --git a/chrome/browser/chromeos/extensions/device_local_account_management_policy_provider.cc b/chrome/browser/chromeos/extensions/device_local_account_management_policy_provider.cc index 3ac410b..5e1899d 100644 --- a/chrome/browser/chromeos/extensions/device_local_account_management_policy_provider.cc +++ b/chrome/browser/chromeos/extensions/device_local_account_management_policy_provider.cc @@ -91,7 +91,7 @@ std::string DeviceLocalAccountManagementPolicyProvider:: bool DeviceLocalAccountManagementPolicyProvider::UserMayLoad( const extensions::Extension* extension, - string16* error) const { + base::string16* error) const { if (account_type_ == policy::DeviceLocalAccount::TYPE_KIOSK_APP) { // For single-app kiosk sessions, allow only platform apps. if (extension->GetType() == extensions::Manifest::TYPE_PLATFORM_APP) diff --git a/chrome/browser/chromeos/extensions/device_local_account_management_policy_provider.h b/chrome/browser/chromeos/extensions/device_local_account_management_policy_provider.h index 7e25e2f..546f2c7 100644 --- a/chrome/browser/chromeos/extensions/device_local_account_management_policy_provider.h +++ b/chrome/browser/chromeos/extensions/device_local_account_management_policy_provider.h @@ -25,7 +25,7 @@ class DeviceLocalAccountManagementPolicyProvider // extensions::ManagementPolicy::Provider: virtual std::string GetDebugPolicyProviderName() const OVERRIDE; virtual bool UserMayLoad(const extensions::Extension* extension, - string16* error) const OVERRIDE; + base::string16* error) const OVERRIDE; private: const policy::DeviceLocalAccount::Type account_type_; diff --git a/chrome/browser/chromeos/extensions/device_local_account_management_policy_provider_unittest.cc b/chrome/browser/chromeos/extensions/device_local_account_management_policy_provider_unittest.cc index 8314d6b..ced74ca 100644 --- a/chrome/browser/chromeos/extensions/device_local_account_management_policy_provider_unittest.cc +++ b/chrome/browser/chromeos/extensions/device_local_account_management_policy_provider_unittest.cc @@ -67,9 +67,9 @@ TEST(DeviceLocalAccountManagementPolicyProviderTest, PublicSession) { // device-local accounts, the extension can be installed. scoped_refptr<const extensions::Extension> extension = CreateHostedApp(); ASSERT_TRUE(extension); - string16 error; + base::string16 error; EXPECT_TRUE(provider.UserMayLoad(extension.get(), &error)); - EXPECT_EQ(string16(), error); + EXPECT_EQ(base::string16(), error); error.clear(); // Verify that if an extension's ID has been explicitly whitelisted for use in @@ -77,7 +77,7 @@ TEST(DeviceLocalAccountManagementPolicyProviderTest, PublicSession) { extension = CreateExtension(kWhitelistedId); ASSERT_TRUE(extension); EXPECT_TRUE(provider.UserMayLoad(extension.get(), &error)); - EXPECT_EQ(string16(), error); + EXPECT_EQ(base::string16(), error); error.clear(); // Verify that if neither the type nor the ID of an extension have been @@ -86,7 +86,7 @@ TEST(DeviceLocalAccountManagementPolicyProviderTest, PublicSession) { extension = CreateExtension(std::string()); ASSERT_TRUE(extension); EXPECT_FALSE(provider.UserMayLoad(extension.get(), &error)); - EXPECT_NE(string16(), error); + EXPECT_NE(base::string16(), error); error.clear(); } @@ -97,9 +97,9 @@ TEST(DeviceLocalAccountManagementPolicyProviderTest, KioskAppSession) { // Verify that a platform app can be installed. scoped_refptr<const extensions::Extension> extension = CreatePlatformApp(); ASSERT_TRUE(extension); - string16 error; + base::string16 error; EXPECT_TRUE(provider.UserMayLoad(extension.get(), &error)); - EXPECT_EQ(string16(), error); + EXPECT_EQ(base::string16(), error); error.clear(); // Verify that an extension whose type has been whitelisted for use in other @@ -108,7 +108,7 @@ TEST(DeviceLocalAccountManagementPolicyProviderTest, KioskAppSession) { extension = CreateHostedApp(); ASSERT_TRUE(extension); EXPECT_FALSE(provider.UserMayLoad(extension.get(), &error)); - EXPECT_NE(string16(), error); + EXPECT_NE(base::string16(), error); error.clear(); // Verify that an extension whose ID has been whitelisted for use in other @@ -117,7 +117,7 @@ TEST(DeviceLocalAccountManagementPolicyProviderTest, KioskAppSession) { extension = CreateExtension(kWhitelistedId); ASSERT_TRUE(extension); EXPECT_FALSE(provider.UserMayLoad(extension.get(), &error)); - EXPECT_NE(string16(), error); + EXPECT_NE(base::string16(), error); error.clear(); } diff --git a/chrome/browser/chromeos/extensions/file_manager/file_browser_handler_api.cc b/chrome/browser/chromeos/extensions/file_manager/file_browser_handler_api.cc index f83b1e9..1bdda52 100644 --- a/chrome/browser/chromeos/extensions/file_manager/file_browser_handler_api.cc +++ b/chrome/browser/chromeos/extensions/file_manager/file_browser_handler_api.cc @@ -211,7 +211,7 @@ bool FileSelectorImpl::StartSelectFile( allowed_file_info.support_drive = true; dialog_->SelectFile(ui::SelectFileDialog::SELECT_SAVEAS_FILE, - string16() /* dialog title*/, + base::string16() /* dialog title*/, suggested_name, &allowed_file_info, 0 /* file type index */, diff --git a/chrome/browser/chromeos/external_protocol_dialog.cc b/chrome/browser/chromeos/external_protocol_dialog.cc index 0cf1185..30f10f2 100644 --- a/chrome/browser/chromeos/external_protocol_dialog.cc +++ b/chrome/browser/chromeos/external_protocol_dialog.cc @@ -52,12 +52,12 @@ int ExternalProtocolDialog::GetDialogButtons() const { return ui::DIALOG_BUTTON_OK; } -string16 ExternalProtocolDialog::GetDialogButtonLabel( +base::string16 ExternalProtocolDialog::GetDialogButtonLabel( ui::DialogButton button) const { return l10n_util::GetStringUTF16(IDS_EXTERNAL_PROTOCOL_OK_BUTTON_TEXT); } -string16 ExternalProtocolDialog::GetWindowTitle() const { +base::string16 ExternalProtocolDialog::GetWindowTitle() const { return l10n_util::GetStringUTF16(IDS_EXTERNAL_PROTOCOL_TITLE); } @@ -94,7 +94,7 @@ ExternalProtocolDialog::ExternalProtocolDialog(WebContents* web_contents, : creation_time_(base::TimeTicks::Now()), scheme_(url.scheme()) { const int kMaxUrlWithoutSchemeSize = 256; - string16 elided_url_without_scheme; + base::string16 elided_url_without_scheme; gfx::ElideString(ASCIIToUTF16(url.possibly_invalid_spec()), kMaxUrlWithoutSchemeSize, &elided_url_without_scheme); diff --git a/chrome/browser/chromeos/external_protocol_dialog.h b/chrome/browser/chromeos/external_protocol_dialog.h index cee403e..171ff57 100644 --- a/chrome/browser/chromeos/external_protocol_dialog.h +++ b/chrome/browser/chromeos/external_protocol_dialog.h @@ -33,8 +33,9 @@ class ExternalProtocolDialog : public views::DialogDelegate { // views::DialogDelegate Methods: virtual int GetDialogButtons() const OVERRIDE; - virtual string16 GetDialogButtonLabel(ui::DialogButton button) const OVERRIDE; - virtual string16 GetWindowTitle() const OVERRIDE; + virtual base::string16 GetDialogButtonLabel( + ui::DialogButton button) const OVERRIDE; + virtual base::string16 GetWindowTitle() const OVERRIDE; virtual void DeleteDelegate() OVERRIDE; virtual bool Accept() OVERRIDE; virtual views::View* GetContentsView() OVERRIDE; diff --git a/chrome/browser/chromeos/file_manager/desktop_notifications.cc b/chrome/browser/chromeos/file_manager/desktop_notifications.cc index 0b64a61..3264623 100644 --- a/chrome/browser/chromeos/file_manager/desktop_notifications.cc +++ b/chrome/browser/chromeos/file_manager/desktop_notifications.cc @@ -91,25 +91,25 @@ int GetIconId(DesktopNotifications::NotificationType type) { return kNotificationTypes[type].icon_id; } -string16 GetTitle(DesktopNotifications::NotificationType type) { +base::string16 GetTitle(DesktopNotifications::NotificationType type) { DCHECK_GE(type, 0); DCHECK_LT(static_cast<size_t>(type), arraysize(kNotificationTypes)); DCHECK(kNotificationTypes[type].type == type); int id = kNotificationTypes[type].title_id; if (id < 0) - return string16(); + return base::string16(); return l10n_util::GetStringUTF16(id); } -string16 GetMessage(DesktopNotifications::NotificationType type) { +base::string16 GetMessage(DesktopNotifications::NotificationType type) { DCHECK_GE(type, 0); DCHECK_LT(static_cast<size_t>(type), arraysize(kNotificationTypes)); DCHECK(kNotificationTypes[type].type == type); int id = kNotificationTypes[type].message_id; if (id < 0) - return string16(); + return base::string16(); return l10n_util::GetStringUTF16(id); } @@ -162,13 +162,13 @@ class DesktopNotifications::NotificationMessage { Profile* profile, NotificationType type, const std::string& notification_id, - const string16& message) + const base::string16& message) : message_(message) { const gfx::Image& icon = ResourceBundle::GetSharedInstance().GetNativeImageNamed( GetIconId(type)); // TODO(mukai): refactor here to invoke NotificationUIManager directly. - const string16 replace_id = UTF8ToUTF16(notification_id); + const base::string16 replace_id = UTF8ToUTF16(notification_id); DesktopNotificationService::AddIconNotification( util::GetFileManagerBaseUrl(), GetTitle(type), message, icon, replace_id, @@ -178,10 +178,10 @@ class DesktopNotifications::NotificationMessage { ~NotificationMessage() {} // Used in test. - string16 message() { return message_; } + base::string16 message() { return message_; } private: - string16 message_; + base::string16 message_; DISALLOW_COPY_AND_ASSIGN(NotificationMessage); }; diff --git a/chrome/browser/chromeos/file_manager/desktop_notifications.h b/chrome/browser/chromeos/file_manager/desktop_notifications.h index e98af57..e17b6f4 100644 --- a/chrome/browser/chromeos/file_manager/desktop_notifications.h +++ b/chrome/browser/chromeos/file_manager/desktop_notifications.h @@ -75,7 +75,7 @@ class DesktopNotifications return notification_map_.find(id) != notification_map_.end(); } - string16 GetNotificationMessageForTest(const std::string& id) const; + base::string16 GetNotificationMessageForTest(const std::string& id) const; private: class NotificationMessage; @@ -87,10 +87,10 @@ class DesktopNotifications // Virtual for mock in unittest. virtual void ShowNotificationWithMessage(NotificationType type, const std::string& path, - const string16& message); + const base::string16& message); void ShowNotificationById(NotificationType type, const std::string& notification_id, - const string16& message); + const base::string16& message); void HideNotificationById(const std::string& notification_id); void RemoveNotificationById(const std::string& notification_id); diff --git a/chrome/browser/chromeos/file_manager/desktop_notifications_unittest.cc b/chrome/browser/chromeos/file_manager/desktop_notifications_unittest.cc index 8a5633f..7548d10 100644 --- a/chrome/browser/chromeos/file_manager/desktop_notifications_unittest.cc +++ b/chrome/browser/chromeos/file_manager/desktop_notifications_unittest.cc @@ -29,7 +29,7 @@ class RecordedDesktopNotifications : public DesktopNotifications { virtual void ShowNotificationWithMessage( NotificationType type, const std::string& path, - const string16& message) OVERRIDE { + const base::string16& message) OVERRIDE { ShowAndHideParams params; params.event = SHOW; params.type = type; @@ -58,7 +58,7 @@ class RecordedDesktopNotifications : public DesktopNotifications { Event event; NotificationType type; std::string path; - string16 message; // Empty for HideNotification(). + base::string16 message; // Empty for HideNotification(). }; // Returns parameters passed to ShowNotificationWithMessage() and diff --git a/chrome/browser/chromeos/file_manager/file_browser_handlers.cc b/chrome/browser/chromeos/file_manager/file_browser_handlers.cc index 8adbe5f..fae1cd7 100644 --- a/chrome/browser/chromeos/file_manager/file_browser_handlers.cc +++ b/chrome/browser/chromeos/file_manager/file_browser_handlers.cc @@ -79,7 +79,7 @@ const FileBrowserHandler* FindFileBrowserHandlerForActionId( } std::string EscapedUtf8ToLower(const std::string& str) { - string16 utf16 = UTF8ToUTF16( + base::string16 utf16 = UTF8ToUTF16( net::UnescapeURLComponent(str, net::UnescapeRule::NORMAL)); return net::EscapeUrlEncodedData( UTF16ToUTF8(base::i18n::ToLower(utf16)), diff --git a/chrome/browser/chromeos/file_manager/select_file_dialog_util.cc b/chrome/browser/chromeos/file_manager/select_file_dialog_util.cc index 34660b3..d04db6fa 100644 --- a/chrome/browser/chromeos/file_manager/select_file_dialog_util.cc +++ b/chrome/browser/chromeos/file_manager/select_file_dialog_util.cc @@ -10,8 +10,9 @@ namespace file_manager { namespace util { -string16 GetSelectFileDialogTitle(ui::SelectFileDialog::Type dialog_type) { - string16 title; +base::string16 GetSelectFileDialogTitle( + ui::SelectFileDialog::Type dialog_type) { + base::string16 title; switch (dialog_type) { case ui::SelectFileDialog::SELECT_NONE: // Full page file manager doesn't need a title. diff --git a/chrome/browser/chromeos/file_manager/select_file_dialog_util.h b/chrome/browser/chromeos/file_manager/select_file_dialog_util.h index acb506f..2f2526b 100644 --- a/chrome/browser/chromeos/file_manager/select_file_dialog_util.h +++ b/chrome/browser/chromeos/file_manager/select_file_dialog_util.h @@ -13,7 +13,7 @@ namespace file_manager { namespace util { // Get file dialog title string from its type. -string16 GetSelectFileDialogTitle(ui::SelectFileDialog::Type type); +base::string16 GetSelectFileDialogTitle(ui::SelectFileDialog::Type type); } // namespace util } // namespace file_manager diff --git a/chrome/browser/chromeos/file_manager/url_util.cc b/chrome/browser/chromeos/file_manager/url_util.cc index 5f43ea4..670a818 100644 --- a/chrome/browser/chromeos/file_manager/url_util.cc +++ b/chrome/browser/chromeos/file_manager/url_util.cc @@ -66,7 +66,7 @@ GURL GetFileManagerMainPageUrl() { GURL GetFileManagerMainPageUrlWithParams( ui::SelectFileDialog::Type type, - const string16& title, + const base::string16& title, const base::FilePath& default_virtual_path, const ui::SelectFileDialog::FileTypeInfo* file_types, int file_type_index, @@ -90,7 +90,7 @@ GURL GetFileManagerMainPageUrlWithParams( dict->Set("extensions", extensions_list); if (i < file_types->extension_description_overrides.size()) { - string16 desc = file_types->extension_description_overrides[i]; + base::string16 desc = file_types->extension_description_overrides[i]; dict->SetString("description", desc); } diff --git a/chrome/browser/chromeos/file_manager/url_util.h b/chrome/browser/chromeos/file_manager/url_util.h index 6c667f8..e68dadf 100644 --- a/chrome/browser/chromeos/file_manager/url_util.h +++ b/chrome/browser/chromeos/file_manager/url_util.h @@ -31,7 +31,7 @@ GURL GetFileManagerMainPageUrl(); // in the query string section. |file_types| is optional. GURL GetFileManagerMainPageUrlWithParams( ui::SelectFileDialog::Type type, - const string16& title, + const base::string16& title, const base::FilePath& default_virtual_path, const ui::SelectFileDialog::FileTypeInfo* file_types, int file_type_index, diff --git a/chrome/browser/chromeos/first_run/drive_first_run_controller.cc b/chrome/browser/chromeos/first_run/drive_first_run_controller.cc index 32184c9..830e174 100644 --- a/chrome/browser/chromeos/first_run/drive_first_run_controller.cc +++ b/chrome/browser/chromeos/first_run/drive_first_run_controller.cc @@ -127,18 +127,18 @@ class DriveWebContentsManager : public content::WebContentsObserver, // content::WebContentsObserver overrides: 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, content::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, content::RenderViewHost* render_view_host) OVERRIDE; // content::WebContentsDelegate overrides: @@ -146,7 +146,7 @@ class DriveWebContentsManager : public content::WebContentsObserver, content::WebContents* web_contents, int route_id, WindowContainerType window_container_type, - const string16& frame_name, + const base::string16& frame_name, const GURL& target_url, const std::string& partition_id, content::SessionStorageNamespace* session_storage_namespace) OVERRIDE; @@ -228,11 +228,11 @@ void DriveWebContentsManager::RunCompletionCallback(bool success) { void DriveWebContentsManager::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, content::RenderViewHost* render_view_host) { if (is_main_frame) { LOG(WARNING) << "Failed to load WebContents to enable offline mode."; @@ -245,7 +245,7 @@ void DriveWebContentsManager::DidFailLoad( const GURL& validated_url, bool is_main_frame, int error_code, - const string16& error_description, + const base::string16& error_description, content::RenderViewHost* render_view_host) { if (is_main_frame) { LOG(WARNING) << "Failed to load WebContents to enable offline mode."; @@ -257,7 +257,7 @@ bool DriveWebContentsManager::ShouldCreateWebContents( content::WebContents* web_contents, int route_id, WindowContainerType window_container_type, - const string16& frame_name, + const base::string16& frame_name, const GURL& target_url, const std::string& partition_id, content::SessionStorageNamespace* session_storage_namespace) { diff --git a/chrome/browser/chromeos/input_method/candidate_view.h b/chrome/browser/chromeos/input_method/candidate_view.h index 823f649..d5ad243 100644 --- a/chrome/browser/chromeos/input_method/candidate_view.h +++ b/chrome/browser/chromeos/input_method/candidate_view.h @@ -30,13 +30,13 @@ class CandidateView : public views::View { int column_height); // Sets candidate text to the given text. - void SetCandidateText(const string16& text); + void SetCandidateText(const base::string16& text); // Sets shortcut text to the given text. - void SetShortcutText(const string16& text); + void SetShortcutText(const base::string16& text); // Sets annotation text to the given text. - void SetAnnotationText(const string16& text); + void SetAnnotationText(const base::string16& text); // Sets infolist icon. void SetInfolistIcon(bool enable); diff --git a/chrome/browser/chromeos/input_method/candidate_window_view.cc b/chrome/browser/chromeos/input_method/candidate_window_view.cc index fcf8a0b..a9a02de 100644 --- a/chrome/browser/chromeos/input_method/candidate_window_view.cc +++ b/chrome/browser/chromeos/input_method/candidate_window_view.cc @@ -450,15 +450,15 @@ void CandidateView::Init(int shortcut_column_width, UpdateLabelBackgroundColors(); } -void CandidateView::SetCandidateText(const string16& text) { +void CandidateView::SetCandidateText(const base::string16& text) { candidate_label_->SetText(text); } -void CandidateView::SetShortcutText(const string16& text) { +void CandidateView::SetShortcutText(const base::string16& text) { shortcut_label_->SetText(text); } -void CandidateView::SetAnnotationText(const string16& text) { +void CandidateView::SetAnnotationText(const base::string16& text) { annotation_label_->SetText(text); } diff --git a/chrome/browser/chromeos/input_method/infolist_window_view.cc b/chrome/browser/chromeos/input_method/infolist_window_view.cc index 491440f..50bcff3 100644 --- a/chrome/browser/chromeos/input_method/infolist_window_view.cc +++ b/chrome/browser/chromeos/input_method/infolist_window_view.cc @@ -101,8 +101,8 @@ void InfolistEntryView::Init(const gfx::Font& title_font, } void InfolistEntryView::Relayout(const InfolistWindowView::Entry& entry) { - const string16 title = UTF8ToUTF16(entry.title); - const string16 description = UTF8ToUTF16(entry.body); + const base::string16 title = UTF8ToUTF16(entry.title); + const base::string16 description = UTF8ToUTF16(entry.body); if ((title_label_->text() == title) && (description_label_->text() == description)) { diff --git a/chrome/browser/chromeos/input_method/input_method_delegate_impl.cc b/chrome/browser/chromeos/input_method/input_method_delegate_impl.cc index 50a70b8..ddfbe69 100644 --- a/chrome/browser/chromeos/input_method/input_method_delegate_impl.cc +++ b/chrome/browser/chromeos/input_method/input_method_delegate_impl.cc @@ -26,11 +26,12 @@ std::string InputMethodDelegateImpl::GetHardwareKeyboardLayout() const { return std::string(); } -string16 InputMethodDelegateImpl::GetLocalizedString(int resource_id) const { +base::string16 InputMethodDelegateImpl::GetLocalizedString( + int resource_id) const { return l10n_util::GetStringUTF16(resource_id); } -string16 InputMethodDelegateImpl::GetDisplayLanguageName( +base::string16 InputMethodDelegateImpl::GetDisplayLanguageName( const std::string& language_code) const { DCHECK(g_browser_process); return l10n_util::GetDisplayNameForLocale( diff --git a/chrome/browser/chromeos/input_method/input_method_delegate_impl.h b/chrome/browser/chromeos/input_method/input_method_delegate_impl.h index cb15566..4d1920a 100644 --- a/chrome/browser/chromeos/input_method/input_method_delegate_impl.h +++ b/chrome/browser/chromeos/input_method/input_method_delegate_impl.h @@ -22,8 +22,8 @@ class InputMethodDelegateImpl : public InputMethodDelegate { // InputMethodDelegate implementation. virtual std::string GetHardwareKeyboardLayout() const OVERRIDE; - virtual string16 GetLocalizedString(int resource_id) const OVERRIDE; - virtual string16 GetDisplayLanguageName( + virtual base::string16 GetLocalizedString(int resource_id) const OVERRIDE; + virtual base::string16 GetDisplayLanguageName( const std::string& language_code) const OVERRIDE; private: diff --git a/chrome/browser/chromeos/input_method/input_method_util.cc b/chrome/browser/chromeos/input_method/input_method_util.cc index 01be20b..8bc71ac 100644 --- a/chrome/browser/chromeos/input_method/input_method_util.cc +++ b/chrome/browser/chromeos/input_method/input_method_util.cc @@ -316,7 +316,7 @@ InputMethodUtil::~InputMethodUtil() { } bool InputMethodUtil::TranslateStringInternal( - const std::string& english_string, string16 *out_string) const { + const std::string& english_string, base::string16 *out_string) const { DCHECK(out_string); HashType::const_iterator iter = english_to_resource_id_.find(english_string); if (iter == english_to_resource_id_.end()) { @@ -331,9 +331,9 @@ bool InputMethodUtil::TranslateStringInternal( return true; } -string16 InputMethodUtil::TranslateString( +base::string16 InputMethodUtil::TranslateString( const std::string& english_string) const { - string16 localized_string; + base::string16 localized_string; if (TranslateStringInternal(english_string, &localized_string)) { return localized_string; } @@ -377,7 +377,7 @@ std::string InputMethodUtil::GetKeyboardLayoutName( std::string InputMethodUtil::GetInputMethodDisplayNameFromId( const std::string& input_method_id) const { - string16 display_name; + base::string16 display_name; if (!extension_ime_util::IsExtensionIME(input_method_id) && TranslateStringInternal(input_method_id, &display_name)) { return UTF16ToUTF8(display_name); @@ -386,11 +386,11 @@ std::string InputMethodUtil::GetInputMethodDisplayNameFromId( return ""; } -string16 InputMethodUtil::GetInputMethodShortName( +base::string16 InputMethodUtil::GetInputMethodShortName( const InputMethodDescriptor& input_method) const { // For the status area, we use two-letter, upper-case language code like // "US" and "JP". - string16 text; + base::string16 text; // Check special cases first. for (size_t i = 0; i < kMappingFromIdToIndicatorTextLen; ++i) { @@ -404,7 +404,7 @@ string16 InputMethodUtil::GetInputMethodShortName( if (text.empty() && IsKeyboardLayout(input_method.id())) { const size_t kMaxKeyboardLayoutNameLen = 2; - const string16 keyboard_layout = + const base::string16 keyboard_layout = UTF8ToUTF16(GetKeyboardLayoutName(input_method.id())); text = StringToUpperASCII(keyboard_layout).substr( 0, kMaxKeyboardLayoutNameLen); @@ -427,7 +427,7 @@ string16 InputMethodUtil::GetInputMethodShortName( return text; } -string16 InputMethodUtil::GetInputMethodMediumName( +base::string16 InputMethodUtil::GetInputMethodMediumName( const InputMethodDescriptor& input_method) const { // For the "Your input method has changed to..." bubble. In most cases // it uses the same name as the short name, unless found in a table @@ -442,7 +442,7 @@ string16 InputMethodUtil::GetInputMethodMediumName( return GetInputMethodShortName(input_method); } -string16 InputMethodUtil::GetInputMethodLongName( +base::string16 InputMethodUtil::GetInputMethodLongName( const InputMethodDescriptor& input_method) const { if (!input_method.name().empty()) { // If the descriptor has a name, use it. @@ -456,17 +456,18 @@ string16 InputMethodUtil::GetInputMethodLongName( // keyboard layouts and share the same layout of keyboard (Belgian). We need // to show explicitly the language for the layout. For Arabic, Amharic, and // Indic languages: they share "Standard Input Method". - const string16 standard_input_method_text = delegate_->GetLocalizedString( - IDS_OPTIONS_SETTINGS_LANGUAGES_M17N_STANDARD_INPUT_METHOD); + const base::string16 standard_input_method_text = + delegate_->GetLocalizedString( + IDS_OPTIONS_SETTINGS_LANGUAGES_M17N_STANDARD_INPUT_METHOD); DCHECK(!input_method.language_codes().empty()); const std::string language_code = input_method.language_codes().at(0); - string16 text = TranslateString(input_method.id()); + base::string16 text = TranslateString(input_method.id()); if (text == standard_input_method_text || language_code == "de" || language_code == "fr" || language_code == "nl") { - const string16 language_name = delegate_->GetDisplayLanguageName( + const base::string16 language_name = delegate_->GetDisplayLanguageName( language_code); text = language_name + UTF8ToUTF16(" - ") + text; diff --git a/chrome/browser/chromeos/input_method/input_method_util.h b/chrome/browser/chromeos/input_method/input_method_util.h index 6f70fea..32f3efb 100644 --- a/chrome/browser/chromeos/input_method/input_method_util.h +++ b/chrome/browser/chromeos/input_method/input_method_util.h @@ -39,7 +39,7 @@ class InputMethodUtil { // into Chrome's string ID, then pulls internationalized resource string from // the resource bundle and returns it. These functions are not thread-safe. // Non-UI threads are not allowed to call them. - string16 TranslateString(const std::string& english_string) const; + base::string16 TranslateString(const std::string& english_string) const; // Converts an input method ID to a language code of the IME. Returns "Eng" // when |input_method_id| is unknown. @@ -53,11 +53,11 @@ class InputMethodUtil { std::string GetInputMethodDisplayNameFromId( const std::string& input_method_id) const; - string16 GetInputMethodShortName( + base::string16 GetInputMethodShortName( const InputMethodDescriptor& input_method) const; - string16 GetInputMethodMediumName( + base::string16 GetInputMethodMediumName( const InputMethodDescriptor& input_method) const; - string16 GetInputMethodLongName( + base::string16 GetInputMethodLongName( const InputMethodDescriptor& input_method) const; // Converts an input method ID to an input method descriptor. Returns NULL @@ -140,7 +140,7 @@ class InputMethodUtil { private: bool TranslateStringInternal(const std::string& english_string, - string16 *out_string) const; + base::string16 *out_string) const; // Map from language code to associated input method IDs, etc. typedef std::multimap<std::string, std::string> LanguageCodeToIdsMap; diff --git a/chrome/browser/chromeos/input_method/input_method_util_unittest.cc b/chrome/browser/chromeos/input_method/input_method_util_unittest.cc index 700eafc..9cb861b 100644 --- a/chrome/browser/chromeos/input_method/input_method_util_unittest.cc +++ b/chrome/browser/chromeos/input_method/input_method_util_unittest.cc @@ -101,7 +101,7 @@ class InputMethodUtilTest : public testing::Test { GURL()); // input view page url } - static string16 GetDisplayLanguageName(const std::string& language_code) { + static base::string16 GetDisplayLanguageName(const std::string& language_code) { return l10n_util::GetDisplayNameForLocale(language_code, "en", true); } @@ -183,8 +183,8 @@ TEST_F(InputMethodUtilTest, GetInputMethodMediumNameTest) { const int len = ARRAYSIZE_UNSAFE(input_method_id); for (int i=0; i<len; ++i) { InputMethodDescriptor desc = GetDesc(input_method_id[i], "", ""); - string16 medium_name = util_.GetInputMethodMediumName(desc); - string16 short_name = util_.GetInputMethodShortName(desc); + base::string16 medium_name = util_.GetInputMethodMediumName(desc); + base::string16 short_name = util_.GetInputMethodShortName(desc); EXPECT_EQ(medium_name,short_name); } } @@ -202,8 +202,8 @@ TEST_F(InputMethodUtilTest, GetInputMethodMediumNameTest) { const int len = ARRAYSIZE_UNSAFE(input_method_id); for (int i=0; i<len; ++i) { InputMethodDescriptor desc = GetDesc(input_method_id[i], "", ""); - string16 medium_name = util_.GetInputMethodMediumName(desc); - string16 short_name = util_.GetInputMethodShortName(desc); + base::string16 medium_name = util_.GetInputMethodMediumName(desc); + base::string16 short_name = util_.GetInputMethodShortName(desc); EXPECT_NE(medium_name,short_name); } } @@ -466,7 +466,7 @@ TEST_F(InputMethodUtilTest, TestIBusInputMethodText) { for (size_t i = 0; i < util_.supported_input_methods_->size(); ++i) { const std::string language_code = util_.supported_input_methods_->at(i).language_codes().at(0); - const string16 display_name = + const base::string16 display_name = l10n_util::GetDisplayNameForLocale(language_code, "en", false); // Only two formats, like "fr" (lower case) and "en-US" (lower-upper), are // allowed. See the text file for details. diff --git a/chrome/browser/chromeos/input_method/mode_indicator_controller.cc b/chrome/browser/chromeos/input_method/mode_indicator_controller.cc index 820212f..006506e 100644 --- a/chrome/browser/chromeos/input_method/mode_indicator_controller.cc +++ b/chrome/browser/chromeos/input_method/mode_indicator_controller.cc @@ -93,7 +93,7 @@ void ModeIndicatorController::ShowModeIndicator() { // Get the short name of the changed input method (e.g. US, JA, etc.) const InputMethodDescriptor descriptor = imm_->GetCurrentInputMethod(); - const string16 short_name = + const base::string16 short_name = imm_->GetInputMethodUtil()->GetInputMethodShortName(descriptor); ModeIndicatorDelegateView* mi_delegate_view = diff --git a/chrome/browser/chromeos/input_method/mode_indicator_delegate_view.cc b/chrome/browser/chromeos/input_method/mode_indicator_delegate_view.cc index fba0cbce..8b15a97 100644 --- a/chrome/browser/chromeos/input_method/mode_indicator_delegate_view.cc +++ b/chrome/browser/chromeos/input_method/mode_indicator_delegate_view.cc @@ -32,7 +32,7 @@ const int kShowingDuration = 500; ModeIndicatorDelegateView::ModeIndicatorDelegateView( const gfx::Rect& cursor_bounds, - const string16& label) + const base::string16& label) : cursor_bounds_(cursor_bounds), label_view_(new views::Label(label)) { set_use_focusless(true); diff --git a/chrome/browser/chromeos/input_method/mode_indicator_delegate_view.h b/chrome/browser/chromeos/input_method/mode_indicator_delegate_view.h index 223c7ef..bc4c9c2 100644 --- a/chrome/browser/chromeos/input_method/mode_indicator_delegate_view.h +++ b/chrome/browser/chromeos/input_method/mode_indicator_delegate_view.h @@ -20,7 +20,7 @@ namespace input_method { class ModeIndicatorDelegateView : public views::BubbleDelegateView { public: ModeIndicatorDelegateView(const gfx::Rect& cursor_bounds, - const string16& label); + const base::string16& label); virtual ~ModeIndicatorDelegateView(); // Show the mode indicator then hide with fading animation. diff --git a/chrome/browser/chromeos/input_method/textinput_surroundingtext_browsertest.cc b/chrome/browser/chromeos/input_method/textinput_surroundingtext_browsertest.cc index d0351bd..a56dc60 100644 --- a/chrome/browser/chromeos/input_method/textinput_surroundingtext_browsertest.cc +++ b/chrome/browser/chromeos/input_method/textinput_surroundingtext_browsertest.cc @@ -34,9 +34,9 @@ IN_PROC_BROWSER_TEST_F(TextInput_SurroundingTextChangedTest, helper.WaitForTextInputStateChanged(ui::TEXT_INPUT_TYPE_TEXT_AREA); EXPECT_EQ(ui::TEXT_INPUT_TYPE_TEXT_AREA, helper.GetTextInputType()); - const string16 sample_text1 = UTF8ToUTF16("abcde"); - const string16 sample_text2 = UTF8ToUTF16("fghij"); - const string16 surrounding_text2 = sample_text1 + sample_text2; + const base::string16 sample_text1 = UTF8ToUTF16("abcde"); + const base::string16 sample_text2 = UTF8ToUTF16("fghij"); + const base::string16 surrounding_text2 = sample_text1 + sample_text2; gfx::Range expected_range1(5, 5); gfx::Range expected_range2(10, 10); @@ -71,7 +71,7 @@ IN_PROC_BROWSER_TEST_F(TextInput_SurroundingTextChangedTest, helper.WaitForTextInputStateChanged(ui::TEXT_INPUT_TYPE_TEXT_AREA); EXPECT_EQ(ui::TEXT_INPUT_TYPE_TEXT_AREA, helper.GetTextInputType()); - const string16 sample_text = UTF8ToUTF16("abcde"); + const base::string16 sample_text = UTF8ToUTF16("abcde"); gfx::Range expected_range(5, 5); ui::CompositionText composition_text; @@ -115,7 +115,7 @@ IN_PROC_BROWSER_TEST_F(TextInput_SurroundingTextChangedTest, // Click textarea containing text, so expecting new surrounding text comes. helper.ClickElement("filled_textarea", tab); - const string16 expected_text = UTF8ToUTF16("abcde"); + const base::string16 expected_text = UTF8ToUTF16("abcde"); const gfx::Range expected_range(5, 5); helper.WaitForSurroundingTextChanged(expected_text, expected_range); EXPECT_EQ(expected_text, helper.GetSurroundingText()); diff --git a/chrome/browser/chromeos/input_method/textinput_test_helper.cc b/chrome/browser/chromeos/input_method/textinput_test_helper.cc index 127b010..bae1bf3 100644 --- a/chrome/browser/chromeos/input_method/textinput_test_helper.cc +++ b/chrome/browser/chromeos/input_method/textinput_test_helper.cc @@ -145,7 +145,7 @@ void TextInputTestHelper::WaitForCaretBoundsChanged( } void TextInputTestHelper::WaitForSurroundingTextChanged( - const string16& expected_text, + const base::string16& expected_text, const gfx::Range& expected_selection) { waiting_type_ = WAIT_ON_CARET_BOUNDS_CHANGED; while (expected_text != surrounding_text_ || diff --git a/chrome/browser/chromeos/input_method/textinput_test_helper.h b/chrome/browser/chromeos/input_method/textinput_test_helper.h index 92dbc46..7013a0d 100644 --- a/chrome/browser/chromeos/input_method/textinput_test_helper.h +++ b/chrome/browser/chromeos/input_method/textinput_test_helper.h @@ -35,7 +35,7 @@ class TextInputTestHelper : public ui::InputMethodObserver { virtual ~TextInputTestHelper(); // Returns the latest status notified to ui::InputMethod - string16 GetSurroundingText() const; + base::string16 GetSurroundingText() const; gfx::Rect GetCaretRect() const; gfx::Rect GetCompositionHead() const; gfx::Range GetSelectionRange() const; @@ -51,7 +51,7 @@ class TextInputTestHelper : public ui::InputMethodObserver { void WaitForBlur(); void WaitForCaretBoundsChanged(const gfx::Rect& expected_caret_rect, const gfx::Rect& expected_composition_head); - void WaitForSurroundingTextChanged(const string16& expected_text, + void WaitForSurroundingTextChanged(const base::string16& expected_text, const gfx::Range& expected_selection); // Converts from string to gfx::Rect. The string should be "x,y,width,height". @@ -84,7 +84,7 @@ class TextInputTestHelper : public ui::InputMethodObserver { // Represents waiting type of text input event. WaitImeEventType waiting_type_; - string16 surrounding_text_; + base::string16 surrounding_text_; gfx::Rect caret_rect_; gfx::Rect composition_head_; gfx::Range selection_range_; diff --git a/chrome/browser/chromeos/kiosk_mode/kiosk_mode_screensaver.cc b/chrome/browser/chromeos/kiosk_mode/kiosk_mode_screensaver.cc index 2888d51..27e952a4 100644 --- a/chrome/browser/chromeos/kiosk_mode/kiosk_mode_screensaver.cc +++ b/chrome/browser/chromeos/kiosk_mode/kiosk_mode_screensaver.cc @@ -61,7 +61,7 @@ class ScreensaverUnpackerClient const base::DictionaryValue* original_manifest, const Extension* extension, const SkBitmap& install_icon) OVERRIDE; - virtual void OnUnpackFailure(const string16& error) OVERRIDE; + virtual void OnUnpackFailure(const base::string16& error) OVERRIDE; protected: virtual ~ScreensaverUnpackerClient() {} @@ -94,7 +94,7 @@ void ScreensaverUnpackerClient::OnUnpackSuccess( extension_root)); } -void ScreensaverUnpackerClient::OnUnpackFailure(const string16& error) { +void ScreensaverUnpackerClient::OnUnpackFailure(const base::string16& error) { LOG(ERROR) << "Couldn't unpack screensaver extension. Error: " << error; NotifyAppPackOfDamagedFile(); } diff --git a/chrome/browser/chromeos/locale_change_guard.cc b/chrome/browser/chromeos/locale_change_guard.cc index 46ff636..acd3483 100644 --- a/chrome/browser/chromeos/locale_change_guard.cc +++ b/chrome/browser/chromeos/locale_change_guard.cc @@ -219,9 +219,9 @@ void LocaleChangeGuard::PrepareChangingLocale( to_locale_ = to_locale; if (!from_locale_.empty() && !to_locale_.empty()) { - string16 from = l10n_util::GetDisplayNameForLocale( + base::string16 from = l10n_util::GetDisplayNameForLocale( from_locale_, cur_locale, true); - string16 to = l10n_util::GetDisplayNameForLocale( + base::string16 to = l10n_util::GetDisplayNameForLocale( to_locale_, cur_locale, true); title_text_ = l10n_util::GetStringUTF16( diff --git a/chrome/browser/chromeos/locale_change_guard.h b/chrome/browser/chromeos/locale_change_guard.h index 35e711a..bfabf4c 100644 --- a/chrome/browser/chromeos/locale_change_guard.h +++ b/chrome/browser/chromeos/locale_change_guard.h @@ -68,9 +68,9 @@ class LocaleChangeGuard : public content::NotificationObserver, // We want to show locale change notification in previous language however // we cannot directly load strings for non-current locale. So we cache // messages before locale change. - string16 title_text_; - string16 message_text_; - string16 revert_link_text_; + base::string16 title_text_; + base::string16 message_text_; + base::string16 revert_link_text_; }; } // namespace chromeos diff --git a/chrome/browser/chromeos/login/captive_portal_view.cc b/chrome/browser/chromeos/login/captive_portal_view.cc index 738c045..4d67aef 100644 --- a/chrome/browser/chromeos/login/captive_portal_view.cc +++ b/chrome/browser/chromeos/login/captive_portal_view.cc @@ -49,7 +49,7 @@ ui::ModalType CaptivePortalView::GetModalType() const { } string16 CaptivePortalView::GetWindowTitle() const { - string16 network_name; + base::string16 network_name; const NetworkState* default_network = NetworkHandler::Get()->network_state_handler()->DefaultNetwork(); std::string default_network_name = diff --git a/chrome/browser/chromeos/login/captive_portal_view.h b/chrome/browser/chromeos/login/captive_portal_view.h index 4913b8b..1a8b34e 100644 --- a/chrome/browser/chromeos/login/captive_portal_view.h +++ b/chrome/browser/chromeos/login/captive_portal_view.h @@ -23,7 +23,7 @@ class CaptivePortalView : public SimpleWebViewDialog { // Overridden from views::WidgetDelegate: virtual bool CanResize() const OVERRIDE; virtual ui::ModalType GetModalType() const OVERRIDE; - virtual string16 GetWindowTitle() const OVERRIDE; + virtual base::string16 GetWindowTitle() const OVERRIDE; virtual bool ShouldShowWindowTitle() const OVERRIDE; virtual views::NonClientFrameView* CreateNonClientFrameView( views::Widget* widget) OVERRIDE; diff --git a/chrome/browser/chromeos/login/default_user_images.cc b/chrome/browser/chromeos/login/default_user_images.cc index 30019e6..91d91af 100644 --- a/chrome/browser/chromeos/login/default_user_images.cc +++ b/chrome/browser/chromeos/login/default_user_images.cc @@ -148,7 +148,7 @@ string16 GetDefaultImageDescription(int index) { if (string_id) return l10n_util::GetStringUTF16(string_id); else - return string16(); + return base::string16(); } // Resource IDs of default user images. diff --git a/chrome/browser/chromeos/login/default_user_images.h b/chrome/browser/chromeos/login/default_user_images.h index d30bd11..9eec792 100644 --- a/chrome/browser/chromeos/login/default_user_images.h +++ b/chrome/browser/chromeos/login/default_user_images.h @@ -37,7 +37,7 @@ bool IsDefaultImageUrl(const std::string& url, int* image_id); const gfx::ImageSkia& GetDefaultImage(int index); // Returns a description of a default user image with specified index. -string16 GetDefaultImageDescription(int index); +base::string16 GetDefaultImageDescription(int index); // Resource IDs of default user images. extern const int kDefaultImageResourceIDs[]; diff --git a/chrome/browser/chromeos/login/existing_user_controller.cc b/chrome/browser/chromeos/login/existing_user_controller.cc index 29a2369..b18fbac 100644 --- a/chrome/browser/chromeos/login/existing_user_controller.cc +++ b/chrome/browser/chromeos/login/existing_user_controller.cc @@ -364,7 +364,7 @@ void ExistingUserController::CompleteLoginInternal( } } -string16 ExistingUserController::GetConnectedNetworkName() { +base::string16 ExistingUserController::GetConnectedNetworkName() { return network_state_helper_->GetCurrentNetworkName(); } diff --git a/chrome/browser/chromeos/login/existing_user_controller.h b/chrome/browser/chromeos/login/existing_user_controller.h index 5a0e84b..d49223f 100644 --- a/chrome/browser/chromeos/login/existing_user_controller.h +++ b/chrome/browser/chromeos/login/existing_user_controller.h @@ -78,7 +78,7 @@ class ExistingUserController : public LoginDisplay::Delegate, virtual void CancelPasswordChangedFlow() OVERRIDE; virtual void CreateAccount() OVERRIDE; virtual void CompleteLogin(const UserContext& user_context) OVERRIDE; - virtual string16 GetConnectedNetworkName() OVERRIDE; + virtual base::string16 GetConnectedNetworkName() OVERRIDE; virtual bool IsSigninInProgress() const OVERRIDE; virtual void Login(const UserContext& user_context) OVERRIDE; virtual void MigrateUserData(const std::string& old_password) OVERRIDE; diff --git a/chrome/browser/chromeos/login/fake_supervised_user_manager.cc b/chrome/browser/chromeos/login/fake_supervised_user_manager.cc index 6310d9e..c0c2b34 100644 --- a/chrome/browser/chromeos/login/fake_supervised_user_manager.cc +++ b/chrome/browser/chromeos/login/fake_supervised_user_manager.cc @@ -17,7 +17,7 @@ const User* FakeSupervisedUserManager::CreateUserRecord( const std::string& manager_id, const std::string& local_user_id, const std::string& sync_user_id, - const string16& display_name) { + const base::string16& display_name) { return NULL; } @@ -26,7 +26,7 @@ std::string FakeSupervisedUserManager::GenerateUserId() { } const User* FakeSupervisedUserManager::FindByDisplayName( - const string16& display_name) const { + const base::string16& display_name) const { return NULL; } @@ -42,7 +42,7 @@ std::string FakeSupervisedUserManager::GetUserSyncId( string16 FakeSupervisedUserManager::GetManagerDisplayName( const std::string& managed_user_id) const { - return string16(); + return base::string16(); } std::string FakeSupervisedUserManager::GetManagerUserId( diff --git a/chrome/browser/chromeos/login/fake_supervised_user_manager.h b/chrome/browser/chromeos/login/fake_supervised_user_manager.h index a291ade..d68ead1 100644 --- a/chrome/browser/chromeos/login/fake_supervised_user_manager.h +++ b/chrome/browser/chromeos/login/fake_supervised_user_manager.h @@ -21,19 +21,19 @@ class FakeSupervisedUserManager : public SupervisedUserManager { const std::string& manager_id, const std::string& local_user_id, const std::string& sync_user_id, - const string16& display_name) OVERRIDE; + const base::string16& display_name) OVERRIDE; virtual std::string GenerateUserId() OVERRIDE; - virtual const User* FindByDisplayName(const string16& display_name) const + virtual const User* FindByDisplayName(const base::string16& display_name) const OVERRIDE; virtual const User* FindBySyncId(const std::string& sync_id) const OVERRIDE; virtual std::string GetUserSyncId(const std::string& user_id) const OVERRIDE; - virtual string16 GetManagerDisplayName(const std::string& user_id) const + virtual base::string16 GetManagerDisplayName(const std::string& user_id) const OVERRIDE; virtual std::string GetManagerUserId(const std::string& user_id) const OVERRIDE; virtual std::string GetManagerDisplayEmail(const std::string& user_id) const OVERRIDE; - virtual void StartCreationTransaction(const string16& display_name) + virtual void StartCreationTransaction(const base::string16& display_name) OVERRIDE {} virtual void SetCreationTransactionUserId(const std::string& user_id) OVERRIDE {} diff --git a/chrome/browser/chromeos/login/fake_user_manager.cc b/chrome/browser/chromeos/login/fake_user_manager.cc index 01df4d0..d17ec39 100644 --- a/chrome/browser/chromeos/login/fake_user_manager.cc +++ b/chrome/browser/chromeos/login/fake_user_manager.cc @@ -108,7 +108,7 @@ void FakeUserManager::SwitchActiveUser(const std::string& email) { void FakeUserManager::SaveUserDisplayName( const std::string& username, - const string16& display_name) { + const base::string16& display_name) { for (UserList::iterator it = user_list_.begin(); it != user_list_.end(); ++it) { if ((*it)->email() == username) { @@ -179,7 +179,7 @@ Profile* FakeUserManager::GetProfileByUser(const User* user) const { string16 FakeUserManager::GetUserDisplayName( const std::string& username) const { - return string16(); + return base::string16(); } std::string FakeUserManager::GetUserDisplayEmail( diff --git a/chrome/browser/chromeos/login/fake_user_manager.h b/chrome/browser/chromeos/login/fake_user_manager.h index 1bc34c6..4e5d0ea 100644 --- a/chrome/browser/chromeos/login/fake_user_manager.h +++ b/chrome/browser/chromeos/login/fake_user_manager.h @@ -47,7 +47,7 @@ class FakeUserManager : public UserManager { virtual User* GetActiveUser() OVERRIDE; virtual void SwitchActiveUser(const std::string& email) OVERRIDE; virtual void SaveUserDisplayName(const std::string& username, - const string16& display_name) OVERRIDE; + const base::string16& display_name) OVERRIDE; // Not implemented. virtual void UpdateUserAccountData( @@ -75,7 +75,7 @@ class FakeUserManager : public UserManager { virtual void SaveUserOAuthStatus( const std::string& username, User::OAuthTokenStatus oauth_token_status) OVERRIDE {} - virtual string16 GetUserDisplayName( + virtual base::string16 GetUserDisplayName( const std::string& username) const OVERRIDE; virtual void SaveUserDisplayEmail(const std::string& username, const std::string& display_email) OVERRIDE {} diff --git a/chrome/browser/chromeos/login/helper.cc b/chrome/browser/chromeos/login/helper.cc index c75fb09..0cdbfec 100644 --- a/chrome/browser/chromeos/login/helper.cc +++ b/chrome/browser/chromeos/login/helper.cc @@ -61,7 +61,7 @@ string16 NetworkStateHelper::GetCurrentNetworkName() const { return l10n_util::GetStringUTF16(IDS_STATUSBAR_NETWORK_DEVICE_ETHERNET); return UTF8ToUTF16(network->name()); } - return string16(); + return base::string16(); } bool NetworkStateHelper::IsConnected() const { diff --git a/chrome/browser/chromeos/login/helper.h b/chrome/browser/chromeos/login/helper.h index 543e6e5..b481c5f 100644 --- a/chrome/browser/chromeos/login/helper.h +++ b/chrome/browser/chromeos/login/helper.h @@ -48,7 +48,7 @@ class NetworkStateHelper { // that is in the "connecting" state. Otherwise empty string is returned. // If there are multiple connected networks, network priority: // Ethernet > WiFi > Cellular. Same for connecting network. - virtual string16 GetCurrentNetworkName() const; + virtual base::string16 GetCurrentNetworkName() const; // Returns true if the default network is in connected state. virtual bool IsConnected() const; diff --git a/chrome/browser/chromeos/login/language_list.cc b/chrome/browser/chromeos/login/language_list.cc index fa5a671..020292e 100644 --- a/chrome/browser/chromeos/login/language_list.cc +++ b/chrome/browser/chromeos/login/language_list.cc @@ -36,10 +36,10 @@ string16 LanguageList::GetLanguageNameAt(int index) const { // We must add directionality formatting to both the native name and the // locale name in order to avoid text rendering problems such as misplaced // parentheses or languages appearing in the wrong order. - string16 locale_name = locale_names_[index]; + base::string16 locale_name = locale_names_[index]; base::i18n::AdjustStringForLocaleDirection(&locale_name); - string16 native_name = locale_data->second.native_name; + base::string16 native_name = locale_data->second.native_name; base::i18n::AdjustStringForLocaleDirection(&native_name); // We used to have a localizable template here, but none of translators @@ -96,9 +96,9 @@ void LanguageList::InitNativeNames( // TODO(jungshik): Even though these strings are used for the UI, // the old code does not add an RTL mark for RTL locales. Make sure // that it's ok without that. - string16 name_in_current_ui = + base::string16 name_in_current_ui = l10n_util::GetDisplayNameForLocale(locale_code, app_locale, false); - string16 name_native = + base::string16 name_native = l10n_util::GetDisplayNameForLocale(locale_code, locale_code, false); locale_names_.push_back(name_in_current_ui); diff --git a/chrome/browser/chromeos/login/language_list.h b/chrome/browser/chromeos/login/language_list.h index f959de4..4edfb11 100644 --- a/chrome/browser/chromeos/login/language_list.h +++ b/chrome/browser/chromeos/login/language_list.h @@ -25,7 +25,7 @@ class LanguageList { int languages_count() const { return static_cast<int>(locale_names_.size()); } // Returns the language for the given |index|. - string16 GetLanguageNameAt(int index) const; + base::string16 GetLanguageNameAt(int index) const; // Return the locale for the given |index|. E.g., may return pt-BR. std::string GetLocaleFromIndex(int index) const; @@ -40,10 +40,10 @@ class LanguageList { private: struct LocaleData { LocaleData() {} - LocaleData(const string16& name, const std::string& code) + LocaleData(const base::string16& name, const std::string& code) : native_name(name), locale_code(code) {} - string16 native_name; + base::string16 native_name; std::string locale_code; // E.g., en-us. }; diff --git a/chrome/browser/chromeos/login/login_display.h b/chrome/browser/chromeos/login/login_display.h index 763a66e..d89166f 100644 --- a/chrome/browser/chromeos/login/login_display.h +++ b/chrome/browser/chromeos/login/login_display.h @@ -42,7 +42,7 @@ class LoginDisplay : public RemoveUserDelegate { virtual void CompleteLogin(const UserContext& user_context) = 0; // Returns name of the currently connected network. - virtual string16 GetConnectedNetworkName() = 0; + virtual base::string16 GetConnectedNetworkName() = 0; // Returns true if sign in is in progress. virtual bool IsSigninInProgress() const = 0; diff --git a/chrome/browser/chromeos/login/login_utils.cc b/chrome/browser/chromeos/login/login_utils.cc index 55013e4..e9cae8c 100644 --- a/chrome/browser/chromeos/login/login_utils.cc +++ b/chrome/browser/chromeos/login/login_utils.cc @@ -410,7 +410,7 @@ void LoginUtilsImpl::PrepareProfile( user_manager->GetUserProfileDir(user_context.username), base::Bind(&LoginUtilsImpl::OnProfileCreated, AsWeakPtr(), user_context.username), - string16(), string16(), std::string()); + base::string16(), base::string16(), std::string()); } void LoginUtilsImpl::DelegateDeleted(LoginUtils::Delegate* delegate) { diff --git a/chrome/browser/chromeos/login/login_utils_browsertest.cc b/chrome/browser/chromeos/login/login_utils_browsertest.cc index ba0651d..14e423f 100644 --- a/chrome/browser/chromeos/login/login_utils_browsertest.cc +++ b/chrome/browser/chromeos/login/login_utils_browsertest.cc @@ -551,7 +551,7 @@ TEST_F(LoginUtilsTest, RlzInitialized) { EXPECT_EQ(std::string(), local_state_.Get()->GetString(prefs::kRLZBrand)); // RLZ value for homepage access point should have been initialized. - string16 rlz_string; + base::string16 rlz_string; EXPECT_TRUE(RLZTracker::GetAccessPointRlz( RLZTracker::CHROME_HOME_PAGE, &rlz_string)); EXPECT_EQ(string16(), rlz_string); diff --git a/chrome/browser/chromeos/login/login_web_dialog.cc b/chrome/browser/chromeos/login/login_web_dialog.cc index f72bf1c..32ff690 100644 --- a/chrome/browser/chromeos/login/login_web_dialog.cc +++ b/chrome/browser/chromeos/login/login_web_dialog.cc @@ -41,7 +41,7 @@ void LoginWebDialog::Delegate::OnDialogClosed() { LoginWebDialog::LoginWebDialog(Delegate* delegate, gfx::NativeWindow parent_window, - const string16& title, + const base::string16& title, const GURL& url, Style style) : delegate_(delegate), @@ -72,7 +72,7 @@ void LoginWebDialog::SetDialogSize(int width, int height) { height_ = height; } -void LoginWebDialog::SetDialogTitle(const string16& title) { +void LoginWebDialog::SetDialogTitle(const base::string16& title) { title_ = title; } diff --git a/chrome/browser/chromeos/login/login_web_dialog.h b/chrome/browser/chromeos/login/login_web_dialog.h index 75290a2..7249ba8 100644 --- a/chrome/browser/chromeos/login/login_web_dialog.h +++ b/chrome/browser/chromeos/login/login_web_dialog.h @@ -40,7 +40,7 @@ class LoginWebDialog : public ui::WebDialogDelegate, LoginWebDialog(Delegate* delegate, gfx::NativeWindow parent_window, - const string16& title, + const base::string16& title, const GURL& url, Style style); virtual ~LoginWebDialog(); @@ -51,7 +51,7 @@ class LoginWebDialog : public ui::WebDialogDelegate, void SetDialogSize(int width, int height); // Overrides dialog title. - void SetDialogTitle(const string16& title); + void SetDialogTitle(const base::string16& title); void set_url(const GURL& url) { url_ = url; } @@ -60,7 +60,7 @@ class LoginWebDialog : public ui::WebDialogDelegate, protected: // ui::WebDialogDelegate implementation. virtual ui::ModalType GetDialogModalType() const OVERRIDE; - virtual string16 GetDialogTitle() const OVERRIDE; + virtual base::string16 GetDialogTitle() const OVERRIDE; virtual GURL GetDialogContentURL() const OVERRIDE; virtual void GetWebUIMessageHandlers( std::vector<content::WebUIMessageHandler*>* handlers) const OVERRIDE; @@ -85,7 +85,7 @@ class LoginWebDialog : public ui::WebDialogDelegate, Delegate* delegate_; gfx::NativeWindow parent_window_; - string16 title_; + base::string16 title_; GURL url_; Style style_; content::NotificationRegistrar notification_registrar_; diff --git a/chrome/browser/chromeos/login/managed/locally_managed_user_creation_controller.cc b/chrome/browser/chromeos/login/managed/locally_managed_user_creation_controller.cc index 80006dc..6da94f9 100644 --- a/chrome/browser/chromeos/login/managed/locally_managed_user_creation_controller.cc +++ b/chrome/browser/chromeos/login/managed/locally_managed_user_creation_controller.cc @@ -84,7 +84,7 @@ LocallyManagedUserCreationController::~LocallyManagedUserCreationController() { } void LocallyManagedUserCreationController::SetUpCreation( - const string16& display_name, + const base::string16& display_name, const std::string& password, int avatar_index) { DCHECK(creation_context_); @@ -94,7 +94,7 @@ void LocallyManagedUserCreationController::SetUpCreation( } void LocallyManagedUserCreationController::StartImport( - const string16& display_name, + const base::string16& display_name, const std::string& password, int avatar_index, const std::string& sync_id, diff --git a/chrome/browser/chromeos/login/managed/locally_managed_user_creation_controller.h b/chrome/browser/chromeos/login/managed/locally_managed_user_creation_controller.h index ce50959..c0a796b 100644 --- a/chrome/browser/chromeos/login/managed/locally_managed_user_creation_controller.h +++ b/chrome/browser/chromeos/login/managed/locally_managed_user_creation_controller.h @@ -73,14 +73,14 @@ class LocallyManagedUserCreationController // Set up controller for creating new supervised user with |display_name|, // |password| and avatar indexed by |avatar_index|. StartCreation() have to // be called to actually start creating user. - void SetUpCreation(const string16& display_name, + void SetUpCreation(const base::string16& display_name, const std::string& password, int avatar_index); // Configures and initiates importing existing supervised user to this device. // Existing user is identified by |sync_id|, has |display_name|, |password|, // |avatar_index|. The master key for cryptohome is a |master_key|. - void StartImport(const string16& display_name, + void StartImport(const base::string16& display_name, const std::string& password, int avatar_index, const std::string& sync_id, @@ -103,7 +103,7 @@ class LocallyManagedUserCreationController UserCreationContext(); ~UserCreationContext(); - string16 display_name; + base::string16 display_name; int avatar_index; std::string manager_id; std::string local_user_id; // Used to identify cryptohome. diff --git a/chrome/browser/chromeos/login/managed/locally_managed_user_creation_flow.h b/chrome/browser/chromeos/login/managed/locally_managed_user_creation_flow.h index 73e3f456..9958620 100644 --- a/chrome/browser/chromeos/login/managed/locally_managed_user_creation_flow.h +++ b/chrome/browser/chromeos/login/managed/locally_managed_user_creation_flow.h @@ -30,7 +30,7 @@ class LocallyManagedUserCreationFlow : public ExtendedUserFlow { virtual void LaunchExtraSteps(Profile* profile) OVERRIDE; private: // Display name for user being created. - string16 name_; + base::string16 name_; // Password for user being created. std::string password_; diff --git a/chrome/browser/chromeos/login/managed/locally_managed_user_creation_screen.cc b/chrome/browser/chromeos/login/managed/locally_managed_user_creation_screen.cc index 46ae7fb..a0b6894 100644 --- a/chrome/browser/chromeos/login/managed/locally_managed_user_creation_screen.cc +++ b/chrome/browser/chromeos/login/managed/locally_managed_user_creation_screen.cc @@ -191,7 +191,7 @@ void LocallyManagedUserCreationScreen::AuthenticateManager( } void LocallyManagedUserCreationScreen::CreateManagedUser( - const string16& display_name, + const base::string16& display_name, const std::string& managed_user_password) { DCHECK(controller_.get()); int image; @@ -214,7 +214,7 @@ void LocallyManagedUserCreationScreen::ImportManagedUser( LOG(ERROR) << "Can not import non-existing user " << user_id; return; } - string16 display_name; + base::string16 display_name; std::string master_key; std::string avatar; bool exists; @@ -258,7 +258,7 @@ void LocallyManagedUserCreationScreen::ImportManagedUserWithPassword( LOG(ERROR) << "Can not import non-existing user " << user_id; return; } - string16 display_name; + base::string16 display_name; std::string master_key; std::string avatar; bool exists; @@ -333,9 +333,9 @@ void LocallyManagedUserCreationScreen::OnActorDestroyed( void LocallyManagedUserCreationScreen::OnCreationError( LocallyManagedUserCreationController::ErrorCode code) { - string16 title; - string16 message; - string16 button; + base::string16 title; + base::string16 message; + base::string16 button; // TODO(antrim) : find out which errors do we really have. // We might reuse some error messages from ordinary user flow. switch (code) { @@ -380,7 +380,7 @@ void LocallyManagedUserCreationScreen::OnLongCreationWarning() { } bool LocallyManagedUserCreationScreen::FindUserByDisplayName( - const string16& display_name, + const base::string16& display_name, std::string *out_id) const { if (!existing_users_.get()) return false; @@ -388,7 +388,7 @@ bool LocallyManagedUserCreationScreen::FindUserByDisplayName( !it.IsAtEnd(); it.Advance()) { const base::DictionaryValue* user_info = static_cast<const base::DictionaryValue*>(&it.value()); - string16 user_display_name; + base::string16 user_display_name; if (user_info->GetString(ManagedUserSyncService::kName, &user_display_name)) { if (display_name == user_display_name) { @@ -486,7 +486,7 @@ void LocallyManagedUserCreationScreen::OnGetManagedUsers( local_copy->SetBoolean(kUserExists, false); ui_copy->SetBoolean(kUserExists, false); - string16 display_name; + base::string16 display_name; local_copy->GetString(ManagedUserSyncService::kName, &display_name); if (supervised_user_manager->FindBySyncId(it.key())) { diff --git a/chrome/browser/chromeos/login/managed/locally_managed_user_creation_screen.h b/chrome/browser/chromeos/login/managed/locally_managed_user_creation_screen.h index 4b870c2..a1cfe32 100644 --- a/chrome/browser/chromeos/login/managed/locally_managed_user_creation_screen.h +++ b/chrome/browser/chromeos/login/managed/locally_managed_user_creation_screen.h @@ -68,7 +68,7 @@ class LocallyManagedUserCreationScreen virtual void OnActorDestroyed(LocallyManagedUserCreationScreenHandler* actor) OVERRIDE; virtual void CreateManagedUser( - const string16& display_name, + const base::string16& display_name, const std::string& managed_user_password) OVERRIDE; virtual void ImportManagedUser(const std::string& user_id) OVERRIDE; virtual void ImportManagedUserWithPassword( @@ -79,7 +79,7 @@ class LocallyManagedUserCreationScreen const std::string& manager_password) OVERRIDE; virtual void AbortFlow() OVERRIDE; virtual void FinishFlow() OVERRIDE; - virtual bool FindUserByDisplayName(const string16& display_name, + virtual bool FindUserByDisplayName(const base::string16& display_name, std::string *out_id) const OVERRIDE; virtual void OnPageSelected(const std::string& page) OVERRIDE; diff --git a/chrome/browser/chromeos/login/mock_user_manager.h b/chrome/browser/chromeos/login/mock_user_manager.h index cf682f6..e6242e7 100644 --- a/chrome/browser/chromeos/login/mock_user_manager.h +++ b/chrome/browser/chromeos/login/mock_user_manager.h @@ -43,10 +43,10 @@ class MockUserManager : public UserManager { User::OAuthTokenStatus)); MOCK_CONST_METHOD1(GetProfileByUser, Profile*(const User*)); MOCK_METHOD2(SaveUserDisplayName, void(const std::string&, - const string16&)); + const base::string16&)); MOCK_METHOD2(UpdateUserAccountData, void(const std::string&, const UserAccountData&)); - MOCK_CONST_METHOD1(GetUserDisplayName, string16(const std::string&)); + MOCK_CONST_METHOD1(GetUserDisplayName, base::string16(const std::string&)); MOCK_METHOD2(SaveUserDisplayEmail, void(const std::string&, const std::string&)); MOCK_CONST_METHOD1(GetUserDisplayEmail, std::string(const std::string&)); diff --git a/chrome/browser/chromeos/login/proxy_settings_dialog.cc b/chrome/browser/chromeos/login/proxy_settings_dialog.cc index 63f1bd2..2da776b 100644 --- a/chrome/browser/chromeos/login/proxy_settings_dialog.cc +++ b/chrome/browser/chromeos/login/proxy_settings_dialog.cc @@ -56,7 +56,7 @@ ProxySettingsDialog::ProxySettingsDialog(const NetworkState& network, gfx::NativeWindow window) : LoginWebDialog(delegate, window, - string16(), + base::string16(), GetURLForProxySettings(network.path()), LoginWebDialog::STYLE_BUBBLE) { DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); diff --git a/chrome/browser/chromeos/login/screen_locker_tester.cc b/chrome/browser/chromeos/login/screen_locker_tester.cc index 928931e..9fbf003 100644 --- a/chrome/browser/chromeos/login/screen_locker_tester.cc +++ b/chrome/browser/chromeos/login/screen_locker_tester.cc @@ -120,7 +120,7 @@ class WebUIScreenLockerTester : public ScreenLockerTester { void WebUIScreenLockerTester::SetPassword(const std::string& password) { RenderViewHost()->ExecuteJavascriptInWebFrame( - string16(), + base::string16(), ASCIIToUTF16(base::StringPrintf( "$('pod-row').pods[0].passwordElement.value = '%s';", password.c_str()))); diff --git a/chrome/browser/chromeos/login/screens/mock_network_screen.h b/chrome/browser/chromeos/login/screens/mock_network_screen.h index 9420d98..08d8dd7 100644 --- a/chrome/browser/chromeos/login/screens/mock_network_screen.h +++ b/chrome/browser/chromeos/login/screens/mock_network_screen.h @@ -29,10 +29,10 @@ class MockNetworkScreenActor : public NetworkScreenActor { MOCK_METHOD0(PrepareToShow, void()); MOCK_METHOD0(Show, void()); MOCK_METHOD0(Hide, void()); - MOCK_METHOD1(ShowError, void(const string16& message)); + MOCK_METHOD1(ShowError, void(const base::string16& message)); MOCK_METHOD0(ClearErrors, void()); MOCK_METHOD2(ShowConnectingStatus, - void(bool connecting, const string16& network_id)); + void(bool connecting, const base::string16& network_id)); MOCK_METHOD1(EnableContinue, void(bool enabled)); MOCK_CONST_METHOD0(IsContinueEnabled, bool()); MOCK_CONST_METHOD0(IsConnecting, bool()); diff --git a/chrome/browser/chromeos/login/screens/network_screen.cc b/chrome/browser/chromeos/login/screens/network_screen.cc index 94eb70e..af6d66e 100644 --- a/chrome/browser/chromeos/login/screens/network_screen.cc +++ b/chrome/browser/chromeos/login/screens/network_screen.cc @@ -162,7 +162,7 @@ void NetworkScreen::UpdateStatus() { if (is_connected) actor_->ClearErrors(); - string16 network_name = network_state_helper_->GetCurrentNetworkName(); + base::string16 network_name = network_state_helper_->GetCurrentNetworkName(); if (is_connected) { StopWaitingForConnection(network_name); } else if (network_state_helper_->IsConnecting()) { @@ -172,7 +172,7 @@ void NetworkScreen::UpdateStatus() { } } -void NetworkScreen::StopWaitingForConnection(const string16& network_id) { +void NetworkScreen::StopWaitingForConnection(const base::string16& network_id) { bool is_connected = network_state_helper_->IsConnected(); if (is_connected && continue_pressed_) { NotifyOnConnection(); @@ -189,7 +189,7 @@ void NetworkScreen::StopWaitingForConnection(const string16& network_id) { } } -void NetworkScreen::WaitForConnection(const string16& network_id) { +void NetworkScreen::WaitForConnection(const base::string16& network_id) { if (network_id_ != network_id || !connection_timer_.IsRunning()) { connection_timer_.Stop(); connection_timer_.Start(FROM_HERE, diff --git a/chrome/browser/chromeos/login/screens/network_screen.h b/chrome/browser/chromeos/login/screens/network_screen.h index 7de34d9..da50a47 100644 --- a/chrome/browser/chromeos/login/screens/network_screen.h +++ b/chrome/browser/chromeos/login/screens/network_screen.h @@ -73,16 +73,16 @@ class NetworkScreen : public WizardScreen, void UpdateStatus(); // Stops waiting for network to connect. - void StopWaitingForConnection(const string16& network_id); + void StopWaitingForConnection(const base::string16& network_id); // Starts waiting for network connection. Shows spinner. - void WaitForConnection(const string16& network_id); + void WaitForConnection(const base::string16& network_id); // True if subscribed to network change notification. bool is_network_subscribed_; // ID of the the network that we are waiting for. - string16 network_id_; + base::string16 network_id_; // True if user pressed continue button so we should proceed with OOBE // as soon as we are connected. diff --git a/chrome/browser/chromeos/login/screens/network_screen_actor.h b/chrome/browser/chromeos/login/screens/network_screen_actor.h index 58ccb27..3703dc4 100644 --- a/chrome/browser/chromeos/login/screens/network_screen_actor.h +++ b/chrome/browser/chromeos/login/screens/network_screen_actor.h @@ -35,7 +35,7 @@ class NetworkScreenActor { virtual void Hide() = 0; // Shows error message in a bubble. - virtual void ShowError(const string16& message) = 0; + virtual void ShowError(const base::string16& message) = 0; // Hides error messages showing no error state. virtual void ClearErrors() = 0; @@ -43,7 +43,7 @@ class NetworkScreenActor { // Shows network connecting status or network selection otherwise. virtual void ShowConnectingStatus( bool connecting, - const string16& network_id) = 0; + const base::string16& network_id) = 0; // Sets whether continue control is enabled. virtual void EnableContinue(bool enabled) = 0; diff --git a/chrome/browser/chromeos/login/screens/network_screen_browsertest.cc b/chrome/browser/chromeos/login/screens/network_screen_browsertest.cc index a77d14c..6ecde46 100644 --- a/chrome/browser/chromeos/login/screens/network_screen_browsertest.cc +++ b/chrome/browser/chromeos/login/screens/network_screen_browsertest.cc @@ -36,7 +36,7 @@ namespace login { class MockNetworkStateHelper : public NetworkStateHelper { public: - MOCK_CONST_METHOD0(GetCurrentNetworkName, string16(void)); + MOCK_CONST_METHOD0(GetCurrentNetworkName, base::string16(void)); MOCK_CONST_METHOD0(IsConnected, bool(void)); MOCK_CONST_METHOD0(IsConnecting, bool(void)); }; @@ -95,7 +95,7 @@ class NetworkScreenTest : public WizardInProcessBrowserTest { void SetDefaultNetworkStateHelperExpectations() { EXPECT_CALL(*mock_network_state_helper_, GetCurrentNetworkName()) .Times(AnyNumber()) - .WillRepeatedly((Return(string16()))); + .WillRepeatedly((Return(base::string16()))); EXPECT_CALL(*mock_network_state_helper_, IsConnected()) .Times(AnyNumber()) .WillRepeatedly((Return(false))); diff --git a/chrome/browser/chromeos/login/supervised_user_manager.h b/chrome/browser/chromeos/login/supervised_user_manager.h index 880c989..4b116a8 100644 --- a/chrome/browser/chromeos/login/supervised_user_manager.h +++ b/chrome/browser/chromeos/login/supervised_user_manager.h @@ -37,14 +37,15 @@ class SupervisedUserManager { const std::string& manager_id, const std::string& local_user_id, const std::string& sync_user_id, - const string16& display_name) = 0; + const base::string16& display_name) = 0; // Generates unique user ID for supervised user. virtual std::string GenerateUserId() = 0; // Returns the supervised user with the given |display_name| if found in // the persistent list. Returns |NULL| otherwise. - virtual const User* FindByDisplayName(const string16& display_name) const = 0; + virtual const User* FindByDisplayName( + const base::string16& display_name) const = 0; // Returns the supervised user with the given |sync_id| if found in // the persistent list. Returns |NULL| otherwise. @@ -57,7 +58,8 @@ class SupervisedUserManager { // Returns the display name for manager of user |user_id| if it is known // (was previously set by a |SaveUserDisplayName| call). // Otherwise, returns a manager id. - virtual string16 GetManagerDisplayName(const std::string& user_id) const = 0; + virtual base::string16 GetManagerDisplayName( + const std::string& user_id) const = 0; // Returns the user id for manager of user |user_id| if it is known (user is // actually a managed user). @@ -71,7 +73,7 @@ class SupervisedUserManager { const = 0; // Create a record about starting supervised user creation transaction. - virtual void StartCreationTransaction(const string16& display_name) = 0; + virtual void StartCreationTransaction(const base::string16& display_name) = 0; // Add user id to supervised user creation transaction record. virtual void SetCreationTransactionUserId(const std::string& user_id) = 0; diff --git a/chrome/browser/chromeos/login/supervised_user_manager_impl.cc b/chrome/browser/chromeos/login/supervised_user_manager_impl.cc index 4d35f06..ca5cadc 100644 --- a/chrome/browser/chromeos/login/supervised_user_manager_impl.cc +++ b/chrome/browser/chromeos/login/supervised_user_manager_impl.cc @@ -108,7 +108,7 @@ const User* SupervisedUserManagerImpl::CreateUserRecord( const std::string& manager_id, const std::string& local_user_id, const std::string& sync_user_id, - const string16& display_name) { + const base::string16& display_name) { const User* user = FindByDisplayName(display_name); DCHECK(!user); if (user) @@ -163,7 +163,7 @@ string16 SupervisedUserManagerImpl::GetManagerDisplayName( PrefService* local_state = g_browser_process->local_state(); const DictionaryValue* manager_names = local_state->GetDictionary(kManagedUserManagerNames); - string16 result; + base::string16 result; if (manager_names->GetStringWithoutPathExpansion(user_id, &result) && !result.empty()) return result; @@ -194,7 +194,7 @@ std::string SupervisedUserManagerImpl::GetManagerDisplayEmail( } const User* SupervisedUserManagerImpl::FindByDisplayName( - const string16& display_name) const { + const base::string16& display_name) const { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); const UserList& users = owner_->GetUsers(); for (UserList::const_iterator it = users.begin(); it != users.end(); ++it) { @@ -220,7 +220,7 @@ const User* SupervisedUserManagerImpl::FindBySyncId( } void SupervisedUserManagerImpl::StartCreationTransaction( - const string16& display_name) { + const base::string16& display_name) { g_browser_process->local_state()-> SetString(kLocallyManagedUserCreationTransactionDisplayName, UTF16ToASCII(display_name)); @@ -311,7 +311,7 @@ bool SupervisedUserManagerImpl::CheckForFirstRun(const std::string& user_id) { } void SupervisedUserManagerImpl::UpdateManagerName(const std::string& manager_id, - const string16& new_display_name) { + const base::string16& new_display_name) { PrefService* local_state = g_browser_process->local_state(); const DictionaryValue* manager_ids = diff --git a/chrome/browser/chromeos/login/supervised_user_manager_impl.h b/chrome/browser/chromeos/login/supervised_user_manager_impl.h index e598006..e31766ee 100644 --- a/chrome/browser/chromeos/login/supervised_user_manager_impl.h +++ b/chrome/browser/chromeos/login/supervised_user_manager_impl.h @@ -26,19 +26,19 @@ class SupervisedUserManagerImpl const std::string& manager_id, const std::string& local_user_id, const std::string& sync_user_id, - const string16& display_name) OVERRIDE; + const base::string16& display_name) OVERRIDE; virtual std::string GenerateUserId() OVERRIDE; - virtual const User* FindByDisplayName(const string16& display_name) const + virtual const User* FindByDisplayName(const base::string16& display_name) const OVERRIDE; virtual const User* FindBySyncId(const std::string& sync_id) const OVERRIDE; virtual std::string GetUserSyncId(const std::string& user_id) const OVERRIDE; - virtual string16 GetManagerDisplayName(const std::string& user_id) const + virtual base::string16 GetManagerDisplayName(const std::string& user_id) const OVERRIDE; virtual std::string GetManagerUserId(const std::string& user_id) const OVERRIDE; virtual std::string GetManagerDisplayEmail(const std::string& user_id) const OVERRIDE; - virtual void StartCreationTransaction(const string16& display_name) OVERRIDE; + virtual void StartCreationTransaction(const base::string16& display_name) OVERRIDE; virtual void SetCreationTransactionUserId(const std::string& user_id) OVERRIDE; virtual void CommitCreationTransaction() OVERRIDE; @@ -61,7 +61,7 @@ class SupervisedUserManagerImpl // Update name if this user is manager of some managed users. void UpdateManagerName(const std::string& manager_id, - const string16& new_display_name); + const base::string16& new_display_name); UserManagerImpl* owner_; diff --git a/chrome/browser/chromeos/login/user.cc b/chrome/browser/chromeos/login/user.cc index 33b38e2..b47d650 100644 --- a/chrome/browser/chromeos/login/user.cc +++ b/chrome/browser/chromeos/login/user.cc @@ -150,7 +150,7 @@ bool UserContext::operator==(const UserContext& context) const { context.using_oauth == using_oauth; } -string16 User::GetDisplayName() const { +base::string16 User::GetDisplayName() const { // Fallback to the email account name in case display name haven't been set. return display_name_.empty() ? UTF8ToUTF16(GetAccountName(true)) : diff --git a/chrome/browser/chromeos/login/user.h b/chrome/browser/chromeos/login/user.h index 708b1f3..5c8168a 100644 --- a/chrome/browser/chromeos/login/user.h +++ b/chrome/browser/chromeos/login/user.h @@ -106,10 +106,10 @@ class User { const std::string& email() const { return email_; } // Returns the human name to display for this user. - string16 GetDisplayName() const; + base::string16 GetDisplayName() const; // Returns given name of user, or empty string if given name is unknown. - const string16& given_name() const { return given_name_; } + const base::string16& given_name() const { return given_name_; } // Returns the account name part of the email. Use the display form of the // email if available and use_display_name == true. Otherwise use canonical. @@ -154,7 +154,7 @@ class User { OAuthTokenStatus oauth_token_status() const { return oauth_token_status_; } // The displayed user name. - string16 display_name() const { return display_name_; } + base::string16 display_name() const { return display_name_; } // The displayed (non-canonical) user email. virtual std::string display_email() const; @@ -214,11 +214,11 @@ class User { oauth_token_status_ = status; } - void set_display_name(const string16& display_name) { + void set_display_name(const base::string16& display_name) { display_name_ = display_name; } - void set_given_name(const string16& given_name) { given_name_ = given_name; } + void set_given_name(const base::string16& given_name) { given_name_ = given_name; } void set_display_email(const std::string& display_email) { display_email_ = display_email; @@ -247,8 +247,8 @@ class User { private: std::string email_; - string16 display_name_; - string16 given_name_; + base::string16 display_name_; + base::string16 given_name_; // The displayed user email, defaults to |email_|. std::string display_email_; UserImage user_image_; diff --git a/chrome/browser/chromeos/login/user_manager.cc b/chrome/browser/chromeos/login/user_manager.cc index c06060e..1af5a26 100644 --- a/chrome/browser/chromeos/login/user_manager.cc +++ b/chrome/browser/chromeos/login/user_manager.cc @@ -52,8 +52,8 @@ PendingUserSessionsRestoreFinished() { UserManager::UserSessionStateObserver::~UserSessionStateObserver() { } -UserManager::UserAccountData::UserAccountData(const string16& display_name, - const string16& given_name, +UserManager::UserAccountData::UserAccountData(const base::string16& display_name, + const base::string16& given_name, const std::string& locale) : display_name_(display_name), given_name_(given_name), diff --git a/chrome/browser/chromeos/login/user_manager.h b/chrome/browser/chromeos/login/user_manager.h index 43ba630..05bec86 100644 --- a/chrome/browser/chromeos/login/user_manager.h +++ b/chrome/browser/chromeos/login/user_manager.h @@ -59,17 +59,17 @@ class UserManager { // Data retrieved from user account. class UserAccountData { public: - UserAccountData(const string16& display_name, - const string16& given_name, + UserAccountData(const base::string16& display_name, + const base::string16& given_name, const std::string& locale); ~UserAccountData(); - const string16& display_name() const { return display_name_; } - const string16& given_name() const { return given_name_; } + const base::string16& display_name() const { return display_name_; } + const base::string16& given_name() const { return given_name_; } const std::string& locale() const { return locale_; } private: - const string16 display_name_; - const string16 given_name_; + const base::string16 display_name_; + const base::string16 given_name_; const std::string locale_; DISALLOW_COPY_AND_ASSIGN(UserAccountData); @@ -228,7 +228,7 @@ class UserManager { // Saves user's displayed name in local state preferences. // Ignored If there is no such user. virtual void SaveUserDisplayName(const std::string& user_id, - const string16& display_name) = 0; + const base::string16& display_name) = 0; // Updates data upon User Account download. virtual void UpdateUserAccountData(const std::string& user_id, @@ -237,7 +237,7 @@ class UserManager { // Returns the display name for user |user_id| if it is known (was // previously set by a |SaveUserDisplayName| call). // Otherwise, returns an empty string. - virtual string16 GetUserDisplayName( + virtual base::string16 GetUserDisplayName( const std::string& user_id) const = 0; // Saves user's displayed (non-canonical) email in local state preferences. diff --git a/chrome/browser/chromeos/login/user_manager_impl.cc b/chrome/browser/chromeos/login/user_manager_impl.cc index 5fae58b..86589e17 100644 --- a/chrome/browser/chromeos/login/user_manager_impl.cc +++ b/chrome/browser/chromeos/login/user_manager_impl.cc @@ -635,7 +635,7 @@ User::OAuthTokenStatus UserManagerImpl::LoadUserOAuthStatus( } void UserManagerImpl::SaveUserDisplayName(const std::string& user_id, - const string16& display_name) { + const base::string16& display_name) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); if (User* user = FindUserAndModify(user_id)) { @@ -659,7 +659,7 @@ void UserManagerImpl::SaveUserDisplayName(const std::string& user_id, string16 UserManagerImpl::GetUserDisplayName( const std::string& user_id) const { const User* user = FindUser(user_id); - return user ? user->display_name() : string16(); + return user ? user->display_name() : base::string16(); } void UserManagerImpl::SaveUserDisplayEmail(const std::string& user_id, @@ -699,7 +699,7 @@ void UserManagerImpl::UpdateUserAccountData( SaveUserDisplayName(user_id, account_data.display_name()); if (User* user = FindUserAndModify(user_id)) { - string16 given_name = account_data.given_name(); + base::string16 given_name = account_data.given_name(); user->set_given_name(given_name); if (!IsUserNonCryptohomeDataEphemeral(user_id)) { PrefService* local_state = g_browser_process->local_state(); @@ -1046,13 +1046,13 @@ void UserManagerImpl::EnsureUsersLoaded() { user->set_oauth_token_status(LoadUserOAuthStatus(*it)); users_.push_back(user); - string16 display_name; + base::string16 display_name; if (prefs_display_names->GetStringWithoutPathExpansion(*it, &display_name)) { user->set_display_name(display_name); } - string16 given_name; + base::string16 given_name; if (prefs_given_names->GetStringWithoutPathExpansion(*it, &given_name)) { user->set_given_name(given_name); } diff --git a/chrome/browser/chromeos/login/user_manager_impl.h b/chrome/browser/chromeos/login/user_manager_impl.h index 7b8b9a6..074e329 100644 --- a/chrome/browser/chromeos/login/user_manager_impl.h +++ b/chrome/browser/chromeos/login/user_manager_impl.h @@ -85,8 +85,8 @@ class UserManagerImpl const std::string& user_id, User::OAuthTokenStatus oauth_token_status) OVERRIDE; virtual void SaveUserDisplayName(const std::string& user_id, - const string16& display_name) OVERRIDE; - virtual string16 GetUserDisplayName( + const base::string16& display_name) OVERRIDE; + virtual base::string16 GetUserDisplayName( const std::string& user_id) const OVERRIDE; virtual void SaveUserDisplayEmail(const std::string& user_id, const std::string& display_email) OVERRIDE; diff --git a/chrome/browser/chromeos/login/webui_login_view.cc b/chrome/browser/chromeos/login/webui_login_view.cc index 722d478..b70ab9c 100644 --- a/chrome/browser/chromeos/login/webui_login_view.cc +++ b/chrome/browser/chromeos/login/webui_login_view.cc @@ -396,11 +396,11 @@ void WebUILoginView::RequestMediaAccessPermission( void WebUILoginView::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, content::RenderViewHost* render_view_host) { if (frame_unique_name != UTF8ToUTF16("gaia-frame")) return; diff --git a/chrome/browser/chromeos/login/webui_login_view.h b/chrome/browser/chromeos/login/webui_login_view.h index 0793280..0ce64c8 100644 --- a/chrome/browser/chromeos/login/webui_login_view.h +++ b/chrome/browser/chromeos/login/webui_login_view.h @@ -140,11 +140,11 @@ class WebUILoginView : public views::View, // Overridden from content::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, content::RenderViewHost* render_view_host) OVERRIDE; // Performs series of actions when login prompt is considered diff --git a/chrome/browser/chromeos/login/webui_screen_locker.cc b/chrome/browser/chromeos/login/webui_screen_locker.cc index 25896cf..1303575 100644 --- a/chrome/browser/chromeos/login/webui_screen_locker.cc +++ b/chrome/browser/chromeos/login/webui_screen_locker.cc @@ -192,7 +192,7 @@ void WebUIScreenLocker::CompleteLogin(const UserContext& user_context) { NOTREACHED(); } -string16 WebUIScreenLocker::GetConnectedNetworkName() { +base::string16 WebUIScreenLocker::GetConnectedNetworkName() { return network_state_helper_->GetCurrentNetworkName(); } diff --git a/chrome/browser/chromeos/login/webui_screen_locker.h b/chrome/browser/chromeos/login/webui_screen_locker.h index 1d97b36..4e8b3bb 100644 --- a/chrome/browser/chromeos/login/webui_screen_locker.h +++ b/chrome/browser/chromeos/login/webui_screen_locker.h @@ -71,7 +71,7 @@ class WebUIScreenLocker : public WebUILoginView, virtual void CancelPasswordChangedFlow() OVERRIDE; virtual void CreateAccount() OVERRIDE; virtual void CompleteLogin(const UserContext& user_context) OVERRIDE; - virtual string16 GetConnectedNetworkName() OVERRIDE; + virtual base::string16 GetConnectedNetworkName() OVERRIDE; virtual bool IsSigninInProgress() const OVERRIDE; virtual void Login(const UserContext& user_context) OVERRIDE; virtual void LoginAsRetailModeUser() OVERRIDE; diff --git a/chrome/browser/chromeos/memory/oom_priority_manager.cc b/chrome/browser/chromeos/memory/oom_priority_manager.cc index 8ad3a6b..6de6c82 100644 --- a/chrome/browser/chromeos/memory/oom_priority_manager.cc +++ b/chrome/browser/chromeos/memory/oom_priority_manager.cc @@ -213,14 +213,14 @@ void OomPriorityManager::Stop() { low_memory_listener_->Stop(); } -std::vector<string16> OomPriorityManager::GetTabTitles() { +std::vector<base::string16> OomPriorityManager::GetTabTitles() { TabStatsList stats = GetTabStatsOnUIThread(); base::AutoLock pid_to_oom_score_autolock(pid_to_oom_score_lock_); - std::vector<string16> titles; + std::vector<base::string16> titles; titles.reserve(stats.size()); TabStatsList::iterator it = stats.begin(); for ( ; it != stats.end(); ++it) { - string16 str; + base::string16 str; str.reserve(4096); int score = pid_to_oom_score_[it->renderer_handle]; str += base::IntToString16(score); diff --git a/chrome/browser/chromeos/memory/oom_priority_manager.h b/chrome/browser/chromeos/memory/oom_priority_manager.h index 4fea9ed..3df538e 100644 --- a/chrome/browser/chromeos/memory/oom_priority_manager.h +++ b/chrome/browser/chromeos/memory/oom_priority_manager.h @@ -52,7 +52,7 @@ class OomPriorityManager : public content::NotificationObserver, // Returns list of tab titles sorted from most interesting (don't kill) // to least interesting (OK to kill). - std::vector<string16> GetTabTitles(); + std::vector<base::string16> GetTabTitles(); // Discards a tab to free the memory occupied by its renderer. // Tab still exists in the tab-strip; clicking on it will reload it. @@ -80,7 +80,7 @@ class OomPriorityManager : public content::NotificationObserver, bool is_discarded; base::TimeTicks last_selected; base::ProcessHandle renderer_handle; - string16 title; + base::string16 title; int64 tab_contents_id; // unique ID per WebContents }; typedef std::vector<TabStats> TabStatsList; diff --git a/chrome/browser/chromeos/options/cert_library.cc b/chrome/browser/chromeos/options/cert_library.cc index 58e3228..8648cba 100644 --- a/chrome/browser/chromeos/options/cert_library.cc +++ b/chrome/browser/chromeos/options/cert_library.cc @@ -36,16 +36,16 @@ namespace { // Root CA certificates that are built into Chrome use this token name. const char kRootCertificateTokenName[] = "Builtin Object Token"; -string16 GetDisplayString(net::X509Certificate* cert, bool hardware_backed) { +base::string16 GetDisplayString(net::X509Certificate* cert, bool hardware_backed) { std::string org; if (!cert->subject().organization_names.empty()) org = cert->subject().organization_names[0]; if (org.empty()) org = cert->subject().GetDisplayName(); - string16 issued_by = UTF8ToUTF16( + base::string16 issued_by = UTF8ToUTF16( x509_certificate_model::GetIssuerCommonName(cert->os_cert_handle(), org)); // alternative text - string16 issued_to = UTF8ToUTF16( + base::string16 issued_to = UTF8ToUTF16( x509_certificate_model::GetCertNameOrNickname(cert->os_cert_handle())); if (hardware_backed) { @@ -82,8 +82,8 @@ class CertNameComparator { bool operator()(const scoped_refptr<net::X509Certificate>& lhs, const scoped_refptr<net::X509Certificate>& rhs) const { - string16 lhs_name = GetDisplayString(lhs.get(), false); - string16 rhs_name = GetDisplayString(rhs.get(), false); + base::string16 lhs_name = GetDisplayString(lhs.get(), false); + base::string16 rhs_name = GetDisplayString(rhs.get(), false); if (collator_ == NULL) return lhs_name < rhs_name; return base::i18n::CompareString16WithCollator( diff --git a/chrome/browser/chromeos/options/cert_library.h b/chrome/browser/chromeos/options/cert_library.h index 620ef87..9bbfb77 100644 --- a/chrome/browser/chromeos/options/cert_library.h +++ b/chrome/browser/chromeos/options/cert_library.h @@ -67,7 +67,7 @@ class CertLibrary : public CertLoader::Observer { int NumCertificates(CertType type) const; // Retreives the certificate property for |type| at |index|. - string16 GetCertDisplayStringAt(CertType type, int index) const; + base::string16 GetCertDisplayStringAt(CertType type, int index) const; std::string GetCertPEMAt(CertType type, int index) const; std::string GetCertPkcs11IdAt(CertType type, int index) const; bool IsCertHardwareBackedAt(CertType type, int index) const; diff --git a/chrome/browser/chromeos/options/network_config_view.cc b/chrome/browser/chromeos/options/network_config_view.cc index 40b2a96..bea4c5c 100644 --- a/chrome/browser/chromeos/options/network_config_view.cc +++ b/chrome/browser/chromeos/options/network_config_view.cc @@ -156,7 +156,7 @@ gfx::NativeWindow NetworkConfigView::GetNativeWindow() const { return GetWidget()->GetNativeWindow(); } -string16 NetworkConfigView::GetDialogButtonLabel( +base::string16 NetworkConfigView::GetDialogButtonLabel( ui::DialogButton button) const { if (button == ui::DIALOG_BUTTON_OK) return l10n_util::GetStringUTF16(IDS_OPTIONS_SETTINGS_CONNECT); @@ -195,7 +195,7 @@ views::View* NetworkConfigView::GetInitiallyFocusedView() { return child_config_view_->GetInitiallyFocusedView(); } -string16 NetworkConfigView::GetWindowTitle() const { +base::string16 NetworkConfigView::GetWindowTitle() const { DCHECK(!child_config_view_->GetTitle().empty()); return child_config_view_->GetTitle(); } diff --git a/chrome/browser/chromeos/options/network_config_view.h b/chrome/browser/chromeos/options/network_config_view.h index 9e4def5..f7ab076 100644 --- a/chrome/browser/chromeos/options/network_config_view.h +++ b/chrome/browser/chromeos/options/network_config_view.h @@ -54,7 +54,8 @@ class NetworkConfigView : public views::DialogDelegateView, gfx::NativeWindow GetNativeWindow() const; // views::DialogDelegate methods. - virtual string16 GetDialogButtonLabel(ui::DialogButton button) const OVERRIDE; + virtual base::string16 GetDialogButtonLabel( + ui::DialogButton button) const OVERRIDE; virtual bool IsDialogButtonEnabled(ui::DialogButton button) const OVERRIDE; virtual bool Cancel() OVERRIDE; virtual bool Accept() OVERRIDE; @@ -62,7 +63,7 @@ class NetworkConfigView : public views::DialogDelegateView, virtual views::View* GetInitiallyFocusedView() OVERRIDE; // views::WidgetDelegate methods. - virtual string16 GetWindowTitle() const OVERRIDE; + virtual base::string16 GetWindowTitle() const OVERRIDE; virtual ui::ModalType GetModalType() const OVERRIDE; // views::View overrides. @@ -121,7 +122,7 @@ class ChildNetworkConfigView : public views::View { virtual ~ChildNetworkConfigView(); // Get the title to show for the dialog. - virtual string16 GetTitle() const = 0; + virtual base::string16 GetTitle() const = 0; // Returns view that should be focused on dialog activation. virtual views::View* GetInitiallyFocusedView() = 0; diff --git a/chrome/browser/chromeos/options/passphrase_textfield.cc b/chrome/browser/chromeos/options/passphrase_textfield.cc index 9cc9bd3..2cdc1d7 100644 --- a/chrome/browser/chromeos/options/passphrase_textfield.cc +++ b/chrome/browser/chromeos/options/passphrase_textfield.cc @@ -41,13 +41,14 @@ std::string PassphraseTextfield::GetPassphrase() { } void PassphraseTextfield::SetFakePassphrase() { - CR_DEFINE_STATIC_LOCAL(string16, fake_passphrase, (ASCIIToUTF16("********"))); + CR_DEFINE_STATIC_LOCAL(base::string16, fake_passphrase, + (ASCIIToUTF16("********"))); SetText(fake_passphrase); changed_ = false; } void PassphraseTextfield::ClearFakePassphrase() { - SetText(string16()); + SetText(base::string16()); changed_ = true; } diff --git a/chrome/browser/chromeos/options/vpn_config_view.cc b/chrome/browser/chromeos/options/vpn_config_view.cc index 35f29d7..574a5b0 100644 --- a/chrome/browser/chromeos/options/vpn_config_view.cc +++ b/chrome/browser/chromeos/options/vpn_config_view.cc @@ -46,7 +46,7 @@ enum ProviderTypeIndex { PROVIDER_TYPE_INDEX_MAX = 3, }; -string16 ProviderTypeIndexToString(int index) { +base::string16 ProviderTypeIndexToString(int index) { switch (index) { case PROVIDER_TYPE_INDEX_L2TP_IPSEC_PSK: return l10n_util::GetStringUTF16( @@ -59,7 +59,7 @@ string16 ProviderTypeIndexToString(int index) { IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_OPEN_VPN); } NOTREACHED(); - return string16(); + return base::string16(); } int ProviderTypeToIndex(const std::string& provider_type, @@ -113,7 +113,7 @@ class ProviderTypeComboboxModel : public ui::ComboboxModel { // Overridden from ui::ComboboxModel: virtual int GetItemCount() const OVERRIDE; - virtual string16 GetItemAt(int index) OVERRIDE; + virtual base::string16 GetItemAt(int index) OVERRIDE; private: DISALLOW_COPY_AND_ASSIGN(ProviderTypeComboboxModel); @@ -126,7 +126,7 @@ class VpnServerCACertComboboxModel : public ui::ComboboxModel { // Overridden from ui::ComboboxModel: virtual int GetItemCount() const OVERRIDE; - virtual string16 GetItemAt(int index) OVERRIDE; + virtual base::string16 GetItemAt(int index) OVERRIDE; private: DISALLOW_COPY_AND_ASSIGN(VpnServerCACertComboboxModel); @@ -139,7 +139,7 @@ class VpnUserCertComboboxModel : public ui::ComboboxModel { // Overridden from ui::ComboboxModel: virtual int GetItemCount() const OVERRIDE; - virtual string16 GetItemAt(int index) OVERRIDE; + virtual base::string16 GetItemAt(int index) OVERRIDE; private: DISALLOW_COPY_AND_ASSIGN(VpnUserCertComboboxModel); @@ -157,7 +157,7 @@ int ProviderTypeComboboxModel::GetItemCount() const { return PROVIDER_TYPE_INDEX_MAX; } -string16 ProviderTypeComboboxModel::GetItemAt(int index) { +base::string16 ProviderTypeComboboxModel::GetItemAt(int index) { return ProviderTypeIndexToString(index); } @@ -177,7 +177,7 @@ int VpnServerCACertComboboxModel::GetItemCount() const { CertLibrary::CERT_TYPE_SERVER_CA) + 1; } -string16 VpnServerCACertComboboxModel::GetItemAt(int index) { +base::string16 VpnServerCACertComboboxModel::GetItemAt(int index) { if (CertLibrary::Get()->CertificatesLoading()) return l10n_util::GetStringUTF16( IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_CERT_LOADING); @@ -207,7 +207,7 @@ int VpnUserCertComboboxModel::GetItemCount() const { return num_certs; } -string16 VpnUserCertComboboxModel::GetItemAt(int index) { +base::string16 VpnUserCertComboboxModel::GetItemAt(int index) { if (CertLibrary::Get()->CertificatesLoading()) { return l10n_util::GetStringUTF16( IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_CERT_LOADING); @@ -262,7 +262,7 @@ VPNConfigView::~VPNConfigView() { CertLibrary::Get()->RemoveObserver(this); } -string16 VPNConfigView::GetTitle() const { +base::string16 VPNConfigView::GetTitle() const { DCHECK_NE(title_, 0); return l10n_util::GetStringUTF16(title_); } @@ -310,12 +310,12 @@ bool VPNConfigView::CanLogin() { } void VPNConfigView::ContentsChanged(views::Textfield* sender, - const string16& new_contents) { + const base::string16& new_contents) { if (sender == server_textfield_ && !service_text_modified_) { // Set the service name to the server name up to '.', unless it has // been explicitly set by the user. - string16 server = server_textfield_->text(); - string16::size_type n = server.find_first_of(L'.'); + base::string16 server = server_textfield_->text(); + base::string16::size_type n = server.find_first_of(L'.'); service_name_from_server_ = server.substr(0, n); service_textfield_->SetText(service_name_from_server_); } @@ -971,7 +971,7 @@ void VPNConfigView::UpdateControls() { void VPNConfigView::UpdateErrorLabel() { // Error message. - string16 error_msg; + base::string16 error_msg; bool cert_required = GetProviderTypeIndex() == PROVIDER_TYPE_INDEX_L2TP_IPSEC_USER_CERT; if (cert_required && CertLibrary::Get()->CertificatesLoaded()) { diff --git a/chrome/browser/chromeos/options/vpn_config_view.h b/chrome/browser/chromeos/options/vpn_config_view.h index e054734..0422c2a 100644 --- a/chrome/browser/chromeos/options/vpn_config_view.h +++ b/chrome/browser/chromeos/options/vpn_config_view.h @@ -50,7 +50,7 @@ class VPNConfigView : public ChildNetworkConfigView, // views::TextfieldController: virtual void ContentsChanged(views::Textfield* sender, - const string16& new_contents) OVERRIDE; + const base::string16& new_contents) OVERRIDE; virtual bool HandleKeyEvent(views::Textfield* sender, const ui::KeyEvent& key_event) OVERRIDE; @@ -65,7 +65,7 @@ class VPNConfigView : public ChildNetworkConfigView, virtual void OnCertificatesLoaded(bool initial_load) OVERRIDE; // ChildNetworkConfigView: - virtual string16 GetTitle() const OVERRIDE; + virtual base::string16 GetTitle() const OVERRIDE; virtual views::View* GetInitiallyFocusedView() OVERRIDE; virtual bool CanLogin() OVERRIDE; virtual bool Login() OVERRIDE; @@ -132,7 +132,7 @@ class VPNConfigView : public ChildNetworkConfigView, const std::string& key, NetworkPropertyUIData* property_ui_data); - string16 service_name_from_server_; + base::string16 service_name_from_server_; bool service_text_modified_; // Initialized in Init(): diff --git a/chrome/browser/chromeos/options/wifi_config_view.cc b/chrome/browser/chromeos/options/wifi_config_view.cc index 19cfbbc..c1b6d59 100644 --- a/chrome/browser/chromeos/options/wifi_config_view.cc +++ b/chrome/browser/chromeos/options/wifi_config_view.cc @@ -106,7 +106,7 @@ class SecurityComboboxModel : public ui::ComboboxModel { // Overridden from ui::ComboboxModel: virtual int GetItemCount() const OVERRIDE; - virtual string16 GetItemAt(int index) OVERRIDE; + virtual base::string16 GetItemAt(int index) OVERRIDE; private: DISALLOW_COPY_AND_ASSIGN(SecurityComboboxModel); @@ -119,7 +119,7 @@ class EAPMethodComboboxModel : public ui::ComboboxModel { // Overridden from ui::ComboboxModel: virtual int GetItemCount() const OVERRIDE; - virtual string16 GetItemAt(int index) OVERRIDE; + virtual base::string16 GetItemAt(int index) OVERRIDE; private: DISALLOW_COPY_AND_ASSIGN(EAPMethodComboboxModel); @@ -132,7 +132,7 @@ class Phase2AuthComboboxModel : public ui::ComboboxModel { // Overridden from ui::ComboboxModel: virtual int GetItemCount() const OVERRIDE; - virtual string16 GetItemAt(int index) OVERRIDE; + virtual base::string16 GetItemAt(int index) OVERRIDE; private: views::Combobox* eap_method_combobox_; @@ -147,7 +147,7 @@ class ServerCACertComboboxModel : public ui::ComboboxModel { // Overridden from ui::ComboboxModel: virtual int GetItemCount() const OVERRIDE; - virtual string16 GetItemAt(int index) OVERRIDE; + virtual base::string16 GetItemAt(int index) OVERRIDE; private: DISALLOW_COPY_AND_ASSIGN(ServerCACertComboboxModel); @@ -160,7 +160,7 @@ class UserCertComboboxModel : public ui::ComboboxModel { // Overridden from ui::ComboboxModel: virtual int GetItemCount() const OVERRIDE; - virtual string16 GetItemAt(int index) OVERRIDE; + virtual base::string16 GetItemAt(int index) OVERRIDE; private: WifiConfigView* owner_; @@ -179,7 +179,7 @@ SecurityComboboxModel::~SecurityComboboxModel() { int SecurityComboboxModel::GetItemCount() const { return SECURITY_INDEX_COUNT; } -string16 SecurityComboboxModel::GetItemAt(int index) { +base::string16 SecurityComboboxModel::GetItemAt(int index) { if (index == SECURITY_INDEX_NONE) return l10n_util::GetStringUTF16( IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_SECURITY_NONE); @@ -190,7 +190,7 @@ string16 SecurityComboboxModel::GetItemAt(int index) { return l10n_util::GetStringUTF16( IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_SECURITY_PSK); NOTREACHED(); - return string16(); + return base::string16(); } // EAPMethodComboboxModel ------------------------------------------------------ @@ -204,7 +204,7 @@ EAPMethodComboboxModel::~EAPMethodComboboxModel() { int EAPMethodComboboxModel::GetItemCount() const { return EAP_METHOD_INDEX_COUNT; } -string16 EAPMethodComboboxModel::GetItemAt(int index) { +base::string16 EAPMethodComboboxModel::GetItemAt(int index) { if (index == EAP_METHOD_INDEX_NONE) return l10n_util::GetStringUTF16( IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_EAP_METHOD_NONE); @@ -221,7 +221,7 @@ string16 EAPMethodComboboxModel::GetItemAt(int index) { return l10n_util::GetStringUTF16( IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_EAP_METHOD_TTLS); NOTREACHED(); - return string16(); + return base::string16(); } // Phase2AuthComboboxModel ----------------------------------------------------- @@ -249,7 +249,7 @@ int Phase2AuthComboboxModel::GetItemCount() const { return 0; } -string16 Phase2AuthComboboxModel::GetItemAt(int index) { +base::string16 Phase2AuthComboboxModel::GetItemAt(int index) { if (index == PHASE_2_AUTH_INDEX_AUTO) return l10n_util::GetStringUTF16( IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_PHASE_2_AUTH_AUTO); @@ -269,7 +269,7 @@ string16 Phase2AuthComboboxModel::GetItemAt(int index) { return l10n_util::GetStringUTF16( IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_PHASE_2_AUTH_CHAP); NOTREACHED(); - return string16(); + return base::string16(); } // ServerCACertComboboxModel --------------------------------------------------- @@ -288,7 +288,7 @@ int ServerCACertComboboxModel::GetItemCount() const { CertLibrary::CERT_TYPE_SERVER_CA) + 2; } -string16 ServerCACertComboboxModel::GetItemAt(int index) { +base::string16 ServerCACertComboboxModel::GetItemAt(int index) { if (CertLibrary::Get()->CertificatesLoading()) return l10n_util::GetStringUTF16( IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_CERT_LOADING); @@ -324,9 +324,9 @@ int UserCertComboboxModel::GetItemCount() const { return num_certs; } -string16 UserCertComboboxModel::GetItemAt(int index) { +base::string16 UserCertComboboxModel::GetItemAt(int index) { if (!owner_->UserCertActive()) - return string16(); + return base::string16(); if (CertLibrary::Get()->CertificatesLoading()) return l10n_util::GetStringUTF16( IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_CERT_LOADING); @@ -379,7 +379,7 @@ WifiConfigView::~WifiConfigView() { CertLibrary::Get()->RemoveObserver(this); } -string16 WifiConfigView::GetTitle() const { +base::string16 WifiConfigView::GetTitle() const { return l10n_util::GetStringUTF16(IDS_OPTIONS_SETTINGS_JOIN_WIFI_NETWORKS); } @@ -497,7 +497,7 @@ void WifiConfigView::RefreshEapFields() { passphrase_ui_data_.IsEditable()); passphrase_label_->SetEnabled(passphrase_enabled); if (!passphrase_enabled) - passphrase_textfield_->SetText(string16()); + passphrase_textfield_->SetText(base::string16()); // User cert. bool certs_loading = CertLibrary::Get()->CertificatesLoading(); @@ -526,7 +526,7 @@ void WifiConfigView::RefreshEapFields() { subject_match_label_->SetEnabled(subject_match_enabled); subject_match_textfield_->SetEnabled(subject_match_enabled); if (!subject_match_enabled) - subject_match_textfield_->SetText(string16()); + subject_match_textfield_->SetText(base::string16()); // No anonymous identity if no phase 2 auth. bool identity_anonymous_enabled = phase_2_auth_enabled; @@ -534,7 +534,7 @@ void WifiConfigView::RefreshEapFields() { identity_anonymous_enabled && identity_anonymous_ui_data_.IsEditable()); identity_anonymous_label_->SetEnabled(identity_anonymous_enabled); if (!identity_anonymous_enabled) - identity_anonymous_textfield_->SetText(string16()); + identity_anonymous_textfield_->SetText(base::string16()); RefreshShareCheckbox(); } diff --git a/chrome/browser/chromeos/options/wifi_config_view.h b/chrome/browser/chromeos/options/wifi_config_view.h index 8589b0c..1988cfe 100644 --- a/chrome/browser/chromeos/options/wifi_config_view.h +++ b/chrome/browser/chromeos/options/wifi_config_view.h @@ -60,7 +60,7 @@ class WifiConfigView : public ChildNetworkConfigView, // views::TextfieldController virtual void ContentsChanged(views::Textfield* sender, - const string16& new_contents) OVERRIDE; + const base::string16& new_contents) OVERRIDE; virtual bool HandleKeyEvent(views::Textfield* sender, const ui::KeyEvent& key_event) OVERRIDE; @@ -75,7 +75,7 @@ class WifiConfigView : public ChildNetworkConfigView, virtual void OnCertificatesLoaded(bool initial_load) OVERRIDE; // ChildNetworkConfigView - virtual string16 GetTitle() const OVERRIDE; + virtual base::string16 GetTitle() const OVERRIDE; virtual views::View* GetInitiallyFocusedView() OVERRIDE; virtual bool CanLogin() OVERRIDE; virtual bool Login() OVERRIDE; diff --git a/chrome/browser/chromeos/options/wimax_config_view.cc b/chrome/browser/chromeos/options/wimax_config_view.cc index c1b715f..e32374c 100644 --- a/chrome/browser/chromeos/options/wimax_config_view.cc +++ b/chrome/browser/chromeos/options/wimax_config_view.cc @@ -114,7 +114,7 @@ void WimaxConfigView::UpdateErrorLabel() { } void WimaxConfigView::ContentsChanged(views::Textfield* sender, - const string16& new_contents) { + const base::string16& new_contents) { UpdateDialogButtons(); } @@ -237,7 +237,7 @@ void WimaxConfigView::Init() { // Identity layout->StartRow(0, column_view_set_id); - string16 identity_label_text = l10n_util::GetStringUTF16( + base::string16 identity_label_text = l10n_util::GetStringUTF16( IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_CERT_IDENTITY); identity_label_ = new views::Label(identity_label_text); layout->AddView(identity_label_); @@ -252,7 +252,7 @@ void WimaxConfigView::Init() { // Passphrase input layout->StartRow(0, column_view_set_id); - string16 passphrase_label_text = l10n_util::GetStringUTF16( + base::string16 passphrase_label_text = l10n_util::GetStringUTF16( IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_PASSPHRASE); passphrase_label_ = new views::Label(passphrase_label_text); layout->AddView(passphrase_label_); diff --git a/chrome/browser/chromeos/options/wimax_config_view.h b/chrome/browser/chromeos/options/wimax_config_view.h index b4e03ef..bc577bea 100644 --- a/chrome/browser/chromeos/options/wimax_config_view.h +++ b/chrome/browser/chromeos/options/wimax_config_view.h @@ -37,7 +37,7 @@ class WimaxConfigView : public ChildNetworkConfigView, // views::TextfieldController: virtual void ContentsChanged(views::Textfield* sender, - const string16& new_contents) OVERRIDE; + const base::string16& new_contents) OVERRIDE; virtual bool HandleKeyEvent(views::Textfield* sender, const ui::KeyEvent& key_event) OVERRIDE; @@ -46,7 +46,7 @@ class WimaxConfigView : public ChildNetworkConfigView, const ui::Event& event) OVERRIDE; // ChildNetworkConfigView: - virtual string16 GetTitle() const OVERRIDE; + virtual base::string16 GetTitle() const OVERRIDE; virtual views::View* GetInitiallyFocusedView() OVERRIDE; virtual bool CanLogin() OVERRIDE; virtual bool Login() OVERRIDE; diff --git a/chrome/browser/chromeos/policy/device_local_account_browsertest.cc b/chrome/browser/chromeos/policy/device_local_account_browsertest.cc index 2015aab..a505536 100644 --- a/chrome/browser/chromeos/policy/device_local_account_browsertest.cc +++ b/chrome/browser/chromeos/policy/device_local_account_browsertest.cc @@ -246,8 +246,8 @@ bool DoesInstallSuccessReferToId(const std::string& id, bool DoesInstallFailureReferToId(const std::string& id, const content::NotificationSource& source, const content::NotificationDetails& details) { - return content::Details<const string16>(details)->find(UTF8ToUTF16(id)) != - string16::npos; + return content::Details<const base::string16>(details)->find(UTF8ToUTF16(id)) != + base::string16::npos; } scoped_ptr<net::FakeURLFetcher> RunCallbackAndReturnFakeURLFetcher( diff --git a/chrome/browser/chromeos/power/idle_action_warning_dialog_view.cc b/chrome/browser/chromeos/power/idle_action_warning_dialog_view.cc index 8cde2dd..3fc7e74 100644 --- a/chrome/browser/chromeos/power/idle_action_warning_dialog_view.cc +++ b/chrome/browser/chromeos/power/idle_action_warning_dialog_view.cc @@ -26,7 +26,7 @@ const int kIdleActionWarningContentWidth = 300; class FixedWidthLabel : public views::Label { public: - FixedWidthLabel(const string16& text, int width); + FixedWidthLabel(const base::string16& text, int width); virtual ~FixedWidthLabel(); virtual gfx::Size GetPreferredSize() OVERRIDE; @@ -37,7 +37,7 @@ class FixedWidthLabel : public views::Label { DISALLOW_COPY_AND_ASSIGN(FixedWidthLabel); }; -FixedWidthLabel::FixedWidthLabel(const string16& text, int width) +FixedWidthLabel::FixedWidthLabel(const base::string16& text, int width) : Label(text), width_(width) { SetHorizontalAlignment(gfx::ALIGN_LEFT); diff --git a/chrome/browser/chromeos/power/idle_action_warning_dialog_view.h b/chrome/browser/chromeos/power/idle_action_warning_dialog_view.h index 92dc34ee..a6fb983 100644 --- a/chrome/browser/chromeos/power/idle_action_warning_dialog_view.h +++ b/chrome/browser/chromeos/power/idle_action_warning_dialog_view.h @@ -21,7 +21,7 @@ class IdleActionWarningDialogView : public views::DialogDelegateView { // views::DialogDelegateView: virtual ui::ModalType GetModalType() const OVERRIDE; - virtual string16 GetWindowTitle() const OVERRIDE; + virtual base::string16 GetWindowTitle() const OVERRIDE; virtual int GetDialogButtons() const OVERRIDE; virtual bool Cancel() OVERRIDE; diff --git a/chrome/browser/chromeos/power/peripheral_battery_observer.cc b/chrome/browser/chromeos/power/peripheral_battery_observer.cc index 289878a..dc0de78 100644 --- a/chrome/browser/chromeos/power/peripheral_battery_observer.cc +++ b/chrome/browser/chromeos/power/peripheral_battery_observer.cc @@ -222,7 +222,7 @@ bool PeripheralBatteryObserver::PostNotification(const std::string& address, UTF8ToUTF16(battery.name), string_text, blink::WebTextDirectionDefault, - string16(), + base::string16(), UTF8ToUTF16(address), new PeripheralBatteryNotificationDelegate(address)); diff --git a/chrome/browser/chromeos/profiles/profile_list_chromeos_unittest.cc b/chrome/browser/chromeos/profiles/profile_list_chromeos_unittest.cc index f33106f..56a979e 100644 --- a/chrome/browser/chromeos/profiles/profile_list_chromeos_unittest.cc +++ b/chrome/browser/chromeos/profiles/profile_list_chromeos_unittest.cc @@ -133,7 +133,7 @@ class ProfileListChromeOSTest : public testing::Test { }; TEST_F(ProfileListChromeOSTest, InitialCreation) { - string16 name1(ASCIIToUTF16("p1")); + base::string16 name1(ASCIIToUTF16("p1")); AddProfile(name1, true); @@ -147,10 +147,10 @@ TEST_F(ProfileListChromeOSTest, InitialCreation) { } TEST_F(ProfileListChromeOSTest, ShowLoggedInUsers) { - string16 name1(ASCIIToUTF16("p1")); - string16 name2(ASCIIToUTF16("p2")); - string16 name3(ASCIIToUTF16("p3")); - string16 name4(ASCIIToUTF16("p4")); + base::string16 name1(ASCIIToUTF16("p1")); + base::string16 name2(ASCIIToUTF16("p2")); + base::string16 name3(ASCIIToUTF16("p3")); + base::string16 name4(ASCIIToUTF16("p4")); AddProfile(name1, true); AddProfile(name2, false); @@ -171,8 +171,8 @@ TEST_F(ProfileListChromeOSTest, ShowLoggedInUsers) { } TEST_F(ProfileListChromeOSTest, DontShowManagedUsers) { - string16 name1(ASCIIToUTF16("p1")); - string16 managed_name(ASCIIToUTF16("p2@example.com")); + base::string16 name1(ASCIIToUTF16("p1")); + base::string16 managed_name(ASCIIToUTF16("p2@example.com")); AddProfile(name1, true); @@ -180,7 +180,7 @@ TEST_F(ProfileListChromeOSTest, DontShowManagedUsers) { ProfileInfoCache* cache = manager()->profile_info_cache(); manager()->profile_info_cache()->AddProfileToCache( cache->GetUserDataDir().AppendASCII("p2"), managed_name, - string16(), 0, "TEST_ID"); + base::string16(), 0, "TEST_ID"); GetFakeUserManager()->AddUser(UTF16ToASCII(managed_name)); @@ -193,8 +193,8 @@ TEST_F(ProfileListChromeOSTest, DontShowManagedUsers) { } TEST_F(ProfileListChromeOSTest, ShowAddProfileLink) { - string16 name1(ASCIIToUTF16("p1.com")); - string16 name2(ASCIIToUTF16("p2.com")); + base::string16 name1(ASCIIToUTF16("p1.com")); + base::string16 name2(ASCIIToUTF16("p2.com")); AddProfile(name1, true); AddProfile(name2, false); @@ -206,8 +206,8 @@ TEST_F(ProfileListChromeOSTest, ShowAddProfileLink) { } TEST_F(ProfileListChromeOSTest, DontShowAddProfileLink) { - string16 name1(ASCIIToUTF16("p1.com")); - string16 name2(ASCIIToUTF16("p2.com")); + base::string16 name1(ASCIIToUTF16("p1.com")); + base::string16 name2(ASCIIToUTF16("p2.com")); AddProfile(name1, true); AddProfile(name2, true); @@ -219,8 +219,8 @@ TEST_F(ProfileListChromeOSTest, DontShowAddProfileLink) { } TEST_F(ProfileListChromeOSTest, ActiveItem) { - string16 name1(ASCIIToUTF16("p1.com")); - string16 name2(ASCIIToUTF16("p2.com")); + base::string16 name1(ASCIIToUTF16("p1.com")); + base::string16 name2(ASCIIToUTF16("p2.com")); AddProfile(name1, true); AddProfile(name2, true); @@ -234,9 +234,9 @@ TEST_F(ProfileListChromeOSTest, ActiveItem) { } TEST_F(ProfileListChromeOSTest, ModifyingNameResortsCorrectly) { - string16 name1(ASCIIToUTF16("Alpha")); - string16 name2(ASCIIToUTF16("Beta")); - string16 newname1(ASCIIToUTF16("Gamma")); + base::string16 name1(ASCIIToUTF16("Alpha")); + base::string16 name2(ASCIIToUTF16("Beta")); + base::string16 newname1(ASCIIToUTF16("Gamma")); AddProfile(name1, true); AddProfile(name2, true); @@ -270,8 +270,8 @@ TEST_F(ProfileListChromeOSTest, ModifyingNameResortsCorrectly) { } TEST_F(ProfileListChromeOSTest, ChangeOnNotify) { - string16 name1(ASCIIToUTF16("p1.com")); - string16 name2(ASCIIToUTF16("p2.com")); + base::string16 name1(ASCIIToUTF16("p1.com")); + base::string16 name2(ASCIIToUTF16("p2.com")); AddProfile(name1, true); AddProfile(name2, true); @@ -279,7 +279,7 @@ TEST_F(ProfileListChromeOSTest, ChangeOnNotify) { AvatarMenu* menu = GetAvatarMenu(); EXPECT_EQ(2U, menu->GetNumberOfItems()); - string16 name3(ASCIIToUTF16("p3.com")); + base::string16 name3(ASCIIToUTF16("p3.com")); AddProfile(name3, true); // Four changes happened via the call to CreateTestingProfile: adding the @@ -304,8 +304,8 @@ TEST_F(ProfileListChromeOSTest, ChangeOnNotify) { TEST_F(ProfileListChromeOSTest, DontShowAvatarMenu) { // If in the new M-32 UX mode the icon gets shown, the menu will not. - string16 name1(ASCIIToUTF16("p1")); - string16 name2(ASCIIToUTF16("p2")); + base::string16 name1(ASCIIToUTF16("p1")); + base::string16 name2(ASCIIToUTF16("p2")); AddProfile(name1, true); @@ -322,8 +322,8 @@ TEST_F(ProfileListChromeOSTest, ShowAvatarMenuInM31) { CommandLine* cl = CommandLine::ForCurrentProcess(); cl->AppendSwitch(ash::switches::kAshEnableFullMultiProfileMode); - string16 name1(ASCIIToUTF16("p1")); - string16 name2(ASCIIToUTF16("p2")); + base::string16 name1(ASCIIToUTF16("p1")); + base::string16 name2(ASCIIToUTF16("p2")); AddProfile(name1, true); diff --git a/chrome/browser/chromeos/settings/system_settings_provider.cc b/chrome/browser/chromeos/settings/system_settings_provider.cc index 2f4353f..d125818 100644 --- a/chrome/browser/chromeos/settings/system_settings_provider.cc +++ b/chrome/browser/chromeos/settings/system_settings_provider.cc @@ -37,7 +37,7 @@ void SystemSettingsProvider::DoSet(const std::string& path, return; if (path == kSystemTimezone) { - string16 timezone_id; + base::string16 timezone_id; if (!in_value.GetAsString(&timezone_id)) return; // This will call TimezoneChanged. diff --git a/chrome/browser/chromeos/sim_dialog_delegate.cc b/chrome/browser/chromeos/sim_dialog_delegate.cc index 35a3449..3fd8a3d 100644 --- a/chrome/browser/chromeos/sim_dialog_delegate.cc +++ b/chrome/browser/chromeos/sim_dialog_delegate.cc @@ -61,7 +61,7 @@ ui::ModalType SimDialogDelegate::GetDialogModalType() const { } string16 SimDialogDelegate::GetDialogTitle() const { - return string16(); + return base::string16(); } GURL SimDialogDelegate::GetDialogContentURL() const { diff --git a/chrome/browser/chromeos/sim_dialog_delegate.h b/chrome/browser/chromeos/sim_dialog_delegate.h index 8bff538..0215050 100644 --- a/chrome/browser/chromeos/sim_dialog_delegate.h +++ b/chrome/browser/chromeos/sim_dialog_delegate.h @@ -33,7 +33,7 @@ class SimDialogDelegate : public ui::WebDialogDelegate { // Overridden from ui::WebDialogDelegate: virtual ui::ModalType GetDialogModalType() const OVERRIDE; - virtual string16 GetDialogTitle() const OVERRIDE; + virtual base::string16 GetDialogTitle() const OVERRIDE; virtual GURL GetDialogContentURL() const OVERRIDE; virtual void GetWebUIMessageHandlers( std::vector<content::WebUIMessageHandler*>* handlers) const OVERRIDE; diff --git a/chrome/browser/chromeos/status/data_promo_notification.cc b/chrome/browser/chromeos/status/data_promo_notification.cc index c774629..c9955e1 100644 --- a/chrome/browser/chromeos/status/data_promo_notification.cc +++ b/chrome/browser/chromeos/status/data_promo_notification.cc @@ -187,7 +187,7 @@ void DataPromoNotification::ShowOptionalMobileDataPromoNotification() { if (carrier) deal = GetCarrierDeal(carrier); - string16 message = l10n_util::GetStringUTF16(IDS_3G_NOTIFICATION_MESSAGE); + base::string16 message = l10n_util::GetStringUTF16(IDS_3G_NOTIFICATION_MESSAGE); std::string info_url; if (deal) { carrier_deal_promo_pref = GetCarrierDealPromoShown(); diff --git a/chrome/browser/chromeos/status/network_menu.cc b/chrome/browser/chromeos/status/network_menu.cc index 35869d9..5ea9e59 100644 --- a/chrome/browser/chromeos/status/network_menu.cc +++ b/chrome/browser/chromeos/status/network_menu.cc @@ -76,7 +76,7 @@ class NetworkMenuModel : public ui::MenuModel { sub_menu_model(NULL), flags(0) { } - MenuItem(ui::MenuModel::ItemType type, string16 label, gfx::ImageSkia icon, + MenuItem(ui::MenuModel::ItemType type, base::string16 label, gfx::ImageSkia icon, const std::string& service_path, int flags) : type(type), label(label), @@ -85,7 +85,7 @@ class NetworkMenuModel : public ui::MenuModel { sub_menu_model(NULL), flags(flags) { } - MenuItem(ui::MenuModel::ItemType type, string16 label, gfx::ImageSkia icon, + MenuItem(ui::MenuModel::ItemType type, base::string16 label, gfx::ImageSkia icon, NetworkMenuModel* sub_menu_model, int flags) : type(type), label(label), @@ -95,7 +95,7 @@ class NetworkMenuModel : public ui::MenuModel { } ui::MenuModel::ItemType type; - string16 label; + base::string16 label; gfx::ImageSkia icon; std::string service_path; NetworkMenuModel* sub_menu_model; // Weak ptr. @@ -122,7 +122,7 @@ class NetworkMenuModel : public ui::MenuModel { virtual int GetItemCount() const OVERRIDE; virtual ui::MenuModel::ItemType GetTypeAt(int index) const OVERRIDE; virtual ui::MenuSeparatorType GetSeparatorTypeAt(int index) const OVERRIDE; - virtual string16 GetLabelAt(int index) const OVERRIDE; + virtual base::string16 GetLabelAt(int index) const OVERRIDE; virtual bool IsItemDynamicAt(int index) const OVERRIDE; virtual const gfx::Font* GetLabelFontAt(int index) const OVERRIDE; virtual bool GetAcceleratorAt(int index, @@ -201,7 +201,7 @@ class MainMenuModel : public NetworkMenuModel { private: void AddWirelessNetworkMenuItem(const NetworkState* wifi_network, int flag); - void AddMessageItem(const string16& msg); + void AddMessageItem(const base::string16& msg); scoped_ptr<MoreMenuModel> more_menu_model_; @@ -346,7 +346,7 @@ void NetworkMenuModel::ShowOther(const std::string& type) const { void MainMenuModel::AddWirelessNetworkMenuItem(const NetworkState* network, int flag) { - string16 label; + base::string16 label; // Ampersand is a valid character in an SSID, but menu2 uses it to mark // "mnemonics" for keyboard shortcuts. std::string wifi_name = EscapeAmpersands(network->name()); @@ -372,7 +372,7 @@ void MainMenuModel::AddWirelessNetworkMenuItem(const NetworkState* network, label, icon, network->path(), flag)); } -void MainMenuModel::AddMessageItem(const string16& msg) { +void MainMenuModel::AddMessageItem(const base::string16& msg) { menu_items_.push_back(MenuItem( ui::MenuModel::TYPE_COMMAND, msg, gfx::ImageSkia(), std::string(), FLAG_DISABLED)); @@ -384,7 +384,7 @@ void MainMenuModel::InitMenuItems(bool should_open_button_options) { NetworkStateHandler* handler = NetworkHandler::Get()->network_state_handler(); // Populate our MenuItems with the current list of networks. - string16 label; + base::string16 label; // Ethernet // Only display an ethernet icon if enabled, and an ethernet network exists. diff --git a/chrome/browser/chromeos/system/ash_system_tray_delegate.cc b/chrome/browser/chromeos/system/ash_system_tray_delegate.cc index c71fb3b..e1f6c83 100644 --- a/chrome/browser/chromeos/system/ash_system_tray_delegate.cc +++ b/chrome/browser/chromeos/system/ash_system_tray_delegate.cc @@ -424,9 +424,9 @@ class SystemTrayDelegate : public ash::SystemTrayDelegate, return enterprise_domain_; } - virtual const string16 GetEnterpriseMessage() const OVERRIDE { + virtual const base::string16 GetEnterpriseMessage() const OVERRIDE { if (GetEnterpriseDomain().empty()) - return string16(); + return base::string16(); return l10n_util::GetStringFUTF16(IDS_DEVICE_OWNED_BY_NOTICE, UTF8ToUTF16(GetEnterpriseDomain())); } @@ -439,17 +439,17 @@ class SystemTrayDelegate : public ash::SystemTrayDelegate, chromeos::UserManager::Get()->GetActiveUser()->email()); } - virtual const string16 GetLocallyManagedUserManagerName() const OVERRIDE { + virtual const base::string16 GetLocallyManagedUserManagerName() const OVERRIDE { if (GetUserLoginStatus() != ash::user::LOGGED_IN_LOCALLY_MANAGED) - return string16(); + return base::string16(); return UserManager::Get()->GetSupervisedUserManager()-> GetManagerDisplayName( chromeos::UserManager::Get()->GetActiveUser()->email()); } - virtual const string16 GetLocallyManagedUserMessage() const OVERRIDE { + virtual const base::string16 GetLocallyManagedUserMessage() const OVERRIDE { if (GetUserLoginStatus() != ash::user::LOGGED_IN_LOCALLY_MANAGED) - return string16(); + return base::string16(); return l10n_util::GetStringFUTF16( IDS_USER_IS_LOCALLY_MANAGED_BY_NOTICE, UTF8ToUTF16(GetLocallyManagedUserManager())); diff --git a/chrome/browser/chromeos/system/timezone_util.cc b/chrome/browser/chromeos/system/timezone_util.cc index edd2e99..0200c4a 100644 --- a/chrome/browser/chromeos/system/timezone_util.cc +++ b/chrome/browser/chromeos/system/timezone_util.cc @@ -64,7 +64,7 @@ string16 GetExemplarCity(const icu::TimeZone& zone) { if (!U_FAILURE(status)) { city = icu::ures_getUnicodeStringByKey(zone_item.get(), "ec", &status); if (U_SUCCESS(status)) - return string16(city.getBuffer(), city.length()); + return base::string16(city.getBuffer(), city.length()); } // Fallback case in case of failure. @@ -112,9 +112,9 @@ string16 GetTimezoneName(const icu::TimeZone& timezone) { // rules (e.g. US Mountain Time in Denver vs Phoenix). icu::UnicodeString name; timezone.getDisplayName(dst_offset != 0, icu::TimeZone::LONG, name); - string16 result(l10n_util::GetStringFUTF16( + base::string16 result(l10n_util::GetStringFUTF16( IDS_OPTIONS_SETTINGS_TIMEZONE_DISPLAY_TEMPLATE, ASCIIToUTF16(offset_str), - string16(name.getBuffer(), name.length()), GetExemplarCity(timezone))); + base::string16(name.getBuffer(), name.length()), GetExemplarCity(timezone))); base::i18n::AdjustStringForLocaleDirection(&result); return result; } diff --git a/chrome/browser/chromeos/ui/echo_dialog_view.cc b/chrome/browser/chromeos/ui/echo_dialog_view.cc index 9e78691..0fd382c 100644 --- a/chrome/browser/chromeos/ui/echo_dialog_view.cc +++ b/chrome/browser/chromeos/ui/echo_dialog_view.cc @@ -35,16 +35,16 @@ EchoDialogView::EchoDialogView(EchoDialogListener* listener) EchoDialogView::~EchoDialogView() {} -void EchoDialogView::InitForEnabledEcho(const string16& service_name, - const string16& origin) { +void EchoDialogView::InitForEnabledEcho(const base::string16& service_name, + const base::string16& origin) { ok_button_label_id_ = IDS_OFFERS_CONSENT_INFOBAR_ENABLE_BUTTON; cancel_button_label_id_ = IDS_OFFERS_CONSENT_INFOBAR_DISABLE_BUTTON; - string16 link = + base::string16 link = l10n_util::GetStringUTF16(IDS_OFFERS_CONSENT_INFOBAR_LABEL_LEARN_MORE); std::vector<size_t> offsets; - string16 text = l10n_util::GetStringFUTF16(IDS_ECHO_CONSENT_DIALOG_TEXT, + base::string16 text = l10n_util::GetStringFUTF16(IDS_ECHO_CONSENT_DIALOG_TEXT, service_name, link, &offsets); @@ -73,11 +73,11 @@ void EchoDialogView::InitForDisabledEcho() { ok_button_label_id_ = 0; cancel_button_label_id_ = IDS_ECHO_CONSENT_DISMISS_BUTTON; - string16 link = + base::string16 link = l10n_util::GetStringUTF16(IDS_OFFERS_CONSENT_INFOBAR_LABEL_LEARN_MORE); size_t offset; - string16 text = l10n_util::GetStringFUTF16( + base::string16 text = l10n_util::GetStringFUTF16( IDS_ECHO_DISABLED_CONSENT_DIALOG_TEXT, link, &offset); label_ = new views::StyledLabel(text, this); @@ -134,7 +134,7 @@ string16 EchoDialogView::GetDialogButtonLabel(ui::DialogButton button) const { return l10n_util::GetStringUTF16(ok_button_label_id_); if (button == ui::DIALOG_BUTTON_CANCEL && cancel_button_label_id_) return l10n_util::GetStringUTF16(cancel_button_label_id_); - return string16(); + return base::string16(); } ui::ModalType EchoDialogView::GetModalType() const { diff --git a/chrome/browser/chromeos/ui/echo_dialog_view.h b/chrome/browser/chromeos/ui/echo_dialog_view.h index 517dbbb..31faff3 100644 --- a/chrome/browser/chromeos/ui/echo_dialog_view.h +++ b/chrome/browser/chromeos/ui/echo_dialog_view.h @@ -35,7 +35,7 @@ class EchoDialogView : public views::DialogDelegateView, // url. Service name should be underlined in the dialog, and hovering over its // label should display tooltip containing |origin|. // The dialog will have both OK and Cancel buttons. - void InitForEnabledEcho(const string16& service_name, const string16& origin); + void InitForEnabledEcho(const base::string16& service_name, const base::string16& origin); // Initializes dialog layout that will be shown when echo extension is not // allowed to redeem offers. The dialog will be showing a message that the @@ -52,7 +52,7 @@ class EchoDialogView : public views::DialogDelegateView, // views::DialogDelegate overrides. virtual int GetDialogButtons() const OVERRIDE; virtual int GetDefaultDialogButton() const OVERRIDE; - virtual string16 GetDialogButtonLabel(ui::DialogButton button) const OVERRIDE; + virtual base::string16 GetDialogButtonLabel(ui::DialogButton button) const OVERRIDE; virtual bool Cancel() OVERRIDE; virtual bool Accept() OVERRIDE; diff --git a/chrome/browser/chromeos/ui/idle_logout_dialog_view.cc b/chrome/browser/chromeos/ui/idle_logout_dialog_view.cc index acbc569..30294e2 100644 --- a/chrome/browser/chromeos/ui/idle_logout_dialog_view.cc +++ b/chrome/browser/chromeos/ui/idle_logout_dialog_view.cc @@ -89,7 +89,7 @@ ui::ModalType IdleLogoutDialogView::GetModalType() const { return ui::MODAL_TYPE_WINDOW; } -string16 IdleLogoutDialogView::GetWindowTitle() const { +base::string16 IdleLogoutDialogView::GetWindowTitle() const { return l10n_util::GetStringUTF16(IDS_IDLE_LOGOUT_TITLE); } diff --git a/chrome/browser/chromeos/ui/idle_logout_dialog_view.h b/chrome/browser/chromeos/ui/idle_logout_dialog_view.h index 7ef0ea5..da6f4d9 100644 --- a/chrome/browser/chromeos/ui/idle_logout_dialog_view.h +++ b/chrome/browser/chromeos/ui/idle_logout_dialog_view.h @@ -46,7 +46,7 @@ class IdleLogoutDialogView : public views::DialogDelegateView { // views::DialogDelegateView: virtual int GetDialogButtons() const OVERRIDE; virtual ui::ModalType GetModalType() const OVERRIDE; - virtual string16 GetWindowTitle() const OVERRIDE; + virtual base::string16 GetWindowTitle() const OVERRIDE; virtual bool Close() OVERRIDE; private: diff --git a/chrome/browser/chromeos/ui/screen_capture_notification_ui_chromeos.cc b/chrome/browser/chromeos/ui/screen_capture_notification_ui_chromeos.cc index 8571363..eed66dc 100644 --- a/chrome/browser/chromeos/ui/screen_capture_notification_ui_chromeos.cc +++ b/chrome/browser/chromeos/ui/screen_capture_notification_ui_chromeos.cc @@ -12,7 +12,7 @@ namespace chromeos { ScreenCaptureNotificationUIChromeOS::ScreenCaptureNotificationUIChromeOS( - const string16& text) + const base::string16& text) : text_(text) { } @@ -32,7 +32,7 @@ void ScreenCaptureNotificationUIChromeOS::OnStarted( // static scoped_ptr<ScreenCaptureNotificationUI> ScreenCaptureNotificationUI::Create( - const string16& text) { + const base::string16& text) { return scoped_ptr<ScreenCaptureNotificationUI>( new chromeos::ScreenCaptureNotificationUIChromeOS(text)); } diff --git a/chrome/browser/chromeos/ui/screen_capture_notification_ui_chromeos.h b/chrome/browser/chromeos/ui/screen_capture_notification_ui_chromeos.h index 33c8e7b..5c87b2d 100644 --- a/chrome/browser/chromeos/ui/screen_capture_notification_ui_chromeos.h +++ b/chrome/browser/chromeos/ui/screen_capture_notification_ui_chromeos.h @@ -14,14 +14,14 @@ namespace chromeos { class ScreenCaptureNotificationUIChromeOS : public ScreenCaptureNotificationUI { public: // |text| is used to specify the text for the notification. - explicit ScreenCaptureNotificationUIChromeOS(const string16& text); + explicit ScreenCaptureNotificationUIChromeOS(const base::string16& text); virtual ~ScreenCaptureNotificationUIChromeOS(); // ScreenCaptureNotificationUI overrides. virtual void OnStarted(const base::Closure& stop_callback) OVERRIDE; private: - const string16 text_; + const base::string16 text_; DISALLOW_COPY_AND_ASSIGN(ScreenCaptureNotificationUIChromeOS); }; diff --git a/chrome/browser/content_settings/content_settings_browsertest.cc b/chrome/browser/content_settings/content_settings_browsertest.cc index a411a58..8521636 100644 --- a/chrome/browser/content_settings/content_settings_browsertest.cc +++ b/chrome/browser/content_settings/content_settings_browsertest.cc @@ -315,7 +315,7 @@ IN_PROC_BROWSER_TEST_F(ClickToPlayPluginTest, Basic) { base::FilePath(), base::FilePath().AppendASCII("clicktoplay.html")); ui_test_utils::NavigateToURL(browser(), url); - string16 expected_title(ASCIIToUTF16("OK")); + base::string16 expected_title(ASCIIToUTF16("OK")); content::TitleWatcher title_watcher( browser()->tab_strip_model()->GetActiveWebContents(), expected_title); @@ -347,7 +347,7 @@ IN_PROC_BROWSER_TEST_F(ClickToPlayPluginTest, AllowException) { std::string(), CONTENT_SETTING_ALLOW); - string16 expected_title(ASCIIToUTF16("OK")); + base::string16 expected_title(ASCIIToUTF16("OK")); content::TitleWatcher title_watcher( browser()->tab_strip_model()->GetActiveWebContents(), expected_title); ui_test_utils::NavigateToURL(browser(), url); @@ -366,7 +366,7 @@ IN_PROC_BROWSER_TEST_F(ClickToPlayPluginTest, BlockException) { std::string(), CONTENT_SETTING_BLOCK); - string16 expected_title(ASCIIToUTF16("Click To Play")); + base::string16 expected_title(ASCIIToUTF16("Click To Play")); content::TitleWatcher title_watcher( browser()->tab_strip_model()->GetActiveWebContents(), expected_title); ui_test_utils::NavigateToURL(browser(), url); @@ -391,7 +391,7 @@ IN_PROC_BROWSER_TEST_F(ClickToPlayPluginTest, MAYBE_LoadAllBlockedPlugins) { base::FilePath().AppendASCII("load_all_blocked_plugins.html")); ui_test_utils::NavigateToURL(browser(), url); - string16 expected_title1(ASCIIToUTF16("1")); + base::string16 expected_title1(ASCIIToUTF16("1")); content::TitleWatcher title_watcher1( browser()->tab_strip_model()->GetActiveWebContents(), expected_title1); @@ -403,7 +403,7 @@ IN_PROC_BROWSER_TEST_F(ClickToPlayPluginTest, MAYBE_LoadAllBlockedPlugins) { host->GetRoutingID(), std::string())); EXPECT_EQ(expected_title1, title_watcher1.WaitAndGetTitle()); - string16 expected_title2(ASCIIToUTF16("2")); + base::string16 expected_title2(ASCIIToUTF16("2")); content::TitleWatcher title_watcher2( browser()->tab_strip_model()->GetActiveWebContents(), expected_title2); @@ -428,7 +428,7 @@ IN_PROC_BROWSER_TEST_F(ClickToPlayPluginTest, NoCallbackAtLoad) { browser()->tab_strip_model()->GetActiveWebContents(), "CallOnStartup = function() { document.title = \"OK\"; }")); - string16 expected_title(ASCIIToUTF16("OK")); + base::string16 expected_title(ASCIIToUTF16("OK")); content::TitleWatcher title_watcher( browser()->tab_strip_model()->GetActiveWebContents(), expected_title); @@ -452,7 +452,7 @@ IN_PROC_BROWSER_TEST_F(ClickToPlayPluginTest, DeleteSelfAtLoad) { base::FilePath().AppendASCII("plugin_delete_self_at_load.html")); ui_test_utils::NavigateToURL(browser(), url); - string16 expected_title(ASCIIToUTF16("OK")); + base::string16 expected_title(ASCIIToUTF16("OK")); content::TitleWatcher title_watcher( browser()->tab_strip_model()->GetActiveWebContents(), expected_title); @@ -518,7 +518,7 @@ class PepperContentSettingsTest : public ContentSettingsTest { content::WebContents* web_contents = browser()->tab_strip_model()->GetActiveWebContents(); - string16 expected_title(ASCIIToUTF16(expected_result)); + base::string16 expected_title(ASCIIToUTF16(expected_result)); content::TitleWatcher title_watcher(web_contents, expected_title); // GetTestUrl assumes paths, so we must append query parameters to result. @@ -544,7 +544,7 @@ class PepperContentSettingsTest : public ContentSettingsTest { browser()->tab_strip_model()->GetActiveWebContents(); TabSpecificContentSettings* tab_settings = TabSpecificContentSettings::FromWebContents(web_contents); - string16 expected_title(ASCIIToUTF16(kExpectedTitle)); + base::string16 expected_title(ASCIIToUTF16(kExpectedTitle)); content::TitleWatcher title_watcher(web_contents, expected_title); GURL url = ui_test_utils::GetTestUrl( diff --git a/chrome/browser/content_settings/content_settings_usages_state.cc b/chrome/browser/content_settings/content_settings_usages_state.cc index 4e82b6f..ed95912 100644 --- a/chrome/browser/content_settings/content_settings_usages_state.cc +++ b/chrome/browser/content_settings/content_settings_usages_state.cc @@ -101,7 +101,7 @@ void ContentSettingsUsagesState::GetDetailedInfo( std::string ContentSettingsUsagesState::GURLToFormattedHost( const GURL& url) const { - string16 display_host; + base::string16 display_host; net::AppendFormattedHost(url, profile_->GetPrefs()->GetString(prefs::kAcceptLanguages), &display_host); return UTF16ToUTF8(display_host); diff --git a/chrome/browser/content_settings/tab_specific_content_settings.cc b/chrome/browser/content_settings/tab_specific_content_settings.cc index 0875ded..a42d6fd 100644 --- a/chrome/browser/content_settings/tab_specific_content_settings.cc +++ b/chrome/browser/content_settings/tab_specific_content_settings.cc @@ -133,8 +133,8 @@ void TabSpecificContentSettings::WebDatabaseAccessed( int render_process_id, int render_view_id, const GURL& url, - const string16& name, - const string16& display_name, + const base::string16& name, + const base::string16& display_name, bool blocked_by_policy) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); TabSpecificContentSettings* settings = Get(render_process_id, render_view_id); @@ -158,7 +158,7 @@ void TabSpecificContentSettings::DOMStorageAccessed(int render_process_id, void TabSpecificContentSettings::IndexedDBAccessed(int render_process_id, int render_view_id, const GURL& url, - const string16& description, + const base::string16& description, bool blocked_by_policy) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); TabSpecificContentSettings* settings = Get(render_process_id, render_view_id); @@ -381,7 +381,7 @@ void TabSpecificContentSettings::OnCookieChanged( void TabSpecificContentSettings::OnIndexedDBAccessed( const GURL& url, - const string16& description, + const base::string16& description, bool blocked_by_policy) { if (blocked_by_policy) { blocked_local_shared_objects_.indexed_dbs()->AddIndexedDB( @@ -416,8 +416,8 @@ void TabSpecificContentSettings::OnLocalStorageAccessed( void TabSpecificContentSettings::OnWebDatabaseAccessed( const GURL& url, - const string16& name, - const string16& display_name, + const base::string16& name, + const base::string16& display_name, bool blocked_by_policy) { if (blocked_by_policy) { blocked_local_shared_objects_.databases()->AddDatabase( diff --git a/chrome/browser/content_settings/tab_specific_content_settings.h b/chrome/browser/content_settings/tab_specific_content_settings.h index 8671e53..1a4cd58 100644 --- a/chrome/browser/content_settings/tab_specific_content_settings.h +++ b/chrome/browser/content_settings/tab_specific_content_settings.h @@ -118,8 +118,8 @@ class TabSpecificContentSettings static void WebDatabaseAccessed(int render_process_id, int render_view_id, const GURL& url, - const string16& name, - const string16& display_name, + const base::string16& name, + const base::string16& display_name, bool blocked_by_policy); // Called when a specific DOM storage area in the current page was @@ -139,7 +139,7 @@ class TabSpecificContentSettings static void IndexedDBAccessed(int render_process_id, int render_view_id, const GURL& url, - const string16& description, + const base::string16& description, bool blocked_by_policy); // Called when a specific file system in the current page was accessed. @@ -312,14 +312,14 @@ class TabSpecificContentSettings void OnFileSystemAccessed(const GURL& url, bool blocked_by_policy); void OnIndexedDBAccessed(const GURL& url, - const string16& description, + const base::string16& description, bool blocked_by_policy); void OnLocalStorageAccessed(const GURL& url, bool local, bool blocked_by_policy); void OnWebDatabaseAccessed(const GURL& url, - const string16& name, - const string16& display_name, + const base::string16& name, + const base::string16& display_name, bool blocked_by_policy); void OnGeolocationPermissionSet(const GURL& requesting_frame, bool allowed); diff --git a/chrome/browser/crash_recovery_browsertest.cc b/chrome/browser/crash_recovery_browsertest.cc index 015570c..fcde2cb 100644 --- a/chrome/browser/crash_recovery_browsertest.cc +++ b/chrome/browser/crash_recovery_browsertest.cc @@ -44,8 +44,8 @@ IN_PROC_BROWSER_TEST_F(CrashRecoveryBrowserTest, Reload) { "data:text/html,<script>document.title=new Date().valueOf()</script>"); ui_test_utils::NavigateToURL(browser(), url); - string16 title_before_crash; - string16 title_after_crash; + base::string16 title_before_crash; + base::string16 title_after_crash; ASSERT_TRUE(ui_test_utils::GetCurrentTabTitle(browser(), &title_before_crash)); @@ -75,8 +75,8 @@ IN_PROC_BROWSER_TEST_F(CrashRecoveryBrowserTest, LoadInNewTab) { base::FilePath(base::FilePath::kCurrentDirectory), base::FilePath(kTitle2File))); - string16 title_before_crash; - string16 title_after_crash; + base::string16 title_before_crash; + base::string16 title_after_crash; ASSERT_TRUE(ui_test_utils::GetCurrentTabTitle(browser(), &title_before_crash)); diff --git a/chrome/browser/custom_handlers/protocol_handler_registry_browsertest.cc b/chrome/browser/custom_handlers/protocol_handler_registry_browsertest.cc index ce23344..abb2680 100644 --- a/chrome/browser/custom_handlers/protocol_handler_registry_browsertest.cc +++ b/chrome/browser/custom_handlers/protocol_handler_registry_browsertest.cc @@ -69,7 +69,7 @@ class RegisterProtocolHandlerBrowserTest : public InProcessBrowserTest { void AddProtocolHandler(const std::string& protocol, const GURL& url, - const string16& title) { + const base::string16& title) { ProtocolHandler handler = ProtocolHandler::CreateProtocolHandler( protocol, url, title); ProtocolHandlerRegistry* registry = diff --git a/chrome/browser/custom_handlers/register_protocol_handler_infobar_delegate.cc b/chrome/browser/custom_handlers/register_protocol_handler_infobar_delegate.cc index d7f6aa1..a2f83e0 100644 --- a/chrome/browser/custom_handlers/register_protocol_handler_infobar_delegate.cc +++ b/chrome/browser/custom_handlers/register_protocol_handler_infobar_delegate.cc @@ -68,7 +68,7 @@ RegisterProtocolHandlerInfoBarDelegate* return this; } -string16 RegisterProtocolHandlerInfoBarDelegate::GetMessageText() const { +base::string16 RegisterProtocolHandlerInfoBarDelegate::GetMessageText() const { ProtocolHandler old_handler = registry_->GetHandlerFor(handler_.protocol()); return old_handler.IsEmpty() ? l10n_util::GetStringFUTF16(IDS_REGISTER_PROTOCOL_HANDLER_CONFIRM, @@ -79,7 +79,7 @@ string16 RegisterProtocolHandlerInfoBarDelegate::GetMessageText() const { GetProtocolName(handler_), old_handler.title()); } -string16 RegisterProtocolHandlerInfoBarDelegate::GetButtonLabel( +base::string16 RegisterProtocolHandlerInfoBarDelegate::GetButtonLabel( InfoBarButton button) const { return (button == BUTTON_OK) ? l10n_util::GetStringFUTF16(IDS_REGISTER_PROTOCOL_HANDLER_ACCEPT, @@ -106,7 +106,7 @@ bool RegisterProtocolHandlerInfoBarDelegate::Cancel() { return true; } -string16 RegisterProtocolHandlerInfoBarDelegate::GetLinkText() const { +base::string16 RegisterProtocolHandlerInfoBarDelegate::GetLinkText() const { return l10n_util::GetStringUTF16(IDS_LEARN_MORE); } @@ -121,7 +121,7 @@ bool RegisterProtocolHandlerInfoBarDelegate::LinkClicked( return false; } -string16 RegisterProtocolHandlerInfoBarDelegate::GetProtocolName( +base::string16 RegisterProtocolHandlerInfoBarDelegate::GetProtocolName( const ProtocolHandler& handler) const { if (handler.protocol() == "mailto") return l10n_util::GetStringUTF16(IDS_REGISTER_PROTOCOL_HANDLER_MAILTO_NAME); diff --git a/chrome/browser/custom_handlers/register_protocol_handler_infobar_delegate.h b/chrome/browser/custom_handlers/register_protocol_handler_infobar_delegate.h index 90b7eae..4e71933 100644 --- a/chrome/browser/custom_handlers/register_protocol_handler_infobar_delegate.h +++ b/chrome/browser/custom_handlers/register_protocol_handler_infobar_delegate.h @@ -35,16 +35,16 @@ class RegisterProtocolHandlerInfoBarDelegate : public ConfirmInfoBarDelegate { virtual Type GetInfoBarType() const OVERRIDE; virtual RegisterProtocolHandlerInfoBarDelegate* AsRegisterProtocolHandlerInfoBarDelegate() OVERRIDE; - virtual string16 GetMessageText() const OVERRIDE; - virtual string16 GetButtonLabel(InfoBarButton button) const OVERRIDE; + virtual base::string16 GetMessageText() const OVERRIDE; + virtual base::string16 GetButtonLabel(InfoBarButton button) const OVERRIDE; virtual bool NeedElevation(InfoBarButton button) const OVERRIDE; virtual bool Accept() OVERRIDE; virtual bool Cancel() OVERRIDE; - virtual string16 GetLinkText() const OVERRIDE; + virtual base::string16 GetLinkText() const OVERRIDE; virtual bool LinkClicked(WindowOpenDisposition disposition) OVERRIDE; // Returns a user-friendly name for the protocol of this protocol handler. - string16 GetProtocolName(const ProtocolHandler& handler) const; + base::string16 GetProtocolName(const ProtocolHandler& handler) const; ProtocolHandlerRegistry* registry_; ProtocolHandler handler_; diff --git a/chrome/browser/custom_home_pages_table_model.cc b/chrome/browser/custom_home_pages_table_model.cc index c2cdfa1..9b7b861 100644 --- a/chrome/browser/custom_home_pages_table_model.cc +++ b/chrome/browser/custom_home_pages_table_model.cc @@ -61,7 +61,7 @@ struct CustomHomePagesTableModel::Entry { GURL url; // Page title. If this is empty, we'll display the URL as the entry. - string16 title; + base::string16 title; // If non-zero, indicates we're loading the title for the page. HistoryService::Handle title_handle; @@ -211,7 +211,7 @@ string16 CustomHomePagesTableModel::GetText(int row, int column_id) { } string16 CustomHomePagesTableModel::GetTooltip(int row) { - return entries_[row].title.empty() ? string16() : + return entries_[row].title.empty() ? base::string16() : l10n_util::GetStringFUTF16(IDS_OPTIONS_STARTUP_PAGE_TOOLTIP, entries_[row].title, FormattedURL(row)); } @@ -267,7 +267,7 @@ CustomHomePagesTableModel::Entry* string16 CustomHomePagesTableModel::FormattedURL(int row) const { std::string languages = profile_->GetPrefs()->GetString(prefs::kAcceptLanguages); - string16 url = net::FormatUrl(entries_[row].url, languages); + base::string16 url = net::FormatUrl(entries_[row].url, languages); url = base::i18n::GetDisplayStringInLTRDirectionality(url); return url; } diff --git a/chrome/browser/custom_home_pages_table_model.h b/chrome/browser/custom_home_pages_table_model.h index cad3a41..64a8b82 100644 --- a/chrome/browser/custom_home_pages_table_model.h +++ b/chrome/browser/custom_home_pages_table_model.h @@ -50,8 +50,8 @@ class CustomHomePagesTableModel : public ui::TableModel { // TableModel overrides: virtual int RowCount() OVERRIDE; - virtual string16 GetText(int row, int column_id) OVERRIDE; - virtual string16 GetTooltip(int row) OVERRIDE; + virtual base::string16 GetText(int row, int column_id) OVERRIDE; + virtual base::string16 GetTooltip(int row) OVERRIDE; virtual void SetObserver(ui::TableModelObserver* observer) OVERRIDE; private: @@ -76,7 +76,7 @@ class CustomHomePagesTableModel : public ui::TableModel { int* entry_index); // Returns the URL for a particular row, formatted for display to the user. - string16 FormattedURL(int row) const; + base::string16 FormattedURL(int row) const; // Set of entries we're showing. std::vector<Entry> entries_; diff --git a/chrome/browser/devtools/devtools_file_helper.h b/chrome/browser/devtools/devtools_file_helper.h index 428b9cd..101f0d7 100644 --- a/chrome/browser/devtools/devtools_file_helper.h +++ b/chrome/browser/devtools/devtools_file_helper.h @@ -48,7 +48,7 @@ class DevToolsFileHelper { RequestFileSystemsCallback; typedef base::Callback<void(const DevToolsFileHelper::FileSystem&)> AddFileSystemCallback; - typedef base::Callback<void(const string16&, + typedef base::Callback<void(const base::string16&, const base::Callback<void(bool)>&)> ShowInfoBarCallback; diff --git a/chrome/browser/devtools/devtools_sanity_browsertest.cc b/chrome/browser/devtools/devtools_sanity_browsertest.cc index 0f1362a..63c8b31 100644 --- a/chrome/browser/devtools/devtools_sanity_browsertest.cc +++ b/chrome/browser/devtools/devtools_sanity_browsertest.cc @@ -445,7 +445,7 @@ class WorkerDevToolsSanityTest : public InProcessBrowserTest { virtual void WorkerCreated ( const GURL& url, - const string16& name, + const base::string16& name, int process_id, int route_id) OVERRIDE { worker_data_->worker_process_id = process_id; diff --git a/chrome/browser/devtools/devtools_targets_ui.cc b/chrome/browser/devtools/devtools_targets_ui.cc index e2f1c00..865eb1d 100644 --- a/chrome/browser/devtools/devtools_targets_ui.cc +++ b/chrome/browser/devtools/devtools_targets_ui.cc @@ -197,7 +197,7 @@ class WorkerObserver // content::WorkerServiceObserver overrides: virtual void WorkerCreated( const GURL& url, - const string16& name, + const base::string16& name, int process_id, int route_id) OVERRIDE { EnumerateOnIOThread(); diff --git a/chrome/browser/devtools/devtools_window.cc b/chrome/browser/devtools/devtools_window.cc index 75b98c1..b197934 100644 --- a/chrome/browser/devtools/devtools_window.cc +++ b/chrome/browser/devtools/devtools_window.cc @@ -81,22 +81,22 @@ class DevToolsConfirmInfoBarDelegate : public ConfirmInfoBarDelegate { // and adds the inofbar to |infobar_service|. static void Create(InfoBarService* infobar_service, const DevToolsWindow::InfoBarCallback& callback, - const string16& message); + const base::string16& message); private: DevToolsConfirmInfoBarDelegate( InfoBarService* infobar_service, const DevToolsWindow::InfoBarCallback& callback, - const string16& message); + const base::string16& message); virtual ~DevToolsConfirmInfoBarDelegate(); - virtual string16 GetMessageText() const OVERRIDE; - virtual string16 GetButtonLabel(InfoBarButton button) const OVERRIDE; + virtual base::string16 GetMessageText() const OVERRIDE; + virtual base::string16 GetButtonLabel(InfoBarButton button) const OVERRIDE; virtual bool Accept() OVERRIDE; virtual bool Cancel() OVERRIDE; DevToolsWindow::InfoBarCallback callback_; - const string16 message_; + const base::string16 message_; DISALLOW_COPY_AND_ASSIGN(DevToolsConfirmInfoBarDelegate); }; @@ -104,7 +104,7 @@ class DevToolsConfirmInfoBarDelegate : public ConfirmInfoBarDelegate { void DevToolsConfirmInfoBarDelegate::Create( InfoBarService* infobar_service, const DevToolsWindow::InfoBarCallback& callback, - const string16& message) { + const base::string16& message) { if (!infobar_service) { callback.Run(false); return; @@ -117,7 +117,7 @@ void DevToolsConfirmInfoBarDelegate::Create( DevToolsConfirmInfoBarDelegate::DevToolsConfirmInfoBarDelegate( InfoBarService* infobar_service, const DevToolsWindow::InfoBarCallback& callback, - const string16& message) + const base::string16& message) : ConfirmInfoBarDelegate(infobar_service), callback_(callback), message_(message) { @@ -128,11 +128,11 @@ DevToolsConfirmInfoBarDelegate::~DevToolsConfirmInfoBarDelegate() { callback_.Run(false); } -string16 DevToolsConfirmInfoBarDelegate::GetMessageText() const { +base::string16 DevToolsConfirmInfoBarDelegate::GetMessageText() const { return message_; } -string16 DevToolsConfirmInfoBarDelegate::GetButtonLabel( +base::string16 DevToolsConfirmInfoBarDelegate::GetButtonLabel( InfoBarButton button) const { return l10n_util::GetStringUTF16((button == BUTTON_OK) ? IDS_DEV_TOOLS_CONFIRM_ALLOW_BUTTON : IDS_DEV_TOOLS_CONFIRM_DENY_BUTTON); @@ -1300,7 +1300,7 @@ void DevToolsWindow::SearchCompleted( } void DevToolsWindow::ShowDevToolsConfirmInfoBar( - const string16& message, + const base::string16& message, const InfoBarCallback& callback) { DevToolsConfirmInfoBarDelegate::Create( IsDocked() ? @@ -1489,7 +1489,7 @@ void DevToolsWindow::CallClientFunction(const std::string& function_name, } } } - string16 javascript = ASCIIToUTF16(function_name + "(" + params + ");"); + base::string16 javascript = ASCIIToUTF16(function_name + "(" + params + ");"); web_contents_->GetRenderViewHost()->ExecuteJavascriptInWebFrame( base::string16(), javascript); } diff --git a/chrome/browser/devtools/devtools_window.h b/chrome/browser/devtools/devtools_window.h index ce8bcee..2247de2 100644 --- a/chrome/browser/devtools/devtools_window.h +++ b/chrome/browser/devtools/devtools_window.h @@ -313,7 +313,7 @@ class DevToolsWindow : private content::NotificationObserver, void SearchCompleted(int request_id, const std::string& file_system_path, const std::vector<std::string>& file_paths); - void ShowDevToolsConfirmInfoBar(const string16& message, + void ShowDevToolsConfirmInfoBar(const base::string16& message, const InfoBarCallback& callback); void CreateDevToolsBrowser(); diff --git a/chrome/browser/diagnostics/diagnostics_writer.cc b/chrome/browser/diagnostics/diagnostics_writer.cc index 4b95ef6..84451cc 100644 --- a/chrome/browser/diagnostics/diagnostics_writer.cc +++ b/chrome/browser/diagnostics/diagnostics_writer.cc @@ -42,7 +42,7 @@ class SimpleConsole { virtual bool Init() = 0; // Writes a string to the console with the current color. - virtual bool Write(const string16& text) = 0; + virtual bool Write(const base::string16& text) = 0; // Called when the program is about to exit. virtual void OnQuit() = 0; @@ -77,7 +77,7 @@ class WinConsole : public SimpleConsole { return SetIOHandles(); } - virtual bool Write(const string16& txt) { + virtual bool Write(const base::string16& txt) { DWORD sz = txt.size(); return (TRUE == ::WriteConsoleW(std_out_, txt.c_str(), sz, &sz, NULL)); } @@ -146,7 +146,7 @@ class PosixConsole : public SimpleConsole { return true; } - virtual bool Write(const string16& text) OVERRIDE { + virtual bool Write(const base::string16& text) OVERRIDE { // We're assuming that the terminal is using UTF-8 encoding. printf("%s", UTF16ToUTF8(text).c_str()); return true; diff --git a/chrome/browser/do_not_track_browsertest.cc b/chrome/browser/do_not_track_browsertest.cc index 561fa85..934ab86 100644 --- a/chrome/browser/do_not_track_browsertest.cc +++ b/chrome/browser/do_not_track_browsertest.cc @@ -28,7 +28,7 @@ IN_PROC_BROWSER_TEST_F(DoNotTrackTest, Simple) { int matches = ui_test_utils::FindInPage( browser()->tab_strip_model()->GetActiveWebContents(), - string16(ASCIIToUTF16("1")), + base::string16(ASCIIToUTF16("1")), true /* forward */, false /* match case */, NULL /* ordinal */, NULL /* selection_rect */); @@ -49,7 +49,7 @@ IN_PROC_BROWSER_TEST_F(DoNotTrackTest, Redirect) { int matches = ui_test_utils::FindInPage( browser()->tab_strip_model()->GetActiveWebContents(), - string16(ASCIIToUTF16("1")), + base::string16(ASCIIToUTF16("1")), true /* forward */, false /* match case */, NULL /* ordinal */, NULL /* selection_rect */); diff --git a/chrome/browser/download/download_browsertest.cc b/chrome/browser/download/download_browsertest.cc index 9f95079..99165e0 100644 --- a/chrome/browser/download/download_browsertest.cc +++ b/chrome/browser/download/download_browsertest.cc @@ -745,9 +745,9 @@ class DownloadTest : public InProcessBrowserTest { // |expected_title_finished| need to be checked. base::FilePath filename; net::FileURLToFilePath(url, &filename); - string16 expected_title_in_progress( + base::string16 expected_title_in_progress( ASCIIToUTF16(partial_indication) + filename.LossyDisplayName()); - string16 expected_title_finished( + base::string16 expected_title_finished( ASCIIToUTF16(total_indication) + filename.LossyDisplayName()); // Download a partial web page in a background tab and wait. @@ -2382,7 +2382,7 @@ IN_PROC_BROWSER_TEST_F(DownloadTest, SavePageNonHTMLViaPost) { content::RenderViewHost* render_view_host = web_contents->GetRenderViewHost(); ASSERT_TRUE(render_view_host != NULL); render_view_host->ExecuteJavascriptInWebFrame( - string16(), ASCIIToUTF16("SubmitForm()")); + base::string16(), ASCIIToUTF16("SubmitForm()")); observer.Wait(); EXPECT_EQ(jpeg_url, web_contents->GetURL()); @@ -2897,7 +2897,7 @@ IN_PROC_BROWSER_TEST_F(DownloadTest, DownloadTest_CrazyFilenames) { ASSERT_TRUE(base::CreateDirectory(DestinationFile(browser(), origin))); for (size_t index = 0; index < arraysize(kCrazyFilenames); ++index) { - string16 crazy16; + base::string16 crazy16; std::string crazy8; const wchar_t* crazy_w = kCrazyFilenames[index]; ASSERT_TRUE(WideToUTF8(crazy_w, wcslen(crazy_w), &crazy8)); diff --git a/chrome/browser/download/download_danger_prompt.cc b/chrome/browser/download/download_danger_prompt.cc index 0d5eb09..d2e77e4 100644 --- a/chrome/browser/download/download_danger_prompt.cc +++ b/chrome/browser/download/download_danger_prompt.cc @@ -42,10 +42,10 @@ class DownloadDangerPromptImpl : public DownloadDangerPrompt, virtual void OnDownloadUpdated(content::DownloadItem* download) OVERRIDE; // TabModalConfirmDialogDelegate: - virtual string16 GetTitle() OVERRIDE; - virtual string16 GetMessage() OVERRIDE; - virtual string16 GetAcceptButtonTitle() OVERRIDE; - virtual string16 GetCancelButtonTitle() OVERRIDE; + virtual base::string16 GetTitle() OVERRIDE; + virtual base::string16 GetMessage() OVERRIDE; + virtual base::string16 GetAcceptButtonTitle() OVERRIDE; + virtual base::string16 GetCancelButtonTitle() OVERRIDE; virtual void OnAccepted() OVERRIDE; virtual void OnCanceled() OVERRIDE; virtual void OnClosed() OVERRIDE; @@ -169,7 +169,7 @@ string16 DownloadDangerPromptImpl::GetMessage() { } } NOTREACHED(); - return string16(); + return base::string16(); } string16 DownloadDangerPromptImpl::GetAcceptButtonTitle() { diff --git a/chrome/browser/download/download_file_picker.cc b/chrome/browser/download/download_file_picker.cc index d4820b0..94dc462 100644 --- a/chrome/browser/download/download_file_picker.cc +++ b/chrome/browser/download/download_file_picker.cc @@ -82,7 +82,7 @@ DownloadFilePicker::DownloadFilePicker( NULL; select_file_dialog_->SelectFile(ui::SelectFileDialog::SELECT_SAVEAS_FILE, - string16(), + base::string16(), suggested_path_, &file_type_info, 0, diff --git a/chrome/browser/download/download_item_model.cc b/chrome/browser/download/download_item_model.cc index ff593ea..815c3cd 100644 --- a/chrome/browser/download/download_item_model.cc +++ b/chrome/browser/download/download_item_model.cc @@ -177,7 +177,7 @@ string16 InterruptReasonStatusMessage(int reason) { string16 InterruptReasonMessage(int reason) { int string_id = 0; - string16 status_text; + base::string16 status_text; switch (reason) { case content::DOWNLOAD_INTERRUPT_REASON_FILE_ACCESS_DENIED: @@ -258,13 +258,13 @@ string16 DownloadItemModel::GetInterruptReasonText() const { if (download_->GetState() != DownloadItem::INTERRUPTED || download_->GetLastReason() == content::DOWNLOAD_INTERRUPT_REASON_USER_CANCELED) { - return string16(); + return base::string16(); } return InterruptReasonMessage(download_->GetLastReason()); } string16 DownloadItemModel::GetStatusText() const { - string16 status_text; + base::string16 status_text; switch (download_->GetState()) { case DownloadItem::IN_PROGRESS: status_text = GetInProgressStatusString(); @@ -282,7 +282,7 @@ string16 DownloadItemModel::GetStatusText() const { case DownloadItem::INTERRUPTED: { content::DownloadInterruptReason reason = download_->GetLastReason(); if (reason != content::DOWNLOAD_INTERRUPT_REASON_USER_CANCELED) { - string16 interrupt_reason = InterruptReasonStatusMessage(reason); + base::string16 interrupt_reason = InterruptReasonStatusMessage(reason); status_text = l10n_util::GetStringFUTF16( IDS_DOWNLOAD_STATUS_INTERRUPTED, interrupt_reason); } else { @@ -301,15 +301,15 @@ string16 DownloadItemModel::GetStatusText() const { string16 DownloadItemModel::GetTabProgressStatusText() const { int64 total = GetTotalBytes(); int64 size = download_->GetReceivedBytes(); - string16 received_size = ui::FormatBytes(size); - string16 amount = received_size; + base::string16 received_size = ui::FormatBytes(size); + base::string16 amount = received_size; // Adjust both strings for the locale direction since we don't yet know which // string we'll end up using for constructing the final progress string. base::i18n::AdjustStringForLocaleDirection(&amount); if (total) { - string16 total_text = ui::FormatBytes(total); + base::string16 total_text = ui::FormatBytes(total); base::i18n::AdjustStringForLocaleDirection(&total_text); base::i18n::AdjustStringForLocaleDirection(&received_size); @@ -319,11 +319,11 @@ string16 DownloadItemModel::GetTabProgressStatusText() const { amount.assign(received_size); } int64 current_speed = download_->CurrentSpeed(); - string16 speed_text = ui::FormatSpeed(current_speed); + base::string16 speed_text = ui::FormatSpeed(current_speed); base::i18n::AdjustStringForLocaleDirection(&speed_text); base::TimeDelta remaining; - string16 time_remaining; + base::string16 time_remaining; if (download_->IsPaused()) time_remaining = l10n_util::GetStringUTF16(IDS_DOWNLOAD_PROGRESS_PAUSED); else if (download_->TimeRemaining(&remaining)) @@ -340,7 +340,7 @@ string16 DownloadItemModel::GetTabProgressStatusText() const { string16 DownloadItemModel::GetTooltipText(const gfx::FontList& font_list, int max_width) const { - string16 tooltip = gfx::ElideFilename( + base::string16 tooltip = gfx::ElideFilename( download_->GetFileNameToReportUser(), font_list, max_width); content::DownloadInterruptReason reason = download_->GetLastReason(); if (download_->GetState() == DownloadItem::INTERRUPTED && @@ -356,7 +356,7 @@ string16 DownloadItemModel::GetWarningText(const gfx::FontList& font_list, int base_width) const { // Should only be called if IsDangerous(). DCHECK(IsDangerous()); - string16 elided_filename = + base::string16 elided_filename = gfx::ElideFilename(download_->GetFileNameToReportUser(), font_list, base_width); switch (download_->GetDangerType()) { @@ -393,7 +393,7 @@ string16 DownloadItemModel::GetWarningText(const gfx::FontList& font_list, } } NOTREACHED(); - return string16(); + return base::string16(); } string16 DownloadItemModel::GetWarningConfirmButtonText() const { @@ -563,19 +563,19 @@ void DownloadItemModel::SetShouldPreferOpeningInBrowser(bool preference) { } string16 DownloadItemModel::GetProgressSizesString() const { - string16 size_ratio; + base::string16 size_ratio; int64 size = GetCompletedBytes(); int64 total = GetTotalBytes(); if (total > 0) { ui::DataUnits amount_units = ui::GetByteDisplayUnits(total); - string16 simple_size = ui::FormatBytesWithUnits(size, amount_units, false); + base::string16 simple_size = ui::FormatBytesWithUnits(size, amount_units, false); // In RTL locales, we render the text "size/total" in an RTL context. This // is problematic since a string such as "123/456 MB" is displayed // as "MB 123/456" because it ends with an LTR run. In order to solve this, // we mark the total string as an LTR string if the UI layout is // right-to-left so that the string "456 MB" is treated as an LTR run. - string16 simple_total = base::i18n::GetDisplayStringInLTRDirectionality( + base::string16 simple_total = base::i18n::GetDisplayStringInLTRDirectionality( ui::FormatBytesWithUnits(total, amount_units, true)); size_ratio = l10n_util::GetStringFUTF16(IDS_DOWNLOAD_STATUS_SIZES, simple_size, simple_total); @@ -594,7 +594,7 @@ string16 DownloadItemModel::GetInProgressStatusString() const { download_->TimeRemaining(&time_remaining)); // Indication of progress. (E.g.:"100/200 MB" or "100MB") - string16 size_ratio = GetProgressSizesString(); + base::string16 size_ratio = GetProgressSizesString(); // The download is a CRX (app, extension, theme, ...) and it is being unpacked // and validated. diff --git a/chrome/browser/download/download_item_model.h b/chrome/browser/download/download_item_model.h index 05a1023f..0419813 100644 --- a/chrome/browser/download/download_item_model.h +++ b/chrome/browser/download/download_item_model.h @@ -37,14 +37,14 @@ class DownloadItemModel { // Returns a long descriptive string for a download that's in the INTERRUPTED // state. For other downloads, the returned string will be empty. - string16 GetInterruptReasonText() const; + base::string16 GetInterruptReasonText() const; // Returns a short one-line status string for the download. - string16 GetStatusText() const; + base::string16 GetStatusText() const; // Returns the localized status text for an in-progress download. This // is the progress status used in the WebUI interface. - string16 GetTabProgressStatusText() const; + base::string16 GetTabProgressStatusText() const; // Returns a string suitable for use as a tooltip. For a regular download, the // tooltip is the filename. For an interrupted download, the string states the @@ -55,17 +55,17 @@ class DownloadItemModel { // |font_list| and |max_width| are used to elide the filename and/or interrupt // reason as necessary to keep the width of the tooltip text under // |max_width|. The tooltip will be at most 2 lines. - string16 GetTooltipText(const gfx::FontList& font_list, int max_width) const; + base::string16 GetTooltipText(const gfx::FontList& font_list, int max_width) const; // Get the warning text to display for a dangerous download. The |base_width| // is the maximum width of an embedded filename (if there is one). The metrics // for the filename will be based on |font_list|. Should only be called if // IsDangerous() is true. - string16 GetWarningText(const gfx::FontList& font_list, int base_width) const; + base::string16 GetWarningText(const gfx::FontList& font_list, int base_width) const; // Get the caption text for a button for confirming a dangerous download // warning. - string16 GetWarningConfirmButtonText() const; + base::string16 GetWarningConfirmButtonText() const; // Get the number of bytes that has completed so far. Virtual for testing. int64 GetCompletedBytes() const; @@ -146,10 +146,10 @@ class DownloadItemModel { // MB" where the numerator is the transferred size and the denominator is the // total size. If the total isn't known, returns the transferred size as a // string (e.g.: "100 MB"). - string16 GetProgressSizesString() const; + base::string16 GetProgressSizesString() const; // Returns a string indicating the status of an in-progress download. - string16 GetInProgressStatusString() const; + base::string16 GetInProgressStatusString() const; // The DownloadItem that this model represents. Note that DownloadItemModel // itself shouldn't maintain any state since there can be more than one diff --git a/chrome/browser/download/download_item_model_unittest.cc b/chrome/browser/download/download_item_model_unittest.cc index 6be4abc..3eafce0 100644 --- a/chrome/browser/download/download_item_model_unittest.cc +++ b/chrome/browser/download/download_item_model_unittest.cc @@ -267,7 +267,7 @@ TEST_F(DownloadItemModelTest, InterruptTooltip) { // Check that if the width is small, the returned tooltip only contains // lines of the given width or smaller. std::vector<string16> lines; - string16 truncated_tooltip = + base::string16 truncated_tooltip = model().GetTooltipText(font_list, kSmallTooltipWidth); Tokenize(truncated_tooltip, ASCIIToUTF16("\n"), &lines); for (unsigned i = 0; i < lines.size(); ++i) diff --git a/chrome/browser/download/download_query.cc b/chrome/browser/download/download_query.cc index 57ea7f3..bd6aab1 100644 --- a/chrome/browser/download/download_query.cc +++ b/chrome/browser/download/download_query.cc @@ -47,7 +47,7 @@ template<> bool GetAs(const base::Value& in, int* out) { template<> bool GetAs(const base::Value& in, std::string* out) { return in.GetAsString(out); } -template<> bool GetAs(const base::Value& in, string16* out) { +template<> bool GetAs(const base::Value& in, base::string16* out) { return in.GetAsString(out); } template<> bool GetAs(const base::Value& in, std::vector<string16>* out) { @@ -56,7 +56,7 @@ template<> bool GetAs(const base::Value& in, std::vector<string16>* out) { if (!in.GetAsList(&list)) return false; for (size_t i = 0; i < list->GetSize(); ++i) { - string16 element; + base::string16 element; if (!list->GetString(i, &element)) { out->clear(); return false; @@ -73,19 +73,19 @@ static bool MatchesQuery( const std::vector<string16>& query_terms, const DownloadItem& item) { DCHECK(!query_terms.empty()); - string16 url_raw(UTF8ToUTF16(item.GetOriginalUrl().spec())); - string16 url_formatted = url_raw; + base::string16 url_raw(UTF8ToUTF16(item.GetOriginalUrl().spec())); + base::string16 url_formatted = url_raw; if (item.GetBrowserContext()) { Profile* profile = Profile::FromBrowserContext(item.GetBrowserContext()); url_formatted = net::FormatUrl( item.GetOriginalUrl(), profile->GetPrefs()->GetString(prefs::kAcceptLanguages)); } - string16 path(item.GetTargetFilePath().LossyDisplayName()); + base::string16 path(item.GetTargetFilePath().LossyDisplayName()); for (std::vector<string16>::const_iterator it = query_terms.begin(); it != query_terms.end(); ++it) { - string16 term = base::i18n::ToLower(*it); + base::string16 term = base::i18n::ToLower(*it); if (!base::i18n::StringSearchIgnoringCaseAndAccents( term, url_raw, NULL, NULL) && !base::i18n::StringSearchIgnoringCaseAndAccents( @@ -132,7 +132,7 @@ static bool GetExists(const DownloadItem& item) { return !item.GetFileExternallyRemoved(); } -static string16 GetFilename(const DownloadItem& item) { +static base::string16 GetFilename(const DownloadItem& item) { // This filename will be compared with strings that could be passed in by the // user, who only sees LossyDisplayNames. return item.GetTargetFilePath().LossyDisplayName(); diff --git a/chrome/browser/download/download_query_unittest.cc b/chrome/browser/download/download_query_unittest.cc index 17bf351..b1c4d58 100644 --- a/chrome/browser/download/download_query_unittest.cc +++ b/chrome/browser/download/download_query_unittest.cc @@ -124,14 +124,15 @@ template<> void DownloadQueryTest::AddFilter( template<> void DownloadQueryTest::AddFilter( DownloadQuery::FilterType name, const char16* cpp_value) { - scoped_ptr<base::Value> value(Value::CreateStringValue(string16(cpp_value))); + scoped_ptr<base::Value> value( + Value::CreateStringValue(base::string16(cpp_value))); CHECK(query_.AddFilter(name, *value.get())); } template<> void DownloadQueryTest::AddFilter( - DownloadQuery::FilterType name, std::vector<string16> cpp_value) { + DownloadQuery::FilterType name, std::vector<base::string16> cpp_value) { scoped_ptr<base::ListValue> list(new base::ListValue()); - for (std::vector<string16>::const_iterator it = cpp_value.begin(); + for (std::vector<base::string16>::const_iterator it = cpp_value.begin(); it != cpp_value.end(); ++it) { list->Append(Value::CreateStringValue(*it)); } diff --git a/chrome/browser/download/download_request_infobar_delegate.cc b/chrome/browser/download/download_request_infobar_delegate.cc index 6a91a5d..c61ea2c 100644 --- a/chrome/browser/download/download_request_infobar_delegate.cc +++ b/chrome/browser/download/download_request_infobar_delegate.cc @@ -58,11 +58,11 @@ int DownloadRequestInfoBarDelegate::GetIconID() const { return IDR_INFOBAR_MULTIPLE_DOWNLOADS; } -string16 DownloadRequestInfoBarDelegate::GetMessageText() const { +base::string16 DownloadRequestInfoBarDelegate::GetMessageText() const { return l10n_util::GetStringUTF16(IDS_MULTI_DOWNLOAD_WARNING); } -string16 DownloadRequestInfoBarDelegate::GetButtonLabel( +base::string16 DownloadRequestInfoBarDelegate::GetButtonLabel( InfoBarButton button) const { return l10n_util::GetStringUTF16((button == BUTTON_OK) ? IDS_MULTI_DOWNLOAD_WARNING_ALLOW : IDS_MULTI_DOWNLOAD_WARNING_DENY); diff --git a/chrome/browser/download/download_request_infobar_delegate.h b/chrome/browser/download/download_request_infobar_delegate.h index 410f91f..418d029 100644 --- a/chrome/browser/download/download_request_infobar_delegate.h +++ b/chrome/browser/download/download_request_infobar_delegate.h @@ -49,8 +49,8 @@ class DownloadRequestInfoBarDelegate : public ConfirmInfoBarDelegate { // ConfirmInfoBarDelegate: virtual int GetIconID() const OVERRIDE; - virtual string16 GetMessageText() const OVERRIDE; - virtual string16 GetButtonLabel(InfoBarButton button) const OVERRIDE; + virtual base::string16 GetMessageText() const OVERRIDE; + virtual base::string16 GetButtonLabel(InfoBarButton button) const OVERRIDE; virtual bool Accept() OVERRIDE; virtual bool Cancel() OVERRIDE; diff --git a/chrome/browser/download/download_shelf_context_menu.cc b/chrome/browser/download/download_shelf_context_menu.cc index d1138d2..bd98ff2 100644 --- a/chrome/browser/download/download_shelf_context_menu.cc +++ b/chrome/browser/download/download_shelf_context_menu.cc @@ -215,7 +215,8 @@ bool DownloadShelfContextMenu::IsItemForCommandIdDynamic(int command_id) const { return command_id == TOGGLE_PAUSE; } -string16 DownloadShelfContextMenu::GetLabelForCommandId(int command_id) const { +base::string16 DownloadShelfContextMenu::GetLabelForCommandId( + int command_id) const { switch (static_cast<ContextMenuCommands>(command_id)) { case SHOW_IN_FOLDER: return l10n_util::GetStringUTF16(IDS_DOWNLOAD_MENU_SHOW); @@ -248,7 +249,7 @@ string16 DownloadShelfContextMenu::GetLabelForCommandId(int command_id) const { IDS_DOWNLOAD_MENU_LEARN_MORE_INTERRUPTED); } NOTREACHED(); - return string16(); + return base::string16(); } void DownloadShelfContextMenu::DetachFromDownloadItem() { diff --git a/chrome/browser/download/download_shelf_context_menu.h b/chrome/browser/download/download_shelf_context_menu.h index 56a78bed..23cc4f0 100644 --- a/chrome/browser/download/download_shelf_context_menu.h +++ b/chrome/browser/download/download_shelf_context_menu.h @@ -58,7 +58,7 @@ class DownloadShelfContextMenu : public ui::SimpleMenuModel::Delegate, int command_id, ui::Accelerator* accelerator) OVERRIDE; virtual bool IsItemForCommandIdDynamic(int command_id) const OVERRIDE; - virtual string16 GetLabelForCommandId(int command_id) const OVERRIDE; + virtual base::string16 GetLabelForCommandId(int command_id) const OVERRIDE; private: // Detaches self from |download_item_|. Called when the DownloadItem is diff --git a/chrome/browser/download/download_status_updater_win.cc b/chrome/browser/download/download_status_updater_win.cc index 542f97c..f8587ed 100644 --- a/chrome/browser/download/download_status_updater_win.cc +++ b/chrome/browser/download/download_status_updater_win.cc @@ -126,9 +126,9 @@ void DownloadStatusUpdater::UpdateAppIconDownloadProgress( ::GetProcAddress(metro, "DisplayNotification")); DCHECK(display_notification); if (display_notification) { - string16 title = l10n_util::GetStringUTF16( + base::string16 title = l10n_util::GetStringUTF16( IDS_METRO_DOWNLOAD_COMPLETE_NOTIFICATION_TITLE); - string16 body = l10n_util::GetStringUTF16( + base::string16 body = l10n_util::GetStringUTF16( IDS_METRO_DOWNLOAD_COMPLETE_NOTIFICATION); // Dummy notification id. Every metro style notification needs a diff --git a/chrome/browser/download/download_target_determiner.cc b/chrome/browser/download/download_target_determiner.cc index eb3aeb6..8698580 100644 --- a/chrome/browser/download/download_target_determiner.cc +++ b/chrome/browser/download/download_target_determiner.cc @@ -601,7 +601,7 @@ DownloadTargetDeterminer::Result // Range of the <random> uniquifier. const int kUnconfirmedUniquifierRange = 1000000; #if defined(OS_WIN) - string16 unconfirmed_format = + base::string16 unconfirmed_format = l10n_util::GetStringUTF16(IDS_DOWNLOAD_UNCONFIRMED_PREFIX); #else std::string unconfirmed_format = diff --git a/chrome/browser/download/save_package_file_picker.cc b/chrome/browser/download/save_package_file_picker.cc index d279978..40c3928 100644 --- a/chrome/browser/download/save_package_file_picker.cc +++ b/chrome/browser/download/save_package_file_picker.cc @@ -205,7 +205,7 @@ SavePackageFilePicker::SavePackageFilePicker( this, new ChromeSelectFilePolicy(web_contents)); select_file_dialog_->SelectFile( ui::SelectFileDialog::SELECT_SAVEAS_FILE, - string16(), + base::string16(), suggested_path_copy, &file_type_info, file_type_index, |