diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-09 20:09:09 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-09 20:09:09 +0000 |
commit | 439f1e3d98de0a2021d71c8bb48773663c337b5a (patch) | |
tree | f5dd7f1e2423c670b1d4a1fa580671034352539d | |
parent | 86478002f66eed132835788ad860300a5d222076 (diff) | |
download | chromium_src-439f1e3d98de0a2021d71c8bb48773663c337b5a.zip chromium_src-439f1e3d98de0a2021d71c8bb48773663c337b5a.tar.gz chromium_src-439f1e3d98de0a2021d71c8bb48773663c337b5a.tar.bz2 |
Convert string16 to use base namespace.
TBR=sky
Review URL: https://codereview.chromium.org/109233002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@239538 0039d316-1c4b-4281-b951-d872f2087c98
201 files changed, 948 insertions, 902 deletions
diff --git a/chrome/browser/enumerate_modules_model_unittest_win.cc b/chrome/browser/enumerate_modules_model_unittest_win.cc index df4850a..d7bed9c 100644 --- a/chrome/browser/enumerate_modules_model_unittest_win.cc +++ b/chrome/browser/enumerate_modules_model_unittest_win.cc @@ -211,8 +211,8 @@ TEST_F(EnumerateModulesTest, MatchFunction) { } const struct CollapsePathList { - string16 expected_result; - string16 test_case; + base::string16 expected_result; + base::string16 test_case; } kCollapsePathList[] = { // Negative testing (should not collapse this path). { ASCIIToUTF16("c:\\a\\a.dll"), ASCIIToUTF16("c:\\a\\a.dll") }, diff --git a/chrome/browser/enumerate_modules_model_win.h b/chrome/browser/enumerate_modules_model_win.h index 51243d1..249cb82 100644 --- a/chrome/browser/enumerate_modules_model_win.h +++ b/chrome/browser/enumerate_modules_model_win.h @@ -78,17 +78,17 @@ class ModuleEnumerator : public base::RefCountedThreadSafe<ModuleEnumerator> { // The module status (benign/bad/etc). ModuleStatus status; // The module path, not including filename. - string16 location; + base::string16 location; // The name of the module (filename). - string16 name; + base::string16 name; // The name of the product the module belongs to. - string16 product_name; + base::string16 product_name; // The module file description. - string16 description; + base::string16 description; // The module version. - string16 version; + base::string16 version; // The signer of the digital certificate for the module. - string16 digital_signer; + base::string16 digital_signer; // The help tips bitmask. RecommendedAction recommended_action; // The duplicate count within each category of modules. @@ -199,10 +199,11 @@ class ModuleEnumerator : public base::RefCountedThreadSafe<ModuleEnumerator> { // Given a filename, returns the Subject (who signed it) retrieved from // the digital signature (Authenticode). - string16 GetSubjectNameFromDigitalSignature(const base::FilePath& filename); + base::string16 GetSubjectNameFromDigitalSignature( + const base::FilePath& filename); // The typedef for the vector that maps a regular file path to %env_var%. - typedef std::vector< std::pair<string16, string16> > PathMapping; + typedef std::vector< std::pair<string16, base::string16> > PathMapping; // The vector of paths to %env_var%, used to account for differences in // where people keep there files, c:\windows vs. d:\windows, etc. diff --git a/chrome/browser/errorpage_browsertest.cc b/chrome/browser/errorpage_browsertest.cc index aa90a22..9c83298 100644 --- a/chrome/browser/errorpage_browsertest.cc +++ b/chrome/browser/errorpage_browsertest.cc @@ -129,11 +129,11 @@ class TestFailProvisionalLoadObserver : public content::WebContentsObserver { // This method is invoked when the provisional load failed. 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 { fail_url_ = validated_url; } @@ -304,7 +304,7 @@ IN_PROC_BROWSER_TEST_F(ErrorPageTest, IFrameDNSError_JavaScript) { content::NOTIFICATION_LOAD_STOP, content::Source<NavigationController>(&wc->GetController())); wc->GetRenderViewHost()->ExecuteJavascriptInWebFrame( - string16(), ASCIIToUTF16(script)); + base::string16(), ASCIIToUTF16(script)); load_observer.Wait(); // Ensure we saw the expected failure. @@ -325,7 +325,7 @@ IN_PROC_BROWSER_TEST_F(ErrorPageTest, IFrameDNSError_JavaScript) { content::NOTIFICATION_LOAD_STOP, content::Source<NavigationController>(&wc->GetController())); wc->GetRenderViewHost()->ExecuteJavascriptInWebFrame( - string16(), ASCIIToUTF16(script)); + base::string16(), ASCIIToUTF16(script)); load_observer.Wait(); } @@ -337,7 +337,7 @@ IN_PROC_BROWSER_TEST_F(ErrorPageTest, IFrameDNSError_JavaScript) { content::NOTIFICATION_LOAD_STOP, content::Source<NavigationController>(&wc->GetController())); wc->GetRenderViewHost()->ExecuteJavascriptInWebFrame( - string16(), ASCIIToUTF16(script)); + base::string16(), ASCIIToUTF16(script)); load_observer.Wait(); EXPECT_EQ(fail_url, fail_observer.fail_url()); diff --git a/chrome/browser/extensions/api/bookmarks/bookmarks_api.cc b/chrome/browser/extensions/api/bookmarks/bookmarks_api.cc index 446e84f..ccfed7e 100644 --- a/chrome/browser/extensions/api/bookmarks/bookmarks_api.cc +++ b/chrome/browser/extensions/api/bookmarks/bookmarks_api.cc @@ -532,7 +532,7 @@ bool BookmarksCreateFunction::RunImpl() { } } - string16 title; // Optional. + base::string16 title; // Optional. if (params->bookmark.title.get()) title = UTF8ToUTF16(*params->bookmark.title.get()); @@ -648,7 +648,7 @@ bool BookmarksUpdateFunction::RunImpl() { EXTENSION_FUNCTION_VALIDATE(params.get()); // Optional but we need to distinguish non present from an empty title. - string16 title; + base::string16 title; bool has_title = false; if (params->changes.title.get()) { title = UTF8ToUTF16(*params->changes.title); @@ -930,7 +930,7 @@ void BookmarksIOFunction::ShowSelectFileDialog( // a case if file-selection dialogs are forbidden by policy, we will not // show an InfoBar, which is better than letting one appear out of the blue. select_file_dialog_->SelectFile(type, - string16(), + base::string16(), default_path, &file_type_info, 0, diff --git a/chrome/browser/extensions/api/commands/command_service.cc b/chrome/browser/extensions/api/commands/command_service.cc index cfcf660..37f51b3 100644 --- a/chrome/browser/extensions/api/commands/command_service.cc +++ b/chrome/browser/extensions/api/commands/command_service.cc @@ -344,7 +344,7 @@ Command CommandService::FindCommandByName( CHECK(tokens.size() >= 2); shortcut = tokens[1]; - return Command(command_name, string16(), shortcut, global); + return Command(command_name, base::string16(), shortcut, global); } return Command(); diff --git a/chrome/browser/extensions/api/commands/commands.cc b/chrome/browser/extensions/api/commands/commands.cc index be1c95b..a4a837d 100644 --- a/chrome/browser/extensions/api/commands/commands.cc +++ b/chrome/browser/extensions/api/commands/commands.cc @@ -15,7 +15,7 @@ base::DictionaryValue* CreateCommandValue( result->SetString("description", command.description()); result->SetString("shortcut", active ? command.accelerator().GetShortcutText() : - string16()); + base::string16()); return result; } diff --git a/chrome/browser/extensions/api/debugger/debugger_api.cc b/chrome/browser/extensions/api/debugger/debugger_api.cc index b9bace4..da51f9e 100644 --- a/chrome/browser/extensions/api/debugger/debugger_api.cc +++ b/chrome/browser/extensions/api/debugger/debugger_api.cc @@ -159,7 +159,7 @@ class ExtensionDevToolsInfoBarDelegate : public ConfirmInfoBarDelegate { virtual Type GetInfoBarType() const OVERRIDE; virtual bool ShouldExpireInternal( const content::LoadCommittedDetails& details) const OVERRIDE; - virtual string16 GetMessageText() const OVERRIDE; + virtual base::string16 GetMessageText() const OVERRIDE; virtual int GetButtons() const OVERRIDE; virtual bool Cancel() OVERRIDE; diff --git a/chrome/browser/extensions/api/declarative/declarative_apitest.cc b/chrome/browser/extensions/api/declarative/declarative_apitest.cc index 40209a7..47356a1 100644 --- a/chrome/browser/extensions/api/declarative/declarative_apitest.cc +++ b/chrome/browser/extensions/api/declarative/declarative_apitest.cc @@ -102,7 +102,7 @@ const char kRedirectToDataNoRules[] = class DeclarativeApiTest : public ExtensionApiTest { public: std::string GetTitle() { - string16 title( + base::string16 title( browser()->tab_strip_model()->GetActiveWebContents()->GetTitle()); return base::UTF16ToUTF8(title); } diff --git a/chrome/browser/extensions/api/desktop_capture/desktop_capture_apitest.cc b/chrome/browser/extensions/api/desktop_capture/desktop_capture_apitest.cc index 4bbe02b..b41b873 100644 --- a/chrome/browser/extensions/api/desktop_capture/desktop_capture_apitest.cc +++ b/chrome/browser/extensions/api/desktop_capture/desktop_capture_apitest.cc @@ -35,7 +35,7 @@ class FakeDesktopMediaPicker : public DesktopMediaPicker { // DesktopMediaPicker interface. virtual void Show(gfx::NativeWindow context, gfx::NativeWindow parent, - const string16& app_name, + const base::string16& app_name, scoped_ptr<DesktopMediaList> model, const DoneCallback& done_callback) OVERRIDE { if (!expect_cancelled_) { diff --git a/chrome/browser/extensions/api/developer_private/developer_private_api.cc b/chrome/browser/extensions/api/developer_private/developer_private_api.cc index 79817f1..db64c33 100644 --- a/chrome/browser/extensions/api/developer_private/developer_private_api.cc +++ b/chrome/browser/extensions/api/developer_private/developer_private_api.cc @@ -818,7 +818,7 @@ bool DeveloperPrivateInspectFunction::RunImpl() { DeveloperPrivateInspectFunction::~DeveloperPrivateInspectFunction() {} bool DeveloperPrivateLoadUnpackedFunction::RunImpl() { - string16 select_title = + base::string16 select_title = l10n_util::GetStringUTF16(IDS_EXTENSION_LOAD_FROM_DIRECTORY); // Balanced in FileSelected / FileSelectionCanceled. @@ -849,7 +849,7 @@ void DeveloperPrivateLoadUnpackedFunction::FileSelectionCanceled() { bool DeveloperPrivateChooseEntryFunction::ShowPicker( ui::SelectFileDialog::Type picker_type, const base::FilePath& last_directory, - const string16& select_title, + const base::string16& select_title, const ui::SelectFileDialog::FileTypeInfo& info, int file_type_index) { ShellWindowRegistry* registry = ShellWindowRegistry::Get(GetProfile()); @@ -1178,7 +1178,7 @@ bool DeveloperPrivateChoosePathFunction::RunImpl() { if (params->select_type == developer::SELECT_TYPE_FILE) { type = ui::SelectFileDialog::SELECT_OPEN_FILE; } - string16 select_title; + base::string16 select_title; int file_type_index = 0; if (params->file_type == developer::FILE_TYPE_LOAD) diff --git a/chrome/browser/extensions/api/developer_private/developer_private_api.h b/chrome/browser/extensions/api/developer_private/developer_private_api.h index 4af2eec..d747fd1 100644 --- a/chrome/browser/extensions/api/developer_private/developer_private_api.h +++ b/chrome/browser/extensions/api/developer_private/developer_private_api.h @@ -274,7 +274,7 @@ class DeveloperPrivateChooseEntryFunction : public ChromeAsyncExtensionFunction, virtual bool RunImpl() OVERRIDE; bool ShowPicker(ui::SelectFileDialog::Type picker_type, const base::FilePath& last_directory, - const string16& select_title, + const base::string16& select_title, const ui::SelectFileDialog::FileTypeInfo& info, int file_type_index); diff --git a/chrome/browser/extensions/api/developer_private/entry_picker.cc b/chrome/browser/extensions/api/developer_private/entry_picker.cc index 91bc1f3..f21371c 100644 --- a/chrome/browser/extensions/api/developer_private/entry_picker.cc +++ b/chrome/browser/extensions/api/developer_private/entry_picker.cc @@ -29,7 +29,7 @@ EntryPicker::EntryPicker(EntryPickerClient* client, content::WebContents* web_contents, ui::SelectFileDialog::Type picker_type, const base::FilePath& last_directory, - const string16& select_title, + const base::string16& select_title, const ui::SelectFileDialog::FileTypeInfo& info, int file_type_index) : client_(client) { diff --git a/chrome/browser/extensions/api/developer_private/entry_picker.h b/chrome/browser/extensions/api/developer_private/entry_picker.h index 592174a..69aedba 100644 --- a/chrome/browser/extensions/api/developer_private/entry_picker.h +++ b/chrome/browser/extensions/api/developer_private/entry_picker.h @@ -29,7 +29,7 @@ class EntryPicker : public ui::SelectFileDialog::Listener { content::WebContents* web_contents, ui::SelectFileDialog::Type picker_type, const base::FilePath& last_directory, - const string16& select_title, + const base::string16& select_title, const ui::SelectFileDialog::FileTypeInfo& info, int file_type_index); diff --git a/chrome/browser/extensions/api/file_system/file_system_api.cc b/chrome/browser/extensions/api/file_system/file_system_api.cc index 7dac9bb..67d717b 100644 --- a/chrome/browser/extensions/api/file_system/file_system_api.cc +++ b/chrome/browser/extensions/api/file_system/file_system_api.cc @@ -153,7 +153,7 @@ bool g_allow_directory_access_for_test = false; bool GetFileTypesFromAcceptOption( const file_system::AcceptOption& accept_option, std::vector<base::FilePath::StringType>* extensions, - string16* description) { + base::string16* description) { std::set<base::FilePath::StringType> extension_set; int description_id = 0; @@ -469,7 +469,7 @@ class FileSystemChooseEntryFunction::FilePicker } select_file_dialog_->SelectFile(picker_type, - string16(), + base::string16(), suggested_name, &file_type_info, 0, @@ -774,7 +774,7 @@ void FileSystemChooseEntryFunction::BuildFileTypeInfo( typedef file_system::AcceptOption AcceptOption; for (std::vector<linked_ptr<AcceptOption> >::const_iterator iter = accepts->begin(); iter != accepts->end(); ++iter) { - string16 description; + base::string16 description; std::vector<base::FilePath::StringType> extensions; if (!GetFileTypesFromAcceptOption(**iter, &extensions, &description)) diff --git a/chrome/browser/extensions/api/history/history_api.cc b/chrome/browser/extensions/api/history/history_api.cc index e55b726..1a46508 100644 --- a/chrome/browser/extensions/api/history/history_api.cc +++ b/chrome/browser/extensions/api/history/history_api.cc @@ -378,7 +378,7 @@ bool HistorySearchFunction::RunAsyncImpl() { scoped_ptr<Search::Params> params(Search::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params.get()); - string16 search_text = UTF8ToUTF16(params->query.text); + base::string16 search_text = UTF8ToUTF16(params->query.text); history::QueryOptions options; options.SetRecentDayRange(1); diff --git a/chrome/browser/extensions/api/i18n/i18n_apitest.cc b/chrome/browser/extensions/api/i18n/i18n_apitest.cc index f6f1ce8..93e3b54 100644 --- a/chrome/browser/extensions/api/i18n/i18n_apitest.cc +++ b/chrome/browser/extensions/api/i18n/i18n_apitest.cc @@ -46,7 +46,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionApiTest, I18NUpdate) { embedded_test_server()->GetURL("/extensions/test_file.html")); EXPECT_TRUE(catcher.GetNextResult()); - string16 title; + base::string16 title; ui_test_utils::GetCurrentTabTitle(browser(), &title); EXPECT_EQ(std::string("FIRSTMESSAGE"), UTF16ToUTF8(title)); diff --git a/chrome/browser/extensions/api/identity/web_auth_flow.cc b/chrome/browser/extensions/api/identity/web_auth_flow.cc index eb61068..0ade81b 100644 --- a/chrome/browser/extensions/api/identity/web_auth_flow.cc +++ b/chrome/browser/extensions/api/identity/web_auth_flow.cc @@ -222,13 +222,14 @@ void WebAuthFlow::DidStartProvisionalLoadForFrame( BeforeUrlLoaded(validated_url); } -void WebAuthFlow::DidFailProvisionalLoad(int64 frame_id, - const string16& frame_unique_name, - bool is_main_frame, - const GURL& validated_url, - int error_code, - const string16& error_description, - RenderViewHost* render_view_host) { +void WebAuthFlow::DidFailProvisionalLoad( + int64 frame_id, + const base::string16& frame_unique_name, + bool is_main_frame, + const GURL& validated_url, + int error_code, + const base::string16& error_description, + RenderViewHost* render_view_host) { if (delegate_) delegate_->OnAuthFlowFailure(LOAD_FAILED); } diff --git a/chrome/browser/extensions/api/identity/web_auth_flow.h b/chrome/browser/extensions/api/identity/web_auth_flow.h index d9a4336..ed96cfa 100644 --- a/chrome/browser/extensions/api/identity/web_auth_flow.h +++ b/chrome/browser/extensions/api/identity/web_auth_flow.h @@ -118,11 +118,11 @@ class WebAuthFlow : public content::NotificationObserver, bool is_iframe_srcdoc, content::RenderViewHost* render_view_host) OVERRIDE; virtual void DidFailProvisionalLoad(int64 frame_id, - const string16& frame_unique_name, + const base::string16& frame_unique_name, bool is_main_frame, const GURL& validated_url, int error_code, - const string16& error_description, + const base::string16& error_description, content::RenderViewHost* render_view_host) OVERRIDE; diff --git a/chrome/browser/extensions/api/input/input.cc b/chrome/browser/extensions/api/input/input.cc index e8ec9a8..35b5f9d 100644 --- a/chrome/browser/extensions/api/input/input.cc +++ b/chrome/browser/extensions/api/input/input.cc @@ -34,7 +34,7 @@ bool VirtualKeyboardPrivateInsertTextFunction::RunImpl() { #if defined(USE_ASH) DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); - string16 text; + base::string16 text; EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &text)); return keyboard::InsertText(text, ash::Shell::GetPrimaryRootWindow()); diff --git a/chrome/browser/extensions/api/media_galleries_private/media_galleries_private_apitest.cc b/chrome/browser/extensions/api/media_galleries_private/media_galleries_private_apitest.cc index f39ccdc..447fcda 100644 --- a/chrome/browser/extensions/api/media_galleries_private/media_galleries_private_apitest.cc +++ b/chrome/browser/extensions/api/media_galleries_private/media_galleries_private_apitest.cc @@ -89,7 +89,7 @@ class MediaGalleriesPrivateApiTest : public ExtensionApiTest { void Attach() { DCHECK(StorageMonitor::GetInstance()->IsInitialized()); StorageInfo info(device_id_, ASCIIToUTF16(kDeviceName), kDevicePath, - string16(), string16(), string16(), 0); + base::string16(), base::string16(), base::string16(), 0); StorageMonitor::GetInstance()->receiver()->ProcessAttach(info); content::RunAllPendingInMessageLoop(); } diff --git a/chrome/browser/extensions/api/messaging/incognito_connectability.cc b/chrome/browser/extensions/api/messaging/incognito_connectability.cc index d9f41c6..09a8f05 100644 --- a/chrome/browser/extensions/api/messaging/incognito_connectability.cc +++ b/chrome/browser/extensions/api/messaging/incognito_connectability.cc @@ -79,7 +79,7 @@ bool IncognitoConnectability::Query(const Extension* extension, result = chrome::ShowMessageBox( web_contents ? web_contents->GetView()->GetTopLevelNativeWindow() : NULL, - string16(), // no title + base::string16(), // no title l10n_util::GetStringFUTF16(template_id, UTF8ToUTF16(origin.spec()), UTF8ToUTF16(extension->name())), diff --git a/chrome/browser/extensions/api/messaging/native_message_process_host_unittest.cc b/chrome/browser/extensions/api/messaging/native_message_process_host_unittest.cc index b3b09f5..a2e7d18 100644 --- a/chrome/browser/extensions/api/messaging/native_message_process_host_unittest.cc +++ b/chrome/browser/extensions/api/messaging/native_message_process_host_unittest.cc @@ -203,7 +203,7 @@ TEST_F(NativeMessagingTest, SingleSendMessageWrite) { base::PlatformFile read_file; #if defined(OS_WIN) - string16 pipe_name = base::StringPrintf( + base::string16 pipe_name = base::StringPrintf( L"\\\\.\\pipe\\chrome.nativeMessaging.out.%llx", base::RandUint64()); base::win::ScopedHandle write_handle( CreateNamedPipeW(pipe_name.c_str(), diff --git a/chrome/browser/extensions/api/messaging/native_process_launcher_win.cc b/chrome/browser/extensions/api/messaging/native_process_launcher_win.cc index 31fbdc8..36a0653 100644 --- a/chrome/browser/extensions/api/messaging/native_process_launcher_win.cc +++ b/chrome/browser/extensions/api/messaging/native_process_launcher_win.cc @@ -27,16 +27,16 @@ namespace { // Reads path to the native messaging host manifest from the registry. Returns // empty string if the path isn't found. -string16 GetManifestPath(const string16& native_host_name, DWORD flags) { +string16 GetManifestPath(const base::string16& native_host_name, DWORD flags) { base::win::RegKey key; - string16 result; + base::string16 result; if (key.Open(HKEY_LOCAL_MACHINE, kNativeMessagingRegistryKey, KEY_QUERY_VALUE | flags) != ERROR_SUCCESS || key.OpenKey(native_host_name.c_str(), KEY_QUERY_VALUE | flags) != ERROR_SUCCESS || key.ReadValue(NULL, &result) != ERROR_SUCCESS) { - return string16(); + return base::string16(); } return result; @@ -48,10 +48,10 @@ string16 GetManifestPath(const string16& native_host_name, DWORD flags) { base::FilePath NativeProcessLauncher::FindManifest( const std::string& native_host_name, std::string* error_message) { - string16 native_host_name_wide = UTF8ToUTF16(native_host_name); + base::string16 native_host_name_wide = UTF8ToUTF16(native_host_name); // First check 32-bit registry and then try 64-bit. - string16 manifest_path_str = + base::string16 manifest_path_str = GetManifestPath(native_host_name_wide, KEY_WOW64_32KEY); if (manifest_path_str.empty()) manifest_path_str = GetManifestPath(native_host_name_wide, KEY_WOW64_64KEY); @@ -91,9 +91,9 @@ bool NativeProcessLauncher::LaunchNativeProcess( uint64 pipe_name_token; crypto::RandBytes(&pipe_name_token, sizeof(pipe_name_token)); - string16 out_pipe_name = base::StringPrintf( + base::string16 out_pipe_name = base::StringPrintf( L"\\\\.\\pipe\\chrome.nativeMessaging.out.%llx", pipe_name_token); - string16 in_pipe_name = base::StringPrintf( + base::string16 in_pipe_name = base::StringPrintf( L"\\\\.\\pipe\\chrome.nativeMessaging.in.%llx", pipe_name_token); // Create the pipes to read and write from. @@ -127,9 +127,9 @@ bool NativeProcessLauncher::LaunchNativeProcess( scoped_ptr<wchar_t[]> comspec(new wchar_t[comspec_length]); ::GetEnvironmentVariable(L"COMSPEC", comspec.get(), comspec_length); - string16 command_line_string = command_line.GetCommandLineString(); + base::string16 command_line_string = command_line.GetCommandLineString(); - string16 command = base::StringPrintf( + base::string16 command = base::StringPrintf( L"%ls /c %ls < %ls > %ls", comspec.get(), command_line_string.c_str(), in_pipe_name.c_str(), out_pipe_name.c_str()); diff --git a/chrome/browser/extensions/api/notifications/notifications_api.cc b/chrome/browser/extensions/api/notifications/notifications_api.cc index 79fb5c7..27c862e 100644 --- a/chrome/browser/extensions/api/notifications/notifications_api.cc +++ b/chrome/browser/extensions/api/notifications/notifications_api.cc @@ -249,8 +249,8 @@ bool NotificationsApiFunction::CreateNotification( // Extract required fields: type, title, message, and icon. message_center::NotificationType type = MapApiTemplateTypeToType(options->type); - const string16 title(UTF8ToUTF16(*options->title)); - const string16 message(UTF8ToUTF16(*options->message)); + const base::string16 title(UTF8ToUTF16(*options->title)); + const base::string16 message(UTF8ToUTF16(*options->message)); gfx::Image icon; // TODO(dewittj): Return error if this fails. diff --git a/chrome/browser/extensions/api/notifications/notifications_apitest.cc b/chrome/browser/extensions/api/notifications/notifications_apitest.cc index aa26396..59d597f 100644 --- a/chrome/browser/extensions/api/notifications/notifications_apitest.cc +++ b/chrome/browser/extensions/api/notifications/notifications_apitest.cc @@ -769,7 +769,7 @@ IN_PROC_BROWSER_TEST_F(NotificationsApiTest, MAYBE_TestGetPermissionLevel) { message_center::NotifierId notifier_id( message_center::NotifierId::APPLICATION, empty_extension->id()); - message_center::Notifier notifier(notifier_id, string16(), true); + message_center::Notifier notifier(notifier_id, base::string16(), true); g_browser_process->message_center()->GetNotifierSettingsProvider()-> SetNotifierEnabled(notifier, false); @@ -806,7 +806,7 @@ IN_PROC_BROWSER_TEST_F(NotificationsApiTest, message_center::NotifierId notifier_id( message_center::NotifierId::APPLICATION, extension->id()); - message_center::Notifier notifier(notifier_id, string16(), true); + message_center::Notifier notifier(notifier_id, base::string16(), true); g_browser_process->message_center()->GetNotifierSettingsProvider()-> SetNotifierEnabled(notifier, false); @@ -820,7 +820,7 @@ IN_PROC_BROWSER_TEST_F(NotificationsApiTest, message_center::NotifierId notifier_id( message_center::NotifierId::APPLICATION, extension->id()); - message_center::Notifier notifier(notifier_id, string16(), false); + message_center::Notifier notifier(notifier_id, base::string16(), false); g_browser_process->message_center()->GetNotifierSettingsProvider()-> SetNotifierEnabled(notifier, true); diff --git a/chrome/browser/extensions/api/omnibox/omnibox_api.cc b/chrome/browser/extensions/api/omnibox/omnibox_api.cc index 85df2cf..f1d7421 100644 --- a/chrome/browser/extensions/api/omnibox/omnibox_api.cc +++ b/chrome/browser/extensions/api/omnibox/omnibox_api.cc @@ -317,7 +317,7 @@ ACMatchClassifications StyleTypesToACMatchClassifications( const omnibox::SuggestResult &suggestion) { ACMatchClassifications match_classifications; if (suggestion.description_styles) { - string16 description = UTF8ToUTF16(suggestion.description); + base::string16 description = UTF8ToUTF16(suggestion.description); std::vector<int> styles(description.length(), 0); for (std::vector<linked_ptr<omnibox::SuggestResult::DescriptionStylesType> > @@ -368,7 +368,7 @@ ACMatchClassifications StyleTypesToACMatchClassifications( void ApplyDefaultSuggestionForExtensionKeyword( Profile* profile, const TemplateURL* keyword, - const string16& remaining_input, + const base::string16& remaining_input, AutocompleteMatch* match) { DCHECK(keyword->GetType() == TemplateURL::OMNIBOX_API_EXTENSION); @@ -377,18 +377,18 @@ void ApplyDefaultSuggestionForExtensionKeyword( if (!suggestion || suggestion->description.empty()) return; // fall back to the universal default - const string16 kPlaceholderText(ASCIIToUTF16("%s")); - const string16 kReplacementText(ASCIIToUTF16("<input>")); + const base::string16 kPlaceholderText(ASCIIToUTF16("%s")); + const base::string16 kReplacementText(ASCIIToUTF16("<input>")); - string16 description = UTF8ToUTF16(suggestion->description); + base::string16 description = UTF8ToUTF16(suggestion->description); ACMatchClassifications& description_styles = match->contents_class; description_styles = StyleTypesToACMatchClassifications(*suggestion); // Replace "%s" with the user's input and adjust the style offsets to the // new length of the description. size_t placeholder(description.find(kPlaceholderText, 0)); - if (placeholder != string16::npos) { - string16 replacement = + if (placeholder != base::string16::npos) { + base::string16 replacement = remaining_input.empty() ? kReplacementText : remaining_input; description.replace(placeholder, kPlaceholderText.length(), replacement); diff --git a/chrome/browser/extensions/api/omnibox/omnibox_api.h b/chrome/browser/extensions/api/omnibox/omnibox_api.h index f5a7de7..500da78 100644 --- a/chrome/browser/extensions/api/omnibox/omnibox_api.h +++ b/chrome/browser/extensions/api/omnibox/omnibox_api.h @@ -161,7 +161,7 @@ class OmniboxSetDefaultSuggestionFunction : public ChromeSyncExtensionFunction { void ApplyDefaultSuggestionForExtensionKeyword( Profile* profile, const TemplateURL* keyword, - const string16& remaining_input, + const base::string16& remaining_input, AutocompleteMatch* match); // This function converts style information populated by the JSON schema diff --git a/chrome/browser/extensions/api/omnibox/omnibox_api_browsertest.cc b/chrome/browser/extensions/api/omnibox/omnibox_api_browsertest.cc index 42640ad..ef2b413 100644 --- a/chrome/browser/extensions/api/omnibox/omnibox_api_browsertest.cc +++ b/chrome/browser/extensions/api/omnibox/omnibox_api_browsertest.cc @@ -32,9 +32,9 @@ IN_PROC_BROWSER_TEST_F(OmniboxApiTest, Basic) { // it. { autocomplete_controller->Start( - AutocompleteInput(ASCIIToUTF16("keywor"), string16::npos, string16(), - GURL(), AutocompleteInput::NTP, true, false, - true, AutocompleteInput::ALL_MATCHES)); + AutocompleteInput(ASCIIToUTF16("keywor"), base::string16::npos, + base::string16(), GURL(), AutocompleteInput::NTP, + true, false, true, AutocompleteInput::ALL_MATCHES)); WaitForAutocompleteDone(autocomplete_controller); EXPECT_TRUE(autocomplete_controller->done()); @@ -54,9 +54,10 @@ IN_PROC_BROWSER_TEST_F(OmniboxApiTest, Basic) { // Test that our extension can send suggestions back to us. { autocomplete_controller->Start( - AutocompleteInput(ASCIIToUTF16("keyword suggestio"), string16::npos, - string16(), GURL(), AutocompleteInput::NTP, - true, false, true, AutocompleteInput::ALL_MATCHES)); + AutocompleteInput(ASCIIToUTF16("keyword suggestio"), + base::string16::npos, base::string16(), GURL(), + AutocompleteInput::NTP, true, false, true, + AutocompleteInput::ALL_MATCHES)); WaitForAutocompleteDone(autocomplete_controller); EXPECT_TRUE(autocomplete_controller->done()); @@ -90,7 +91,7 @@ IN_PROC_BROWSER_TEST_F(OmniboxApiTest, Basic) { EXPECT_EQ(AutocompleteProvider::TYPE_KEYWORD, result.match_at(3).provider->type()); - string16 description = + base::string16 description = ASCIIToUTF16("Description with style: <match>, [dim], (url till end)"); EXPECT_EQ(description, result.match_at(1).contents); ASSERT_EQ(6u, result.match_at(1).contents_class.size()); @@ -164,8 +165,8 @@ IN_PROC_BROWSER_TEST_F(OmniboxApiTest, OnInputEntered) { omnibox_view->OnAfterPossibleChange(); autocomplete_controller->Start( - AutocompleteInput(ASCIIToUTF16("keyword command"), string16::npos, - string16(), GURL(), AutocompleteInput::NTP, + AutocompleteInput(ASCIIToUTF16("keyword command"), base::string16::npos, + base::string16(), GURL(), AutocompleteInput::NTP, true, false, true, AutocompleteInput::ALL_MATCHES)); omnibox_view->model()->AcceptInput(CURRENT_TAB, false); WaitForAutocompleteDone(autocomplete_controller); @@ -179,8 +180,8 @@ IN_PROC_BROWSER_TEST_F(OmniboxApiTest, OnInputEntered) { EXPECT_TRUE(autocomplete_controller->done()); autocomplete_controller->Start( - AutocompleteInput(ASCIIToUTF16("keyword newtab"), string16::npos, - string16(), GURL(), AutocompleteInput::NTP, + AutocompleteInput(ASCIIToUTF16("keyword newtab"), base::string16::npos, + base::string16(), GURL(), AutocompleteInput::NTP, true, false, true, AutocompleteInput::ALL_MATCHES)); omnibox_view->model()->AcceptInput(NEW_FOREGROUND_TAB, false); WaitForAutocompleteDone(autocomplete_controller); @@ -216,9 +217,10 @@ IN_PROC_BROWSER_TEST_F(OmniboxApiTest, DISABLED_IncognitoSplitMode) { // Test that we get the incognito-specific suggestions. { autocomplete_controller->Start( - AutocompleteInput(ASCIIToUTF16("keyword suggestio"), string16::npos, - string16(), GURL(), AutocompleteInput::NTP, - true, false, true, AutocompleteInput::ALL_MATCHES)); + AutocompleteInput(ASCIIToUTF16("keyword suggestio"), + base::string16::npos, base::string16(), GURL(), + AutocompleteInput::NTP, true, false, true, + AutocompleteInput::ALL_MATCHES)); WaitForAutocompleteDone(autocomplete_controller); EXPECT_TRUE(autocomplete_controller->done()); @@ -239,7 +241,7 @@ IN_PROC_BROWSER_TEST_F(OmniboxApiTest, DISABLED_IncognitoSplitMode) { ResultCatcher catcher; autocomplete_controller->Start( AutocompleteInput(ASCIIToUTF16("keyword command incognito"), - string16::npos, string16(), GURL(), + base::string16::npos, base::string16(), GURL(), AutocompleteInput::NTP, true, false, true, AutocompleteInput::ALL_MATCHES)); location_bar->AcceptInput(); diff --git a/chrome/browser/extensions/api/omnibox/omnibox_api_interactive_test.cc b/chrome/browser/extensions/api/omnibox/omnibox_api_interactive_test.cc index 232b580..d8b68c2 100644 --- a/chrome/browser/extensions/api/omnibox/omnibox_api_interactive_test.cc +++ b/chrome/browser/extensions/api/omnibox/omnibox_api_interactive_test.cc @@ -41,8 +41,8 @@ IN_PROC_BROWSER_TEST_F(OmniboxApiTest, PopupStaysClosed) { // directly, figure out how to send it via the proper calls to // location_bar or location_bar->(). autocomplete_controller->Start( - AutocompleteInput(ASCIIToUTF16("keyword command"), string16::npos, - string16(), GURL(), AutocompleteInput::NTP, + AutocompleteInput(ASCIIToUTF16("keyword command"), base::string16::npos, + base::string16(), GURL(), AutocompleteInput::NTP, true, false, true, AutocompleteInput::ALL_MATCHES)); location_bar->AcceptInput(); WaitForAutocompleteDone(autocomplete_controller); diff --git a/chrome/browser/extensions/api/omnibox/omnibox_api_testbase.h b/chrome/browser/extensions/api/omnibox/omnibox_api_testbase.h index c14e521..169ca90 100644 --- a/chrome/browser/extensions/api/omnibox/omnibox_api_testbase.h +++ b/chrome/browser/extensions/api/omnibox/omnibox_api_testbase.h @@ -43,7 +43,8 @@ class OmniboxApiTest : public ExtensionApiTest { } } - static string16 AutocompleteResultAsString(const AutocompleteResult& result) { + static 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); diff --git a/chrome/browser/extensions/api/proxy/proxy_api.cc b/chrome/browser/extensions/api/proxy/proxy_api.cc index a115a1b..d5b60c9 100644 --- a/chrome/browser/extensions/api/proxy/proxy_api.cc +++ b/chrome/browser/extensions/api/proxy/proxy_api.cc @@ -57,7 +57,7 @@ void ProxyEventRouter::OnPACScriptError( EventRouterForwarder* event_router, void* profile, int line_number, - const string16& error) { + const base::string16& error) { scoped_ptr<base::ListValue> args(new base::ListValue()); base::DictionaryValue* dict = new base::DictionaryValue(); dict->SetBoolean(keys::kProxyEventFatal, false); diff --git a/chrome/browser/extensions/api/proxy/proxy_api.h b/chrome/browser/extensions/api/proxy/proxy_api.h index 187d774..6d35047 100644 --- a/chrome/browser/extensions/api/proxy/proxy_api.h +++ b/chrome/browser/extensions/api/proxy/proxy_api.h @@ -55,7 +55,7 @@ class ProxyEventRouter { void OnPACScriptError(EventRouterForwarder* event_router, void* profile, int line_number, - const string16& error); + const base::string16& error); private: friend struct DefaultSingletonTraits<ProxyEventRouter>; diff --git a/chrome/browser/extensions/api/proxy/proxy_api_helpers.cc b/chrome/browser/extensions/api/proxy/proxy_api_helpers.cc index 1c0d693..fa88fbd 100644 --- a/chrome/browser/extensions/api/proxy/proxy_api_helpers.cc +++ b/chrome/browser/extensions/api/proxy/proxy_api_helpers.cc @@ -106,7 +106,7 @@ bool GetPacUrlFromExtensionPref(const base::DictionaryValue* proxy_config, return true; // TODO(battre): Handle UTF-8 URLs (http://crbug.com/72692). - string16 pac_url16; + base::string16 pac_url16; if (pac_dict->HasKey(keys::kProxyConfigPacScriptUrl) && !pac_dict->GetString(keys::kProxyConfigPacScriptUrl, &pac_url16)) { LOG(ERROR) << "'pacScript.url' could not be parsed."; @@ -131,7 +131,7 @@ bool GetPacDataFromExtensionPref(const base::DictionaryValue* proxy_config, if (!pac_dict) return true; - string16 pac_data16; + base::string16 pac_data16; if (pac_dict->HasKey(keys::kProxyConfigPacScriptData) && !pac_dict->GetString(keys::kProxyConfigPacScriptData, &pac_data16)) { LOG(ERROR) << "'pacScript.data' could not be parsed."; @@ -164,7 +164,7 @@ bool GetProxyServer(const base::DictionaryValue* proxy_server, scheme = default_scheme; // TODO(battre): handle UTF-8 in hostnames (http://crbug.com/72692). - string16 host16; + base::string16 host16; if (!proxy_server->GetString(keys::kProxyConfigRuleHost, &host16)) { LOG(ERROR) << "Could not parse a 'rules.*.host' entry."; *bad_message = true; @@ -267,7 +267,7 @@ bool JoinUrlList(const base::ListValue* list, result.append(joiner); // TODO(battre): handle UTF-8 (http://crbug.com/72692). - string16 entry; + base::string16 entry; if (!list->GetString(i, &entry)) { LOG(ERROR) << "'rules.bypassList' could not be parsed."; *bad_message = true; diff --git a/chrome/browser/extensions/api/push_messaging/push_messaging_canary_test.cc b/chrome/browser/extensions/api/push_messaging/push_messaging_canary_test.cc index 077e79f..0902bad 100644 --- a/chrome/browser/extensions/api/push_messaging/push_messaging_canary_test.cc +++ b/chrome/browser/extensions/api/push_messaging/push_messaging_canary_test.cc @@ -156,7 +156,7 @@ IN_PROC_BROWSER_TEST_F(PushMessagingCanaryTest, MANUAL_ReceivesPush) { const std::string& client_secret = sync_setup_helper()->client_secret(); const std::string& refresh_token = sync_setup_helper()->refresh_token(); - const string16& script_string = UTF8ToUTF16(base::StringPrintf( + const base::string16& script_string = UTF8ToUTF16(base::StringPrintf( "startTestWithCredentials('%s', '%s', '%s');", client_id.c_str(), client_secret.c_str(), refresh_token.c_str())); diff --git a/chrome/browser/extensions/api/serial/serial_port_enumerator_win.cc b/chrome/browser/extensions/api/serial/serial_port_enumerator_win.cc index f3fac2f..213ef43 100644 --- a/chrome/browser/extensions/api/serial/serial_port_enumerator_win.cc +++ b/chrome/browser/extensions/api/serial/serial_port_enumerator_win.cc @@ -21,7 +21,7 @@ SerialPortEnumerator::GenerateValidSerialPortNames() { L"HARDWARE\\DEVICEMAP\\SERIALCOMM\\"); for (; iter_key.Valid(); ++iter_key) { - string16 str(iter_key.Value()); + base::string16 str(iter_key.Value()); std::string device_string(WideToASCII(str)); name_set.insert(device_string); } diff --git a/chrome/browser/extensions/api/system_indicator/system_indicator_manager.cc b/chrome/browser/extensions/api/system_indicator/system_indicator_manager.cc index f6bdc3e..fc6e8b0 100644 --- a/chrome/browser/extensions/api/system_indicator/system_indicator_manager.cc +++ b/chrome/browser/extensions/api/system_indicator/system_indicator_manager.cc @@ -112,7 +112,7 @@ ExtensionIndicatorIcon::ExtensionIndicatorIcon(const Extension* extension, // used as the tool tip. gfx::ImageSkia icon_image = icon_factory_.GetIcon(ExtensionAction::kDefaultTabId).AsImageSkia(); - string16 tool_tip = UTF8ToUTF16(extension_->name()); + base::string16 tool_tip = UTF8ToUTF16(extension_->name()); icon_ = status_tray_->CreateStatusIcon( StatusTray::OTHER_ICON, icon_image, tool_tip); diff --git a/chrome/browser/extensions/api/system_storage/storage_api_test_util.cc b/chrome/browser/extensions/api/system_storage/storage_api_test_util.cc index 3a66314..930efb3 100644 --- a/chrome/browser/extensions/api/system_storage/storage_api_test_util.cc +++ b/chrome/browser/extensions/api/system_storage/storage_api_test_util.cc @@ -19,9 +19,9 @@ StorageInfo BuildStorageInfoFromTestStorageUnitInfo( unit.device_id, UTF8ToUTF16(unit.name), base::FilePath::StringType(), /* no location */ - string16(), /* no storage label */ - string16(), /* no storage vendor */ - string16(), /* no storage model */ + base::string16(), /* no storage label */ + base::string16(), /* no storage vendor */ + base::string16(), /* no storage model */ unit.capacity); } diff --git a/chrome/browser/extensions/api/web_navigation/web_navigation_api.cc b/chrome/browser/extensions/api/web_navigation/web_navigation_api.cc index 839b4b6..b9575dd 100644 --- a/chrome/browser/extensions/api/web_navigation/web_navigation_api.cc +++ b/chrome/browser/extensions/api/web_navigation/web_navigation_api.cc @@ -406,7 +406,7 @@ void WebNavigationTabObserver::DidStartProvisionalLoadForFrame( void WebNavigationTabObserver::DidCommitProvisionalLoadForFrame( int64 frame_num, - const string16& frame_unique_name, + const base::string16& frame_unique_name, bool is_main_frame, const GURL& url, content::PageTransition transition_type, @@ -484,11 +484,11 @@ void WebNavigationTabObserver::DidCommitProvisionalLoadForFrame( void WebNavigationTabObserver::DidFailProvisionalLoad( int64 frame_num, - const string16& frame_unique_id, + const base::string16& frame_unique_id, 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) { DVLOG(2) << "DidFailProvisionalLoad(" << "render_view_host=" << render_view_host @@ -592,7 +592,7 @@ void WebNavigationTabObserver::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) { DVLOG(2) << "DidFailLoad(" << "render_view_host=" << render_view_host diff --git a/chrome/browser/extensions/api/web_navigation/web_navigation_api.h b/chrome/browser/extensions/api/web_navigation/web_navigation_api.h index 1f3e357..c0dd107 100644 --- a/chrome/browser/extensions/api/web_navigation/web_navigation_api.h +++ b/chrome/browser/extensions/api/web_navigation/web_navigation_api.h @@ -66,18 +66,18 @@ class WebNavigationTabObserver content::RenderViewHost* render_view_host) OVERRIDE; virtual void DidCommitProvisionalLoadForFrame( int64 frame_num, - const string16& frame_unique_name, + const base::string16& frame_unique_name, bool is_main_frame, const GURL& url, content::PageTransition transition_type, content::RenderViewHost* render_view_host) OVERRIDE; virtual void DidFailProvisionalLoad( int64 frame_num, - 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 DocumentLoadedInFrame( int64 frame_num, @@ -92,7 +92,7 @@ class WebNavigationTabObserver 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; virtual void DidOpenRequestedURL(content::WebContents* new_contents, const GURL& url, diff --git a/chrome/browser/extensions/api/web_navigation/web_navigation_apitest.cc b/chrome/browser/extensions/api/web_navigation/web_navigation_apitest.cc index 321a90b..5857139 100644 --- a/chrome/browser/extensions/api/web_navigation/web_navigation_apitest.cc +++ b/chrome/browser/extensions/api/web_navigation/web_navigation_apitest.cc @@ -206,7 +206,7 @@ class DelayLoadStartAndExecuteJavascript 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, diff --git a/chrome/browser/extensions/api/web_request/web_request_api.cc b/chrome/browser/extensions/api/web_request/web_request_api.cc index 008b6fc..e104f92 100644 --- a/chrome/browser/extensions/api/web_request/web_request_api.cc +++ b/chrome/browser/extensions/api/web_request/web_request_api.cc @@ -2301,8 +2301,8 @@ bool WebRequestEventHandled::RunImpl() { EXTENSION_FUNCTION_VALIDATE(value->GetDictionary( keys::kAuthCredentialsKey, &credentials_value)); - string16 username; - string16 password; + base::string16 username; + base::string16 password; EXTENSION_FUNCTION_VALIDATE( credentials_value->GetString(keys::kUsernameKey, &username)); EXTENSION_FUNCTION_VALIDATE( diff --git a/chrome/browser/extensions/api/web_request/web_request_api_unittest.cc b/chrome/browser/extensions/api/web_request/web_request_api_unittest.cc index d7a8bca..d5dfb49 100644 --- a/chrome/browser/extensions/api/web_request/web_request_api_unittest.cc +++ b/chrome/browser/extensions/api/web_request/web_request_api_unittest.cc @@ -1295,8 +1295,8 @@ TEST(ExtensionWebRequestHelpersTest, TestCalculateOnHeadersReceivedDelta) { TEST(ExtensionWebRequestHelpersTest, TestCalculateOnAuthRequiredDelta) { const bool cancel = true; - string16 username = ASCIIToUTF16("foo"); - string16 password = ASCIIToUTF16("bar"); + base::string16 username = ASCIIToUTF16("foo"); + base::string16 password = ASCIIToUTF16("bar"); scoped_ptr<net::AuthCredentials> credentials( new net::AuthCredentials(username, password)); @@ -2068,9 +2068,9 @@ TEST(ExtensionWebRequestHelpersTest, TestMergeOnAuthRequiredResponses) { net::BoundNetLog net_log = capturing_net_log.bound(); ExtensionWarningSet warning_set; EventResponseDeltas deltas; - string16 username = ASCIIToUTF16("foo"); - string16 password = ASCIIToUTF16("bar"); - string16 password2 = ASCIIToUTF16("baz"); + base::string16 username = ASCIIToUTF16("foo"); + base::string16 password = ASCIIToUTF16("bar"); + base::string16 password2 = ASCIIToUTF16("baz"); // Check that we can handle if not returning credentials. linked_ptr<EventResponseDelta> d0( diff --git a/chrome/browser/extensions/api/webrtc_audio_private/webrtc_audio_private_browsertest.cc b/chrome/browser/extensions/api/webrtc_audio_private/webrtc_audio_private_browsertest.cc index 760072d..e3f7c7e 100644 --- a/chrome/browser/extensions/api/webrtc_audio_private/webrtc_audio_private_browsertest.cc +++ b/chrome/browser/extensions/api/webrtc_audio_private/webrtc_audio_private_browsertest.cc @@ -373,7 +373,7 @@ IN_PROC_BROWSER_TEST_F(HangoutServicesBrowserTest, content::TitleWatcher title_watcher(tab, ASCIIToUTF16("success")); title_watcher.AlsoWaitForTitle(ASCIIToUTF16("failure")); - string16 result = title_watcher.WaitAndGetTitle(); + base::string16 result = title_watcher.WaitAndGetTitle(); EXPECT_EQ(ASCIIToUTF16("success"), result); } diff --git a/chrome/browser/extensions/api/webstore_private/webstore_private_apitest.cc b/chrome/browser/extensions/api/webstore_private/webstore_private_apitest.cc index 1b3f2ab..4110415 100644 --- a/chrome/browser/extensions/api/webstore_private/webstore_private_apitest.cc +++ b/chrome/browser/extensions/api/webstore_private/webstore_private_apitest.cc @@ -151,14 +151,14 @@ IN_PROC_BROWSER_TEST_F(ExtensionWebstorePrivateApiTest, DISABLED_FrameWebstorePageBlocked) { content::WebContents* contents = browser()->tab_strip_model()->GetActiveWebContents(); - string16 expected_title = UTF8ToUTF16("PASS: about:blank"); - string16 failure_title = UTF8ToUTF16("FAIL"); + base::string16 expected_title = UTF8ToUTF16("PASS: about:blank"); + base::string16 failure_title = UTF8ToUTF16("FAIL"); content::TitleWatcher watcher(contents, expected_title); watcher.AlsoWaitForTitle(failure_title); GURL url = test_server()->GetURL( "files/extensions/api_test/webstore_private/noframe.html"); ui_test_utils::NavigateToURL(browser(), url); - string16 final_title = watcher.WaitAndGetTitle(); + base::string16 final_title = watcher.WaitAndGetTitle(); EXPECT_EQ(expected_title, final_title); } @@ -168,14 +168,14 @@ IN_PROC_BROWSER_TEST_F(ExtensionWebstorePrivateApiTest, DISABLED_FrameErrorPageBlocked) { content::WebContents* contents = browser()->tab_strip_model()->GetActiveWebContents(); - string16 expected_title = UTF8ToUTF16("PASS: about:blank"); - string16 failure_title = UTF8ToUTF16("FAIL"); + base::string16 expected_title = UTF8ToUTF16("PASS: about:blank"); + base::string16 failure_title = UTF8ToUTF16("FAIL"); content::TitleWatcher watcher(contents, expected_title); watcher.AlsoWaitForTitle(failure_title); GURL url = test_server()->GetURL( "files/extensions/api_test/webstore_private/noframe2.html"); ui_test_utils::NavigateToURL(browser(), url); - string16 final_title = watcher.WaitAndGetTitle(); + base::string16 final_title = watcher.WaitAndGetTitle(); EXPECT_EQ(expected_title, final_title); } diff --git a/chrome/browser/extensions/bundle_installer.cc b/chrome/browser/extensions/bundle_installer.cc index 4f5f7e3..f9a2189 100644 --- a/chrome/browser/extensions/bundle_installer.cc +++ b/chrome/browser/extensions/bundle_installer.cc @@ -97,7 +97,7 @@ void BundleInstaller::SetAutoApproveForTesting(bool auto_approve) { BundleInstaller::Item::Item() : state(STATE_PENDING) {} string16 BundleInstaller::Item::GetNameForDisplay() { - string16 name = UTF8ToUTF16(localized_name); + base::string16 name = UTF8ToUTF16(localized_name); base::i18n::AdjustStringForLocaleDirection(&name); return l10n_util::GetStringFUTF16(IDS_EXTENSION_PERMISSION_LINE, name); } @@ -182,7 +182,7 @@ string16 BundleInstaller::GetHeadingTextFor(Item::State state) const { if (state == Item::STATE_FAILED) { if (GetItemsWithState(state).size()) return l10n_util::GetStringUTF16(IDS_EXTENSION_BUNDLE_ERROR_HEADING); - return string16(); + return base::string16(); } size_t total = GetItemsWithState(state).size(); @@ -198,7 +198,7 @@ string16 BundleInstaller::GetHeadingTextFor(Item::State state) const { int msg_id = kHeadingIds[state][index]; if (!msg_id) - return string16(); + return base::string16(); return l10n_util::GetStringUTF16(msg_id); } diff --git a/chrome/browser/extensions/bundle_installer.h b/chrome/browser/extensions/bundle_installer.h index 492490c..2edda54 100644 --- a/chrome/browser/extensions/bundle_installer.h +++ b/chrome/browser/extensions/bundle_installer.h @@ -69,7 +69,7 @@ class BundleInstaller : public WebstoreInstallHelper::Delegate, Item(); // Gets the localized name, formatted for display in the prompt or bubble. - string16 GetNameForDisplay(); + base::string16 GetNameForDisplay(); std::string id; std::string manifest; @@ -109,7 +109,7 @@ class BundleInstaller : public WebstoreInstallHelper::Delegate, // STATE_PENDING - install prompt // STATE_INSTALLED - installed bubble successful installs list // STATE_FAILED - installed bubble failed installs list - string16 GetHeadingTextFor(Item::State state) const; + base::string16 GetHeadingTextFor(Item::State state) const; private: friend class base::RefCountedThreadSafe<BundleInstaller>; diff --git a/chrome/browser/extensions/context_menu_matcher.cc b/chrome/browser/extensions/context_menu_matcher.cc index 80f7bd7..6f03d6a 100644 --- a/chrome/browser/extensions/context_menu_matcher.cc +++ b/chrome/browser/extensions/context_menu_matcher.cc @@ -27,10 +27,10 @@ ContextMenuMatcher::ContextMenuMatcher( filter_(filter) { } -void ContextMenuMatcher::AppendExtensionItems(const std::string& extension_id, - const string16& selection_text, - int* index) -{ +void ContextMenuMatcher::AppendExtensionItems( + const std::string& extension_id, + const base::string16& selection_text, + int* index) { DCHECK_GE(*index, 0); int max_index = IDC_EXTENSIONS_CONTEXT_CUSTOM_LAST - IDC_EXTENSIONS_CONTEXT_CUSTOM_FIRST; @@ -61,7 +61,7 @@ void ContextMenuMatcher::AppendExtensionItems(const std::string& extension_id, menu_model_, index); } else { int menu_id = IDC_EXTENSIONS_CONTEXT_CUSTOM_FIRST + (*index)++; - string16 title; + base::string16 title; MenuItem::List submenu_items; if (items.size() > 1 || items[0]->type() != MenuItem::NORMAL) { @@ -97,7 +97,7 @@ void ContextMenuMatcher::Clear() { base::string16 ContextMenuMatcher::GetTopLevelContextMenuTitle( const std::string& extension_id, - const string16& selection_text) { + const base::string16& selection_text) { const Extension* extension = NULL; MenuItem::List items; bool can_cross_incognito; @@ -189,7 +189,7 @@ MenuItem::List ContextMenuMatcher::GetRelevantExtensionItems( void ContextMenuMatcher::RecursivelyAppendExtensionItems( const MenuItem::List& items, bool can_cross_incognito, - const string16& selection_text, + const base::string16& selection_text, ui::SimpleMenuModel* menu_model, int* index) { @@ -212,7 +212,7 @@ void ContextMenuMatcher::RecursivelyAppendExtensionItems( if (menu_id >= IDC_EXTENSIONS_CONTEXT_CUSTOM_LAST) return; extension_item_map_[menu_id] = item->id(); - string16 title = item->TitleWithReplacement(selection_text, + base::string16 title = item->TitleWithReplacement(selection_text, kMaxExtensionItemTitleLength); if (item->type() == MenuItem::NORMAL) { MenuItem::List children = diff --git a/chrome/browser/extensions/context_menu_matcher.h b/chrome/browser/extensions/context_menu_matcher.h index d375163..51707af 100644 --- a/chrome/browser/extensions/context_menu_matcher.h +++ b/chrome/browser/extensions/context_menu_matcher.h @@ -35,15 +35,16 @@ class ContextMenuMatcher { // The |index| parameter is used for assigning id's, and is incremented for // each item actually added. void AppendExtensionItems(const std::string& extension_id, - const string16& selection_text, + const base::string16& selection_text, int* index); void Clear(); // This function returns the top level context menu title of an extension // based on a printable selection text. - base::string16 GetTopLevelContextMenuTitle(const std::string& extension_id, - const string16& selection_text); + base::string16 GetTopLevelContextMenuTitle( + const std::string& extension_id, + const base::string16& selection_text); bool IsCommandIdChecked(int command_id) const; bool IsCommandIdEnabled(int command_id) const; @@ -67,7 +68,7 @@ class ContextMenuMatcher { // Used for recursively adding submenus of extension items. void RecursivelyAppendExtensionItems(const MenuItem::List& items, bool can_cross_incognito, - const string16& selection_text, + const base::string16& selection_text, ui::SimpleMenuModel* menu_model, int* index); diff --git a/chrome/browser/extensions/convert_user_script.cc b/chrome/browser/extensions/convert_user_script.cc index ef29c3b..9725a64 100644 --- a/chrome/browser/extensions/convert_user_script.cc +++ b/chrome/browser/extensions/convert_user_script.cc @@ -32,7 +32,7 @@ namespace values = manifest_values; scoped_refptr<Extension> ConvertUserScriptToExtension( const base::FilePath& user_script_path, const GURL& original_url, - const base::FilePath& extensions_dir, string16* error) { + const base::FilePath& extensions_dir, base::string16* error) { std::string content; if (!base::ReadFileToString(user_script_path, &content)) { *error = ASCIIToUTF16("Could not read source file."); @@ -171,7 +171,7 @@ scoped_refptr<Extension> ConvertUserScriptToExtension( } // TODO(rdevlin.cronin): Continue removing std::string errors and replacing - // with string16 + // with base::string16 std::string utf8_error; scoped_refptr<Extension> extension = Extension::Create( temp_dir.path(), diff --git a/chrome/browser/extensions/convert_user_script.h b/chrome/browser/extensions/convert_user_script.h index 1ce8936..1a910a0 100644 --- a/chrome/browser/extensions/convert_user_script.h +++ b/chrome/browser/extensions/convert_user_script.h @@ -28,7 +28,7 @@ class Extension; // returned object. scoped_refptr<extensions::Extension> ConvertUserScriptToExtension( const base::FilePath& user_script, const GURL& original_url, - const base::FilePath& extensions_dir, string16* error); + const base::FilePath& extensions_dir, base::string16* error); } // namespace extensions diff --git a/chrome/browser/extensions/convert_user_script_unittest.cc b/chrome/browser/extensions/convert_user_script_unittest.cc index d0e5e95..e0e8ac7 100644 --- a/chrome/browser/extensions/convert_user_script_unittest.cc +++ b/chrome/browser/extensions/convert_user_script_unittest.cc @@ -41,7 +41,7 @@ TEST_F(ExtensionFromUserScript, Basic) { test_file = test_file.AppendASCII("extensions") .AppendASCII("user_script_basic.user.js"); - string16 error; + base::string16 error; scoped_refptr<Extension> extension(ConvertUserScriptToExtension( test_file, GURL("http://www.google.com/foo"), extensions_dir.path(), &error)); @@ -94,7 +94,7 @@ TEST_F(ExtensionFromUserScript, NoMetadata) { test_file = test_file.AppendASCII("extensions") .AppendASCII("user_script_no_metadata.user.js"); - string16 error; + base::string16 error; scoped_refptr<Extension> extension(ConvertUserScriptToExtension( test_file, GURL("http://www.google.com/foo/bar.user.js?monkey"), extensions_dir.path(), &error)); @@ -143,7 +143,7 @@ TEST_F(ExtensionFromUserScript, NotUTF8) { test_file = test_file.AppendASCII("extensions") .AppendASCII("user_script_not_utf8.user.js"); - string16 error; + base::string16 error; scoped_refptr<Extension> extension(ConvertUserScriptToExtension( test_file, GURL("http://www.google.com/foo/bar.user.js?monkey"), extensions_dir.path(), &error)); @@ -161,7 +161,7 @@ TEST_F(ExtensionFromUserScript, RunAtDocumentStart) { test_file = test_file.AppendASCII("extensions") .AppendASCII("user_script_run_at_start.user.js"); - string16 error; + base::string16 error; scoped_refptr<Extension> extension(ConvertUserScriptToExtension( test_file, GURL("http://www.google.com/foo"), extensions_dir.path(), &error)); @@ -196,7 +196,7 @@ TEST_F(ExtensionFromUserScript, RunAtDocumentEnd) { test_file = test_file.AppendASCII("extensions") .AppendASCII("user_script_run_at_end.user.js"); - string16 error; + base::string16 error; scoped_refptr<Extension> extension(ConvertUserScriptToExtension( test_file, GURL("http://www.google.com/foo"), extensions_dir.path(), &error)); @@ -232,7 +232,7 @@ TEST_F(ExtensionFromUserScript, RunAtDocumentIdle) { .AppendASCII("user_script_run_at_idle.user.js"); ASSERT_TRUE(base::PathExists(test_file)) << test_file.value(); - string16 error; + base::string16 error; scoped_refptr<Extension> extension(ConvertUserScriptToExtension( test_file, GURL("http://www.google.com/foo"), extensions_dir.path(), &error)); diff --git a/chrome/browser/extensions/crx_installer.cc b/chrome/browser/extensions/crx_installer.cc index 85109f56..cdc45e5 100644 --- a/chrome/browser/extensions/crx_installer.cc +++ b/chrome/browser/extensions/crx_installer.cc @@ -206,7 +206,7 @@ void CrxInstaller::InstallUserScript(const base::FilePath& source_file, } void CrxInstaller::ConvertUserScriptOnFileThread() { - string16 error; + base::string16 error; scoped_refptr<Extension> extension = ConvertUserScriptToExtension( source_file_, download_url_, install_directory_, &error); if (!extension.get()) { @@ -231,7 +231,7 @@ void CrxInstaller::InstallWebApp(const WebApplicationInfo& web_app) { void CrxInstaller::ConvertWebAppOnFileThread( const WebApplicationInfo& web_app, const base::FilePath& install_directory) { - string16 error; + base::string16 error; scoped_refptr<Extension> extension( ConvertWebAppToExtension(web_app, base::Time::Now(), install_directory)); if (!extension.get()) { @@ -416,7 +416,7 @@ CrxInstallerError CrxInstaller::AllowInstall(const Extension* extension) { return CrxInstallerError(); } -void CrxInstaller::OnUnpackFailure(const string16& error_message) { +void CrxInstaller::OnUnpackFailure(const base::string16& error_message) { DCHECK(installer_task_runner_->RunsTasksOnCurrentThread()); UMA_HISTOGRAM_ENUMERATION("Extensions.UnpackFailureInstallSource", @@ -564,7 +564,7 @@ void CrxInstaller::ConfirmInstall() { } } - string16 error = installer_.CheckManagementPolicy(); + base::string16 error = installer_.CheckManagementPolicy(); if (!error.empty()) { // We don't want to show the error infobar for installs from the WebStore, // because the WebStore already shows an error dialog itself. @@ -695,7 +695,7 @@ void CrxInstaller::CompleteInstall() { // TODO(aa): All paths to resources inside extensions should be created // lazily and based on the Extension's root path at that moment. // TODO(rdevlin.cronin): Continue removing std::string errors and replacing - // with string16 + // with base::string16 std::string extension_id = extension()->id(); std::string error; installer_.set_extension(extension_file_util::LoadExtension( @@ -729,7 +729,7 @@ void CrxInstaller::ReportFailureFromUIThread(const CrxInstallerError& error) { content::NotificationService::current(); service->Notify(chrome::NOTIFICATION_EXTENSION_INSTALL_ERROR, content::Source<CrxInstaller>(this), - content::Details<const string16>(&error.message())); + content::Details<const base::string16>(&error.message())); // This isn't really necessary, it is only used because unit tests expect to // see errors get reported via this interface. diff --git a/chrome/browser/extensions/crx_installer.h b/chrome/browser/extensions/crx_installer.h index b213a3f..ce6d2df 100644 --- a/chrome/browser/extensions/crx_installer.h +++ b/chrome/browser/extensions/crx_installer.h @@ -219,7 +219,7 @@ class CrxInstaller CrxInstallerError AllowInstall(const Extension* extension); // SandboxedUnpackerClient - virtual void OnUnpackFailure(const string16& error_message) OVERRIDE; + virtual void OnUnpackFailure(const base::string16& error_message) OVERRIDE; virtual void OnUnpackSuccess(const base::FilePath& temp_dir, const base::FilePath& extension_dir, const base::DictionaryValue* original_manifest, diff --git a/chrome/browser/extensions/crx_installer_browsertest.cc b/chrome/browser/extensions/crx_installer_browsertest.cc index 3e5bd6f..5ef3f3e 100644 --- a/chrome/browser/extensions/crx_installer_browsertest.cc +++ b/chrome/browser/extensions/crx_installer_browsertest.cc @@ -52,7 +52,7 @@ class MockPromptProxy : bool did_succeed() const { return !extension_id_.empty(); } const std::string& extension_id() { return extension_id_; } bool confirmation_requested() const { return confirmation_requested_; } - const string16& error() const { return error_; } + const base::string16& error() const { return error_; } // To have any effect, this should be called before CreatePrompt. void set_record_oauth2_grant(bool record_oauth2_grant) { @@ -61,7 +61,7 @@ class MockPromptProxy : void set_extension_id(const std::string& id) { extension_id_ = id; } void set_confirmation_requested() { confirmation_requested_ = true; } - void set_error(const string16& error) { error_ = error; } + void set_error(const base::string16& error) { error_ = error; } scoped_ptr<ExtensionInstallPrompt> CreatePrompt(); @@ -76,7 +76,7 @@ class MockPromptProxy : // Data reported back to us by the prompt we created. bool confirmation_requested_; std::string extension_id_; - string16 error_; + base::string16 error_; }; class MockInstallPrompt : public ExtensionInstallPrompt { diff --git a/chrome/browser/extensions/crx_installer_error.h b/chrome/browser/extensions/crx_installer_error.h index 41990af..730a9e3 100644 --- a/chrome/browser/extensions/crx_installer_error.h +++ b/chrome/browser/extensions/crx_installer_error.h @@ -22,21 +22,21 @@ class CrxInstallerError { CrxInstallerError() : type_(ERROR_NONE) { } - explicit CrxInstallerError(const string16& message) + explicit CrxInstallerError(const base::string16& message) : type_(message.empty() ? ERROR_NONE : ERROR_OTHER), message_(message) { } - CrxInstallerError(Type type, const string16& message) + CrxInstallerError(Type type, const base::string16& message) : type_(type), message_(message) { } Type type() const { return type_; } - const string16& message() const { return message_; } + const base::string16& message() const { return message_; } private: Type type_; - string16 message_; + base::string16 message_; }; } // namespace extensions diff --git a/chrome/browser/extensions/error_console/error_console_unittest.cc b/chrome/browser/extensions/error_console/error_console_unittest.cc index 501e7aa..c0a386c 100644 --- a/chrome/browser/extensions/error_console/error_console_unittest.cc +++ b/chrome/browser/extensions/error_console/error_console_unittest.cc @@ -49,7 +49,7 @@ string16 GetSourceForExtensionId(const std::string& extension_id) { scoped_ptr<ExtensionError> CreateNewRuntimeError( bool from_incognito, const std::string& extension_id, - const string16& message) { + const base::string16& message) { return scoped_ptr<ExtensionError>(new RuntimeError( extension_id, from_incognito, @@ -117,7 +117,7 @@ TEST_F(ErrorConsoleUnitTest, AddAndRemoveErrors) { // Add another error for a different extension id. const std::string kSecondId = id_util::GenerateId("id2"); error_console_->ReportError( - CreateNewRuntimeError(false, kSecondId, string16())); + CreateNewRuntimeError(false, kSecondId, base::string16())); // There should be two entries now, one for each id, and there should be one // error for the second extension. diff --git a/chrome/browser/extensions/extension_context_menu_browsertest.cc b/chrome/browser/extensions/extension_context_menu_browsertest.cc index c52506b..616465a 100644 --- a/chrome/browser/extensions/extension_context_menu_browsertest.cc +++ b/chrome/browser/extensions/extension_context_menu_browsertest.cc @@ -205,12 +205,12 @@ class ExtensionContextMenuBrowserTest : public ExtensionBrowserTest { bool MenuHasExtensionItemWithLabel(TestRenderViewContextMenu* menu, const std::string& label) { - string16 label16 = UTF8ToUTF16(label); + base::string16 label16 = UTF8ToUTF16(label); std::map<int, MenuItem::Id>::iterator i; for (i = menu->extension_items().extension_item_map_.begin(); i != menu->extension_items().extension_item_map_.end(); ++i) { const MenuItem::Id& id = i->second; - string16 tmp_label; + base::string16 tmp_label; EXPECT_TRUE(GetItemLabel(menu, id, &tmp_label)); if (tmp_label == label16) return true; @@ -223,7 +223,7 @@ class ExtensionContextMenuBrowserTest : public ExtensionBrowserTest { // false. bool GetItemLabel(TestRenderViewContextMenu* menu, const MenuItem::Id& id, - string16* result) { + base::string16* result) { int command_id = 0; if (!FindCommandId(menu, id, &command_id)) return false; @@ -333,7 +333,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionContextMenuBrowserTest, LongTitle) { scoped_ptr<TestRenderViewContextMenu> menu( CreateMenu(browser(), url, GURL(), GURL())); - string16 label; + base::string16 label; ASSERT_TRUE(GetItemLabel(menu.get(), item->id(), &label)); ASSERT_TRUE(label.size() <= limit); } @@ -472,7 +472,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionContextMenuBrowserTest, Separators) { // name. MenuModel* model = NULL; int index = 0; - string16 label; + base::string16 label; ASSERT_TRUE(menu->GetMenuModelAndItemIndex( IDC_EXTENSIONS_CONTEXT_CUSTOM_FIRST, &model, &index)); EXPECT_EQ(UTF8ToUTF16(extension->name()), model->GetLabelAt(index)); diff --git a/chrome/browser/extensions/extension_disabled_ui.cc b/chrome/browser/extensions/extension_disabled_ui.cc index 4a5c3d9..a5560ab 100644 --- a/chrome/browser/extensions/extension_disabled_ui.cc +++ b/chrome/browser/extensions/extension_disabled_ui.cc @@ -148,13 +148,13 @@ class ExtensionDisabledGlobalError : public GlobalErrorWithStandardBubble, virtual Severity GetSeverity() OVERRIDE; virtual bool HasMenuItem() OVERRIDE; virtual int MenuItemCommandID() OVERRIDE; - virtual string16 MenuItemLabel() OVERRIDE; + virtual base::string16 MenuItemLabel() OVERRIDE; virtual void ExecuteMenuItem(Browser* browser) OVERRIDE; virtual gfx::Image GetBubbleViewIcon() OVERRIDE; - virtual string16 GetBubbleViewTitle() OVERRIDE; + virtual base::string16 GetBubbleViewTitle() OVERRIDE; virtual std::vector<string16> GetBubbleViewMessages() OVERRIDE; - virtual string16 GetBubbleViewAcceptButtonLabel() OVERRIDE; - virtual string16 GetBubbleViewCancelButtonLabel() OVERRIDE; + virtual base::string16 GetBubbleViewAcceptButtonLabel() OVERRIDE; + virtual base::string16 GetBubbleViewCancelButtonLabel() OVERRIDE; virtual void OnBubbleViewDidClose(Browser* browser) OVERRIDE; virtual void BubbleViewAcceptButtonPressed(Browser* browser) OVERRIDE; virtual void BubbleViewCancelButtonPressed(Browser* browser) OVERRIDE; diff --git a/chrome/browser/extensions/extension_error_reporter.cc b/chrome/browser/extensions/extension_error_reporter.cc index 669abb1..618a8c8 100644 --- a/chrome/browser/extensions/extension_error_reporter.cc +++ b/chrome/browser/extensions/extension_error_reporter.cc @@ -35,7 +35,7 @@ ExtensionErrorReporter::ExtensionErrorReporter(bool enable_noisy_errors) ExtensionErrorReporter::~ExtensionErrorReporter() {} -void ExtensionErrorReporter::ReportError(const string16& message, +void ExtensionErrorReporter::ReportError(const base::string16& message, bool be_noisy) { // NOTE: There won't be a ui_loop_ in the unit test environment. if (ui_loop_ && base::MessageLoop::current() != ui_loop_) { diff --git a/chrome/browser/extensions/extension_error_reporter.h b/chrome/browser/extensions/extension_error_reporter.h index 058b027..f2ee723 100644 --- a/chrome/browser/extensions/extension_error_reporter.h +++ b/chrome/browser/extensions/extension_error_reporter.h @@ -33,7 +33,7 @@ class ExtensionErrorReporter { // Report an error. Errors always go to VLOG(1). Optionally, they can also // cause a noisy alert box. This method can be called from any thread. - void ReportError(const string16& message, bool be_noisy); + void ReportError(const base::string16& message, bool be_noisy); // Get the errors that have been reported so far. const std::vector<string16>* GetErrors(); diff --git a/chrome/browser/extensions/extension_error_ui.cc b/chrome/browser/extensions/extension_error_ui.cc index 5412b90..96603e6 100644 --- a/chrome/browser/extensions/extension_error_ui.cc +++ b/chrome/browser/extensions/extension_error_ui.cc @@ -40,7 +40,7 @@ string16 ExtensionErrorUI::GenerateMessageSection( CHECK(extensions); CHECK(extension_template_message_id); CHECK(app_template_message_id); - string16 message; + base::string16 message; for (ExtensionIdSet::const_iterator iter = extensions->begin(); iter != extensions->end(); ++iter) { diff --git a/chrome/browser/extensions/extension_error_ui.h b/chrome/browser/extensions/extension_error_ui.h index d70fa1a..362c2df 100644 --- a/chrome/browser/extensions/extension_error_ui.h +++ b/chrome/browser/extensions/extension_error_ui.h @@ -56,10 +56,10 @@ class ExtensionErrorUI { ExtensionService* extension_service() const { return extension_service_; } // Model methods for the bubble view. - string16 GetBubbleViewTitle(); + base::string16 GetBubbleViewTitle(); std::vector<string16> GetBubbleViewMessages(); - string16 GetBubbleViewAcceptButtonLabel(); - string16 GetBubbleViewCancelButtonLabel(); + base::string16 GetBubbleViewAcceptButtonLabel(); + base::string16 GetBubbleViewCancelButtonLabel(); // Sub-classes should call this methods based on the actions taken by the user // in the error bubble. @@ -72,16 +72,17 @@ class ExtensionErrorUI { ExtensionService* extension_service_; scoped_ptr<extensions::ExtensionIdSet> external_extension_ids_; scoped_ptr<extensions::ExtensionIdSet> blacklisted_extension_ids_; - string16 message_; // Displayed in the body of the alert. + base::string16 message_; // Displayed in the body of the alert. // For a given set of extension IDs, generates appropriate text // describing what the user needs to know about them. - string16 GenerateMessageSection(const extensions::ExtensionIdSet* extensions, - int extension_template_message_id, - int app_template_message_id); + base::string16 GenerateMessageSection( + const extensions::ExtensionIdSet* extensions, + int extension_template_message_id, + int app_template_message_id); // Generates the message displayed in the body of the alert. - string16 GenerateMessage(); + base::string16 GenerateMessage(); DISALLOW_COPY_AND_ASSIGN(ExtensionErrorUI); }; diff --git a/chrome/browser/extensions/extension_error_ui_default.h b/chrome/browser/extensions/extension_error_ui_default.h index dab1444..8475cb6 100644 --- a/chrome/browser/extensions/extension_error_ui_default.h +++ b/chrome/browser/extensions/extension_error_ui_default.h @@ -33,12 +33,12 @@ class ExtensionErrorUIDefault : public ExtensionErrorUI { // GlobalError methods. virtual bool HasMenuItem() OVERRIDE; virtual int MenuItemCommandID() OVERRIDE; - virtual string16 MenuItemLabel() OVERRIDE; + virtual base::string16 MenuItemLabel() OVERRIDE; virtual void ExecuteMenuItem(Browser* browser) OVERRIDE; - virtual string16 GetBubbleViewTitle() OVERRIDE; + virtual base::string16 GetBubbleViewTitle() OVERRIDE; virtual std::vector<string16> GetBubbleViewMessages() OVERRIDE; - virtual string16 GetBubbleViewAcceptButtonLabel() OVERRIDE; - virtual string16 GetBubbleViewCancelButtonLabel() OVERRIDE; + virtual base::string16 GetBubbleViewAcceptButtonLabel() OVERRIDE; + virtual base::string16 GetBubbleViewCancelButtonLabel() OVERRIDE; virtual void OnBubbleViewDidClose(Browser* browser) OVERRIDE; virtual void BubbleViewAcceptButtonPressed(Browser* browser) OVERRIDE; virtual void BubbleViewCancelButtonPressed(Browser* browser) OVERRIDE; diff --git a/chrome/browser/extensions/extension_install_prompt.h b/chrome/browser/extensions/extension_install_prompt.h index 35ecc2a5..772b66c 100644 --- a/chrome/browser/extensions/extension_install_prompt.h +++ b/chrome/browser/extensions/extension_install_prompt.h @@ -97,16 +97,16 @@ class ExtensionInstallPrompt void set_type(PromptType type) { type_ = type; } // Getters for UI element labels. - string16 GetDialogTitle() const; - string16 GetHeading() const; + base::string16 GetDialogTitle() const; + base::string16 GetHeading() const; int GetDialogButtons() const; bool HasAcceptButtonLabel() const; - string16 GetAcceptButtonLabel() const; + base::string16 GetAcceptButtonLabel() const; bool HasAbortButtonLabel() const; - string16 GetAbortButtonLabel() const; - string16 GetPermissionsHeading() const; - string16 GetOAuthHeading() const; - string16 GetRetainedFilesHeading() const; + base::string16 GetAbortButtonLabel() const; + base::string16 GetPermissionsHeading() const; + base::string16 GetOAuthHeading() const; + base::string16 GetRetainedFilesHeading() const; bool ShouldShowPermissions() const; @@ -119,17 +119,17 @@ class ExtensionInstallPrompt // that they append to the star display area. typedef void(*StarAppender)(const gfx::ImageSkia*, void*); void AppendRatingStars(StarAppender appender, void* data) const; - string16 GetRatingCount() const; - string16 GetUserCount() const; + base::string16 GetRatingCount() const; + base::string16 GetUserCount() const; size_t GetPermissionCount() const; size_t GetPermissionsDetailsCount() const; - string16 GetPermission(size_t index) const; - string16 GetPermissionsDetails(size_t index) const; + base::string16 GetPermission(size_t index) const; + base::string16 GetPermissionsDetails(size_t index) const; bool GetIsShowingDetails(DetailsType type, size_t index) const; size_t GetOAuthIssueCount() const; const IssueAdviceInfoEntry& GetOAuthIssue(size_t index) const; size_t GetRetainedFileCount() const; - string16 GetRetainedFile(size_t index) const; + base::string16 GetRetainedFile(size_t index) const; // Populated for BUNDLE_INSTALL_PROMPT. const extensions::BundleInstaller* bundle() const { return bundle_; } @@ -169,7 +169,7 @@ class ExtensionInstallPrompt IssueAdviceInfo oauth_issue_advice_; // User name to be used in Oauth heading label. - string16 oauth_user_name_; + base::string16 oauth_user_name_; // The extension or bundle being installed. const extensions::Extension* extension_; diff --git a/chrome/browser/extensions/extension_installer.cc b/chrome/browser/extensions/extension_installer.cc index 7d47df1..b6dae68 100644 --- a/chrome/browser/extensions/extension_installer.cc +++ b/chrome/browser/extensions/extension_installer.cc @@ -28,7 +28,7 @@ void ExtensionInstaller::CheckRequirements( } string16 ExtensionInstaller::CheckManagementPolicy() { - string16 error; + base::string16 error; bool allowed = ExtensionSystem::Get(profile_)->management_policy() ->UserMayLoad(extension_.get(), &error); DCHECK(allowed || !error.empty()); diff --git a/chrome/browser/extensions/extension_installer.h b/chrome/browser/extensions/extension_installer.h index 13170cb..e72e01b 100644 --- a/chrome/browser/extensions/extension_installer.h +++ b/chrome/browser/extensions/extension_installer.h @@ -35,7 +35,7 @@ class ExtensionInstaller { void CheckRequirements(const RequirementsCallback& callback); // Checks the management policy if the extension can be installed. - string16 CheckManagementPolicy(); + base::string16 CheckManagementPolicy(); Profile* profile() const { return profile_; diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc index f8245a5..e010bbb 100644 --- a/chrome/browser/extensions/extension_service.cc +++ b/chrome/browser/extensions/extension_service.cc @@ -168,12 +168,12 @@ class SharedModuleProvider : public extensions::ManagementPolicy::Provider { } virtual bool UserMayModifySettings(const Extension* extension, - string16* error) const OVERRIDE { + base::string16* error) const OVERRIDE { return !IsCWSSharedModule(extension); } virtual bool MustRemainEnabled(const Extension* extension, - string16* error) const OVERRIDE { + base::string16* error) const OVERRIDE { return IsCWSSharedModule(extension); } @@ -296,7 +296,7 @@ bool ExtensionService::UninstallExtensionHelper( // The following call to UninstallExtension will not allow an uninstall of a // policy-controlled extension. - string16 error; + base::string16 error; if (!extensions_service->UninstallExtension(extension_id, false, &error)) { LOG(WARNING) << "Cannot uninstall extension with id " << extension_id << ": " << error; @@ -745,7 +745,7 @@ void ExtensionService::ReloadExtension(const std::string extension_id) { bool ExtensionService::UninstallExtension( std::string extension_id, bool external_uninstall, - string16* error) { + base::string16* error) { CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); scoped_refptr<const Extension> extension(GetInstalledExtension(extension_id)); @@ -2418,7 +2418,7 @@ void ExtensionService::ReportExtensionLoadError( content::Details<const std::string>(&error)); std::string path_str = UTF16ToUTF8(extension_path.LossyDisplayName()); - string16 message = UTF8ToUTF16(base::StringPrintf( + base::string16 message = UTF8ToUTF16(base::StringPrintf( "Could not load extension from '%s'. %s", path_str.c_str(), error.c_str())); ExtensionErrorReporter::GetInstance()->ReportError(message, be_noisy); diff --git a/chrome/browser/extensions/extension_service.h b/chrome/browser/extensions/extension_service.h index 2d2adb9..e9e38b6 100644 --- a/chrome/browser/extensions/extension_service.h +++ b/chrome/browser/extensions/extension_service.h @@ -268,7 +268,7 @@ class ExtensionService // to ExtensionPrefs some other way. virtual bool UninstallExtension(std::string extension_id, bool external_uninstall, - string16* error); + base::string16* error); virtual bool IsExtensionEnabled( const std::string& extension_id) const OVERRIDE; diff --git a/chrome/browser/extensions/extension_service_unittest.cc b/chrome/browser/extensions/extension_service_unittest.cc index 70d2121..7d23c2f 100644 --- a/chrome/browser/extensions/extension_service_unittest.cc +++ b/chrome/browser/extensions/extension_service_unittest.cc @@ -4265,8 +4265,8 @@ TEST_F(ExtensionServiceTest, ClearExtensionData) { webkit_database::DatabaseTracker* db_tracker = BrowserContext::GetDefaultStoragePartition(profile_.get())-> GetDatabaseTracker(); - string16 db_name = UTF8ToUTF16("db"); - string16 description = UTF8ToUTF16("db_description"); + base::string16 db_name = UTF8ToUTF16("db"); + base::string16 description = UTF8ToUTF16("db_description"); int64 size; db_tracker->DatabaseOpened(origin_id, db_name, description, 1, &size); db_tracker->DatabaseClosed(origin_id, db_name); @@ -4381,8 +4381,8 @@ TEST_F(ExtensionServiceTest, ClearAppData) { webkit_database::DatabaseTracker* db_tracker = BrowserContext::GetDefaultStoragePartition(profile_.get())-> GetDatabaseTracker(); - string16 db_name = UTF8ToUTF16("db"); - string16 description = UTF8ToUTF16("db_description"); + base::string16 db_name = UTF8ToUTF16("db"); + base::string16 description = UTF8ToUTF16("db_description"); int64 size; db_tracker->DatabaseOpened(origin_id, db_name, description, 1, &size); db_tracker->DatabaseClosed(origin_id, db_name); diff --git a/chrome/browser/extensions/extension_warning_badge_service.cc b/chrome/browser/extensions/extension_warning_badge_service.cc index 3ef80c4..c465d04 100644 --- a/chrome/browser/extensions/extension_warning_badge_service.cc +++ b/chrome/browser/extensions/extension_warning_badge_service.cc @@ -28,7 +28,7 @@ class ErrorBadge : public GlobalError { // Implementation for GlobalError: virtual bool HasMenuItem() OVERRIDE; virtual int MenuItemCommandID() OVERRIDE; - virtual string16 MenuItemLabel() OVERRIDE; + virtual base::string16 MenuItemLabel() OVERRIDE; virtual void ExecuteMenuItem(Browser* browser) OVERRIDE; virtual bool HasBubbleView() OVERRIDE; diff --git a/chrome/browser/extensions/external_install_ui.cc b/chrome/browser/extensions/external_install_ui.cc index b5ac233..0e50729 100644 --- a/chrome/browser/extensions/external_install_ui.cc +++ b/chrome/browser/extensions/external_install_ui.cc @@ -103,13 +103,13 @@ class ExternalInstallMenuAlert : public GlobalErrorWithStandardBubble, virtual Severity GetSeverity() OVERRIDE; virtual bool HasMenuItem() OVERRIDE; virtual int MenuItemCommandID() OVERRIDE; - virtual string16 MenuItemLabel() OVERRIDE; + virtual base::string16 MenuItemLabel() OVERRIDE; virtual void ExecuteMenuItem(Browser* browser) OVERRIDE; virtual bool HasBubbleView() OVERRIDE; - virtual string16 GetBubbleViewTitle() OVERRIDE; + virtual base::string16 GetBubbleViewTitle() OVERRIDE; virtual std::vector<string16> GetBubbleViewMessages() OVERRIDE; - virtual string16 GetBubbleViewAcceptButtonLabel() OVERRIDE; - virtual string16 GetBubbleViewCancelButtonLabel() OVERRIDE; + virtual base::string16 GetBubbleViewAcceptButtonLabel() OVERRIDE; + virtual base::string16 GetBubbleViewCancelButtonLabel() OVERRIDE; virtual void OnBubbleViewDidClose(Browser* browser) OVERRIDE; virtual void BubbleViewAcceptButtonPressed(Browser* browser) OVERRIDE; virtual void BubbleViewCancelButtonPressed(Browser* browser) OVERRIDE; @@ -137,10 +137,10 @@ class ExternalInstallGlobalError : public ExternalInstallMenuAlert { virtual void ExecuteMenuItem(Browser* browser) OVERRIDE; virtual bool HasBubbleView() OVERRIDE; virtual gfx::Image GetBubbleViewIcon() OVERRIDE; - virtual string16 GetBubbleViewTitle() OVERRIDE; + virtual base::string16 GetBubbleViewTitle() OVERRIDE; virtual std::vector<string16> GetBubbleViewMessages() OVERRIDE; - virtual string16 GetBubbleViewAcceptButtonLabel() OVERRIDE; - virtual string16 GetBubbleViewCancelButtonLabel() OVERRIDE; + virtual base::string16 GetBubbleViewAcceptButtonLabel() OVERRIDE; + virtual base::string16 GetBubbleViewCancelButtonLabel() OVERRIDE; virtual void OnBubbleViewDidClose(Browser* browser) OVERRIDE; virtual void BubbleViewAcceptButtonPressed(Browser* browser) OVERRIDE; virtual void BubbleViewCancelButtonPressed(Browser* browser) OVERRIDE; @@ -282,7 +282,7 @@ bool ExternalInstallMenuAlert::HasBubbleView() { return false; } string16 ExternalInstallMenuAlert::GetBubbleViewTitle() { - return string16(); + return base::string16(); } std::vector<string16> ExternalInstallMenuAlert::GetBubbleViewMessages() { @@ -290,11 +290,11 @@ std::vector<string16> ExternalInstallMenuAlert::GetBubbleViewMessages() { } string16 ExternalInstallMenuAlert::GetBubbleViewAcceptButtonLabel() { - return string16(); + return base::string16(); } string16 ExternalInstallMenuAlert::GetBubbleViewCancelButtonLabel() { - return string16(); + return base::string16(); } void ExternalInstallMenuAlert::OnBubbleViewDidClose(Browser* browser) { diff --git a/chrome/browser/extensions/external_registry_loader_win.cc b/chrome/browser/extensions/external_registry_loader_win.cc index 2edf5fa..00366b9 100644 --- a/chrome/browser/extensions/external_registry_loader_win.cc +++ b/chrome/browser/extensions/external_registry_loader_win.cc @@ -70,7 +70,7 @@ void ExternalRegistryLoader::LoadOnFileThread() { for (std::set<string16>::const_iterator it = keys.begin(); it != keys.end(); ++it) { base::win::RegKey key; - string16 key_path = ASCIIToWide(kRegistryExtensions); + base::string16 key_path = ASCIIToWide(kRegistryExtensions); key_path.append(L"\\"); key_path.append(*it); if (key.Open(HKEY_LOCAL_MACHINE, @@ -83,7 +83,7 @@ void ExternalRegistryLoader::LoadOnFileThread() { } } - string16 extension_path_str; + base::string16 extension_path_str; if (key.ReadValue(kRegistryExtensionPath, &extension_path_str) != ERROR_SUCCESS) { // TODO(erikkay): find a way to get this into about:extensions @@ -115,7 +115,7 @@ void ExternalRegistryLoader::LoadOnFileThread() { continue; } - string16 extension_version; + base::string16 extension_version; if (key.ReadValue(kRegistryExtensionVersion, &extension_version) != ERROR_SUCCESS) { // TODO(erikkay): find a way to get this into about:extensions diff --git a/chrome/browser/extensions/install_verifier.cc b/chrome/browser/extensions/install_verifier.cc index 4b7f347..d235757 100644 --- a/chrome/browser/extensions/install_verifier.cc +++ b/chrome/browser/extensions/install_verifier.cc @@ -180,7 +180,7 @@ static bool FromStore(const Extension* extension) { bool InstallVerifier::MustRemainDisabled(const Extension* extension, Extension::DisableReason* reason, - string16* error) const { + base::string16* error) const { if (!ShouldEnforce() || !extension->is_extension() || Manifest::IsUnpackedLocation(extension->location()) || AllowedByEnterprisePolicy(extension->id())) diff --git a/chrome/browser/extensions/install_verifier.h b/chrome/browser/extensions/install_verifier.h index 1f209ac..1131e38 100644 --- a/chrome/browser/extensions/install_verifier.h +++ b/chrome/browser/extensions/install_verifier.h @@ -68,7 +68,7 @@ class InstallVerifier : public ManagementPolicy::Provider { virtual std::string GetDebugPolicyProviderName() const OVERRIDE; virtual bool MustRemainDisabled(const Extension* extension, Extension::DisableReason* reason, - string16* error) const OVERRIDE; + base::string16* error) const OVERRIDE; private: // We keep a list of operations to the current set of extensions - either diff --git a/chrome/browser/extensions/menu_manager.cc b/chrome/browser/extensions/menu_manager.cc index 909bff0e..298ea34 100644 --- a/chrome/browser/extensions/menu_manager.cc +++ b/chrome/browser/extensions/menu_manager.cc @@ -168,8 +168,8 @@ std::set<MenuItem::Id> MenuItem::RemoveAllDescendants() { } string16 MenuItem::TitleWithReplacement( - const string16& selection, size_t max_length) const { - string16 result = UTF8ToUTF16(title_); + const base::string16& selection, size_t max_length) const { + base::string16 result = UTF8ToUTF16(title_); // TODO(asargent) - Change this to properly handle %% escaping so you can // put "%s" in titles that won't get substituted. ReplaceSubstringsAfterOffset(&result, 0, ASCIIToUTF16("%s"), selection); diff --git a/chrome/browser/extensions/menu_manager.h b/chrome/browser/extensions/menu_manager.h index ac0d7a3..ea6cecf 100644 --- a/chrome/browser/extensions/menu_manager.h +++ b/chrome/browser/extensions/menu_manager.h @@ -169,7 +169,7 @@ class MenuItem { // Returns the title with any instances of %s replaced by |selection|. The // result will be no longer than |max_length|. - string16 TitleWithReplacement(const string16& selection, + base::string16 TitleWithReplacement(const base::string16& selection, size_t max_length) const; // Sets the checked state to |checked|. Returns true if successful. diff --git a/chrome/browser/extensions/menu_manager_unittest.cc b/chrome/browser/extensions/menu_manager_unittest.cc index e6e8b6c..ea2056e 100644 --- a/chrome/browser/extensions/menu_manager_unittest.cc +++ b/chrome/browser/extensions/menu_manager_unittest.cc @@ -620,7 +620,7 @@ TEST_F(MenuManagerTest, ExecuteCommand) { ASSERT_TRUE(info->GetString("pageUrl", &tmp)); ASSERT_EQ(params.page_url.spec(), tmp); - string16 tmp16; + base::string16 tmp16; ASSERT_TRUE(info->GetString("selectionText", &tmp16)); ASSERT_EQ(params.selection_text, tmp16); diff --git a/chrome/browser/extensions/pack_extension_job.cc b/chrome/browser/extensions/pack_extension_job.cc index da182b1..a1e752f 100644 --- a/chrome/browser/extensions/pack_extension_job.cc +++ b/chrome/browser/extensions/pack_extension_job.cc @@ -93,8 +93,8 @@ void PackExtensionJob::ReportFailureOnClientThread( string16 PackExtensionJob::StandardSuccessMessage( const base::FilePath& crx_file, const base::FilePath& key_file) { - string16 crx_file_string = crx_file.LossyDisplayName(); - string16 key_file_string = key_file.LossyDisplayName(); + base::string16 crx_file_string = crx_file.LossyDisplayName(); + base::string16 key_file_string = key_file.LossyDisplayName(); if (key_file_string.empty()) { return l10n_util::GetStringFUTF16( IDS_EXTENSION_PACK_DIALOG_SUCCESS_BODY_UPDATE, diff --git a/chrome/browser/extensions/pack_extension_job.h b/chrome/browser/extensions/pack_extension_job.h index adf21ab..61a48cb 100644 --- a/chrome/browser/extensions/pack_extension_job.h +++ b/chrome/browser/extensions/pack_extension_job.h @@ -44,7 +44,7 @@ class PackExtensionJob : public base::RefCountedThreadSafe<PackExtensionJob> { void ClearClient(); // The standard packing success message. - static string16 StandardSuccessMessage(const base::FilePath& crx_file, + static base::string16 StandardSuccessMessage(const base::FilePath& crx_file, const base::FilePath& key_file); void set_asynchronous(bool async) { asynchronous_ = async; } diff --git a/chrome/browser/extensions/sandboxed_unpacker.cc b/chrome/browser/extensions/sandboxed_unpacker.cc index 34716af..33478d2 100644 --- a/chrome/browser/extensions/sandboxed_unpacker.cc +++ b/chrome/browser/extensions/sandboxed_unpacker.cc @@ -368,7 +368,7 @@ void SandboxedUnpacker::OnUnpackExtensionSucceeded( // Localize manifest now, so confirm UI gets correct extension name. // TODO(rdevlin.cronin): Continue removing std::string errors and replacing - // with string16 + // with base::string16 std::string utf8_error; if (!extension_l10n_util::LocalizeExtension(extension_root_, final_manifest.get(), @@ -404,7 +404,7 @@ void SandboxedUnpacker::OnUnpackExtensionSucceeded( ReportSuccess(manifest, install_icon); } -void SandboxedUnpacker::OnUnpackExtensionFailed(const string16& error) { +void SandboxedUnpacker::OnUnpackExtensionFailed(const base::string16& error) { CHECK(unpacker_io_task_runner_->RunsTasksOnCurrentThread()); got_response_ = true; ReportFailure( @@ -577,7 +577,7 @@ bool SandboxedUnpacker::ValidateSignature() { } void SandboxedUnpacker::ReportFailure(FailureReason reason, - const string16& error) { + const base::string16& error) { UMA_HISTOGRAM_ENUMERATION("Extensions.SandboxUnpackFailureReason", reason, NUM_FAILURE_REASONS); UMA_HISTOGRAM_TIMES("Extensions.SandboxUnpackFailureTime", diff --git a/chrome/browser/extensions/sandboxed_unpacker.h b/chrome/browser/extensions/sandboxed_unpacker.h index 6f4075f..71384fc 100644 --- a/chrome/browser/extensions/sandboxed_unpacker.h +++ b/chrome/browser/extensions/sandboxed_unpacker.h @@ -44,7 +44,7 @@ class SandboxedUnpackerClient const base::DictionaryValue* original_manifest, const Extension* extension, const SkBitmap& install_icon) = 0; - virtual void OnUnpackFailure(const string16& error) = 0; + virtual void OnUnpackFailure(const base::string16& error) = 0; protected: friend class base::RefCountedThreadSafe<SandboxedUnpackerClient>; @@ -179,9 +179,9 @@ class SandboxedUnpacker : public content::UtilityProcessHostClient { // IPC message handlers. void OnUnpackExtensionSucceeded(const base::DictionaryValue& manifest); - void OnUnpackExtensionFailed(const string16& error_message); + void OnUnpackExtensionFailed(const base::string16& error_message); - void ReportFailure(FailureReason reason, const string16& message); + void ReportFailure(FailureReason reason, const base::string16& message); void ReportSuccess(const base::DictionaryValue& original_manifest, const SkBitmap& install_icon); diff --git a/chrome/browser/extensions/sandboxed_unpacker_unittest.cc b/chrome/browser/extensions/sandboxed_unpacker_unittest.cc index 5f7e673..3ab39ae 100644 --- a/chrome/browser/extensions/sandboxed_unpacker_unittest.cc +++ b/chrome/browser/extensions/sandboxed_unpacker_unittest.cc @@ -47,7 +47,7 @@ class MockSandboxedUnpackerClient : public SandboxedUnpackerClient { } - virtual void OnUnpackFailure(const string16& error) OVERRIDE { + virtual void OnUnpackFailure(const base::string16& error) OVERRIDE { ASSERT_TRUE(false); } diff --git a/chrome/browser/extensions/standard_management_policy_provider.cc b/chrome/browser/extensions/standard_management_policy_provider.cc index ae51540..a9a0d34 100644 --- a/chrome/browser/extensions/standard_management_policy_provider.cc +++ b/chrome/browser/extensions/standard_management_policy_provider.cc @@ -33,7 +33,7 @@ std::string bool StandardManagementPolicyProvider::UserMayLoad( const Extension* extension, - string16* error) const { + base::string16* error) const { PrefService* pref_service = prefs_->pref_service(); const base::ListValue* blacklist = @@ -52,13 +52,13 @@ bool StandardManagementPolicyProvider::UserMayLoad( bool StandardManagementPolicyProvider::UserMayModifySettings( const Extension* extension, - string16* error) const { + base::string16* error) const { return admin_policy::UserMayModifySettings(extension, error); } bool StandardManagementPolicyProvider::MustRemainEnabled( const Extension* extension, - string16* error) const { + base::string16* error) const { return admin_policy::MustRemainEnabled(extension, error); } diff --git a/chrome/browser/extensions/standard_management_policy_provider.h b/chrome/browser/extensions/standard_management_policy_provider.h index 5ed53a7..45d4adc 100644 --- a/chrome/browser/extensions/standard_management_policy_provider.h +++ b/chrome/browser/extensions/standard_management_policy_provider.h @@ -25,11 +25,11 @@ class StandardManagementPolicyProvider : public ManagementPolicy::Provider { // ManagementPolicy::Provider implementation. virtual std::string GetDebugPolicyProviderName() const OVERRIDE; virtual bool UserMayLoad(const Extension* extension, - string16* error) const OVERRIDE; + base::string16* error) const OVERRIDE; virtual bool UserMayModifySettings(const Extension* extension, - string16* error) const OVERRIDE; + base::string16* error) const OVERRIDE; virtual bool MustRemainEnabled(const Extension* extension, - string16* error) const OVERRIDE; + base::string16* error) const OVERRIDE; private: ExtensionPrefs* const prefs_; diff --git a/chrome/browser/extensions/standard_management_policy_provider_unittest.cc b/chrome/browser/extensions/standard_management_policy_provider_unittest.cc index 862f95a..f51c27b 100644 --- a/chrome/browser/extensions/standard_management_policy_provider_unittest.cc +++ b/chrome/browser/extensions/standard_management_policy_provider_unittest.cc @@ -55,7 +55,7 @@ TEST_F(StandardManagementPolicyProviderTest, RequiredExtension) { scoped_refptr<const Extension> extension = CreateExtension(Manifest::EXTERNAL_POLICY_DOWNLOAD, true); - string16 error16; + base::string16 error16; EXPECT_TRUE(provider_.UserMayLoad(extension.get(), &error16)); EXPECT_EQ(string16(), error16); @@ -73,7 +73,7 @@ TEST_F(StandardManagementPolicyProviderTest, NotRequiredExtension) { scoped_refptr<const Extension> extension = CreateExtension(Manifest::INTERNAL, false); - string16 error16; + base::string16 error16; EXPECT_TRUE(provider_.UserMayLoad(extension.get(), &error16)); EXPECT_EQ(string16(), error16); EXPECT_TRUE(provider_.UserMayModifySettings(extension.get(), &error16)); diff --git a/chrome/browser/extensions/startup_helper.cc b/chrome/browser/extensions/startup_helper.cc index 6277e5d..9e87260 100644 --- a/chrome/browser/extensions/startup_helper.cc +++ b/chrome/browser/extensions/startup_helper.cc @@ -89,7 +89,7 @@ class ValidateCrxHelper : public SandboxedUnpackerClient { bool finished() { return finished_; } bool success() { return success_; } - const string16& error() { return error_; } + const base::string16& error() { return error_; } void Start() { BrowserThread::PostTask(BrowserThread::FILE, @@ -114,7 +114,7 @@ class ValidateCrxHelper : public SandboxedUnpackerClient { this)); } - virtual void OnUnpackFailure(const string16& error) OVERRIDE { + virtual void OnUnpackFailure(const base::string16& error) OVERRIDE { finished_ = true; success_ = false; error_ = error; @@ -161,7 +161,7 @@ class ValidateCrxHelper : public SandboxedUnpackerClient { bool success_; // If the unpacking wasn't successful, this contains an error message. - string16 error_; + base::string16 error_; }; } // namespace diff --git a/chrome/browser/extensions/suspicious_extension_bubble_controller.cc b/chrome/browser/extensions/suspicious_extension_bubble_controller.cc index 421ef84..836da33 100644 --- a/chrome/browser/extensions/suspicious_extension_bubble_controller.cc +++ b/chrome/browser/extensions/suspicious_extension_bubble_controller.cc @@ -123,15 +123,15 @@ string16 SuspiciousExtensionBubbleController::GetMessageBody() { } string16 SuspiciousExtensionBubbleController::GetOverflowText( - const string16& overflow_count) { - string16 overflow_string = l10n_util::GetStringUTF16( + const base::string16& overflow_count) { + base::string16 overflow_string = l10n_util::GetStringUTF16( IDS_EXTENSIONS_SUSPICIOUS_DISABLED_AND_N_MORE); - string16 new_string; + base::string16 new_string; // Just before string freeze, we checked in # as a substitution value for // this string, whereas we should have used $1. It was discovered too late, // so we do the substitution by hand in that case. - if (overflow_string.find(ASCIIToUTF16("#")) != string16::npos) { + if (overflow_string.find(ASCIIToUTF16("#")) != base::string16::npos) { base::ReplaceChars(overflow_string, ASCIIToUTF16("#").c_str(), overflow_count, &new_string); } else { diff --git a/chrome/browser/extensions/suspicious_extension_bubble_controller.h b/chrome/browser/extensions/suspicious_extension_bubble_controller.h index 0618135..7cd7aa7 100644 --- a/chrome/browser/extensions/suspicious_extension_bubble_controller.h +++ b/chrome/browser/extensions/suspicious_extension_bubble_controller.h @@ -36,11 +36,11 @@ class SuspiciousExtensionBubbleController : public ProfileKeyedAPI { void Show(SuspiciousExtensionBubble* bubble); // Text for various UI labels shown in the bubble. - string16 GetTitle(); - string16 GetMessageBody(); - string16 GetOverflowText(const string16& overflow_count); - string16 GetLearnMoreLabel(); - string16 GetDismissButtonLabel(); + base::string16 GetTitle(); + base::string16 GetMessageBody(); + base::string16 GetOverflowText(const base::string16& overflow_count); + base::string16 GetLearnMoreLabel(); + base::string16 GetDismissButtonLabel(); // Returns a vector of names of suspicious extensions found. std::vector<string16> GetSuspiciousExtensionNames(); diff --git a/chrome/browser/extensions/theme_installed_infobar_delegate.h b/chrome/browser/extensions/theme_installed_infobar_delegate.h index 94727a7..bcc42b4 100644 --- a/chrome/browser/extensions/theme_installed_infobar_delegate.h +++ b/chrome/browser/extensions/theme_installed_infobar_delegate.h @@ -46,9 +46,9 @@ class ThemeInstalledInfoBarDelegate : public ConfirmInfoBarDelegate, virtual Type GetInfoBarType() const OVERRIDE; virtual ThemeInstalledInfoBarDelegate* AsThemePreviewInfobarDelegate() OVERRIDE; - virtual string16 GetMessageText() const OVERRIDE; + virtual base::string16 GetMessageText() const OVERRIDE; virtual int GetButtons() const OVERRIDE; - virtual string16 GetButtonLabel(InfoBarButton button) const OVERRIDE; + virtual base::string16 GetButtonLabel(InfoBarButton button) const OVERRIDE; virtual bool Cancel() OVERRIDE; // content::NotificationObserver: diff --git a/chrome/browser/extensions/unpacked_installer.cc b/chrome/browser/extensions/unpacked_installer.cc index 52de886..eaad27e 100644 --- a/chrome/browser/extensions/unpacked_installer.cc +++ b/chrome/browser/extensions/unpacked_installer.cc @@ -283,7 +283,7 @@ void UnpackedInstaller::ReportExtensionLoadError(const std::string &error) { void UnpackedInstaller::ConfirmInstall() { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); - string16 error = installer_.CheckManagementPolicy(); + base::string16 error = installer_.CheckManagementPolicy(); if (!error.empty()) { ReportExtensionLoadError(UTF16ToUTF8(error)); return; diff --git a/chrome/browser/extensions/webstore_installer.cc b/chrome/browser/extensions/webstore_installer.cc index a2e98d9..b3c28f2 100644 --- a/chrome/browser/extensions/webstore_installer.cc +++ b/chrome/browser/extensions/webstore_installer.cc @@ -390,8 +390,9 @@ void WebstoreInstaller::Observe(int type, return; // TODO(rdevlin.cronin): Continue removing std::string errors and - // replacing with string16. See crbug.com/71980. - const string16* error = content::Details<const string16>(details).ptr(); + // replacing with base::string16. See crbug.com/71980. + const base::string16* error = + content::Details<const base::string16>(details).ptr(); const std::string utf8_error = UTF16ToUTF8(*error); if (download_url_ == crx_installer->original_download_url()) ReportFailure(utf8_error, FAILURE_REASON_OTHER); diff --git a/chrome/browser/external_extension_browsertest.cc b/chrome/browser/external_extension_browsertest.cc index 86ee942..37a28e6 100644 --- a/chrome/browser/external_extension_browsertest.cc +++ b/chrome/browser/external_extension_browsertest.cc @@ -68,7 +68,7 @@ class SearchProviderTest : public InProcessBrowserTest { void FinishIsSearchProviderInstalledTest( const IsSearchProviderTestData& data) { - string16 title = data.tab->GetTitle(); + base::string16 title = data.tab->GetTitle(); if (title.empty()) { content::TitleWatcher title_watcher(data.tab, ASCIIToUTF16("OK")); title_watcher.AlsoWaitForTitle(ASCIIToUTF16("FAIL")); diff --git a/chrome/browser/geolocation/access_token_store_browsertest.cc b/chrome/browser/geolocation/access_token_store_browsertest.cc index 399c104..c10e536 100644 --- a/chrome/browser/geolocation/access_token_store_browsertest.cc +++ b/chrome/browser/geolocation/access_token_store_browsertest.cc @@ -32,8 +32,8 @@ class GeolocationAccessTokenStoreTest : token_to_expect_(NULL), token_to_set_(NULL) {} void DoTestStepAndWaitForResults( - const char* ref_url, const string16* token_to_expect, - const string16* token_to_set); + const char* ref_url, const base::string16* token_to_expect, + const base::string16* token_to_set); void OnAccessTokenStoresLoaded( AccessTokenStore::AccessTokenSet access_token_set, @@ -41,8 +41,8 @@ class GeolocationAccessTokenStoreTest scoped_refptr<AccessTokenStore> token_store_; GURL ref_url_; - const string16* token_to_expect_; - const string16* token_to_set_; + const base::string16* token_to_expect_; + const base::string16* token_to_set_; }; void StartTestStepFromClientThread( @@ -62,8 +62,8 @@ struct TokenLoadClientForTest { }; void GeolocationAccessTokenStoreTest::DoTestStepAndWaitForResults( - const char* ref_url, const string16* token_to_expect, - const string16* token_to_set) { + const char* ref_url, const base::string16* token_to_expect, + const base::string16* token_to_set) { ref_url_ = GURL(ref_url); token_to_expect_ = token_to_expect; token_to_set_ = token_to_set; @@ -104,8 +104,8 @@ void GeolocationAccessTokenStoreTest::OnAccessTokenStoresLoaded( } IN_PROC_BROWSER_TEST_F(GeolocationAccessTokenStoreTest, SetAcrossInstances) { - const string16 ref_token1 = ASCIIToUTF16("jksdfo90,'s#\"#1*("); - const string16 ref_token2 = ASCIIToUTF16("\1\2\3\4\5\6\7\10\11\12=023"); + const base::string16 ref_token1 = ASCIIToUTF16("jksdfo90,'s#\"#1*("); + const base::string16 ref_token2 = ASCIIToUTF16("\1\2\3\4\5\6\7\10\11\12=023"); ASSERT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::UI)); DoTestStepAndWaitForResults(kRefServerUrl1, NULL, &ref_token1); @@ -122,7 +122,7 @@ IN_PROC_BROWSER_TEST_F(GeolocationAccessTokenStoreTest, SetAcrossInstances) { } IN_PROC_BROWSER_TEST_F(GeolocationAccessTokenStoreTest, OldUrlRemoval) { - const string16 ref_token1 = ASCIIToUTF16("jksdfo90,'s#\"#1*("); + const base::string16 ref_token1 = ASCIIToUTF16("jksdfo90,'s#\"#1*("); ASSERT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::UI)); // Set a token for the old default network provider url. diff --git a/chrome/browser/geolocation/chrome_access_token_store.cc b/chrome/browser/geolocation/chrome_access_token_store.cc index 00b9098..1db095d 100644 --- a/chrome/browser/geolocation/chrome_access_token_store.cc +++ b/chrome/browser/geolocation/chrome_access_token_store.cc @@ -113,7 +113,7 @@ void ChromeAccessTokenStore::LoadAccessTokens( ChromeAccessTokenStore::~ChromeAccessTokenStore() {} static void SetAccessTokenOnUIThread(const GURL& server_url, - const string16& token) { + const base::string16& token) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DictionaryPrefUpdate update(g_browser_process->local_state(), prefs::kGeolocationAccessToken); @@ -122,8 +122,9 @@ static void SetAccessTokenOnUIThread(const GURL& server_url, server_url.spec(), Value::CreateStringValue(token)); } -void ChromeAccessTokenStore::SaveAccessToken(const GURL& server_url, - const string16& access_token) { +void ChromeAccessTokenStore::SaveAccessToken( + const GURL& server_url, + const base::string16& access_token) { BrowserThread::PostTask( BrowserThread::UI, FROM_HERE, base::Bind(&SetAccessTokenOnUIThread, server_url, access_token)); diff --git a/chrome/browser/geolocation/chrome_access_token_store.h b/chrome/browser/geolocation/chrome_access_token_store.h index ab7bada..b7b24c0 100644 --- a/chrome/browser/geolocation/chrome_access_token_store.h +++ b/chrome/browser/geolocation/chrome_access_token_store.h @@ -25,7 +25,7 @@ class ChromeAccessTokenStore : public content::AccessTokenStore { // AccessTokenStore virtual void SaveAccessToken( - const GURL& server_url, const string16& access_token) OVERRIDE; + const GURL& server_url, const base::string16& access_token) OVERRIDE; DISALLOW_COPY_AND_ASSIGN(ChromeAccessTokenStore); }; diff --git a/chrome/browser/geolocation/chrome_geolocation_permission_context_unittest.cc b/chrome/browser/geolocation/chrome_geolocation_permission_context_unittest.cc index 3c7664a..032d017 100644 --- a/chrome/browser/geolocation/chrome_geolocation_permission_context_unittest.cc +++ b/chrome/browser/geolocation/chrome_geolocation_permission_context_unittest.cc @@ -279,7 +279,7 @@ TEST_F(GeolocationPermissionContextTests, GeolocationEnabledDisabled) { ConfirmInfoBarDelegate* infobar_delegate_0 = infobar_service()-> infobar_at(0)->delegate()->AsConfirmInfoBarDelegate(); ASSERT_TRUE(infobar_delegate_0); - string16 text_0 = infobar_delegate_0->GetButtonLabel( + base::string16 text_0 = infobar_delegate_0->GetButtonLabel( ConfirmInfoBarDelegate::BUTTON_OK); NavigateAndCommit(requesting_frame); @@ -290,7 +290,7 @@ TEST_F(GeolocationPermissionContextTests, GeolocationEnabledDisabled) { ConfirmInfoBarDelegate* infobar_delegate_1 = infobar_service()-> infobar_at(0)->delegate()->AsConfirmInfoBarDelegate(); ASSERT_TRUE(infobar_delegate_1); - string16 text_1 = infobar_delegate_1->GetButtonLabel( + base::string16 text_1 = infobar_delegate_1->GetButtonLabel( ConfirmInfoBarDelegate::BUTTON_OK); EXPECT_NE(text_0, text_1); @@ -355,7 +355,7 @@ TEST_F(GeolocationPermissionContextTests, QueuedPermission) { ConfirmInfoBarDelegate* infobar_delegate_0 = infobar_0->delegate()->AsConfirmInfoBarDelegate(); ASSERT_TRUE(infobar_delegate_0); - string16 text_0 = infobar_delegate_0->GetMessageText(); + base::string16 text_0 = infobar_delegate_0->GetMessageText(); // Accept the first frame. infobar_delegate_0->Accept(); @@ -373,7 +373,7 @@ TEST_F(GeolocationPermissionContextTests, QueuedPermission) { ConfirmInfoBarDelegate* infobar_delegate_1 = infobar_1->delegate()->AsConfirmInfoBarDelegate(); ASSERT_TRUE(infobar_delegate_1); - string16 text_1 = infobar_delegate_1->GetMessageText(); + base::string16 text_1 = infobar_delegate_1->GetMessageText(); EXPECT_NE(text_0, text_1); // Cancel (block) this frame. @@ -474,7 +474,7 @@ TEST_F(GeolocationPermissionContextTests, CancelGeolocationPermissionRequest) { ConfirmInfoBarDelegate* infobar_delegate_0 = infobar_0->delegate()->AsConfirmInfoBarDelegate(); ASSERT_TRUE(infobar_delegate_0); - string16 text_0 = infobar_delegate_0->GetMessageText(); + base::string16 text_0 = infobar_delegate_0->GetMessageText(); // Simulate the frame going away, ensure the infobar for this frame // is removed and the next pending infobar is created. @@ -488,7 +488,7 @@ TEST_F(GeolocationPermissionContextTests, CancelGeolocationPermissionRequest) { ConfirmInfoBarDelegate* infobar_delegate_1 = infobar_1->delegate()->AsConfirmInfoBarDelegate(); ASSERT_TRUE(infobar_delegate_1); - string16 text_1 = infobar_delegate_1->GetMessageText(); + base::string16 text_1 = infobar_delegate_1->GetMessageText(); EXPECT_NE(text_0, text_1); // Allow this frame. diff --git a/chrome/browser/geolocation/geolocation_browsertest.cc b/chrome/browser/geolocation/geolocation_browsertest.cc index caa9231..1a6ff11 100644 --- a/chrome/browser/geolocation/geolocation_browsertest.cc +++ b/chrome/browser/geolocation/geolocation_browsertest.cc @@ -90,7 +90,7 @@ IFrameLoader::IFrameLoader(Browser* browser, int iframe_id, const GURL& url) "window.domAutomationController.send(addIFrame(%d, \"%s\"));", iframe_id, url.spec().c_str())); web_contents->GetRenderViewHost()->ExecuteJavascriptInWebFrame( - string16(), UTF8ToUTF16(script)); + base::string16(), UTF8ToUTF16(script)); content::RunMessageLoop(); EXPECT_EQ(base::StringPrintf("\"%d\"", iframe_id), javascript_response_); diff --git a/chrome/browser/geolocation/geolocation_infobar_delegate.h b/chrome/browser/geolocation/geolocation_infobar_delegate.h index 342b821..94a0efb 100644 --- a/chrome/browser/geolocation/geolocation_infobar_delegate.h +++ b/chrome/browser/geolocation/geolocation_infobar_delegate.h @@ -55,10 +55,10 @@ class GeolocationInfoBarDelegate : 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 Cancel() OVERRIDE; - virtual string16 GetLinkText() const OVERRIDE; + virtual base::string16 GetLinkText() const OVERRIDE; virtual bool LinkClicked(WindowOpenDisposition disposition) OVERRIDE; PermissionQueueController* controller_; diff --git a/chrome/browser/geolocation/geolocation_infobar_delegate_android.h b/chrome/browser/geolocation/geolocation_infobar_delegate_android.h index bca3425..3365656 100644 --- a/chrome/browser/geolocation/geolocation_infobar_delegate_android.h +++ b/chrome/browser/geolocation/geolocation_infobar_delegate_android.h @@ -23,7 +23,7 @@ class GeolocationInfoBarDelegateAndroid : public GeolocationInfoBarDelegate { virtual ~GeolocationInfoBarDelegateAndroid(); // ConfirmInfoBarDelegate: - virtual string16 GetButtonLabel(InfoBarButton button) const OVERRIDE; + virtual base::string16 GetButtonLabel(InfoBarButton button) const OVERRIDE; virtual bool Accept() OVERRIDE; scoped_ptr<GoogleLocationSettingsHelper> google_location_settings_helper_; diff --git a/chrome/browser/google/google_update_win.cc b/chrome/browser/google/google_update_win.cc index 36358d4..18688cc 100644 --- a/chrome/browser/google/google_update_win.cc +++ b/chrome/browser/google/google_update_win.cc @@ -56,7 +56,7 @@ GoogleUpdateErrorCode CanUpdateCurrentChrome( return CANNOT_UPGRADE_CHROME_IN_THIS_DIRECTORY; } - string16 app_guid = installer::GetAppGuidForUpdates( + base::string16 app_guid = installer::GetAppGuidForUpdates( !InstallUtil::IsPerUserInstall(chrome_exe_path.value().c_str())); DCHECK(!app_guid.empty()); @@ -90,7 +90,7 @@ HRESULT CoCreateInstanceAsAdmin(REFCLSID class_id, REFIID interface_id, StringFromGUID2(class_id, class_id_as_string, arraysize(class_id_as_string)); - string16 elevation_moniker_name = + base::string16 elevation_moniker_name = base::StringPrintf(L"Elevation:Administrator!new:%ls", class_id_as_string); @@ -217,10 +217,10 @@ class GoogleUpdateJobObserver GoogleUpdateUpgradeResult result_; // The version string Google Update found. - string16 new_version_; + base::string16 new_version_; // An error message, if any. - string16 error_message_; + base::string16 error_message_; // Allows us control the upgrade process to a small degree. After OnComplete // has been called, this object can not be used. @@ -261,7 +261,7 @@ void GoogleUpdate::InitiateGoogleUpdateCheck(bool install_if_newer, main_loop->PostTask( FROM_HERE, base::Bind(&GoogleUpdate::ReportResults, this, - UPGRADE_ERROR, error_code, string16())); + UPGRADE_ERROR, error_code, base::string16())); return; } @@ -275,7 +275,7 @@ void GoogleUpdate::InitiateGoogleUpdateCheck(bool install_if_newer, // Most of the error messages come straight from Google Update. This one is // deemed worthy enough to also warrant its own error. GoogleUpdateErrorCode error = GOOGLE_UPDATE_JOB_SERVER_CREATION_FAILED; - string16 error_code = base::StringPrintf(L"%d: 0x%x", error, hr); + base::string16 error_code = base::StringPrintf(L"%d: 0x%x", error, hr); ReportFailure( hr, error, l10n_util::GetStringFUTF16(IDS_ABOUT_BOX_ERROR_UPDATE_CHECK_FAILED, @@ -308,7 +308,7 @@ void GoogleUpdate::InitiateGoogleUpdateCheck(bool install_if_newer, if (hr != S_OK) { GoogleUpdateErrorCode error = GOOGLE_UPDATE_ONDEMAND_CLASS_NOT_FOUND; - string16 error_code = base::StringPrintf(L"%d: 0x%x", error, hr); + base::string16 error_code = base::StringPrintf(L"%d: 0x%x", error, hr); if (system_level) error_code += L" -- system level"; ReportFailure(hr, error, @@ -319,7 +319,7 @@ void GoogleUpdate::InitiateGoogleUpdateCheck(bool install_if_newer, return; } - string16 app_guid = installer::GetAppGuidForUpdates(system_level); + base::string16 app_guid = installer::GetAppGuidForUpdates(system_level); DCHECK(!app_guid.empty()); if (!install_if_newer) @@ -329,7 +329,7 @@ void GoogleUpdate::InitiateGoogleUpdateCheck(bool install_if_newer, if (hr != S_OK) { GoogleUpdateErrorCode error = GOOGLE_UPDATE_ONDEMAND_CLASS_REPORTED_ERROR; - string16 error_code = base::StringPrintf(L"%d: 0x%x", error, hr); + base::string16 error_code = base::StringPrintf(L"%d: 0x%x", error, hr); ReportFailure(hr, error, l10n_util::GetStringFUTF16( IDS_ABOUT_BOX_ERROR_UPDATE_CHECK_FAILED, @@ -349,7 +349,7 @@ void GoogleUpdate::InitiateGoogleUpdateCheck(bool install_if_newer, if (hr != S_OK) { GoogleUpdateErrorCode error = GOOGLE_UPDATE_GET_RESULT_CALL_FAILED; - string16 error_code = base::StringPrintf(L"%d: 0x%x", error, hr); + base::string16 error_code = base::StringPrintf(L"%d: 0x%x", error, hr); ReportFailure(hr, error, l10n_util::GetStringFUTF16( IDS_ABOUT_BOX_ERROR_UPDATE_CHECK_FAILED, @@ -359,7 +359,7 @@ void GoogleUpdate::InitiateGoogleUpdateCheck(bool install_if_newer, } if (results == UPGRADE_ERROR) { - string16 error_message; + base::string16 error_message; job_observer->GetErrorMessage(&error_message); ReportFailure(hr, GOOGLE_UPDATE_ERROR_UPDATING, error_message, main_loop); return; @@ -368,7 +368,7 @@ void GoogleUpdate::InitiateGoogleUpdateCheck(bool install_if_newer, hr = job_observer->GetVersionInfo(&version_available_); if (hr != S_OK) { GoogleUpdateErrorCode error = GOOGLE_UPDATE_GET_VERSION_INFO_FAILED; - string16 error_code = base::StringPrintf(L"%d: 0x%x", error, hr); + base::string16 error_code = base::StringPrintf(L"%d: 0x%x", error, hr); ReportFailure(hr, error, l10n_util::GetStringFUTF16( IDS_ABOUT_BOX_ERROR_UPDATE_CHECK_FAILED, @@ -380,14 +380,14 @@ void GoogleUpdate::InitiateGoogleUpdateCheck(bool install_if_newer, main_loop->PostTask( FROM_HERE, base::Bind(&GoogleUpdate::ReportResults, this, - results, GOOGLE_UPDATE_NO_ERROR, string16())); + results, GOOGLE_UPDATE_NO_ERROR, base::string16())); job_holder = NULL; on_demand = NULL; } void GoogleUpdate::ReportResults(GoogleUpdateUpgradeResult results, GoogleUpdateErrorCode error_code, - const string16& error_message) { + const base::string16& error_message) { // If there is an error, then error code must not be blank, and vice versa. DCHECK(results == UPGRADE_ERROR ? error_code != GOOGLE_UPDATE_NO_ERROR : error_code == GOOGLE_UPDATE_NO_ERROR); @@ -399,7 +399,7 @@ void GoogleUpdate::ReportResults(GoogleUpdateUpgradeResult results, bool GoogleUpdate::ReportFailure(HRESULT hr, GoogleUpdateErrorCode error_code, - const string16& error_message, + const base::string16& error_message, base::MessageLoop* main_loop) { NOTREACHED() << "Communication with Google Update failed: " << hr << " error: " << error_code diff --git a/chrome/browser/google/google_update_win.h b/chrome/browser/google/google_update_win.h index 06e5fe2..01886eb 100644 --- a/chrome/browser/google/google_update_win.h +++ b/chrome/browser/google/google_update_win.h @@ -77,8 +77,8 @@ class GoogleUpdateStatusListener { // server config for Chrome) is blank. virtual void OnReportResults(GoogleUpdateUpgradeResult results, GoogleUpdateErrorCode error_code, - const string16& error_message, - const string16& version) = 0; + const base::string16& error_message, + const base::string16& version) = 0; }; //////////////////////////////////////////////////////////////////////////////// @@ -115,7 +115,7 @@ class GoogleUpdate : public base::RefCountedThreadSafe<GoogleUpdate> { // listener. // Note, after this function completes, this object will have deleted itself. bool ReportFailure(HRESULT hr, GoogleUpdateErrorCode error_code, - const string16& error_message, + const base::string16& error_message, base::MessageLoop* main_loop); // The update check needs to run on another thread than the main thread, and @@ -132,11 +132,11 @@ class GoogleUpdate : public base::RefCountedThreadSafe<GoogleUpdate> { // Note, after this function completes, this object will have deleted itself. void ReportResults(GoogleUpdateUpgradeResult results, GoogleUpdateErrorCode error_code, - const string16& error_message); + const base::string16& error_message); // Which version string Google Update found (if a new one was available). // Otherwise, this will be blank. - string16 version_available_; + base::string16 version_available_; // The listener who is interested in finding out the result of the operation. GoogleUpdateStatusListener* listener_; diff --git a/chrome/browser/google/google_url_tracker.cc b/chrome/browser/google/google_url_tracker.cc index c6160af..81cb919 100644 --- a/chrome/browser/google/google_url_tracker.cc +++ b/chrome/browser/google/google_url_tracker.cc @@ -155,7 +155,7 @@ void GoogleURLTracker::OnURLFetchComplete(const net::URLFetcher* source) { return; } - string16 fetched_host(net::StripWWWFromHost(fetched_google_url_)); + base::string16 fetched_host(net::StripWWWFromHost(fetched_google_url_)); if (fetched_google_url_ == google_url_) { // Either the user has continually been on this URL, or we prompted for a // different URL but have now changed back before they responded to any of diff --git a/chrome/browser/google/google_url_tracker_infobar_delegate.h b/chrome/browser/google/google_url_tracker_infobar_delegate.h index 36b482a..cbeab03 100644 --- a/chrome/browser/google/google_url_tracker_infobar_delegate.h +++ b/chrome/browser/google/google_url_tracker_infobar_delegate.h @@ -41,9 +41,9 @@ class GoogleURLTrackerInfoBarDelegate : public ConfirmInfoBarDelegate { private: // ConfirmInfoBarDelegate: - virtual string16 GetMessageText() const OVERRIDE; - virtual string16 GetButtonLabel(InfoBarButton button) const OVERRIDE; - virtual string16 GetLinkText() const OVERRIDE; + virtual base::string16 GetMessageText() const OVERRIDE; + virtual base::string16 GetButtonLabel(InfoBarButton button) const OVERRIDE; + virtual base::string16 GetLinkText() const OVERRIDE; virtual bool LinkClicked(WindowOpenDisposition disposition) OVERRIDE; virtual bool ShouldExpireInternal( const content::LoadCommittedDetails& details) const OVERRIDE; diff --git a/chrome/browser/google/google_util.cc b/chrome/browser/google/google_util.cc index 99e4b7a..fe4c9df 100644 --- a/chrome/browser/google/google_util.cc +++ b/chrome/browser/google/google_util.cc @@ -112,7 +112,7 @@ bool GetBrand(std::string* brand) { return true; } - string16 brand16; + base::string16 brand16; bool ret = GoogleUpdateSettings::GetBrand(&brand16); if (ret) brand->assign(WideToASCII(brand16)); @@ -120,7 +120,7 @@ bool GetBrand(std::string* brand) { } bool GetReactivationBrand(std::string* brand) { - string16 brand16; + base::string16 brand16; bool ret = GoogleUpdateSettings::GetReactivationBrand(&brand16); if (ret) brand->assign(WideToASCII(brand16)); diff --git a/chrome/browser/history/android/android_cache_database.cc b/chrome/browser/history/android/android_cache_database.cc index 1fdd981..5df7951 100644 --- a/chrome/browser/history/android/android_cache_database.cc +++ b/chrome/browser/history/android/android_cache_database.cc @@ -108,7 +108,7 @@ bool AndroidCacheDatabase::SetFaviconID(URLID url_id, } SearchTermID AndroidCacheDatabase::AddSearchTerm( - const string16& term, + const base::string16& term, const base::Time& last_visit_time) { sql::Statement statement(GetDB().GetCachedStatement(SQL_FROM_HERE, "INSERT INTO android_cache_db.search_terms (search, " @@ -139,7 +139,7 @@ bool AndroidCacheDatabase::UpdateSearchTerm(SearchTermID id, return statement.Run(); } -SearchTermID AndroidCacheDatabase::GetSearchTerm(const string16& term, +SearchTermID AndroidCacheDatabase::GetSearchTerm(const base::string16& term, SearchTermRow* row) { sql::Statement statement(GetDB().GetCachedStatement(SQL_FROM_HERE, "SELECT _id, search, date " diff --git a/chrome/browser/history/android/android_cache_database.h b/chrome/browser/history/android/android_cache_database.h index 4f4dd19..314e0d1 100644 --- a/chrome/browser/history/android/android_cache_database.h +++ b/chrome/browser/history/android/android_cache_database.h @@ -49,7 +49,7 @@ class AndroidCacheDatabase { // Add a row in the search_term table with the given |term| and // |last_visit_time|. Return the new row's id on success, otherwise 0 is // returned. - SearchTermID AddSearchTerm(const string16& term, + SearchTermID AddSearchTerm(const base::string16& term, const base::Time& last_visit_time); // Updates the |id|'s row with the given |row|; returns true on success. @@ -58,7 +58,7 @@ class AndroidCacheDatabase { // Get SearchTermRow of the given |term|; return the row id on success. // otherwise 0 is returned. // The found row is return in |row| if it is not NULL. - SearchTermID GetSearchTerm(const string16& term, SearchTermRow* row); + SearchTermID GetSearchTerm(const base::string16& term, SearchTermRow* row); // Delete the search terms which don't exist in keyword_search_terms table. bool DeleteUnusedSearchTerms(); diff --git a/chrome/browser/history/android/android_cache_database_unittest.cc b/chrome/browser/history/android/android_cache_database_unittest.cc index e586874..e56e3e9 100644 --- a/chrome/browser/history/android/android_cache_database_unittest.cc +++ b/chrome/browser/history/android/android_cache_database_unittest.cc @@ -73,7 +73,7 @@ TEST_F(AndroidCacheDatabaseTest, InitAndroidCacheDatabase) { TEST_F(AndroidCacheDatabaseTest, SearchTermsTable) { // Test AddSearchTerm. Time search_time1 = Time::Now() - TimeDelta::FromDays(1); - string16 search_term1(UTF8ToUTF16("search term 1")); + base::string16 search_term1(UTF8ToUTF16("search term 1")); SearchTermID id1 = history_db_.AddSearchTerm(search_term1, search_time1); ASSERT_TRUE(id1); SearchTermRow row1; @@ -95,7 +95,7 @@ TEST_F(AndroidCacheDatabaseTest, SearchTermsTable) { EXPECT_EQ(id1, row1.id); Time search_time2 = Time::Now() - TimeDelta::FromHours(1); - string16 search_term2(UTF8ToUTF16("search term 2")); + base::string16 search_term2(UTF8ToUTF16("search term 2")); SearchTermID id2 = history_db_.AddSearchTerm(search_term2, search_time2); ASSERT_TRUE(id2); ASSERT_TRUE(history_db_.SetKeywordSearchTermsForURL(1, 1, search_term2)); diff --git a/chrome/browser/history/android/android_history_types.h b/chrome/browser/history/android/android_history_types.h index 843f465..8bef571e 100644 --- a/chrome/browser/history/android/android_history_types.h +++ b/chrome/browser/history/android/android_history_types.h @@ -72,11 +72,11 @@ class HistoryAndBookmarkRow { } // The title of page. - void set_title(const string16& title) { + void set_title(const base::string16& title) { set_value_explicitly(TITLE); title_ = title; } - const string16& title() const { + const base::string16& title() const { return title_; } @@ -169,7 +169,7 @@ class HistoryAndBookmarkRow { AndroidURLID id_; GURL url_; std::string raw_url_; - string16 title_; + base::string16 title_; base::Time created_; base::Time last_visit_time_; scoped_refptr<base::RefCountedMemory> favicon_; @@ -219,10 +219,10 @@ class SearchRow { id_ = id; } - const string16& search_term() const { + const base::string16& search_term() const { return search_term_; } - void set_search_term(const string16& search_term) { + void set_search_term(const base::string16& search_term) { set_value_explicitly(SearchRow::SEARCH_TERM); search_term_ = search_term; } @@ -262,7 +262,7 @@ class SearchRow { } SearchTermID id_; - string16 search_term_; + base::string16 search_term_; base::Time search_time_; GURL url_; TemplateURLID template_url_id_; @@ -294,7 +294,7 @@ struct SearchTermRow { // The unique id of the row. SearchTermID id; // The keyword. - string16 term; + base::string16 term; // The last visit time. base::Time last_visit_time; }; diff --git a/chrome/browser/history/android/android_provider_backend.cc b/chrome/browser/history/android/android_provider_backend.cc index ff69a0e..599e9dc 100644 --- a/chrome/browser/history/android/android_provider_backend.cc +++ b/chrome/browser/history/android/android_provider_backend.cc @@ -827,7 +827,7 @@ bool AndroidProviderBackend::UpdateSearchTermTable() { sql::Statement statement(db_->GetCachedStatement(SQL_FROM_HERE, kSearchTermUpdateClause)); while (statement.Step()) { - string16 term = statement.ColumnString16(0); + base::string16 term = statement.ColumnString16(0); Time last_visit_time = Time::FromInternalValue(statement.ColumnInt64(1)); SearchTermRow search_term_row; if (history_db_->GetSearchTerm(term, &search_term_row)) { diff --git a/chrome/browser/history/android/android_provider_backend_unittest.cc b/chrome/browser/history/android/android_provider_backend_unittest.cc index 0d3d1c7..16145f1 100644 --- a/chrome/browser/history/android/android_provider_backend_unittest.cc +++ b/chrome/browser/history/android/android_provider_backend_unittest.cc @@ -149,7 +149,7 @@ class AndroidProviderBackendTest : public testing::Test { void AddBookmark(const GURL& url) { const BookmarkNode* mobile_node = bookmark_model_->mobile_node(); ASSERT_TRUE(mobile_node); - ASSERT_TRUE(bookmark_model_->AddURL(mobile_node, 0, string16(), url)); + ASSERT_TRUE(bookmark_model_->AddURL(mobile_node, 0, base::string16(), url)); } bool GetAndroidURLsRows(std::vector<AndroidURLRow>* rows, @@ -227,7 +227,7 @@ TEST_F(AndroidProviderBackendTest, UpdateTables) { // Add a bookmark which is not in the history. GURL url3("http://www.bookmark.com"); - string16 title3(UTF8ToUTF16("bookmark")); + base::string16 title3(UTF8ToUTF16("bookmark")); ASSERT_TRUE(bookmark_model_->AddURL(bookmark_model_->bookmark_bar_node(), 0, title3, url3)); // Only use the HistoryBackend to generate the test data. @@ -354,7 +354,7 @@ TEST_F(AndroidProviderBackendTest, UpdateTables) { TEST_F(AndroidProviderBackendTest, QueryHistoryAndBookmarks) { GURL url1("http://www.cnn.com"); URLID url_id1 = 0; - const string16 title1(UTF8ToUTF16("cnn")); + const base::string16 title1(UTF8ToUTF16("cnn")); std::vector<VisitInfo> visits1; Time last_visited1 = Time::Now() - TimeDelta::FromDays(1); Time created1 = last_visited1 - TimeDelta::FromDays(20); @@ -366,7 +366,7 @@ TEST_F(AndroidProviderBackendTest, QueryHistoryAndBookmarks) { GURL url2("http://www.example.com"); URLID url_id2 = 0; std::vector<VisitInfo> visits2; - const string16 title2(UTF8ToUTF16("example")); + const base::string16 title2(UTF8ToUTF16("example")); Time last_visited2 = Time::Now(); Time created2 = last_visited2 - TimeDelta::FromDays(10); visits2.push_back(VisitInfo(created2, content::PAGE_TRANSITION_LINK)); @@ -1195,7 +1195,7 @@ TEST_F(AndroidProviderBackendTest, UpdateSearchTermTable) { row1.set_last_visit_time(Time::Now() - TimeDelta::FromDays(1)); row1.set_title(UTF8ToUTF16("cnn")); ASSERT_TRUE(backend->InsertHistoryAndBookmark(row1)); - string16 term = UTF8ToUTF16("Search term 1"); + base::string16 term = UTF8ToUTF16("Search term 1"); URLID url_id = history_db_.GetRowForURL(row1.url(), NULL); ASSERT_TRUE(url_id); ASSERT_TRUE(history_db_.SetKeywordSearchTermsForURL(url_id, 1, term)); @@ -1216,7 +1216,7 @@ TEST_F(AndroidProviderBackendTest, UpdateSearchTermTable) { ASSERT_TRUE(backend->InsertHistoryAndBookmark(row2)); url_id = history_db_.GetRowForURL(row2.url(), NULL); ASSERT_TRUE(url_id); - string16 term2 = UTF8ToUTF16("Search term 2"); + base::string16 term2 = UTF8ToUTF16("Search term 2"); ASSERT_TRUE(history_db_.SetKeywordSearchTermsForURL(url_id, 1, term2)); ASSERT_TRUE(backend->UpdateSearchTermTable()); SearchTermID search_id1 = history_db_.GetSearchTerm(term, @@ -1273,7 +1273,7 @@ TEST_F(AndroidProviderBackendTest, QuerySearchTerms) { row1.set_last_visit_time(Time::Now() - TimeDelta::FromDays(1)); row1.set_title(UTF8ToUTF16("cnn")); ASSERT_TRUE(backend->InsertHistoryAndBookmark(row1)); - string16 term = UTF8ToUTF16("Search term 1"); + base::string16 term = UTF8ToUTF16("Search term 1"); URLID url_id = history_db_.GetRowForURL(row1.url(), NULL); ASSERT_TRUE(url_id); ASSERT_TRUE(history_db_.SetKeywordSearchTermsForURL(url_id, 1, term)); @@ -1306,7 +1306,7 @@ TEST_F(AndroidProviderBackendTest, UpdateSearchTerms) { row1.set_last_visit_time(Time::Now() - TimeDelta::FromDays(1)); row1.set_title(UTF8ToUTF16("cnn")); ASSERT_TRUE(backend->InsertHistoryAndBookmark(row1)); - string16 term = UTF8ToUTF16("Search term 1"); + base::string16 term = UTF8ToUTF16("Search term 1"); URLID url_id = history_db_.GetRowForURL(row1.url(), NULL); ASSERT_TRUE(url_id); ASSERT_TRUE(history_db_.SetKeywordSearchTermsForURL(url_id, 1, term)); @@ -1327,7 +1327,7 @@ TEST_F(AndroidProviderBackendTest, UpdateSearchTerms) { EXPECT_FALSE(statement->statement()->Step()); // Update the search term and time. - string16 update_term = UTF8ToUTF16("Update search term"); + base::string16 update_term = UTF8ToUTF16("Update search term"); args.clear(); args.push_back(term); SearchRow search_row; @@ -1410,7 +1410,7 @@ TEST_F(AndroidProviderBackendTest, DeleteSearchTerms) { row1.set_last_visit_time(Time::Now() - TimeDelta::FromDays(1)); row1.set_title(UTF8ToUTF16("cnn")); ASSERT_TRUE(backend->InsertHistoryAndBookmark(row1)); - string16 term = UTF8ToUTF16("Search term 1"); + base::string16 term = UTF8ToUTF16("Search term 1"); URLID url_id = history_db_.GetRowForURL(row1.url(), NULL); ASSERT_TRUE(url_id); ASSERT_TRUE(history_db_.SetKeywordSearchTermsForURL(url_id, 1, term)); @@ -1437,7 +1437,7 @@ TEST_F(AndroidProviderBackendTest, DeleteSearchTerms) { row2.set_last_visit_time(Time::Now() - TimeDelta::FromDays(1)); row2.set_title(UTF8ToUTF16("google")); ASSERT_TRUE(backend->InsertHistoryAndBookmark(row2)); - string16 term2 = UTF8ToUTF16("Search term 2"); + base::string16 term2 = UTF8ToUTF16("Search term 2"); URLID url_id2 = history_db_.GetRowForURL(row2.url(), NULL); ASSERT_TRUE(url_id2); ASSERT_TRUE(history_db_.SetKeywordSearchTermsForURL(url_id2, 1, term2)); @@ -1751,7 +1751,7 @@ TEST_F(AndroidProviderBackendTest, AndroidCTSComplianceFolderColumnExists) { TEST_F(AndroidProviderBackendTest, QueryWithoutThumbnailDB) { GURL url1("http://www.cnn.com"); URLID url_id1 = 0; - const string16 title1(UTF8ToUTF16("cnn")); + const base::string16 title1(UTF8ToUTF16("cnn")); std::vector<VisitInfo> visits1; Time last_visited1 = Time::Now() - TimeDelta::FromDays(1); Time created1 = last_visited1 - TimeDelta::FromDays(20); @@ -1763,7 +1763,7 @@ TEST_F(AndroidProviderBackendTest, QueryWithoutThumbnailDB) { GURL url2("http://www.example.com"); URLID url_id2 = 0; std::vector<VisitInfo> visits2; - const string16 title2(UTF8ToUTF16("example")); + const base::string16 title2(UTF8ToUTF16("example")); Time last_visited2 = Time::Now(); Time created2 = last_visited2 - TimeDelta::FromDays(10); visits2.push_back(VisitInfo(created2, content::PAGE_TRANSITION_LINK)); diff --git a/chrome/browser/history/android/bookmark_model_sql_handler.cc b/chrome/browser/history/android/bookmark_model_sql_handler.cc index 98e2460..446d2af 100644 --- a/chrome/browser/history/android/bookmark_model_sql_handler.cc +++ b/chrome/browser/history/android/bookmark_model_sql_handler.cc @@ -31,7 +31,7 @@ BookmarkModelSQLHandler::Task::Task() { void BookmarkModelSQLHandler::Task::AddBookmarkToMobileFolder( const GURL& url, - const string16& title) { + const base::string16& title) { BookmarkModel* bookmark_model = GetBookmarkModel(); if (!bookmark_model) return; @@ -41,7 +41,7 @@ void BookmarkModelSQLHandler::Task::AddBookmarkToMobileFolder( } void BookmarkModelSQLHandler::Task::AddBookmark(const GURL& url, - const string16& title, + const base::string16& title, int64 parent_id) { BookmarkModel* bookmark_model = GetBookmarkModel(); if (!bookmark_model) @@ -64,8 +64,9 @@ void BookmarkModelSQLHandler::Task::RemoveBookmark(const GURL& url) { } } -void BookmarkModelSQLHandler::Task::UpdateBookmarkTitle(const GURL& url, - const string16&title) { +void BookmarkModelSQLHandler::Task::UpdateBookmarkTitle( + const GURL& url, + const base::string16& title) { BookmarkModel* bookmark_model = GetBookmarkModel(); if (!bookmark_model) return; @@ -170,4 +171,4 @@ bool BookmarkModelSQLHandler::Insert(HistoryAndBookmarkRow* row) { return true; } -} // namespace history. +} // namespace history diff --git a/chrome/browser/history/android/bookmark_model_sql_handler.h b/chrome/browser/history/android/bookmark_model_sql_handler.h index 672cf4d..f2a5ef7 100644 --- a/chrome/browser/history/android/bookmark_model_sql_handler.h +++ b/chrome/browser/history/android/bookmark_model_sql_handler.h @@ -42,16 +42,20 @@ class BookmarkModelSQLHandler : public SQLHandler { Task(); // Add the a bookmark with the given |url| to mobile folder. - void AddBookmarkToMobileFolder(const GURL& url, const string16& title); + void AddBookmarkToMobileFolder(const GURL& url, + const base::string16& title); // Adds a bookmark with the given |url|, |title| and |parent_id|. - void AddBookmark(const GURL& url, const string16& title, int64 parent_id); + void AddBookmark(const GURL& url, + const base::string16& title, + int64 parent_id); // Removes the bookmark with the given |url|. void RemoveBookmark(const GURL& url); // Updates the given bookmark's title. - void UpdateBookmarkTitle(const GURL& url, const string16&title); + void UpdateBookmarkTitle(const GURL& url, + const base::string16& title); private: friend class base::RefCountedThreadSafe<Task>; diff --git a/chrome/browser/history/android/sqlite_cursor.cc b/chrome/browser/history/android/sqlite_cursor.cc index 36cc882..53e9ef5 100644 --- a/chrome/browser/history/android/sqlite_cursor.cc +++ b/chrome/browser/history/android/sqlite_cursor.cc @@ -80,7 +80,7 @@ ScopedJavaLocalRef<jobjectArray> SQLiteCursor::GetColumnNames(JNIEnv* env, ScopedJavaLocalRef<jstring> SQLiteCursor::GetString(JNIEnv* env, jobject obj, jint column) { - string16 value = statement_->statement()->ColumnString16(column); + base::string16 value = statement_->statement()->ColumnString16(column); return ScopedJavaLocalRef<jstring>(env, env->NewString(value.data(), value.size())); } diff --git a/chrome/browser/history/expire_history_backend_unittest.cc b/chrome/browser/history/expire_history_backend_unittest.cc index d91409b..105bc7d 100644 --- a/chrome/browser/history/expire_history_backend_unittest.cc +++ b/chrome/browser/history/expire_history_backend_unittest.cc @@ -87,7 +87,7 @@ class ExpireHistoryTest : public testing::Test, void StarURL(const GURL& url) { bookmark_model_.AddURL( - bookmark_model_.bookmark_bar_node(), 0, string16(), url); + bookmark_model_.bookmark_bar_node(), 0, base::string16(), url); } static bool IsStringInFile(const base::FilePath& filename, const char* str); diff --git a/chrome/browser/history/history_backend.cc b/chrome/browser/history/history_backend.cc index be5a171..1afbeaa 100644 --- a/chrome/browser/history/history_backend.cc +++ b/chrome/browser/history/history_backend.cc @@ -873,7 +873,8 @@ bool HistoryBackend::IsExpiredVisitTime(const base::Time& time) { return time < expirer_.GetCurrentArchiveTime(); } -void HistoryBackend::SetPageTitle(const GURL& url, const string16& title) { +void HistoryBackend::SetPageTitle(const GURL& url, + const base::string16& title) { if (!db_) return; @@ -919,7 +920,7 @@ void HistoryBackend::SetPageTitle(const GURL& url, const string16& title) { } void HistoryBackend::AddPageNoVisitForBookmark(const GURL& url, - const string16& title) { + const base::string16& title) { if (!db_) return; @@ -1129,7 +1130,7 @@ void HistoryBackend::QuerySegmentDuration( void HistoryBackend::SetKeywordSearchTermsForURL(const GURL& url, TemplateURLID keyword_id, - const string16& term) { + const base::string16& term) { if (!db_) return; @@ -1162,7 +1163,7 @@ void HistoryBackend::DeleteAllSearchTermsForKeyword( void HistoryBackend::GetMostRecentKeywordSearchTerms( scoped_refptr<GetMostRecentKeywordSearchTermsRequest> request, TemplateURLID keyword_id, - const string16& prefix, + const base::string16& prefix, int max_count) { if (request->canceled()) return; @@ -1253,7 +1254,7 @@ void HistoryBackend::RemoveDownloads(const std::set<uint32>& ids) { } void HistoryBackend::QueryHistory(scoped_refptr<QueryHistoryRequest> request, - const string16& text_query, + const base::string16& text_query, const QueryOptions& options) { if (request->canceled()) return; @@ -1348,7 +1349,7 @@ void HistoryBackend::QueryHistoryBasic(URLDatabase* url_db, // Text-based querying of history. void HistoryBackend::QueryHistoryText(URLDatabase* url_db, VisitDatabase* visit_db, - const string16& text_query, + const base::string16& text_query, const QueryOptions& options, QueryResults* result) { URLRows text_matches; diff --git a/chrome/browser/history/history_backend.h b/chrome/browser/history/history_backend.h index a4971b2..6139966 100644 --- a/chrome/browser/history/history_backend.h +++ b/chrome/browser/history/history_backend.h @@ -143,8 +143,8 @@ class HistoryBackend : public base::RefCountedThreadSafe<HistoryBackend>, // |request.time| must be unique with high probability. void AddPage(const HistoryAddPageArgs& request); - virtual void SetPageTitle(const GURL& url, const string16& title); - void AddPageNoVisitForBookmark(const GURL& url, const string16& title); + virtual void SetPageTitle(const GURL& url, const base::string16& title); + void AddPageNoVisitForBookmark(const GURL& url, const base::string16& title); // Updates the database backend with a page's ending time stamp information. // The page can be identified by the combination of the pointer to @@ -172,7 +172,7 @@ class HistoryBackend : public base::RefCountedThreadSafe<HistoryBackend>, const GURL& url, bool want_visits); void QueryHistory(scoped_refptr<QueryHistoryRequest> request, - const string16& text_query, + const base::string16& text_query, const QueryOptions& options); void QueryRedirectsFrom(scoped_refptr<QueryRedirectsRequest> request, const GURL& url); @@ -308,14 +308,14 @@ class HistoryBackend : public base::RefCountedThreadSafe<HistoryBackend>, void SetKeywordSearchTermsForURL(const GURL& url, TemplateURLID keyword_id, - const string16& term); + const base::string16& term); void DeleteAllSearchTermsForKeyword(TemplateURLID keyword_id); void GetMostRecentKeywordSearchTerms( scoped_refptr<GetMostRecentKeywordSearchTermsRequest> request, TemplateURLID keyword_id, - const string16& prefix, + const base::string16& prefix, int max_count); void DeleteKeywordSearchTermForURL(const GURL& url); @@ -620,7 +620,7 @@ class HistoryBackend : public base::RefCountedThreadSafe<HistoryBackend>, const QueryOptions& options, QueryResults* result); void QueryHistoryText(URLDatabase* url_db, VisitDatabase* visit_db, - const string16& text_query, + const base::string16& text_query, const QueryOptions& options, QueryResults* result); diff --git a/chrome/browser/history/history_backend_unittest.cc b/chrome/browser/history/history_backend_unittest.cc index 5d01cf1..fe772a8 100644 --- a/chrome/browser/history/history_backend_unittest.cc +++ b/chrome/browser/history/history_backend_unittest.cc @@ -504,7 +504,7 @@ TEST_F(HistoryBackendTest, DeleteAll) { // Star row1. bookmark_model_.AddURL( - bookmark_model_.bookmark_bar_node(), 0, string16(), row1.url()); + bookmark_model_.bookmark_bar_node(), 0, base::string16(), row1.url()); // Now finally clear all history. backend_->DeleteAllHistory(); @@ -654,8 +654,10 @@ TEST_F(HistoryBackendTest, URLsNoLongerBookmarked) { URLID row2_id = backend_->db_->GetRowForURL(row2.url(), NULL); // Star the two URLs. - bookmark_utils::AddIfNotBookmarked(&bookmark_model_, row1.url(), string16()); - bookmark_utils::AddIfNotBookmarked(&bookmark_model_, row2.url(), string16()); + bookmark_utils::AddIfNotBookmarked(&bookmark_model_, row1.url(), + base::string16()); + bookmark_utils::AddIfNotBookmarked(&bookmark_model_, row2.url(), + base::string16()); // Delete url 2. Because url 2 is starred this won't delete the URL, only // the visits. @@ -862,8 +864,8 @@ TEST_F(HistoryBackendTest, ImportedFaviconsTest) { EXPECT_TRUE(backend_->db_->GetRowForURL(url3, &url_row3) == 0); // If the URL is bookmarked, it should get added to history with 0 visits. - bookmark_model_.AddURL(bookmark_model_.bookmark_bar_node(), 0, string16(), - url3); + bookmark_model_.AddURL(bookmark_model_.bookmark_bar_node(), 0, + base::string16(), url3); backend_->SetImportedFavicons(favicons); EXPECT_FALSE(backend_->db_->GetRowForURL(url3, &url_row3) == 0); EXPECT_TRUE(url_row3.visit_count() == 0); @@ -2612,7 +2614,7 @@ TEST_F(HistoryBackendTest, AddPageNoVisitForBookmark) { ASSERT_TRUE(backend_.get()); GURL url("http://www.google.com"); - string16 title(UTF8ToUTF16("Bookmark title")); + base::string16 title(UTF8ToUTF16("Bookmark title")); backend_->AddPageNoVisitForBookmark(url, title); URLRow row; @@ -2622,7 +2624,7 @@ TEST_F(HistoryBackendTest, AddPageNoVisitForBookmark) { EXPECT_EQ(0, row.visit_count()); backend_->DeleteURL(url); - backend_->AddPageNoVisitForBookmark(url, string16()); + backend_->AddPageNoVisitForBookmark(url, base::string16()); backend_->GetURL(url, &row); EXPECT_EQ(url, row.url()); EXPECT_EQ(UTF8ToUTF16(url.spec()), row.title()); diff --git a/chrome/browser/history/history_browsertest.cc b/chrome/browser/history/history_browsertest.cc index e2f8f2a..5f2a050 100644 --- a/chrome/browser/history/history_browsertest.cc +++ b/chrome/browser/history/history_browsertest.cc @@ -101,7 +101,7 @@ class HistoryBrowserTest : public InProcessBrowserTest { } void LoadAndWaitForURL(const GURL& url) { - string16 expected_title(ASCIIToUTF16("OK")); + base::string16 expected_title(ASCIIToUTF16("OK")); content::TitleWatcher title_watcher( browser()->tab_strip_model()->GetActiveWebContents(), expected_title); title_watcher.AlsoWaitForTitle(ASCIIToUTF16("FAIL")); @@ -466,7 +466,7 @@ IN_PROC_BROWSER_TEST_F(HistoryBrowserTest, SubmitFormAddsTargetPage) { content::WebContents* web_contents = browser()->tab_strip_model()->GetActiveWebContents(); - string16 expected_title(ASCIIToUTF16("Target Page")); + base::string16 expected_title(ASCIIToUTF16("Target Page")); content::TitleWatcher title_watcher( browser()->tab_strip_model()->GetActiveWebContents(), expected_title); ASSERT_TRUE(content::ExecuteScript( @@ -488,7 +488,7 @@ IN_PROC_BROWSER_TEST_F(HistoryBrowserTest, OneHistoryTabPerWindow) { // 'Loading...' for a brief time while the history page loads. content::WebContents* web_contents = browser()->tab_strip_model()->GetActiveWebContents(); - string16 expected_title(ASCIIToUTF16("History")); + base::string16 expected_title(ASCIIToUTF16("History")); content::TitleWatcher title_watcher(web_contents, expected_title); chrome::ExecuteCommand(browser(), IDC_SHOW_HISTORY); EXPECT_EQ(expected_title, title_watcher.WaitAndGetTitle()); diff --git a/chrome/browser/history/history_notifications.cc b/chrome/browser/history/history_notifications.cc index 477ffc9..d0d9be6 100644 --- a/chrome/browser/history/history_notifications.cc +++ b/chrome/browser/history/history_notifications.cc @@ -25,7 +25,7 @@ URLsDeletedDetails::~URLsDeletedDetails() {} KeywordSearchUpdatedDetails::KeywordSearchUpdatedDetails( const GURL& url, TemplateURLID keyword_id, - const string16& term) + const base::string16& term) : url(url), keyword_id(keyword_id), term(term) { diff --git a/chrome/browser/history/history_notifications.h b/chrome/browser/history/history_notifications.h index ad8ae31..29de877 100644 --- a/chrome/browser/history/history_notifications.h +++ b/chrome/browser/history/history_notifications.h @@ -65,12 +65,12 @@ struct URLsDeletedDetails : public HistoryDetails { struct KeywordSearchUpdatedDetails : public HistoryDetails { KeywordSearchUpdatedDetails(const GURL& url, TemplateURLID keyword_id, - const string16& term); + const base::string16& term); virtual ~KeywordSearchUpdatedDetails(); GURL url; TemplateURLID keyword_id; - string16 term; + base::string16 term; }; // Details for HISTORY_KEYWORD_SEARCH_TERM_DELETED. diff --git a/chrome/browser/history/history_service.cc b/chrome/browser/history/history_service.cc index f1bdf22..c615675 100644 --- a/chrome/browser/history/history_service.cc +++ b/chrome/browser/history/history_service.cc @@ -376,7 +376,7 @@ void HistoryService::Shutdown() { void HistoryService::SetKeywordSearchTermsForURL(const GURL& url, TemplateURLID keyword_id, - const string16& term) { + const base::string16& term) { DCHECK(thread_checker_.CalledOnValidThread()); ScheduleAndForget(PRIORITY_UI, &HistoryBackend::SetKeywordSearchTermsForURL, @@ -393,7 +393,7 @@ void HistoryService::DeleteAllSearchTermsForKeyword( HistoryService::Handle HistoryService::GetMostRecentKeywordSearchTerms( TemplateURLID keyword_id, - const string16& prefix, + const base::string16& prefix, int max_count, CancelableRequestConsumerBase* consumer, const GetMostRecentKeywordSearchTermsCallback& callback) { @@ -524,7 +524,7 @@ void HistoryService::AddPage(const history::HistoryAddPageArgs& add_page_args) { } void HistoryService::AddPageNoVisitForBookmark(const GURL& url, - const string16& title) { + const base::string16& title) { DCHECK(thread_checker_.CalledOnValidThread()); if (!CanAddURL(url)) return; @@ -534,7 +534,7 @@ void HistoryService::AddPageNoVisitForBookmark(const GURL& url, } void HistoryService::SetPageTitle(const GURL& url, - const string16& title) { + const base::string16& title) { DCHECK(thread_checker_.CalledOnValidThread()); ScheduleAndForget(PRIORITY_NORMAL, &HistoryBackend::SetPageTitle, url, title); } @@ -549,7 +549,7 @@ void HistoryService::UpdateWithPageEndTime(const void* host, } void HistoryService::AddPageWithDetails(const GURL& url, - const string16& title, + const base::string16& title, int visit_count, int typed_count, Time last_visit, @@ -842,7 +842,7 @@ void HistoryService::RemoveDownloads(const std::set<uint32>& ids) { } HistoryService::Handle HistoryService::QueryHistory( - const string16& text_query, + const base::string16& text_query, const history::QueryOptions& options, CancelableRequestConsumerBase* consumer, const QueryHistoryCallback& callback) { diff --git a/chrome/browser/history/history_service.h b/chrome/browser/history/history_service.h index 4b322ae..11e5530 100644 --- a/chrome/browser/history/history_service.h +++ b/chrome/browser/history/history_service.h @@ -217,11 +217,11 @@ class HistoryService : public CancelableRequestProvider, // Adds an entry for the specified url without creating a visit. This should // only be used when bookmarking a page, otherwise the row leaks in the // history db (it never gets cleaned). - void AddPageNoVisitForBookmark(const GURL& url, const string16& title); + void AddPageNoVisitForBookmark(const GURL& url, const base::string16& title); // Sets the title for the given page. The page should be in history. If it // is not, this operation is ignored. - void SetPageTitle(const GURL& url, const string16& title); + void SetPageTitle(const GURL& url, const base::string16& title); // Updates the history database with a page's ending time stamp information. // The page can be identified by the combination of the pointer to @@ -267,7 +267,7 @@ class HistoryService : public CancelableRequestProvider, // Queries all history with the given options (see QueryOptions in // history_types.h). If empty, all results matching the given options // will be returned. - Handle QueryHistory(const string16& text_query, + Handle QueryHistory(const base::string16& text_query, const history::QueryOptions& options, CancelableRequestConsumerBase* consumer, const QueryHistoryCallback& callback); @@ -487,7 +487,7 @@ class HistoryService : public CancelableRequestProvider, // id of the url, keyword_id the id of the keyword and term the search term. void SetKeywordSearchTermsForURL(const GURL& url, TemplateURLID keyword_id, - const string16& term); + const base::string16& term); // Deletes all search terms for the specified keyword. void DeleteAllSearchTermsForKeyword(TemplateURLID keyword_id); @@ -502,7 +502,7 @@ class HistoryService : public CancelableRequestProvider, // first. Handle GetMostRecentKeywordSearchTerms( TemplateURLID keyword_id, - const string16& prefix, + const base::string16& prefix, int max_count, CancelableRequestConsumerBase* consumer, const GetMostRecentKeywordSearchTermsCallback& callback); @@ -556,7 +556,7 @@ class HistoryService : public CancelableRequestProvider, // visit using the |last_visit| timestamp, and a PageTransition type of LINK, // if |visit_source| != SYNCED. void AddPageWithDetails(const GURL& url, - const string16& title, + const base::string16& title, int visit_count, int typed_count, base::Time last_visit, diff --git a/chrome/browser/history/history_types.cc b/chrome/browser/history/history_types.cc index 959d118..283c55b 100644 --- a/chrome/browser/history/history_types.cc +++ b/chrome/browser/history/history_types.cc @@ -282,13 +282,13 @@ KeywordSearchTermRow::~KeywordSearchTermRow() {} MostVisitedURL::MostVisitedURL() {} MostVisitedURL::MostVisitedURL(const GURL& url, - const string16& title) + const base::string16& title) : url(url), title(title) { } MostVisitedURL::MostVisitedURL(const GURL& url, - const string16& title, + const base::string16& title, const base::Time& last_forced_time) : url(url), title(title), diff --git a/chrome/browser/history/history_types.h b/chrome/browser/history/history_types.h index a24a79a..2fac614 100644 --- a/chrome/browser/history/history_types.h +++ b/chrome/browser/history/history_types.h @@ -86,10 +86,10 @@ class URLRow { const GURL& url() const { return url_; } - const string16& title() const { + const base::string16& title() const { return title_; } - void set_title(const string16& title) { + void set_title(const base::string16& title) { // The title is frequently set to the same thing, so we don't bother // updating unless the string has changed. if (title != title_) { @@ -173,7 +173,7 @@ class URLRow { // the constructor to make a new one. GURL url_; - string16 title_; + base::string16 title_; // Total number of times this URL has been visited. int visit_count_; @@ -486,7 +486,7 @@ struct KeywordSearchTermVisit { KeywordSearchTermVisit(); ~KeywordSearchTermVisit(); - string16 term; // The search term that was used. + base::string16 term; // The search term that was used. int visits; // The visit count. base::Time time; // The time of the most recent visit. }; @@ -500,7 +500,7 @@ struct KeywordSearchTermRow { TemplateURLID keyword_id; // ID of the keyword. URLID url_id; // ID of the url. - string16 term; // The search term that was used. + base::string16 term; // The search term that was used. }; // MostVisitedURL -------------------------------------------------------------- @@ -508,14 +508,14 @@ struct KeywordSearchTermRow { // Holds the per-URL information of the most visited query. struct MostVisitedURL { MostVisitedURL(); - MostVisitedURL(const GURL& url, const string16& title); + MostVisitedURL(const GURL& url, const base::string16& title); MostVisitedURL(const GURL& url, - const string16& title, + const base::string16& title, const base::Time& last_forced_time); ~MostVisitedURL(); GURL url; - string16 title; + base::string16 title; // If this is a URL for which we want to force a thumbnail, records the last // time it was forced so we can evict it when more recent URLs are requested. @@ -550,7 +550,7 @@ struct FilteredURL { ~FilteredURL(); GURL url; - string16 title; + base::string16 title; double score; ExtendedInfo extended_info; }; diff --git a/chrome/browser/history/history_unittest.cc b/chrome/browser/history/history_unittest.cc index d8b5e80..21ce21a 100644 --- a/chrome/browser/history/history_unittest.cc +++ b/chrome/browser/history/history_unittest.cc @@ -1274,7 +1274,7 @@ TEST_F(HistoryTest, SetTitle) { existing_url, base::Time::Now(), history::SOURCE_BROWSED); // Set some title. - const string16 existing_title = UTF8ToUTF16("Google"); + const base::string16 existing_title = UTF8ToUTF16("Google"); history_service_->SetPageTitle(existing_url, existing_title); // Make sure the title got set. @@ -1283,7 +1283,7 @@ TEST_F(HistoryTest, SetTitle) { // set a title on a nonexistent page const GURL nonexistent_url("http://news.google.com/"); - const string16 nonexistent_title = UTF8ToUTF16("Google News"); + const base::string16 nonexistent_title = UTF8ToUTF16("Google News"); history_service_->SetPageTitle(nonexistent_url, nonexistent_title); // Make sure nothing got written. @@ -1826,7 +1826,7 @@ TEST_F(HistoryBackendDBTest, MigratePresentations) { const URLID url_id = 3; const GURL url("http://www.foo.com"); const std::string url_name(VisitSegmentDatabase::ComputeSegmentName(url)); - const string16 title(ASCIIToUTF16("Title1")); + const base::string16 title(ASCIIToUTF16("Title1")); const Time segment_time(Time::Now()); { diff --git a/chrome/browser/history/in_memory_url_index.cc b/chrome/browser/history/in_memory_url_index.cc index 2ce9695..4c2d53c 100644 --- a/chrome/browser/history/in_memory_url_index.cc +++ b/chrome/browser/history/in_memory_url_index.cc @@ -160,7 +160,7 @@ bool InMemoryURLIndex::GetCacheFilePath(base::FilePath* file_path) { // Querying -------------------------------------------------------------------- ScoredHistoryMatches InMemoryURLIndex::HistoryItemsForTerms( - const string16& term_string, + const base::string16& term_string, size_t cursor_position) { return private_data_->HistoryItemsForTerms( term_string, diff --git a/chrome/browser/history/in_memory_url_index.h b/chrome/browser/history/in_memory_url_index.h index 8033ee9..1279c32 100644 --- a/chrome/browser/history/in_memory_url_index.h +++ b/chrome/browser/history/in_memory_url_index.h @@ -117,10 +117,10 @@ class InMemoryURLIndex : public content::NotificationObserver, // Scans the history index and returns a vector with all scored, matching // history items. This entry point simply forwards the call on to the // URLIndexPrivateData class. For a complete description of this function - // refer to that class. If |cursor_position| is string16::npos, the + // refer to that class. If |cursor_position| is base::string16::npos, the // function doesn't do anything special with the cursor; this is equivalent // to the cursor being at the end. - ScoredHistoryMatches HistoryItemsForTerms(const string16& term_string, + ScoredHistoryMatches HistoryItemsForTerms(const base::string16& term_string, size_t cursor_position); // Deletes the index entry, if any, for the given |url|. diff --git a/chrome/browser/history/in_memory_url_index_types.cc b/chrome/browser/history/in_memory_url_index_types.cc index e30e2c3..77197be 100644 --- a/chrome/browser/history/in_memory_url_index_types.cc +++ b/chrome/browser/history/in_memory_url_index_types.cc @@ -49,18 +49,20 @@ string16 CleanUpUrlForMatching(const GURL& gurl, NULL, NULL, NULL)); } -string16 CleanUpTitleForMatching(const string16& title) { +string16 CleanUpTitleForMatching(const base::string16& title) { return base::i18n::ToLower(title.substr(0u, kCleanedUpTitleMaxLength)); } -TermMatches MatchTermInString(const string16& term, - const string16& cleaned_string, +TermMatches MatchTermInString(const base::string16& term, + const base::string16& cleaned_string, int term_num) { const size_t kMaxCompareLength = 2048; - const string16& short_string = (cleaned_string.length() > kMaxCompareLength) ? + const base::string16& short_string = + (cleaned_string.length() > kMaxCompareLength) ? cleaned_string.substr(0, kMaxCompareLength) : cleaned_string; TermMatches matches; - for (size_t location = short_string.find(term); location != string16::npos; + for (size_t location = short_string.find(term); + location != base::string16::npos; location = short_string.find(term, location + 1)) matches.push_back(TermMatch(term_num, location, term.length())); return matches; @@ -102,7 +104,7 @@ TermMatches ReplaceOffsetsInTermMatches(const TermMatches& matches, std::vector<size_t>::const_iterator offset_iter = offsets.begin(); for (TermMatches::const_iterator term_iter = matches.begin(); term_iter != matches.end(); ++term_iter, ++offset_iter) { - if (*offset_iter != string16::npos) { + if (*offset_iter != base::string16::npos) { TermMatch new_match(*term_iter); new_match.offset = *offset_iter; new_matches.push_back(new_match); @@ -113,7 +115,7 @@ TermMatches ReplaceOffsetsInTermMatches(const TermMatches& matches, // Utility Functions ----------------------------------------------------------- -String16Set String16SetFromString16(const string16& cleaned_uni_string, +String16Set String16SetFromString16(const base::string16& cleaned_uni_string, WordStarts* word_starts) { String16Vector words = String16VectorFromString16(cleaned_uni_string, false, word_starts); @@ -124,9 +126,10 @@ String16Set String16SetFromString16(const string16& cleaned_uni_string, return word_set; } -String16Vector String16VectorFromString16(const string16& cleaned_uni_string, - bool break_on_space, - WordStarts* word_starts) { +String16Vector String16VectorFromString16( + const base::string16& cleaned_uni_string, + bool break_on_space, + WordStarts* word_starts) { if (word_starts) word_starts->clear(); base::i18n::BreakIterator iter(cleaned_uni_string, @@ -137,10 +140,10 @@ String16Vector String16VectorFromString16(const string16& cleaned_uni_string, return words; while (iter.Advance()) { if (break_on_space || iter.IsWord()) { - string16 word(iter.GetString()); + base::string16 word(iter.GetString()); size_t initial_whitespace = 0; if (break_on_space) { - string16 trimmed_word; + base::string16 trimmed_word; TrimWhitespace(word, TRIM_LEADING, &trimmed_word); initial_whitespace = word.length() - trimmed_word.length(); TrimWhitespace(trimmed_word, TRIM_TRAILING, &word); @@ -158,7 +161,7 @@ String16Vector String16VectorFromString16(const string16& cleaned_uni_string, return words; } -Char16Set Char16SetFromString16(const string16& term) { +Char16Set Char16SetFromString16(const base::string16& term) { Char16Set characters; for (string16::const_iterator iter = term.begin(); iter != term.end(); ++iter) characters.insert(*iter); diff --git a/chrome/browser/history/in_memory_url_index_types.h b/chrome/browser/history/in_memory_url_index_types.h index 243f5ef..976e062 100644 --- a/chrome/browser/history/in_memory_url_index_types.h +++ b/chrome/browser/history/in_memory_url_index_types.h @@ -46,12 +46,12 @@ typedef std::vector<TermMatch> TermMatches; // no longer match this URL. Note that the resulting unescaped URL // may not be directly navigable (which is why we escaped it to begin // with). |languages| is passed to net::FormatUrl(). -string16 CleanUpUrlForMatching(const GURL& gurl, - const std::string& languages); +base::string16 CleanUpUrlForMatching(const GURL& gurl, + const std::string& languages); // Returns the lower-cased title, possibly truncated if the original title // is overly-long. -string16 CleanUpTitleForMatching(const string16& title); +base::string16 CleanUpTitleForMatching(const base::string16& title); // Returns a TermMatches which has an entry for each occurrence of the // string |term| found in the string |cleaned_string|. Use @@ -61,8 +61,8 @@ string16 CleanUpTitleForMatching(const string16& title); // with other TermMatches for other terms. Note that only the first // 2,048 characters of |string| are considered during the match // operation. -TermMatches MatchTermInString(const string16& term, - const string16& cleaned_string, +TermMatches MatchTermInString(const base::string16& term, + const base::string16& cleaned_string, int term_num); // Sorts and removes overlapping substring matches from |matches| and @@ -79,8 +79,8 @@ TermMatches ReplaceOffsetsInTermMatches(const TermMatches& matches, // Convenience Types ----------------------------------------------------------- -typedef std::vector<string16> String16Vector; -typedef std::set<string16> String16Set; +typedef std::vector<base::string16> String16Vector; +typedef std::set<base::string16> String16Set; typedef std::set<char16> Char16Set; typedef std::vector<char16> Char16Vector; @@ -96,7 +96,7 @@ typedef std::vector<size_t> WordStarts; // |cleaned_uni_string| at which each word starts onto // |word_starts|. These offsets are collected only up to the first // kMaxSignificantChars of |cleaned_uni_string|. -String16Set String16SetFromString16(const string16& cleaned_uni_string, +String16Set String16SetFromString16(const base::string16& cleaned_uni_string, WordStarts* word_starts); // Breaks the |cleaned_uni_string| string down into individual words @@ -118,9 +118,10 @@ String16Set String16SetFromString16(const string16& cleaned_uni_string, // "http", "www", "google", "com", "harry", "the", "rabbit" // With |break_on_space| true the returned list will contain: // "http://", "www.google.com/", "harry", "the", "rabbit." -String16Vector String16VectorFromString16(const string16& cleaned_uni_string, - bool break_on_space, - WordStarts* word_starts); +String16Vector String16VectorFromString16( + const base::string16& cleaned_uni_string, + bool break_on_space, + WordStarts* word_starts); // Breaks the |uni_word| string down into its individual characters. // Note that this is temporarily intended to work on a single word, but @@ -130,7 +131,7 @@ String16Vector String16VectorFromString16(const string16& cleaned_uni_string, // and properly handle substring matches, scoring and sorting the results // by score. Also, provide the metrics for where the matches occur so that // the UI can highlight the matched sections. -Char16Set Char16SetFromString16(const string16& uni_word); +Char16Set Char16SetFromString16(const base::string16& uni_word); // Support for InMemoryURLIndex Private Data ----------------------------------- @@ -138,7 +139,7 @@ Char16Set Char16SetFromString16(const string16& uni_word); typedef size_t WordID; // A map allowing a WordID to be determined given a word. -typedef std::map<string16, WordID> WordMap; +typedef std::map<base::string16, WordID> WordMap; // A map from character to the word_ids of words containing that character. typedef std::set<WordID> WordIDSet; // An index into the WordList. diff --git a/chrome/browser/history/in_memory_url_index_types_unittest.cc b/chrome/browser/history/in_memory_url_index_types_unittest.cc index 4f3a209..f31348b 100644 --- a/chrome/browser/history/in_memory_url_index_types_unittest.cc +++ b/chrome/browser/history/in_memory_url_index_types_unittest.cc @@ -30,7 +30,7 @@ class InMemoryURLIndexTypesTest : public testing::Test { TEST_F(InMemoryURLIndexTypesTest, StaticFunctions) { // Test String16VectorFromString16 - string16 string_a(ASCIIToUTF16("http://www.google.com/ frammy the brammy")); + base::string16 string_a(ASCIIToUTF16("http://www.google.com/ frammy the brammy")); WordStarts actual_starts_a; String16Vector string_vec = String16VectorFromString16(string_a, false, &actual_starts_a); @@ -60,7 +60,7 @@ TEST_F(InMemoryURLIndexTypesTest, StaticFunctions) { EXPECT_TRUE(IntArraysEqual(expected_starts_b, arraysize(expected_starts_b), actual_starts_b)); - string16 string_c(ASCIIToUTF16( + base::string16 string_c(ASCIIToUTF16( " funky%20string-with=@strange sequences, intended(to exceed)")); WordStarts actual_starts_c; string_vec = String16VectorFromString16(string_c, false, &actual_starts_c); @@ -71,7 +71,7 @@ TEST_F(InMemoryURLIndexTypesTest, StaticFunctions) { actual_starts_c)); // Test String16SetFromString16 - string16 string_d(ASCIIToUTF16( + base::string16 string_d(ASCIIToUTF16( "http://web.google.com/search Google Web Search")); WordStarts actual_starts_d; String16Set string_set = String16SetFromString16(string_d, &actual_starts_d); @@ -135,7 +135,7 @@ TEST_F(InMemoryURLIndexTypesTest, OffsetsAndTermMatches) { EXPECT_EQ(expected_offsets_a[i], offsets[i]); // Test ReplaceOffsetsInTermMatches - offsets[2] = string16::npos; + offsets[2] = base::string16::npos; history::TermMatches matches_b = ReplaceOffsetsInTermMatches(matches_a, offsets); const size_t expected_offsets_b[] = {1, 4, 10, 14}; diff --git a/chrome/browser/history/in_memory_url_index_unittest.cc b/chrome/browser/history/in_memory_url_index_unittest.cc index bd2c039..9be82cf3 100644 --- a/chrome/browser/history/in_memory_url_index_unittest.cc +++ b/chrome/browser/history/in_memory_url_index_unittest.cc @@ -90,7 +90,7 @@ class InMemoryURLIndexTest : public testing::Test { // Validates that the given |term| is contained in |cache| and that it is // marked as in-use. void CheckTerm(const URLIndexPrivateData::SearchTermCacheMap& cache, - string16 term) const; + base::string16 term) const; // Pass-through function to simplify our friendship with HistoryService. sql::Connection& GetDB(); @@ -283,7 +283,7 @@ base::FilePath::StringType InMemoryURLIndexTest::TestDBName() const { void InMemoryURLIndexTest::CheckTerm( const URLIndexPrivateData::SearchTermCacheMap& cache, - string16 term) const { + base::string16 term) const { URLIndexPrivateData::SearchTermCacheMap::const_iterator cache_iter( cache.find(term)); ASSERT_TRUE(cache.end() != cache_iter) @@ -444,7 +444,7 @@ TEST_F(LimitedInMemoryURLIndexTest, Initialization) { TEST_F(InMemoryURLIndexTest, Retrieval) { // See if a very specific term gives a single result. ScoredHistoryMatches matches = url_index_->HistoryItemsForTerms( - ASCIIToUTF16("DrudgeReport"), string16::npos); + ASCIIToUTF16("DrudgeReport"), base::string16::npos); ASSERT_EQ(1U, matches.size()); // Verify that we got back the result we expected. @@ -456,7 +456,7 @@ TEST_F(InMemoryURLIndexTest, Retrieval) { // Make sure a trailing space prevents inline-ability but still results // in the expected result. matches = url_index_->HistoryItemsForTerms(ASCIIToUTF16("DrudgeReport "), - string16::npos); + base::string16::npos); ASSERT_EQ(1U, matches.size()); EXPECT_EQ(5, matches[0].url_info.id()); EXPECT_EQ("http://drudgereport.com/", matches[0].url_info.url().spec()); @@ -465,14 +465,14 @@ TEST_F(InMemoryURLIndexTest, Retrieval) { // Search which should result in multiple results. matches = url_index_->HistoryItemsForTerms(ASCIIToUTF16("drudge"), - string16::npos); + base::string16::npos); ASSERT_EQ(2U, matches.size()); // The results should be in descending score order. EXPECT_GE(matches[0].raw_score(), matches[1].raw_score()); // Search which should result in nearly perfect result. matches = url_index_->HistoryItemsForTerms( - ASCIIToUTF16("Nearly Perfect Result"), string16::npos); + ASCIIToUTF16("Nearly Perfect Result"), base::string16::npos); ASSERT_EQ(1U, matches.size()); // The results should have a very high score. EXPECT_GT(matches[0].raw_score(), 900); @@ -485,7 +485,7 @@ TEST_F(InMemoryURLIndexTest, Retrieval) { // Search which should result in very poor result. matches = url_index_->HistoryItemsForTerms(ASCIIToUTF16("qui c"), - string16::npos); + base::string16::npos); ASSERT_EQ(1U, matches.size()); // The results should have a poor score. EXPECT_LT(matches[0].raw_score(), 500); @@ -498,14 +498,14 @@ TEST_F(InMemoryURLIndexTest, Retrieval) { // Search which will match at the end of an URL with encoded characters. matches = url_index_->HistoryItemsForTerms(ASCIIToUTF16("Mice"), - string16::npos); + base::string16::npos); ASSERT_EQ(1U, matches.size()); EXPECT_EQ(30, matches[0].url_info.id()); EXPECT_FALSE(matches[0].can_inline()); // Check that URLs are not escaped an escape time. matches = url_index_->HistoryItemsForTerms(ASCIIToUTF16("1% wikipedia"), - string16::npos); + base::string16::npos); ASSERT_EQ(1U, matches.size()); EXPECT_EQ(35, matches[0].url_info.id()); EXPECT_EQ("http://en.wikipedia.org/wiki/1%25_rule_(Internet_culture)", @@ -514,7 +514,7 @@ TEST_F(InMemoryURLIndexTest, Retrieval) { // Verify that a single term can appear multiple times in the URL and as long // as one starts the URL it is still inlined. matches = url_index_->HistoryItemsForTerms(ASCIIToUTF16("fubar"), - string16::npos); + base::string16::npos); ASSERT_EQ(1U, matches.size()); EXPECT_EQ(34, matches[0].url_info.id()); EXPECT_EQ("http://fubarfubarandfubar.com/", matches[0].url_info.url().spec()); @@ -526,7 +526,7 @@ TEST_F(InMemoryURLIndexTest, Retrieval) { TEST_F(InMemoryURLIndexTest, CursorPositionRetrieval) { // See if a very specific term with no cursor gives an empty result. ScoredHistoryMatches matches = url_index_->HistoryItemsForTerms( - ASCIIToUTF16("DrudReport"), string16::npos); + ASCIIToUTF16("DrudReport"), base::string16::npos); ASSERT_EQ(0U, matches.size()); // The same test with the cursor at the end should give an empty result. @@ -543,7 +543,7 @@ TEST_F(InMemoryURLIndexTest, CursorPositionRetrieval) { // Now check multi-word inputs. No cursor should fail to find a // result on this input. matches = url_index_->HistoryItemsForTerms( - ASCIIToUTF16("MORTGAGERATE DROPS"), string16::npos); + ASCIIToUTF16("MORTGAGERATE DROPS"), base::string16::npos); ASSERT_EQ(0U, matches.size()); // Ditto with cursor at end. @@ -566,61 +566,61 @@ TEST_F(InMemoryURLIndexTest, CursorPositionRetrieval) { TEST_F(InMemoryURLIndexTest, URLPrefixMatching) { // "drudgere" - found, can inline ScoredHistoryMatches matches = url_index_->HistoryItemsForTerms( - ASCIIToUTF16("drudgere"), string16::npos); + ASCIIToUTF16("drudgere"), base::string16::npos); ASSERT_EQ(1U, matches.size()); EXPECT_TRUE(matches[0].can_inline()); // "drudgere" - found, can inline matches = url_index_->HistoryItemsForTerms(ASCIIToUTF16("drudgere"), - string16::npos); + base::string16::npos); ASSERT_EQ(1U, matches.size()); EXPECT_TRUE(matches[0].can_inline()); // "www.atdmt" - not found matches = url_index_->HistoryItemsForTerms(ASCIIToUTF16("www.atdmt"), - string16::npos); + base::string16::npos); EXPECT_EQ(0U, matches.size()); // "atdmt" - found, cannot inline matches = url_index_->HistoryItemsForTerms(ASCIIToUTF16("atdmt"), - string16::npos); + base::string16::npos); ASSERT_EQ(1U, matches.size()); EXPECT_FALSE(matches[0].can_inline()); // "view.atdmt" - found, can inline matches = url_index_->HistoryItemsForTerms(ASCIIToUTF16("view.atdmt"), - string16::npos); + base::string16::npos); ASSERT_EQ(1U, matches.size()); EXPECT_TRUE(matches[0].can_inline()); // "view.atdmt" - found, can inline matches = url_index_->HistoryItemsForTerms(ASCIIToUTF16("view.atdmt"), - string16::npos); + base::string16::npos); ASSERT_EQ(1U, matches.size()); EXPECT_TRUE(matches[0].can_inline()); // "cnn.com" - found, can inline matches = url_index_->HistoryItemsForTerms(ASCIIToUTF16("cnn.com"), - string16::npos); + base::string16::npos); ASSERT_EQ(2U, matches.size()); // One match should be inline-able, the other not. EXPECT_TRUE(matches[0].can_inline() != matches[1].can_inline()); // "www.cnn.com" - found, can inline matches = url_index_->HistoryItemsForTerms(ASCIIToUTF16("www.cnn.com"), - string16::npos); + base::string16::npos); ASSERT_EQ(1U, matches.size()); EXPECT_TRUE(matches[0].can_inline()); // "ww.cnn.com" - found because we allow mid-term matches in hostnames matches = url_index_->HistoryItemsForTerms(ASCIIToUTF16("ww.cnn.com"), - string16::npos); + base::string16::npos); ASSERT_EQ(1U, matches.size()); // "www.cnn.com" - found, can inline matches = url_index_->HistoryItemsForTerms(ASCIIToUTF16("www.cnn.com"), - string16::npos); + base::string16::npos); ASSERT_EQ(1U, matches.size()); EXPECT_TRUE(matches[0].can_inline()); @@ -628,7 +628,7 @@ TEST_F(InMemoryURLIndexTest, URLPrefixMatching) { // match matches = url_index_->HistoryItemsForTerms(ASCIIToUTF16("tp://www.cnn.com"), - string16::npos); + base::string16::npos); ASSERT_EQ(0U, matches.size()); } @@ -638,13 +638,13 @@ TEST_F(InMemoryURLIndexTest, ProperStringMatching) { // "atdmt.view" - not found // "view.atdmt" - found ScoredHistoryMatches matches = url_index_->HistoryItemsForTerms( - ASCIIToUTF16("atdmt view"), string16::npos); + ASCIIToUTF16("atdmt view"), base::string16::npos); ASSERT_EQ(1U, matches.size()); matches = url_index_->HistoryItemsForTerms(ASCIIToUTF16("atdmt.view"), - string16::npos); + base::string16::npos); ASSERT_EQ(0U, matches.size()); matches = url_index_->HistoryItemsForTerms(ASCIIToUTF16("view.atdmt"), - string16::npos); + base::string16::npos); ASSERT_EQ(1U, matches.size()); } @@ -657,7 +657,7 @@ TEST_F(InMemoryURLIndexTest, HugeResultSet) { } ScoredHistoryMatches matches = - url_index_->HistoryItemsForTerms(ASCIIToUTF16("b"), string16::npos); + url_index_->HistoryItemsForTerms(ASCIIToUTF16("b"), base::string16::npos); URLIndexPrivateData& private_data(*GetPrivateData()); ASSERT_EQ(AutocompleteProvider::kMaxMatches, matches.size()); // There are 7 matches already in the database. @@ -673,7 +673,7 @@ TEST_F(InMemoryURLIndexTest, TitleSearch) { // Ensure title is being searched. ScoredHistoryMatches matches = url_index_->HistoryItemsForTerms( - ASCIIToUTF16("MORTGAGE RATE DROPS"), string16::npos); + ASCIIToUTF16("MORTGAGE RATE DROPS"), base::string16::npos); ASSERT_EQ(1U, matches.size()); // Verify that we got back the result we expected. @@ -687,10 +687,10 @@ TEST_F(InMemoryURLIndexTest, TitleSearch) { TEST_F(InMemoryURLIndexTest, TitleChange) { // Verify current title terms retrieves desired item. - string16 original_terms = + base::string16 original_terms = ASCIIToUTF16("lebronomics could high taxes influence"); ScoredHistoryMatches matches = - url_index_->HistoryItemsForTerms(original_terms, string16::npos); + url_index_->HistoryItemsForTerms(original_terms, base::string16::npos); ASSERT_EQ(1U, matches.size()); // Verify that we got back the result we expected. @@ -704,8 +704,8 @@ TEST_F(InMemoryURLIndexTest, TitleChange) { URLRow old_row(matches[0].url_info); // Verify new title terms retrieves nothing. - string16 new_terms = ASCIIToUTF16("does eat oats little lambs ivy"); - matches = url_index_->HistoryItemsForTerms(new_terms, string16::npos); + base::string16 new_terms = ASCIIToUTF16("does eat oats little lambs ivy"); + matches = url_index_->HistoryItemsForTerms(new_terms, base::string16::npos); ASSERT_EQ(0U, matches.size()); // Update the row. @@ -713,10 +713,11 @@ TEST_F(InMemoryURLIndexTest, TitleChange) { EXPECT_TRUE(UpdateURL(old_row)); // Verify we get the row using the new terms but not the original terms. - matches = url_index_->HistoryItemsForTerms(new_terms, string16::npos); + matches = url_index_->HistoryItemsForTerms(new_terms, base::string16::npos); ASSERT_EQ(1U, matches.size()); EXPECT_EQ(expected_id, matches[0].url_info.id()); - matches = url_index_->HistoryItemsForTerms(original_terms, string16::npos); + matches = + url_index_->HistoryItemsForTerms(original_terms, base::string16::npos); ASSERT_EQ(0U, matches.size()); } @@ -724,29 +725,30 @@ TEST_F(InMemoryURLIndexTest, NonUniqueTermCharacterSets) { // The presence of duplicate characters should succeed. Exercise by cycling // through a string with several duplicate characters. ScoredHistoryMatches matches = - url_index_->HistoryItemsForTerms(ASCIIToUTF16("ABRA"), string16::npos); + url_index_->HistoryItemsForTerms(ASCIIToUTF16("ABRA"), + base::string16::npos); ASSERT_EQ(1U, matches.size()); EXPECT_EQ(28, matches[0].url_info.id()); EXPECT_EQ("http://www.ddj.com/windows/184416623", matches[0].url_info.url().spec()); matches = url_index_->HistoryItemsForTerms(ASCIIToUTF16("ABRACAD"), - string16::npos); + base::string16::npos); ASSERT_EQ(1U, matches.size()); EXPECT_EQ(28, matches[0].url_info.id()); matches = url_index_->HistoryItemsForTerms(ASCIIToUTF16("ABRACADABRA"), - string16::npos); + base::string16::npos); ASSERT_EQ(1U, matches.size()); EXPECT_EQ(28, matches[0].url_info.id()); matches = url_index_->HistoryItemsForTerms(ASCIIToUTF16("ABRACADABR"), - string16::npos); + base::string16::npos); ASSERT_EQ(1U, matches.size()); EXPECT_EQ(28, matches[0].url_info.id()); matches = url_index_->HistoryItemsForTerms(ASCIIToUTF16("ABRACA"), - string16::npos); + base::string16::npos); ASSERT_EQ(1U, matches.size()); EXPECT_EQ(28, matches[0].url_info.id()); } @@ -769,20 +771,21 @@ TEST_F(InMemoryURLIndexTest, TypedCharacterCaching) { // Simulate typing "r" giving "r" in the simulated omnibox. The results for // 'r' will be not cached because it is only 1 character long. - url_index_->HistoryItemsForTerms(ASCIIToUTF16("r"), string16::npos); + url_index_->HistoryItemsForTerms(ASCIIToUTF16("r"), base::string16::npos); EXPECT_EQ(0U, cache.size()); // Simulate typing "re" giving "r re" in the simulated omnibox. // 're' should be cached at this point but not 'r' as it is a single // character. - url_index_->HistoryItemsForTerms(ASCIIToUTF16("r re"), string16::npos); + url_index_->HistoryItemsForTerms(ASCIIToUTF16("r re"), base::string16::npos); ASSERT_EQ(1U, cache.size()); CheckTerm(cache, ASCIIToUTF16("re")); // Simulate typing "reco" giving "r re reco" in the simulated omnibox. // 're' and 'reco' should be cached at this point but not 'r' as it is a // single character. - url_index_->HistoryItemsForTerms(ASCIIToUTF16("r re reco"), string16::npos); + url_index_->HistoryItemsForTerms(ASCIIToUTF16("r re reco"), + base::string16::npos); ASSERT_EQ(2U, cache.size()); CheckTerm(cache, ASCIIToUTF16("re")); CheckTerm(cache, ASCIIToUTF16("reco")); @@ -790,18 +793,20 @@ TEST_F(InMemoryURLIndexTest, TypedCharacterCaching) { // Simulate typing "mort". // Since we now have only one search term, the cached results for 're' and // 'reco' should be purged, giving us only 1 item in the cache (for 'mort'). - url_index_->HistoryItemsForTerms(ASCIIToUTF16("mort"), string16::npos); + url_index_->HistoryItemsForTerms(ASCIIToUTF16("mort"), base::string16::npos); ASSERT_EQ(1U, cache.size()); CheckTerm(cache, ASCIIToUTF16("mort")); // Simulate typing "reco" giving "mort reco" in the simulated omnibox. - url_index_->HistoryItemsForTerms(ASCIIToUTF16("mort reco"), string16::npos); + url_index_->HistoryItemsForTerms(ASCIIToUTF16("mort reco"), + base::string16::npos); ASSERT_EQ(2U, cache.size()); CheckTerm(cache, ASCIIToUTF16("mort")); CheckTerm(cache, ASCIIToUTF16("reco")); // Simulate a <DELETE> by removing the 'reco' and adding back the 'rec'. - url_index_->HistoryItemsForTerms(ASCIIToUTF16("mort rec"), string16::npos); + url_index_->HistoryItemsForTerms(ASCIIToUTF16("mort rec"), + base::string16::npos); ASSERT_EQ(2U, cache.size()); CheckTerm(cache, ASCIIToUTF16("mort")); CheckTerm(cache, ASCIIToUTF16("rec")); @@ -813,7 +818,7 @@ TEST_F(InMemoryURLIndexTest, AddNewRows) { // Newly created URLRows get a last_visit time of 'right now' so it should // qualify as a quick result candidate. EXPECT_TRUE(url_index_->HistoryItemsForTerms( - ASCIIToUTF16("brokeandalone"), string16::npos).empty()); + ASCIIToUTF16("brokeandalone"), base::string16::npos).empty()); // Add a new row. URLRow new_row(GURL("http://www.brokeandaloneinmanitoba.com/"), new_row_id++); @@ -822,13 +827,13 @@ TEST_F(InMemoryURLIndexTest, AddNewRows) { // Verify that we can retrieve it. EXPECT_EQ(1U, url_index_->HistoryItemsForTerms( - ASCIIToUTF16("brokeandalone"), string16::npos).size()); + ASCIIToUTF16("brokeandalone"), base::string16::npos).size()); // Add it again just to be sure that is harmless and that it does not update // the index. EXPECT_FALSE(UpdateURL(new_row)); EXPECT_EQ(1U, url_index_->HistoryItemsForTerms( - ASCIIToUTF16("brokeandalone"), string16::npos).size()); + ASCIIToUTF16("brokeandalone"), base::string16::npos).size()); // Make up an URL that does not qualify and try to add it. URLRow unqualified_row(GURL("http://www.brokeandaloneinmanitoba.com/"), @@ -838,13 +843,13 @@ TEST_F(InMemoryURLIndexTest, AddNewRows) { TEST_F(InMemoryURLIndexTest, DeleteRows) { ScoredHistoryMatches matches = url_index_->HistoryItemsForTerms( - ASCIIToUTF16("DrudgeReport"), string16::npos); + ASCIIToUTF16("DrudgeReport"), base::string16::npos); ASSERT_EQ(1U, matches.size()); // Delete the URL then search again. EXPECT_TRUE(DeleteURL(matches[0].url_info.url())); EXPECT_TRUE(url_index_->HistoryItemsForTerms( - ASCIIToUTF16("DrudgeReport"), string16::npos).empty()); + ASCIIToUTF16("DrudgeReport"), base::string16::npos).empty()); // Make up an URL that does not exist in the database and delete it. GURL url("http://www.hokeypokey.com/putyourrightfootin.html"); @@ -853,7 +858,7 @@ TEST_F(InMemoryURLIndexTest, DeleteRows) { TEST_F(InMemoryURLIndexTest, ExpireRow) { ScoredHistoryMatches matches = url_index_->HistoryItemsForTerms( - ASCIIToUTF16("DrudgeReport"), string16::npos); + ASCIIToUTF16("DrudgeReport"), base::string16::npos); ASSERT_EQ(1U, matches.size()); // Determine the row id for the result, remember that id, broadcast a @@ -865,7 +870,7 @@ TEST_F(InMemoryURLIndexTest, ExpireRow) { content::Source<InMemoryURLIndexTest>(this), content::Details<history::HistoryDetails>(&deleted_details)); EXPECT_TRUE(url_index_->HistoryItemsForTerms( - ASCIIToUTF16("DrudgeReport"), string16::npos).empty()); + ASCIIToUTF16("DrudgeReport"), base::string16::npos).empty()); } TEST_F(InMemoryURLIndexTest, WhitelistedURLs) { diff --git a/chrome/browser/history/page_usage_data.h b/chrome/browser/history/page_usage_data.h index 07f58dd..582f1c3 100644 --- a/chrome/browser/history/page_usage_data.h +++ b/chrome/browser/history/page_usage_data.h @@ -41,11 +41,11 @@ class PageUsageData { return url_; } - void SetTitle(const string16& s) { + void SetTitle(const base::string16& s) { title_ = s; } - const string16& GetTitle() const { + const base::string16& GetTitle() const { return title_; } @@ -71,7 +71,7 @@ class PageUsageData { private: history::SegmentID id_; GURL url_; - string16 title_; + base::string16 title_; double score_; diff --git a/chrome/browser/history/query_parser.cc b/chrome/browser/history/query_parser.cc index 322da23..f61de1a 100644 --- a/chrome/browser/history/query_parser.cc +++ b/chrome/browser/history/query_parser.cc @@ -75,17 +75,17 @@ bool IsQueryQuote(wchar_t ch) { // A QueryNodeWord is a single word in the query. class QueryNodeWord : public QueryNode { public: - explicit QueryNodeWord(const string16& word); + explicit QueryNodeWord(const base::string16& word); virtual ~QueryNodeWord(); - const string16& word() const { return word_; } + const base::string16& word() const { return word_; } void set_literal(bool literal) { literal_ = literal; } // QueryNode: virtual int AppendToSQLiteQuery(string16* query) const OVERRIDE; virtual bool IsWord() const OVERRIDE; - virtual bool Matches(const string16& word, bool exact) const OVERRIDE; + virtual bool Matches(const base::string16& word, bool exact) const OVERRIDE; virtual bool HasMatchIn( const std::vector<QueryWord>& words, Snippet::MatchPositions* match_positions) const OVERRIDE; @@ -94,13 +94,13 @@ class QueryNodeWord : public QueryNode { virtual void AppendWords(std::vector<string16>* words) const OVERRIDE; private: - string16 word_; + base::string16 word_; bool literal_; DISALLOW_COPY_AND_ASSIGN(QueryNodeWord); }; -QueryNodeWord::QueryNodeWord(const string16& word) +QueryNodeWord::QueryNodeWord(const base::string16& word) : word_(word), literal_(false) {} @@ -119,7 +119,7 @@ bool QueryNodeWord::IsWord() const { return true; } -bool QueryNodeWord::Matches(const string16& word, bool exact) const { +bool QueryNodeWord::Matches(const base::string16& word, bool exact) const { if (exact || !QueryParser::IsWordLongEnoughForPrefixSearch(word_)) return word == word_; return word.size() >= word_.size() && @@ -149,7 +149,7 @@ bool QueryNodeWord::HasMatchIn(const std::vector<QueryWord>& words) const { return false; } -void QueryNodeWord::AppendWords(std::vector<string16>* words) const { +void QueryNodeWord::AppendWords(std::vector<base::string16>* words) const { words->push_back(word_); } @@ -169,18 +169,18 @@ class QueryNodeList : public QueryNode { void RemoveEmptySubnodes(); // QueryNode: - virtual int AppendToSQLiteQuery(string16* query) const OVERRIDE; + virtual int AppendToSQLiteQuery(base::string16* query) const OVERRIDE; virtual bool IsWord() const OVERRIDE; - virtual bool Matches(const string16& word, bool exact) const OVERRIDE; + virtual bool Matches(const base::string16& word, bool exact) const OVERRIDE; virtual bool HasMatchIn( const std::vector<QueryWord>& words, Snippet::MatchPositions* match_positions) const OVERRIDE; virtual bool HasMatchIn( const std::vector<QueryWord>& words) const OVERRIDE; - virtual void AppendWords(std::vector<string16>* words) const OVERRIDE; + virtual void AppendWords(std::vector<base::string16>* words) const OVERRIDE; protected: - int AppendChildrenToString(string16* query) const; + int AppendChildrenToString(base::string16* query) const; QueryNodeVector children_; @@ -213,7 +213,7 @@ void QueryNodeList::RemoveEmptySubnodes() { } } -int QueryNodeList::AppendToSQLiteQuery(string16* query) const { +int QueryNodeList::AppendToSQLiteQuery(base::string16* query) const { return AppendChildrenToString(query); } @@ -221,7 +221,7 @@ bool QueryNodeList::IsWord() const { return false; } -bool QueryNodeList::Matches(const string16& word, bool exact) const { +bool QueryNodeList::Matches(const base::string16& word, bool exact) const { NOTREACHED(); return false; } @@ -237,12 +237,12 @@ bool QueryNodeList::HasMatchIn(const std::vector<QueryWord>& words) const { return false; } -void QueryNodeList::AppendWords(std::vector<string16>* words) const { +void QueryNodeList::AppendWords(std::vector<base::string16>* words) const { for (size_t i = 0; i < children_.size(); ++i) children_[i]->AppendWords(words); } -int QueryNodeList::AppendChildrenToString(string16* query) const { +int QueryNodeList::AppendChildrenToString(base::string16* query) const { int num_words = 0; for (QueryNodeVector::const_iterator node = children_.begin(); node != children_.end(); ++node) { @@ -260,7 +260,7 @@ class QueryNodePhrase : public QueryNodeList { virtual ~QueryNodePhrase(); // QueryNodeList: - virtual int AppendToSQLiteQuery(string16* query) const OVERRIDE; + virtual int AppendToSQLiteQuery(base::string16* query) const OVERRIDE; virtual bool HasMatchIn( const std::vector<QueryWord>& words, Snippet::MatchPositions* match_positions) const OVERRIDE; @@ -278,7 +278,7 @@ QueryNodePhrase::QueryNodePhrase() {} QueryNodePhrase::~QueryNodePhrase() {} -int QueryNodePhrase::AppendToSQLiteQuery(string16* query) const { +int QueryNodePhrase::AppendToSQLiteQuery(base::string16* query) const { query->push_back(L'"'); int num_words = AppendChildrenToString(query); query->push_back(L'"'); @@ -332,7 +332,7 @@ bool QueryNodePhrase::HasMatchIn(const std::vector<QueryWord>& words) const { QueryParser::QueryParser() {} // static -bool QueryParser::IsWordLongEnoughForPrefixSearch(const string16& word) { +bool QueryParser::IsWordLongEnoughForPrefixSearch(const base::string16& word) { DCHECK(!word.empty()); size_t minimum_length = 3; // We intentionally exclude Hangul Jamos (both Conjoining and compatibility) @@ -343,14 +343,15 @@ bool QueryParser::IsWordLongEnoughForPrefixSearch(const string16& word) { return word.size() >= minimum_length; } -int QueryParser::ParseQuery(const string16& query, string16* sqlite_query) { +int QueryParser::ParseQuery(const base::string16& query, + base::string16* sqlite_query) { QueryNodeList root; if (!ParseQueryImpl(query, &root)) return 0; return root.AppendToSQLiteQuery(sqlite_query); } -void QueryParser::ParseQueryWords(const string16& query, +void QueryParser::ParseQueryWords(const base::string16& query, std::vector<string16>* words) { QueryNodeList root; if (!ParseQueryImpl(query, &root)) @@ -358,21 +359,21 @@ void QueryParser::ParseQueryWords(const string16& query, root.AppendWords(words); } -void QueryParser::ParseQueryNodes(const string16& query, +void QueryParser::ParseQueryNodes(const base::string16& query, std::vector<QueryNode*>* nodes) { QueryNodeList root; if (ParseQueryImpl(base::i18n::ToLower(query), &root)) nodes->swap(*root.children()); } -bool QueryParser::DoesQueryMatch(const string16& text, +bool QueryParser::DoesQueryMatch(const base::string16& text, const std::vector<QueryNode*>& query_nodes, Snippet::MatchPositions* match_positions) { if (query_nodes.empty()) return false; std::vector<QueryWord> query_words; - string16 lower_text = base::i18n::ToLower(text); + base::string16 lower_text = base::i18n::ToLower(text); ExtractQueryWords(lower_text, &query_words); if (query_words.empty()) @@ -408,7 +409,8 @@ bool QueryParser::DoesQueryMatch(const std::vector<QueryWord>& query_words, return true; } -bool QueryParser::ParseQueryImpl(const string16& query, QueryNodeList* root) { +bool QueryParser::ParseQueryImpl(const base::string16& query, + QueryNodeList* root) { base::i18n::BreakIterator iter(query, base::i18n::BreakIterator::BREAK_WORD); // TODO(evanm): support a locale here if (!iter.Init()) @@ -448,7 +450,7 @@ bool QueryParser::ParseQueryImpl(const string16& query, QueryNodeList* root) { return true; } -void QueryParser::ExtractQueryWords(const string16& text, +void QueryParser::ExtractQueryWords(const base::string16& text, std::vector<QueryWord>* words) { base::i18n::BreakIterator iter(text, base::i18n::BreakIterator::BREAK_WORD); // TODO(evanm): support a locale here @@ -460,7 +462,7 @@ void QueryParser::ExtractQueryWords(const string16& text, // is not necessarily a word, but could also be a sequence of punctuation // or whitespace. if (iter.IsWord()) { - string16 word = iter.GetString(); + base::string16 word = iter.GetString(); if (!word.empty()) { words->push_back(QueryWord()); words->back().word = word; diff --git a/chrome/browser/history/query_parser.h b/chrome/browser/history/query_parser.h index fe69e0b..02f40f6 100644 --- a/chrome/browser/history/query_parser.h +++ b/chrome/browser/history/query_parser.h @@ -16,7 +16,7 @@ class QueryNodeList; // Used by HasMatchIn. struct QueryWord { // The work to match against. - string16 word; + base::string16 word; // The starting position of the word in the original text. size_t position; @@ -31,14 +31,14 @@ class QueryNode { // Serialize ourselves out to a string that can be passed to SQLite. Returns // the number of words in this node. - virtual int AppendToSQLiteQuery(string16* query) const = 0; + virtual int AppendToSQLiteQuery(base::string16* query) const = 0; // Return true if this is a QueryNodeWord, false if it's a QueryNodeList. virtual bool IsWord() const = 0; // Returns true if this node matches |word|. If |exact| is true, the string // must exactly match. Otherwise, this uses a starts with comparison. - virtual bool Matches(const string16& word, bool exact) const = 0; + virtual bool Matches(const base::string16& word, bool exact) const = 0; // Returns true if this node matches at least one of the words in |words|. An // entry is added to |match_positions| for all matching words giving the @@ -50,7 +50,7 @@ class QueryNode { virtual bool HasMatchIn(const std::vector<QueryWord>& words) const = 0; // Appends the words that make up this node in |words|. - virtual void AppendWords(std::vector<string16>* words) const = 0; + virtual void AppendWords(std::vector<base::string16>* words) const = 0; }; // This class is used to parse queries entered into the history search into more @@ -66,27 +66,29 @@ class QueryParser { // point doing anything for them and we only adjust the minimum length // to 2 for Korean Hangul while using 3 for others. This is a temporary // hack until we have a segmentation support. - static bool IsWordLongEnoughForPrefixSearch(const string16& word); + static bool IsWordLongEnoughForPrefixSearch(const base::string16& word); // Parse a query into a SQLite query. The resulting query is placed in // |sqlite_query| and the number of words is returned. - int ParseQuery(const string16& query, string16* sqlite_query); + int ParseQuery(const base::string16& query, base::string16* sqlite_query); // Parses |query|, returning the words that make up it. Any words in quotes // are put in |words| without the quotes. For example, the query text // "foo bar" results in two entries being added to words, one for foo and one // for bar. - void ParseQueryWords(const string16& query, std::vector<string16>* words); + void ParseQueryWords(const base::string16& query, + std::vector<string16>* words); // Parses |query|, returning the nodes that constitute the valid words in the // query. This is intended for later usage with DoesQueryMatch. Ownership of // the nodes passes to the caller. - void ParseQueryNodes(const string16& query, std::vector<QueryNode*>* nodes); + void ParseQueryNodes(const base::string16& query, + std::vector<QueryNode*>* nodes); // Returns true if the string text matches the query nodes created by a call // to ParseQuery. If the query does match, each of the matching positions in // the text is added to |match_positions|. - bool DoesQueryMatch(const string16& text, + bool DoesQueryMatch(const base::string16& text, const std::vector<QueryNode*>& nodes, Snippet::MatchPositions* match_positions); @@ -96,12 +98,13 @@ class QueryParser { const std::vector<QueryNode*>& nodes); // Extracts the words from |text|, placing each word into |words|. - void ExtractQueryWords(const string16& text, std::vector<QueryWord>* words); + void ExtractQueryWords(const base::string16& text, + std::vector<QueryWord>* words); private: // Does the work of parsing |query|; creates nodes in |root| as appropriate. // This is invoked from both of the ParseQuery methods. - bool ParseQueryImpl(const string16& query, QueryNodeList* root); + bool ParseQueryImpl(const base::string16& query, QueryNodeList* root); DISALLOW_COPY_AND_ASSIGN(QueryParser); }; diff --git a/chrome/browser/history/query_parser_unittest.cc b/chrome/browser/history/query_parser_unittest.cc index 4982b30..ebc91e4 100644 --- a/chrome/browser/history/query_parser_unittest.cc +++ b/chrome/browser/history/query_parser_unittest.cc @@ -24,7 +24,7 @@ class QueryParserTest : public testing::Test { // Test helper: Convert a user query string in 8-bit (for hardcoding // convenience) to a SQLite query string. std::string QueryParserTest::QueryToString(const std::string& query) { - string16 sqlite_query; + base::string16 sqlite_query; query_parser_.ParseQuery(UTF8ToUTF16(query), &sqlite_query); return UTF16ToUTF8(sqlite_query); } @@ -80,7 +80,7 @@ TEST_F(QueryParserTest, NumWords) { }; for (size_t i = 0; i < arraysize(data); ++i) { - string16 query_string; + base::string16 query_string; EXPECT_EQ(data[i].expected_word_count, query_parser_.ParseQuery(UTF8ToUTF16(data[i].input), &query_string)); diff --git a/chrome/browser/history/scored_history_match.cc b/chrome/browser/history/scored_history_match.cc index 3494d52..84ca61b 100644 --- a/chrome/browser/history/scored_history_match.cc +++ b/chrome/browser/history/scored_history_match.cc @@ -48,7 +48,7 @@ ScoredHistoryMatch::ScoredHistoryMatch() ScoredHistoryMatch::ScoredHistoryMatch(const URLRow& row, const VisitInfoVector& visits, const std::string& languages, - const string16& lower_string, + const base::string16& lower_string, const String16Vector& terms, const RowWordStarts& word_starts, const base::Time now, @@ -64,12 +64,12 @@ ScoredHistoryMatch::ScoredHistoryMatch(const URLRow& row, // Figure out where each search term appears in the URL and/or page title // so that we can score as well as provide autocomplete highlighting. - string16 url = CleanUpUrlForMatching(gurl, languages); - string16 title = CleanUpTitleForMatching(row.title()); + base::string16 url = CleanUpUrlForMatching(gurl, languages); + base::string16 title = CleanUpTitleForMatching(row.title()); int term_num = 0; for (String16Vector::const_iterator iter = terms.begin(); iter != terms.end(); ++iter, ++term_num) { - string16 term = *iter; + base::string16 term = *iter; TermMatches url_term_matches = MatchTermInString(term, url, term_num); TermMatches title_term_matches = MatchTermInString(term, title, term_num); if (url_term_matches.empty() && title_term_matches.empty()) @@ -134,7 +134,7 @@ ScoredHistoryMatch::ScoredHistoryMatch(const URLRow& row, // Now, the code that implements this. // The deepest prefix for this URL regardless of where the match is. const URLPrefix* best_prefix = - URLPrefix::BestURLPrefix(UTF8ToUTF16(gurl.spec()), string16()); + URLPrefix::BestURLPrefix(UTF8ToUTF16(gurl.spec()), base::string16()); DCHECK(best_prefix != NULL); const int num_components_in_best_prefix = best_prefix->num_components; // If the URL is inlineable, we must have a match. Note the prefix that @@ -276,7 +276,7 @@ TermMatches ScoredHistoryMatch::FilterTermMatchesByWordStarts( float ScoredHistoryMatch::GetTopicalityScore( const int num_terms, - const string16& url, + const base::string16& url, const RowWordStarts& word_starts) { // Because the below thread is not thread safe, we check that we're // only calling it from one thread: the UI thread. Specifically, diff --git a/chrome/browser/history/scored_history_match.h b/chrome/browser/history/scored_history_match.h index 2e2af77..839459e 100644 --- a/chrome/browser/history/scored_history_match.h +++ b/chrome/browser/history/scored_history_match.h @@ -45,7 +45,7 @@ class ScoredHistoryMatch : public history::HistoryMatch { ScoredHistoryMatch(const URLRow& row, const VisitInfoVector& visits, const std::string& languages, - const string16& lower_string, + const base::string16& lower_string, const String16Vector& terms_vector, const RowWordStarts& word_starts, const base::Time now, @@ -91,7 +91,7 @@ class ScoredHistoryMatch : public history::HistoryMatch { // process so they only reflect matches used for scoring. (For // instance, some mid-word matches are not given credit in scoring.) float GetTopicalityScore(const int num_terms, - const string16& cleaned_up_url, + const base::string16& cleaned_up_url, const RowWordStarts& word_starts); // Precalculates raw_term_score_to_topicality_score_, used in diff --git a/chrome/browser/history/scored_history_match_unittest.cc b/chrome/browser/history/scored_history_match_unittest.cc index 2a22152..7f9a26e 100644 --- a/chrome/browser/history/scored_history_match_unittest.cc +++ b/chrome/browser/history/scored_history_match_unittest.cc @@ -51,9 +51,9 @@ class ScoredHistoryMatchTest : public testing::Test { // term match and word break information automatically that are needed // to call GetTopicalityScore(). It only works for scoring a single term, // not multiple terms. - float GetTopicalityScoreOfTermAgainstURLAndTitle(const string16& term, - const string16& url, - const string16& title); + float GetTopicalityScoreOfTermAgainstURLAndTitle(const base::string16& term, + const base::string16& url, + const base::string16& title); }; URLRow ScoredHistoryMatchTest::MakeURLRow(const char* url, @@ -93,9 +93,9 @@ String16Vector ScoredHistoryMatchTest::Make2Terms(const char* term_1, } float ScoredHistoryMatchTest::GetTopicalityScoreOfTermAgainstURLAndTitle( - const string16& term, - const string16& url, - const string16& title) { + const base::string16& term, + const base::string16& url, + const base::string16& title) { // Make an empty match and simply populate the fields we need in order // to call GetTopicalityScore(). ScoredHistoryMatch scored_match; @@ -361,9 +361,9 @@ TEST_F(ScoredHistoryMatchTest, GetTopicalityScoreTrailingSlash) { // This function only tests scoring of single terms that match exactly // once somewhere in the URL or title. TEST_F(ScoredHistoryMatchTest, GetTopicalityScore) { - string16 url = ASCIIToUTF16("http://abc.def.com/path1/path2?" + base::string16 url = ASCIIToUTF16("http://abc.def.com/path1/path2?" "arg1=val1&arg2=val2#hash_component"); - string16 title = ASCIIToUTF16("here is a title"); + base::string16 title = ASCIIToUTF16("here is a title"); const float hostname_score = GetTopicalityScoreOfTermAgainstURLAndTitle( ASCIIToUTF16("abc"), url, title); diff --git a/chrome/browser/history/shortcuts_backend.cc b/chrome/browser/history/shortcuts_backend.cc index 3fba50e..a5abb3fe 100644 --- a/chrome/browser/history/shortcuts_backend.cc +++ b/chrome/browser/history/shortcuts_backend.cc @@ -82,15 +82,15 @@ ShortcutsBackend::Shortcut::MatchCore::MatchCore( } ShortcutsBackend::Shortcut::MatchCore::MatchCore( - const string16& fill_into_edit, + const base::string16& fill_into_edit, const GURL& destination_url, - const string16& contents, + const base::string16& contents, const ACMatchClassifications& contents_class, - const string16& description, + const base::string16& description, const ACMatchClassifications& description_class, content::PageTransition transition, AutocompleteMatch::Type type, - const string16& keyword) + const base::string16& keyword) : fill_into_edit(fill_into_edit), destination_url(destination_url), contents(contents), @@ -124,7 +124,7 @@ AutocompleteMatch ShortcutsBackend::Shortcut::MatchCore::ToMatch() const { ShortcutsBackend::Shortcut::Shortcut( const std::string& id, - const string16& text, + const base::string16& text, const MatchCore& match_core, const base::Time& last_access_time, int number_of_hits) @@ -189,9 +189,9 @@ void ShortcutsBackend::RemoveObserver(ShortcutsBackendObserver* obs) { observer_list_.RemoveObserver(obs); } -void ShortcutsBackend::AddOrUpdateShortcut(const string16& text, +void ShortcutsBackend::AddOrUpdateShortcut(const base::string16& text, const AutocompleteMatch& match) { - const string16 text_lowercase(base::i18n::ToLower(text)); + const base::string16 text_lowercase(base::i18n::ToLower(text)); const base::Time now(base::Time::Now()); for (ShortcutMap::const_iterator it( shortcuts_map_.lower_bound(text_lowercase)); diff --git a/chrome/browser/history/shortcuts_backend.h b/chrome/browser/history/shortcuts_backend.h index 242a0c6..a9c2e63 100644 --- a/chrome/browser/history/shortcuts_backend.h +++ b/chrome/browser/history/shortcuts_backend.h @@ -39,35 +39,35 @@ class ShortcutsBackend : public RefcountedBrowserContextKeyedService, // The pieces of an AutocompleteMatch that we preserve in a shortcut. struct MatchCore { explicit MatchCore(const AutocompleteMatch& match); - MatchCore(const string16& fill_into_edit, + MatchCore(const base::string16& fill_into_edit, const GURL& destination_url, - const string16& contents, + const base::string16& contents, const ACMatchClassifications& contents_class, - const string16& description, + const base::string16& description, const ACMatchClassifications& description_class, content::PageTransition transition, AutocompleteMatch::Type type, - const string16& keyword); + const base::string16& keyword); ~MatchCore(); AutocompleteMatch ToMatch() const; - string16 fill_into_edit; + base::string16 fill_into_edit; GURL destination_url; - string16 contents; + base::string16 contents; // For both contents_class and description_class, we strip MATCH // classifications; the ShortcutsProvider will re-mark MATCH regions based // on the user's current typing. ACMatchClassifications contents_class; - string16 description; + base::string16 description; ACMatchClassifications description_class; content::PageTransition transition; AutocompleteMatch::Type type; - string16 keyword; + base::string16 keyword; }; Shortcut(const std::string& id, - const string16& text, + const base::string16& text, const MatchCore& match_core, const base::Time& last_access_time, int number_of_hits); @@ -76,7 +76,7 @@ class ShortcutsBackend : public RefcountedBrowserContextKeyedService, ~Shortcut(); std::string id; // Unique guid for the shortcut. - string16 text; // The user's original input string. + base::string16 text; // The user's original input string. MatchCore match_core; base::Time last_access_time; // Last time shortcut was selected. int number_of_hits; // How many times shortcut was selected. @@ -119,7 +119,7 @@ class ShortcutsBackend : public RefcountedBrowserContextKeyedService, // Looks for an existing shortcut to match.destination_url that starts with // |text|. Updates that shortcut if found, otherwise adds a new shortcut. - void AddOrUpdateShortcut(const string16& text, + void AddOrUpdateShortcut(const base::string16& text, const AutocompleteMatch& match); private: diff --git a/chrome/browser/history/shortcuts_backend_unittest.cc b/chrome/browser/history/shortcuts_backend_unittest.cc index 8f752e9..30abe74 100644 --- a/chrome/browser/history/shortcuts_backend_unittest.cc +++ b/chrome/browser/history/shortcuts_backend_unittest.cc @@ -25,7 +25,7 @@ namespace { AutocompleteMatch::Type ConvertedMatchType(AutocompleteMatch::Type type) { return ShortcutsBackend::Shortcut( - std::string(), string16(), ShortcutsBackend::Shortcut::MatchCore( + std::string(), base::string16(), ShortcutsBackend::Shortcut::MatchCore( AutocompleteMatch(NULL, 0, 0, type)), base::Time::Now(), 0).match_core.type; } diff --git a/chrome/browser/history/snippet.cc b/chrome/browser/history/snippet.cc index e1069a6..f73f56e 100644 --- a/chrome/browser/history/snippet.cc +++ b/chrome/browser/history/snippet.cc @@ -211,7 +211,7 @@ void Snippet::ComputeSnippet(const MatchPositions& match_positions, // The length of snippets we try to produce. // We can generate longer snippets but stop once we cross kSnippetMaxLength. const size_t kSnippetMaxLength = 200; - const string16 kEllipsis = ASCIIToUTF16(" ... "); + const base::string16 kEllipsis = ASCIIToUTF16(" ... "); UText* document_utext = NULL; UErrorCode status = U_ZERO_ERROR; @@ -227,7 +227,7 @@ void Snippet::ComputeSnippet(const MatchPositions& match_positions, // We build the snippet by iterating through the matches and then grabbing // context around each match. If matches are near enough each other (within // kSnippetContext), we skip the "..." between them. - string16 snippet; + base::string16 snippet; size_t start = 0; for (size_t i = 0; i < match_positions.size(); ++i) { // Some shorter names for the current match. diff --git a/chrome/browser/history/snippet.h b/chrome/browser/history/snippet.h index 058fbbd..9e6fdb0 100644 --- a/chrome/browser/history/snippet.h +++ b/chrome/browser/history/snippet.h @@ -52,7 +52,7 @@ class Snippet { void ComputeSnippet(const MatchPositions& matches, const std::string& document); - const string16& text() const { return text_; } + const base::string16& text() const { return text_; } const MatchPositions& matches() const { return matches_; } // Efficiently swaps the contents of this snippet with the other. @@ -60,7 +60,7 @@ class Snippet { private: // The text of the snippet. - string16 text_; + base::string16 text_; // The matches within text_. MatchPositions matches_; diff --git a/chrome/browser/history/snippet_unittest.cc b/chrome/browser/history/snippet_unittest.cc index 8f39d6d..e05836b 100644 --- a/chrome/browser/history/snippet_unittest.cc +++ b/chrome/browser/history/snippet_unittest.cc @@ -120,7 +120,7 @@ string16 BuildSnippet(const std::string& document, snippet.ComputeSnippet(match_positions, document); // Now "highlight" all matches in the snippet with **. - string16 star_snippet; + base::string16 star_snippet; Snippet::MatchPositions::const_iterator match; size_t pos = 0; for (match = snippet.matches().begin(); diff --git a/chrome/browser/history/top_sites_cache_unittest.cc b/chrome/browser/history/top_sites_cache_unittest.cc index 947e7f6..89ee386 100644 --- a/chrome/browser/history/top_sites_cache_unittest.cc +++ b/chrome/browser/history/top_sites_cache_unittest.cc @@ -50,7 +50,7 @@ void TopSitesCacheTest::BuildTopSites(const char** spec, size_t size) { NOTREACHED() << "Duplicate URL found: " << spec_item; urls_seen.insert(spec_item); if (spec_item == spec[i]) { // No indent: add new MostVisitedURL. - string16 title(ASCIIToUTF16("Title ") + + base::string16 title(ASCIIToUTF16("Title ") + base::Uint64ToString16(top_sites_.size() + 1)); top_sites_.push_back(MostVisitedURL(GURL(spec_item), title)); } diff --git a/chrome/browser/history/top_sites_impl_unittest.cc b/chrome/browser/history/top_sites_impl_unittest.cc index dac6efe..8c6a253 100644 --- a/chrome/browser/history/top_sites_impl_unittest.cc +++ b/chrome/browser/history/top_sites_impl_unittest.cc @@ -243,7 +243,7 @@ class TopSitesImplTest : public HistoryUnitTestBase { } // Adds a page to history. - void AddPageToHistory(const GURL& url, const string16& title) { + void AddPageToHistory(const GURL& url, const base::string16& title) { RedirectList redirects; redirects.push_back(url); history_service()->AddPage( @@ -255,7 +255,7 @@ class TopSitesImplTest : public HistoryUnitTestBase { // Adds a page to history. void AddPageToHistory(const GURL& url, - const string16& title, + const base::string16& title, const history::RedirectList& redirects, base::Time time) { history_service()->AddPage( @@ -649,11 +649,11 @@ TEST_F(TopSitesImplTest, GetMostVisited) { TEST_F(TopSitesImplTest, SaveToDB) { MostVisitedURL url; GURL asdf_url("http://asdf.com"); - string16 asdf_title(ASCIIToUTF16("ASDF")); + base::string16 asdf_title(ASCIIToUTF16("ASDF")); GURL google_url("http://google.com"); - string16 google_title(ASCIIToUTF16("Google")); + base::string16 google_title(ASCIIToUTF16("Google")); GURL news_url("http://news.google.com"); - string16 news_title(ASCIIToUTF16("Google News")); + base::string16 news_title(ASCIIToUTF16("Google News")); // Add asdf_url to history. AddPageToHistory(asdf_url, asdf_title); @@ -713,11 +713,11 @@ TEST_F(TopSitesImplTest, SaveToDB) { TEST_F(TopSitesImplTest, SaveForcedToDB) { MostVisitedURL url; GURL asdf_url("http://asdf.com"); - string16 asdf_title(ASCIIToUTF16("ASDF")); + base::string16 asdf_title(ASCIIToUTF16("ASDF")); GURL google_url("http://google.com"); - string16 google_title(ASCIIToUTF16("Google")); + base::string16 google_title(ASCIIToUTF16("Google")); GURL news_url("http://news.google.com"); - string16 news_title(ASCIIToUTF16("Google News")); + base::string16 news_title(ASCIIToUTF16("Google News")); // Add a number of forced URLs. std::vector<MostVisitedURL> list; @@ -773,13 +773,13 @@ TEST_F(TopSitesImplTest, SaveForcedToDB) { TEST_F(TopSitesImplTest, RealDatabase) { MostVisitedURL url; GURL asdf_url("http://asdf.com"); - string16 asdf_title(ASCIIToUTF16("ASDF")); + base::string16 asdf_title(ASCIIToUTF16("ASDF")); GURL google1_url("http://google.com"); GURL google2_url("http://google.com/redirect"); GURL google3_url("http://www.google.com"); - string16 google_title(ASCIIToUTF16("Google")); + base::string16 google_title(ASCIIToUTF16("Google")); GURL news_url("http://news.google.com"); - string16 news_title(ASCIIToUTF16("Google News")); + base::string16 news_title(ASCIIToUTF16("Google News")); url.url = asdf_url; url.title = asdf_title; @@ -887,9 +887,9 @@ TEST_F(TopSitesImplTest, DeleteNotifications) { GURL google1_url("http://google.com"); GURL google2_url("http://google.com/redirect"); GURL google3_url("http://www.google.com"); - string16 google_title(ASCIIToUTF16("Google")); + base::string16 google_title(ASCIIToUTF16("Google")); GURL news_url("http://news.google.com"); - string16 news_title(ASCIIToUTF16("Google News")); + base::string16 news_title(ASCIIToUTF16("Google News")); AddPageToHistory(google1_url, google_title); AddPageToHistory(news_url, news_title); diff --git a/chrome/browser/history/url_database.cc b/chrome/browser/history/url_database.cc index 1c90cda..e1149b2 100644 --- a/chrome/browser/history/url_database.cc +++ b/chrome/browser/history/url_database.cc @@ -331,7 +331,7 @@ bool URLDatabase::FindShortestURLFromBase(const std::string& base, return true; } -bool URLDatabase::GetTextMatches(const string16& query, +bool URLDatabase::GetTextMatches(const base::string16& query, URLRows* results) { ScopedVector<QueryNode> query_nodes; query_parser_.ParseQueryNodes(query, &query_nodes.get()); @@ -342,19 +342,19 @@ bool URLDatabase::GetTextMatches(const string16& query, while (statement.Step()) { std::vector<QueryWord> query_words; - string16 url = base::i18n::ToLower(statement.ColumnString16(1)); + base::string16 url = base::i18n::ToLower(statement.ColumnString16(1)); query_parser_.ExtractQueryWords(url, &query_words); GURL gurl(url); if (gurl.is_valid()) { // Decode punycode to match IDN. // |query_words| won't be shown to user - therefore we can use empty // |languages| to reduce dependency (no need to call PrefService). - string16 ascii = base::ASCIIToUTF16(gurl.host()); - string16 utf = net::IDNToUnicode(gurl.host(), std::string()); + base::string16 ascii = base::ASCIIToUTF16(gurl.host()); + base::string16 utf = net::IDNToUnicode(gurl.host(), std::string()); if (ascii != utf) query_parser_.ExtractQueryWords(utf, &query_words); } - string16 title = base::i18n::ToLower(statement.ColumnString16(2)); + base::string16 title = base::i18n::ToLower(statement.ColumnString16(2)); query_parser_.ExtractQueryWords(title, &query_words); if (query_parser_.DoesQueryMatch(query_words, query_nodes.get())) { @@ -411,7 +411,7 @@ bool URLDatabase::DropKeywordSearchTermsTable() { bool URLDatabase::SetKeywordSearchTermsForURL(URLID url_id, TemplateURLID keyword_id, - const string16& term) { + const base::string16& term) { DCHECK(url_id && keyword_id && !term.empty()); sql::Statement exist_statement(GetDB().GetCachedStatement(SQL_FROM_HERE, @@ -455,7 +455,7 @@ bool URLDatabase::GetKeywordSearchTermRow(URLID url_id, } bool URLDatabase::GetKeywordSearchTermRows( - const string16& term, + const base::string16& term, std::vector<KeywordSearchTermRow>* rows) { sql::Statement statement(GetDB().GetCachedStatement(SQL_FROM_HERE, "SELECT keyword_id, url_id FROM keyword_search_terms WHERE term=?")); @@ -486,7 +486,7 @@ void URLDatabase::DeleteAllSearchTermsForKeyword( void URLDatabase::GetMostRecentKeywordSearchTerms( TemplateURLID keyword_id, - const string16& prefix, + const base::string16& prefix, int max_count, std::vector<KeywordSearchTermVisit>* matches) { // NOTE: the keyword_id can be zero if on first run the user does a query @@ -504,9 +504,9 @@ void URLDatabase::GetMostRecentKeywordSearchTerms( "ORDER BY u.last_visit_time DESC LIMIT ?")); // NOTE: Keep this ToLower() call in sync with search_provider.cc. - string16 lower_prefix = base::i18n::ToLower(prefix); + base::string16 lower_prefix = base::i18n::ToLower(prefix); // This magic gives us a prefix search. - string16 next_prefix = lower_prefix; + base::string16 next_prefix = lower_prefix; next_prefix[next_prefix.size() - 1] = next_prefix[next_prefix.size() - 1] + 1; statement.BindInt64(0, keyword_id); @@ -523,7 +523,7 @@ void URLDatabase::GetMostRecentKeywordSearchTerms( } } -bool URLDatabase::DeleteKeywordSearchTerm(const string16& term) { +bool URLDatabase::DeleteKeywordSearchTerm(const base::string16& term) { sql::Statement statement(GetDB().GetCachedStatement(SQL_FROM_HERE, "DELETE FROM keyword_search_terms WHERE term=?")); statement.BindString16(0, term); diff --git a/chrome/browser/history/url_database.h b/chrome/browser/history/url_database.h index 59b942a..a5ee0df 100644 --- a/chrome/browser/history/url_database.h +++ b/chrome/browser/history/url_database.h @@ -181,14 +181,14 @@ class URLDatabase { // Performs a brute force search over the database to find any URLs or titles // which match the |query| string. Returns any matches in |results|. - bool GetTextMatches(const string16& query, URLRows* results); + bool GetTextMatches(const base::string16& query, URLRows* results); // Keyword Search Terms ------------------------------------------------------ // Sets the search terms for the specified url/keyword pair. bool SetKeywordSearchTermsForURL(URLID url_id, TemplateURLID keyword_id, - const string16& term); + const base::string16& term); // Looks up a keyword search term given a url id. Returns all the search terms // in |rows|. Returns true on success. @@ -196,7 +196,7 @@ class URLDatabase { // Looks up all keyword search terms given a term, Fills the rows with data. // Returns true on success and false otherwise. - bool GetKeywordSearchTermRows(const string16& term, + bool GetKeywordSearchTermRows(const base::string16& term, std::vector<KeywordSearchTermRow>* rows); // Deletes all search terms for the specified keyword that have been added by @@ -207,12 +207,12 @@ class URLDatabase { // keyword. void GetMostRecentKeywordSearchTerms( TemplateURLID keyword_id, - const string16& prefix, + const base::string16& prefix, int max_count, std::vector<KeywordSearchTermVisit>* matches); // Deletes all searches matching |term|. - bool DeleteKeywordSearchTerm(const string16& term); + bool DeleteKeywordSearchTerm(const base::string16& term); // Deletes any search corresponding to |url_id|. bool DeleteKeywordSearchTermForURL(URLID url_id); diff --git a/chrome/browser/history/url_database_unittest.cc b/chrome/browser/history/url_database_unittest.cc index cfb0ec0..0f71dd4 100644 --- a/chrome/browser/history/url_database_unittest.cc +++ b/chrome/browser/history/url_database_unittest.cc @@ -134,7 +134,7 @@ TEST_F(URLDatabaseTest, KeywordSearchTermVisit) { // Add a keyword visit. TemplateURLID keyword_id = 100; - string16 keyword = UTF8ToUTF16("visit"); + base::string16 keyword = UTF8ToUTF16("visit"); ASSERT_TRUE(SetKeywordSearchTermsForURL(url_id, keyword_id, keyword)); // Make sure we get it back. @@ -233,7 +233,7 @@ TEST_F(URLDatabaseTest, GetAndDeleteKeywordSearchTermByTerm) { // Add a keyword visit. TemplateURLID keyword_id = 100; - string16 keyword = UTF8ToUTF16("visit"); + base::string16 keyword = UTF8ToUTF16("visit"); ASSERT_TRUE(SetKeywordSearchTermsForURL(url_id1, keyword_id, keyword)); URLRow url_info2(GURL("https://www.google.com/")); @@ -256,7 +256,7 @@ TEST_F(URLDatabaseTest, GetAndDeleteKeywordSearchTermByTerm) { url_info3.set_hidden(false); URLID url_id3 = AddURL(url_info3); ASSERT_NE(0, url_id3); - string16 keyword2 = UTF8ToUTF16("Search"); + base::string16 keyword2 = UTF8ToUTF16("Search"); ASSERT_TRUE(SetKeywordSearchTermsForURL(url_id3, keyword_id, keyword2)); diff --git a/chrome/browser/history/url_index_private_data.cc b/chrome/browser/history/url_index_private_data.cc index b7d9c37..a17b0a4 100644 --- a/chrome/browser/history/url_index_private_data.cc +++ b/chrome/browser/history/url_index_private_data.cc @@ -73,7 +73,8 @@ typedef imui::InMemoryURLIndexCacheItem_WordStartsMapItem_WordStartsMapEntry // Algorithm Functions --------------------------------------------------------- // Comparison function for sorting search terms by descending length. -bool LengthGreater(const string16& string_a, const string16& string_b) { +bool LengthGreater(const base::string16& string_a, + const base::string16& string_b) { return string_a.length() > string_b.length(); } @@ -151,14 +152,14 @@ URLIndexPrivateData::URLIndexPrivateData() } ScoredHistoryMatches URLIndexPrivateData::HistoryItemsForTerms( - string16 search_string, + base::string16 search_string, size_t cursor_position, const std::string& languages, BookmarkService* bookmark_service) { // If cursor position is set and useful (not at either end of the // string), allow the search string to be broken at cursor position. // We do this by pretending there's a space where the cursor is. - if ((cursor_position != string16::npos) && + if ((cursor_position != base::string16::npos) && (cursor_position < search_string.length()) && (cursor_position > 0)) { search_string.insert(cursor_position, ASCIIToUTF16(" ")); @@ -170,8 +171,8 @@ ScoredHistoryMatches URLIndexPrivateData::HistoryItemsForTerms( // the index we need individual, lower-cased words, ignoring escapings. For // the final filtering we need whitespace separated substrings possibly // containing escaped characters. - string16 lower_raw_string(base::i18n::ToLower(search_string)); - string16 lower_unescaped_string = + base::string16 lower_raw_string(base::i18n::ToLower(search_string)); + base::string16 lower_unescaped_string = net::UnescapeURLComponent(lower_raw_string, net::UnescapeRule::SPACES | net::UnescapeRule::URL_SPECIAL_CHARS); // Extract individual 'words' (as opposed to 'terms'; see below) from the @@ -527,7 +528,7 @@ HistoryIDSet URLIndexPrivateData::HistoryIDSetFromWords( std::sort(words.begin(), words.end(), LengthGreater); for (String16Vector::iterator iter = words.begin(); iter != words.end(); ++iter) { - string16 uni_word = *iter; + base::string16 uni_word = *iter; HistoryIDSet term_history_set = HistoryIDsForTerm(uni_word); if (term_history_set.empty()) { history_id_set.clear(); @@ -548,7 +549,7 @@ HistoryIDSet URLIndexPrivateData::HistoryIDSetFromWords( } HistoryIDSet URLIndexPrivateData::HistoryIDsForTerm( - const string16& term) { + const base::string16& term) { if (term.empty()) return HistoryIDSet(); @@ -572,7 +573,7 @@ HistoryIDSet URLIndexPrivateData::HistoryIDsForTerm( // If a prefix was found then determine the leftover characters to be used // for further refining the results from that prefix. Char16Set prefix_chars; - string16 leftovers(term); + base::string16 leftovers(term); if (best_prefix != search_term_cache_.end()) { // If the prefix is an exact match for the term then grab the cached // results and we're done. @@ -624,7 +625,7 @@ HistoryIDSet URLIndexPrivateData::HistoryIDsForTerm( // contains words which do not have the search term as a proper subset. for (WordIDSet::iterator word_set_iter = word_id_set.begin(); word_set_iter != word_id_set.end(); ) { - if (word_list_[*word_set_iter].find(term) == string16::npos) + if (word_list_[*word_set_iter].find(term) == base::string16::npos) word_id_set.erase(word_set_iter++); else ++word_set_iter; @@ -706,7 +707,7 @@ bool URLIndexPrivateData::IndexRow( URLID row_id = row.id(); // Strip out username and password before saving and indexing. - string16 url(net::FormatUrl(gurl, languages, + base::string16 url(net::FormatUrl(gurl, languages, net::kFormatUrlOmitUsernamePassword, net::UnescapeRule::NONE, NULL, NULL, NULL)); @@ -755,10 +756,10 @@ void URLIndexPrivateData::AddRowWordsToIndex(const URLRow& row, HistoryID history_id = static_cast<HistoryID>(row.id()); // Split URL into individual, unique words then add in the title words. const GURL& gurl(row.url()); - const string16& url = CleanUpUrlForMatching(gurl, languages); + const base::string16& url = CleanUpUrlForMatching(gurl, languages); String16Set url_words = String16SetFromString16(url, word_starts ? &word_starts->url_word_starts_ : NULL); - const string16& title = CleanUpTitleForMatching(row.title()); + const base::string16& title = CleanUpTitleForMatching(row.title()); String16Set title_words = String16SetFromString16(title, word_starts ? &word_starts->title_word_starts_ : NULL); String16Set words; @@ -772,7 +773,7 @@ void URLIndexPrivateData::AddRowWordsToIndex(const URLRow& row, search_term_cache_.clear(); // Invalidate the term cache. } -void URLIndexPrivateData::AddWordToIndex(const string16& term, +void URLIndexPrivateData::AddWordToIndex(const base::string16& term, HistoryID history_id) { WordMap::iterator word_pos = word_map_.find(term); if (word_pos != word_map_.end()) @@ -781,7 +782,7 @@ void URLIndexPrivateData::AddWordToIndex(const string16& term, AddWordHistory(term, history_id); } -void URLIndexPrivateData::AddWordHistory(const string16& term, +void URLIndexPrivateData::AddWordHistory(const base::string16& term, HistoryID history_id) { WordID word_id = word_list_.size(); if (available_words_.empty()) { @@ -863,7 +864,7 @@ void URLIndexPrivateData::RemoveRowWordsFromIndex(const URLRow& row) { continue; // The word is still in use. // The word is no longer in use. Reconcile any changes to character usage. - string16 word = word_list_[word_id]; + base::string16 word = word_list_[word_id]; Char16Set characters = Char16SetFromString16(word); for (Char16Set::iterator uni_char_iter = characters.begin(); uni_char_iter != characters.end(); ++uni_char_iter) { @@ -876,7 +877,7 @@ void URLIndexPrivateData::RemoveRowWordsFromIndex(const URLRow& row) { // Complete the removal of references to the word. word_id_history_map_.erase(word_id); word_map_.erase(word); - word_list_[word_id] = string16(); + word_list_[word_id] = base::string16(); available_words_.insert(word_id); } } @@ -1180,7 +1181,7 @@ bool URLIndexPrivateData::RestoreHistoryInfoMap( url_row.set_typed_count(iter->typed_count()); url_row.set_last_visit(base::Time::FromInternalValue(iter->last_visit())); if (iter->has_title()) { - string16 title(UTF8ToUTF16(iter->title())); + base::string16 title(UTF8ToUTF16(iter->title())); url_row.set_title(title); } history_info_map_[history_id].url_row = url_row; @@ -1236,9 +1237,9 @@ bool URLIndexPrivateData::RestoreWordStartsMap( iter != history_info_map_.end(); ++iter) { RowWordStarts word_starts; const URLRow& row(iter->second.url_row); - const string16& url = CleanUpUrlForMatching(row.url(), languages); + const base::string16& url = CleanUpUrlForMatching(row.url(), languages); String16VectorFromString16(url, false, &word_starts.url_word_starts_); - const string16& title = CleanUpTitleForMatching(row.title()); + const base::string16& title = CleanUpTitleForMatching(row.title()); String16VectorFromString16(title, false, &word_starts.title_word_starts_); word_starts_map_[iter->first] = word_starts; } @@ -1275,7 +1276,7 @@ URLIndexPrivateData::AddHistoryMatch::AddHistoryMatch( const URLIndexPrivateData& private_data, const std::string& languages, BookmarkService* bookmark_service, - const string16& lower_string, + const base::string16& lower_string, const String16Vector& lower_terms, const base::Time now) : private_data_(private_data), diff --git a/chrome/browser/history/url_index_private_data.h b/chrome/browser/history/url_index_private_data.h index e8db24b..6e26edf 100644 --- a/chrome/browser/history/url_index_private_data.h +++ b/chrome/browser/history/url_index_private_data.h @@ -48,11 +48,11 @@ class URLIndexPrivateData public: URLIndexPrivateData(); - // Given a string16 in |term_string|, scans the history index and returns a - // vector with all scored, matching history items. The |term_string| is - // broken down into individual terms (words), each of which must occur in the - // candidate history item's URL or page title for the item to qualify; - // however, the terms do not necessarily have to be adjacent. We + // Given a base::string16 in |term_string|, scans the history index and + // returns a vector with all scored, matching history items. The + // |term_string| is broken down into individual terms (words), each of which + // must occur in the candidate history item's URL or page title for the item + // to qualify; however, the terms do not necessarily have to be adjacent. We // also allow breaking |term_string| at |cursor_position| (if // set). Once we have a set of candidates, they are filtered to ensure // that all |term_string| terms, as separated by whitespace and the @@ -67,7 +67,7 @@ class URLIndexPrivateData // to this function. |bookmark_service| is used to boost a result's score if // its URL is referenced by one or more of the user's bookmarks. |languages| // is used to help parse/format the URLs in the history index. - ScoredHistoryMatches HistoryItemsForTerms(string16 term_string, + ScoredHistoryMatches HistoryItemsForTerms(base::string16 term_string, size_t cursor_position, const std::string& languages, BookmarkService* bookmark_service); @@ -189,7 +189,7 @@ class URLIndexPrivateData HistoryIDSet history_id_set_; bool used_; // True if this item has been used for the current term search. }; - typedef std::map<string16, SearchTermCacheItem> SearchTermCacheMap; + typedef std::map<base::string16, SearchTermCacheItem> SearchTermCacheMap; // A helper class which performs the final filter on each candidate // history URL match, inserting accepted matches into |scored_matches_|. @@ -198,7 +198,7 @@ class URLIndexPrivateData AddHistoryMatch(const URLIndexPrivateData& private_data, const std::string& languages, BookmarkService* bookmark_service, - const string16& lower_string, + const base::string16& lower_string, const String16Vector& lower_terms, const base::Time now); ~AddHistoryMatch(); @@ -212,7 +212,7 @@ class URLIndexPrivateData const std::string& languages_; BookmarkService* bookmark_service_; ScoredHistoryMatches scored_matches_; - const string16& lower_string_; + const base::string16& lower_string_; const String16Vector& lower_terms_; const base::Time now_; }; @@ -239,7 +239,7 @@ class URLIndexPrivateData // Helper function to HistoryIDSetFromWords which composes a set of history // ids for the given term given in |term|. - HistoryIDSet HistoryIDsForTerm(const string16& term); + HistoryIDSet HistoryIDsForTerm(const base::string16& term); // Given a set of Char16s, finds words containing those characters. WordIDSet WordIDSetForTermChars(const Char16Set& term_chars); @@ -270,11 +270,11 @@ class URLIndexPrivateData // Given a single word in |uni_word|, adds a reference for the containing // history item identified by |history_id| to the index. - void AddWordToIndex(const string16& uni_word, HistoryID history_id); + void AddWordToIndex(const base::string16& uni_word, HistoryID history_id); // Creates a new entry in the word/history map for |word_id| and add // |history_id| as the initial element of the word's set. - void AddWordHistory(const string16& uni_word, HistoryID history_id); + void AddWordHistory(const base::string16& uni_word, HistoryID history_id); // Updates an existing entry in the word/history index by adding the // |history_id| to set for |word_id| in the word_id_history_map_. diff --git a/chrome/browser/history/web_history_service.cc b/chrome/browser/history/web_history_service.cc index 3816713..a96fb25 100644 --- a/chrome/browser/history/web_history_service.cc +++ b/chrome/browser/history/web_history_service.cc @@ -233,7 +233,7 @@ std::string ServerTimeString(base::Time time) { // |options|. |version_info|, if not empty, should be a token that was received // from the server in response to a write operation. It is used to help ensure // read consistency after a write. -GURL GetQueryUrl(const string16& text_query, +GURL GetQueryUrl(const base::string16& text_query, const QueryOptions& options, const std::string& version_info) { GURL url = GURL(kHistoryQueryHistoryUrl); @@ -299,7 +299,7 @@ WebHistoryService::~WebHistoryService() { } scoped_ptr<WebHistoryService::Request> WebHistoryService::QueryHistory( - const string16& text_query, + const base::string16& text_query, const QueryOptions& options, const WebHistoryService::QueryWebHistoryCallback& callback) { // Wrap the original callback into a generic completion callback. diff --git a/chrome/browser/history/web_history_service.h b/chrome/browser/history/web_history_service.h index 3a234a2..94dc680 100644 --- a/chrome/browser/history/web_history_service.h +++ b/chrome/browser/history/web_history_service.h @@ -59,7 +59,7 @@ class WebHistoryService : public BrowserContextKeyedService { // The caller takes ownership of the returned Request. If it is destroyed, the // request is cancelled. scoped_ptr<Request> QueryHistory( - const string16& text_query, + const base::string16& text_query, const QueryOptions& options, const QueryWebHistoryCallback& callback); diff --git a/chrome/browser/infobars/confirm_infobar_delegate.cc b/chrome/browser/infobars/confirm_infobar_delegate.cc index d7d1ac3..8739edf 100644 --- a/chrome/browser/infobars/confirm_infobar_delegate.cc +++ b/chrome/browser/infobars/confirm_infobar_delegate.cc @@ -37,7 +37,7 @@ bool ConfirmInfoBarDelegate::Cancel() { } string16 ConfirmInfoBarDelegate::GetLinkText() const { - return string16(); + return base::string16(); } bool ConfirmInfoBarDelegate::LinkClicked(WindowOpenDisposition disposition) { diff --git a/chrome/browser/infobars/confirm_infobar_delegate.h b/chrome/browser/infobars/confirm_infobar_delegate.h index 1dd7da0..ce90461 100644 --- a/chrome/browser/infobars/confirm_infobar_delegate.h +++ b/chrome/browser/infobars/confirm_infobar_delegate.h @@ -27,14 +27,14 @@ class ConfirmInfoBarDelegate : public InfoBarDelegate { virtual InfoBarAutomationType GetInfoBarAutomationType() const OVERRIDE; // Returns the message string to be displayed for the InfoBar. - virtual string16 GetMessageText() const = 0; + virtual base::string16 GetMessageText() const = 0; // Return the buttons to be shown for this InfoBar. virtual int GetButtons() const; // Return the label for the specified button. The default implementation // returns "OK" for the OK button and "Cancel" for the Cancel button. - virtual string16 GetButtonLabel(InfoBarButton button) const; + virtual base::string16 GetButtonLabel(InfoBarButton button) const; // Return whether or not the specified button needs elevation. virtual bool NeedElevation(InfoBarButton button) const; @@ -51,7 +51,7 @@ class ConfirmInfoBarDelegate : public InfoBarDelegate { // Returns the text of the link to be displayed, if any. Otherwise returns // and empty string. - virtual string16 GetLinkText() const; + virtual base::string16 GetLinkText() const; // Called when the Link (if any) is clicked. The |disposition| specifies how // the resulting document should be loaded (based on the event flags present diff --git a/chrome/browser/infobars/insecure_content_infobar_delegate.h b/chrome/browser/infobars/insecure_content_infobar_delegate.h index 65d729f..139908f 100644 --- a/chrome/browser/infobars/insecure_content_infobar_delegate.h +++ b/chrome/browser/infobars/insecure_content_infobar_delegate.h @@ -42,11 +42,11 @@ class InsecureContentInfoBarDelegate : public ConfirmInfoBarDelegate { virtual void InfoBarDismissed() OVERRIDE; virtual InsecureContentInfoBarDelegate* AsInsecureContentInfoBarDelegate() 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; InfoBarType type_; diff --git a/chrome/browser/infobars/simple_alert_infobar_delegate.cc b/chrome/browser/infobars/simple_alert_infobar_delegate.cc index 0c092f2..8dc18d8 100644 --- a/chrome/browser/infobars/simple_alert_infobar_delegate.cc +++ b/chrome/browser/infobars/simple_alert_infobar_delegate.cc @@ -11,7 +11,7 @@ // static void SimpleAlertInfoBarDelegate::Create(InfoBarService* infobar_service, int icon_id, - const string16& message, + const base::string16& message, bool auto_expire) { infobar_service->AddInfoBar(ConfirmInfoBarDelegate::CreateInfoBar( scoped_ptr<ConfirmInfoBarDelegate>( @@ -20,7 +20,7 @@ void SimpleAlertInfoBarDelegate::Create(InfoBarService* infobar_service, SimpleAlertInfoBarDelegate::SimpleAlertInfoBarDelegate( int icon_id, - const string16& message, + const base::string16& message, bool auto_expire) : ConfirmInfoBarDelegate(), icon_id_(icon_id), diff --git a/chrome/browser/infobars/simple_alert_infobar_delegate.h b/chrome/browser/infobars/simple_alert_infobar_delegate.h index d2a1ed0..7bd125a 100644 --- a/chrome/browser/infobars/simple_alert_infobar_delegate.h +++ b/chrome/browser/infobars/simple_alert_infobar_delegate.h @@ -16,24 +16,24 @@ class SimpleAlertInfoBarDelegate : public ConfirmInfoBarDelegate { // |infobar_service|. static void Create(InfoBarService* infobar_service, int icon_id, // May be |kNoIconID| if no icon is shown. - const string16& message, + const base::string16& message, bool auto_expire); private: SimpleAlertInfoBarDelegate(int icon_id, - const string16& message, + const base::string16& message, bool auto_expire); virtual ~SimpleAlertInfoBarDelegate(); // ConfirmInfoBarDelegate: virtual int GetIconID() const OVERRIDE; - virtual string16 GetMessageText() const OVERRIDE; + virtual base::string16 GetMessageText() const OVERRIDE; virtual int GetButtons() const OVERRIDE; virtual bool ShouldExpireInternal( const content::LoadCommittedDetails& details) const OVERRIDE; const int icon_id_; - string16 message_; + base::string16 message_; bool auto_expire_; // Should it expire automatically on navigation? DISALLOW_COPY_AND_ASSIGN(SimpleAlertInfoBarDelegate); diff --git a/chrome/browser/local_discovery/privet_notifications.cc b/chrome/browser/local_discovery/privet_notifications.cc index a9aef82..31deebe 100644 --- a/chrome/browser/local_discovery/privet_notifications.cc +++ b/chrome/browser/local_discovery/privet_notifications.cc @@ -234,7 +234,7 @@ bool PrivetNotificationService::IsForced() { void PrivetNotificationService::PrivetNotify(bool has_multiple, bool added) { - string16 product_name = l10n_util::GetStringUTF16( + base::string16 product_name = l10n_util::GetStringUTF16( IDS_LOCAL_DISOCVERY_PRODUCT_NAME_PRINTER); int title_resource = has_multiple ? @@ -245,8 +245,9 @@ void PrivetNotificationService::PrivetNotify(bool has_multiple, IDS_LOCAL_DISOCVERY_NOTIFICATION_CONTENTS_PRINTER_MULTIPLE : IDS_LOCAL_DISOCVERY_NOTIFICATION_CONTENTS_PRINTER; - string16 title = l10n_util::GetStringUTF16(title_resource); - string16 body = l10n_util::GetStringFUTF16(body_resource, product_name); + base::string16 title = l10n_util::GetStringUTF16(title_resource); + base::string16 body = + l10n_util::GetStringFUTF16(body_resource, product_name); Profile* profile_object = Profile::FromBrowserContext(profile_); message_center::RichNotificationData rich_notification_data; diff --git a/chrome/browser/media_galleries/fileapi/picasa_finder.cc b/chrome/browser/media_galleries/fileapi/picasa_finder.cc index 87ec630..68f2c79 100644 --- a/chrome/browser/media_galleries/fileapi/picasa_finder.cc +++ b/chrome/browser/media_galleries/fileapi/picasa_finder.cc @@ -39,7 +39,7 @@ base::FilePath GetCustomPicasaAppDataPathFromWinRegistry() { return base::FilePath(); } - string16 value; + base::string16 value; if (key.ReadValue(kPicasaRegistryAppDataPathKey, &value) != ERROR_SUCCESS) return base::FilePath(); if (value.empty()) diff --git a/chrome/browser/media_galleries/media_file_system_registry.cc b/chrome/browser/media_galleries/media_file_system_registry.cc index eef446c..af27d95 100644 --- a/chrome/browser/media_galleries/media_file_system_registry.cc +++ b/chrome/browser/media_galleries/media_file_system_registry.cc @@ -182,7 +182,7 @@ class RPHReferenceManager : public content::NotificationObserver { } // namespace -MediaFileSystemInfo::MediaFileSystemInfo(const string16& fs_name, +MediaFileSystemInfo::MediaFileSystemInfo(const base::string16& fs_name, const base::FilePath& fs_path, const std::string& filesystem_id, MediaGalleryPrefId pref_id, diff --git a/chrome/browser/media_galleries/media_file_system_registry.h b/chrome/browser/media_galleries/media_file_system_registry.h index d47a490..b79fc0d 100644 --- a/chrome/browser/media_galleries/media_file_system_registry.h +++ b/chrome/browser/media_galleries/media_file_system_registry.h @@ -41,7 +41,7 @@ class IsolatedContext; // client, including metadata like the name and ID, and API handles like the // fsid (filesystem ID) used to hook up the API objects. struct MediaFileSystemInfo { - MediaFileSystemInfo(const string16& fs_name, + MediaFileSystemInfo(const base::string16& fs_name, const base::FilePath& fs_path, const std::string& filesystem_id, MediaGalleryPrefId pref_id, @@ -51,7 +51,7 @@ struct MediaFileSystemInfo { MediaFileSystemInfo(); ~MediaFileSystemInfo(); - string16 name; + base::string16 name; base::FilePath path; std::string fsid; MediaGalleryPrefId pref_id; diff --git a/chrome/browser/media_galleries/media_file_system_registry_unittest.cc b/chrome/browser/media_galleries/media_file_system_registry_unittest.cc index 6ede692..b98ac8b 100644 --- a/chrome/browser/media_galleries/media_file_system_registry_unittest.cc +++ b/chrome/browser/media_galleries/media_file_system_registry_unittest.cc @@ -227,12 +227,12 @@ class ProfileState { extensions::Extension* regular_permission_extension(); Profile* profile(); - void AddNameForReadCompare(const string16& name); - void AddNameForAllCompare(const string16& name); + void AddNameForReadCompare(const base::string16& name); + void AddNameForAllCompare(const base::string16& name); private: void CompareResults(const std::string& test, - const std::vector<string16>& names, + const std::vector<base::string16>& names, const std::vector<MediaFileSystemInfo>& expected, const std::vector<MediaFileSystemInfo>& actual); bool ContainsEntry(const MediaFileSystemInfo& info, @@ -257,8 +257,8 @@ class ProfileState { content::MockRenderProcessHost* single_rph_; content::MockRenderProcessHost* shared_rph_; - std::vector<string16> compare_names_read_; - std::vector<string16> compare_names_all_; + std::vector<base::string16> compare_names_read_; + std::vector<base::string16> compare_names_all_; DISALLOW_COPY_AND_ASSIGN(ProfileState); }; @@ -317,9 +317,10 @@ class MediaFileSystemRegistryTest : public ChromeRenderViewHostTestHarness { ProfileState* profile_state); void ProcessAttach(const std::string& id, - const string16& name, + const base::string16& name, const base::FilePath::StringType& location) { - StorageInfo info(id, string16(), location, name, string16(), string16(), 0); + StorageInfo info(id, base::string16(), location, name, base::string16(), + base::string16(), 0); StorageMonitor::GetInstance()->receiver()->ProcessAttach(info); } @@ -479,7 +480,7 @@ void ProfileState::CheckGalleries( // No Media Galleries permissions. std::vector<MediaFileSystemInfo> empty_expectation; - std::vector<string16> empty_names; + std::vector<base::string16> empty_names; registry->GetMediaFileSystemsForExtension( rvh, no_permissions_extension_.get(), base::Bind(&ProfileState::CompareResults, base::Unretained(this), @@ -534,11 +535,11 @@ Profile* ProfileState::profile() { return profile_.get(); } -void ProfileState::AddNameForReadCompare(const string16& name) { +void ProfileState::AddNameForReadCompare(const base::string16& name) { compare_names_read_.push_back(name); } -void ProfileState::AddNameForAllCompare(const string16& name) { +void ProfileState::AddNameForAllCompare(const base::string16& name) { compare_names_all_.push_back(name); } @@ -558,7 +559,7 @@ bool ProfileState::ContainsEntry( void ProfileState::CompareResults( const std::string& test, - const std::vector<string16>& names, + const std::vector<base::string16>& names, const std::vector<MediaFileSystemInfo>& expected, const std::vector<MediaFileSystemInfo>& actual) { num_comparisons_++; @@ -569,7 +570,7 @@ void ProfileState::CompareResults( std::sort(sorted.begin(), sorted.end(), MediaFileSystemInfoComparator); std::vector<MediaFileSystemInfo> expect(expected); std::sort(expect.begin(), expect.end(), MediaFileSystemInfoComparator); - std::vector<string16> expect_names(names); + std::vector<base::string16> expect_names(names); std::sort(expect_names.begin(), expect_names.end()); for (size_t i = 0; i < expect.size() && i < sorted.size(); ++i) { @@ -621,7 +622,8 @@ std::string MediaFileSystemRegistryTest::AddUserGallery( for (size_t i = 0; i < profile_states_.size(); ++i) { profile_states_[i]->GetMediaGalleriesPrefs()->AddGallery( device_id, base::FilePath(), true /*user_added*/, - string16(), string16(), string16(), 0, base::Time::Now()); + base::string16(), base::string16(), base::string16(), 0, + base::Time::Now()); } return device_id; } @@ -632,7 +634,7 @@ std::string MediaFileSystemRegistryTest::AttachDevice( const base::FilePath& location) { std::string device_id = StorageInfo::MakeDeviceId(type, unique_id); DCHECK(StorageInfo::IsRemovableDevice(device_id)); - string16 label = location.BaseName().LossyDisplayName(); + base::string16 label = location.BaseName().LossyDisplayName(); ProcessAttach(device_id, label, location.value()); base::MessageLoop::current()->RunUntilIdle(); return device_id; diff --git a/chrome/browser/media_galleries/media_galleries_dialog_controller.h b/chrome/browser/media_galleries/media_galleries_dialog_controller.h index 6221dd2..a567315 100644 --- a/chrome/browser/media_galleries/media_galleries_dialog_controller.h +++ b/chrome/browser/media_galleries/media_galleries_dialog_controller.h @@ -70,13 +70,13 @@ class MediaGalleriesDialogController const base::Closure& on_finish); // The title of the dialog view. - string16 GetHeader() const; + base::string16 GetHeader() const; // Explanatory text directly below the title. - string16 GetSubtext() const; + base::string16 GetSubtext() const; // Header for unattached devices part of the dialog. - string16 GetUnattachedLocationsHeader() const; + base::string16 GetUnattachedLocationsHeader() const; // Initial state of whether the dialog's confirmation button will be enabled. bool HasPermittedGalleries() const; diff --git a/chrome/browser/media_galleries/media_galleries_dialog_controller_mock.h b/chrome/browser/media_galleries/media_galleries_dialog_controller_mock.h index 4457938..4d5b211 100644 --- a/chrome/browser/media_galleries/media_galleries_dialog_controller_mock.h +++ b/chrome/browser/media_galleries/media_galleries_dialog_controller_mock.h @@ -15,8 +15,8 @@ class MediaGalleriesDialogControllerMock const extensions::Extension& extension); virtual ~MediaGalleriesDialogControllerMock(); - MOCK_CONST_METHOD0(GetHeader, string16()); - MOCK_CONST_METHOD0(GetSubtext, string16()); + MOCK_CONST_METHOD0(GetHeader, base::string16()); + MOCK_CONST_METHOD0(GetSubtext, base::string16()); MOCK_CONST_METHOD0(HasPermittedGalleries, bool()); MOCK_CONST_METHOD0(AttachedPermissions, GalleryPermissionsVector()); MOCK_CONST_METHOD0(UnattachedPermissions, GalleryPermissionsVector()); diff --git a/chrome/browser/media_galleries/media_galleries_dialog_controller_unittest.cc b/chrome/browser/media_galleries/media_galleries_dialog_controller_unittest.cc index 9f43cef..94b7645 100644 --- a/chrome/browser/media_galleries/media_galleries_dialog_controller_unittest.cc +++ b/chrome/browser/media_galleries/media_galleries_dialog_controller_unittest.cc @@ -13,7 +13,7 @@ #include "testing/gtest/include/gtest/gtest.h" std::string GalleryName(const MediaGalleryPrefInfo& gallery) { - string16 name = gallery.GetGalleryDisplayName(); + base::string16 name = gallery.GetGalleryDisplayName(); return UTF16ToASCII(name); } @@ -33,7 +33,7 @@ TEST(MediaGalleriesDialogControllerTest, TestNameGeneration) { gallery.display_name = ASCIIToUTF16("override"); EXPECT_EQ("override", GalleryName(gallery)); - gallery.display_name = string16(); + gallery.display_name = base::string16(); gallery.volume_label = ASCIIToUTF16("label"); EXPECT_EQ(galleryName, GalleryName(gallery)); @@ -60,10 +60,10 @@ TEST(MediaGalleriesDialogControllerTest, TestNameGeneration) { gallery.model_name = ASCIIToUTF16("model"); EXPECT_EQ("override", GalleryName(gallery)); - gallery.display_name = string16(); + gallery.display_name = base::string16(); EXPECT_EQ("volume", GalleryName(gallery)); - gallery.volume_label = string16(); + gallery.volume_label = base::string16(); EXPECT_EQ("vendor, model", GalleryName(gallery)); gallery.total_size_in_bytes = 1000000; diff --git a/chrome/browser/media_galleries/media_galleries_preferences.cc b/chrome/browser/media_galleries/media_galleries_preferences.cc index fffa94a..45a7f3e 100644 --- a/chrome/browser/media_galleries/media_galleries_preferences.cc +++ b/chrome/browser/media_galleries/media_galleries_preferences.cc @@ -127,13 +127,13 @@ bool GetType(const DictionaryValue& dict, MediaGalleryPrefInfo::Type* type) { bool PopulateGalleryPrefInfoFromDictionary( const DictionaryValue& dict, MediaGalleryPrefInfo* out_gallery_info) { MediaGalleryPrefId pref_id; - string16 display_name; + base::string16 display_name; std::string device_id; base::FilePath::StringType path; MediaGalleryPrefInfo::Type type = MediaGalleryPrefInfo::kAutoDetected; - string16 volume_label; - string16 vendor_name; - string16 model_name; + base::string16 volume_label; + base::string16 vendor_name; + base::string16 model_name; double total_size_in_bytes = 0.0; double last_attach_time = 0.0; bool volume_metadata_valid = false; @@ -245,8 +245,8 @@ bool GetMediaGalleryPermissionFromDictionary( return false; } -string16 GetDisplayNameForDevice(uint64 storage_size_in_bytes, - const string16& name) { +base::string16 GetDisplayNameForDevice(uint64 storage_size_in_bytes, + const base::string16& name) { DCHECK(!name.empty()); return (storage_size_in_bytes == 0) ? name : ui::FormatBytes(storage_size_in_bytes) + ASCIIToUTF16(" ") + name; @@ -254,8 +254,8 @@ string16 GetDisplayNameForDevice(uint64 storage_size_in_bytes, // For a device with |device_name| and a relative path |sub_folder|, construct // a display name. If |sub_folder| is empty, then just return |device_name|. -string16 GetDisplayNameForSubFolder(const string16& device_name, - const base::FilePath& sub_folder) { +base::string16 GetDisplayNameForSubFolder(const base::string16& device_name, + const base::FilePath& sub_folder) { if (sub_folder.empty()) return device_name; return (sub_folder.BaseName().LossyDisplayName() + @@ -263,12 +263,12 @@ string16 GetDisplayNameForSubFolder(const string16& device_name, device_name); } -string16 GetFullProductName(const string16& vendor_name, - const string16& model_name) { +base::string16 GetFullProductName(const base::string16& vendor_name, + const base::string16& model_name) { if (vendor_name.empty() && model_name.empty()) - return string16(); + return base::string16(); - string16 product_name; + base::string16 product_name; if (vendor_name.empty()) product_name = model_name; else if (model_name.empty()) @@ -297,7 +297,7 @@ base::FilePath MediaGalleryPrefInfo::AbsolutePath() const { return base_path.empty() ? base_path : base_path.Append(path); } -string16 MediaGalleryPrefInfo::GetGalleryDisplayName() const { +base::string16 MediaGalleryPrefInfo::GetGalleryDisplayName() const { if (!StorageInfo::IsRemovableDevice(device_id)) { // For fixed storage, the default name is the fully qualified directory // name, or in the case of a root directory, the root directory name. @@ -322,7 +322,7 @@ string16 MediaGalleryPrefInfo::GetGalleryDisplayName() const { #endif } - string16 name = display_name; + base::string16 name = display_name; if (name.empty()) name = volume_label; if (name.empty()) @@ -338,12 +338,12 @@ string16 MediaGalleryPrefInfo::GetGalleryDisplayName() const { return name; } -string16 MediaGalleryPrefInfo::GetGalleryTooltip() const { +base::string16 MediaGalleryPrefInfo::GetGalleryTooltip() const { return AbsolutePath().LossyDisplayName(); } -string16 MediaGalleryPrefInfo::GetGalleryAdditionalDetails() const { - string16 attached; +base::string16 MediaGalleryPrefInfo::GetGalleryAdditionalDetails() const { + base::string16 attached; if (StorageInfo::IsRemovableDevice(device_id)) { if (MediaStorageUtil::IsRemovableStorageAttached(device_id)) { attached = l10n_util::GetStringUTF16( @@ -562,7 +562,7 @@ void MediaGalleriesPreferences::OnFinderDeviceID(const std::string& device_id) { AddGalleryInternal(device_id, ASCIIToUTF16(gallery_name), base::FilePath(), false /*not user added*/, - string16(), string16(), string16(), 0, + base::string16(), base::string16(), base::string16(), 0, base::Time(), false, 2); } @@ -698,20 +698,20 @@ base::FilePath MediaGalleriesPreferences::LookUpGalleryPathForExtension( MediaGalleryPrefId MediaGalleriesPreferences::AddGallery( const std::string& device_id, const base::FilePath& relative_path, bool user_added, - const string16& volume_label, const string16& vendor_name, - const string16& model_name, uint64 total_size_in_bytes, + const base::string16& volume_label, const base::string16& vendor_name, + const base::string16& model_name, uint64 total_size_in_bytes, base::Time last_attach_time) { DCHECK(IsInitialized()); - return AddGalleryInternal(device_id, string16(), relative_path, user_added, - volume_label, vendor_name, model_name, + return AddGalleryInternal(device_id, base::string16(), relative_path, + user_added, volume_label, vendor_name, model_name, total_size_in_bytes, last_attach_time, true, 2); } MediaGalleryPrefId MediaGalleriesPreferences::AddGalleryInternal( - const std::string& device_id, const string16& display_name, + const std::string& device_id, const base::string16& display_name, const base::FilePath& relative_path, bool user_added, - const string16& volume_label, const string16& vendor_name, - const string16& model_name, uint64 total_size_in_bytes, + const base::string16& volume_label, const base::string16& vendor_name, + const base::string16& model_name, uint64 total_size_in_bytes, base::Time last_attach_time, bool volume_metadata_valid, int prefs_version) { diff --git a/chrome/browser/media_galleries/media_galleries_preferences.h b/chrome/browser/media_galleries/media_galleries_preferences.h index 070e4be..8f2e939 100644 --- a/chrome/browser/media_galleries/media_galleries_preferences.h +++ b/chrome/browser/media_galleries/media_galleries_preferences.h @@ -60,7 +60,7 @@ struct MediaGalleryPrefInfo { MediaGalleryPrefId pref_id; // The user-visible name of this gallery. - string16 display_name; + base::string16 display_name; // A string which uniquely and persistently identifies the device that the // gallery lives on. @@ -74,15 +74,15 @@ struct MediaGalleryPrefInfo { // The volume label of the volume/device on which the gallery // resides. Empty if there is no such label or it is unknown. - string16 volume_label; + base::string16 volume_label; // Vendor name for the volume/device on which the gallery is located. // Will be empty if unknown. - string16 vendor_name; + base::string16 vendor_name; // Model name for the volume/device on which the gallery is located. // Will be empty if unknown. - string16 model_name; + base::string16 model_name; // The capacity in bytes of the volume/device on which the gallery is // located. Will be zero if unknown. @@ -104,9 +104,9 @@ struct MediaGalleryPrefInfo { int prefs_version; // Called by views to provide details for the gallery permission entries. - string16 GetGalleryDisplayName() const; - string16 GetGalleryTooltip() const; - string16 GetGalleryAdditionalDetails() const; + base::string16 GetGalleryDisplayName() const; + base::string16 GetGalleryTooltip() const; + base::string16 GetGalleryAdditionalDetails() const; // Returns true if the gallery is currently a removable device gallery which // is now attached, or a fixed storage gallery. @@ -195,9 +195,9 @@ class MediaGalleriesPreferences : public BrowserContextKeyedService, MediaGalleryPrefId AddGallery(const std::string& device_id, const base::FilePath& relative_path, bool user_added, - const string16& volume_label, - const string16& vendor_name, - const string16& model_name, + const base::string16& volume_label, + const base::string16& vendor_name, + const base::string16& model_name, uint64 total_size_in_bytes, base::Time last_attach_time); @@ -263,12 +263,12 @@ class MediaGalleriesPreferences : public BrowserContextKeyedService, void InitFromPrefs(); MediaGalleryPrefId AddGalleryInternal(const std::string& device_id, - const string16& display_name, + const base::string16& display_name, const base::FilePath& relative_path, bool user_added, - const string16& volume_label, - const string16& vendor_name, - const string16& model_name, + const base::string16& volume_label, + const base::string16& vendor_name, + const base::string16& model_name, uint64 total_size_in_bytes, base::Time last_attach_time, bool volume_metadata_valid, diff --git a/chrome/browser/media_galleries/media_galleries_preferences_unittest.cc b/chrome/browser/media_galleries/media_galleries_preferences_unittest.cc index bbcab9e..45d1b5e 100644 --- a/chrome/browser/media_galleries/media_galleries_preferences_unittest.cc +++ b/chrome/browser/media_galleries/media_galleries_preferences_unittest.cc @@ -200,7 +200,7 @@ class MediaGalleriesPreferencesTest : public testing::Test { return default_galleries_count_; } - void AddGalleryExpectation(MediaGalleryPrefId id, string16 display_name, + void AddGalleryExpectation(MediaGalleryPrefId id, base::string16 display_name, std::string device_id, base::FilePath relative_path, MediaGalleryPrefInfo::Type type) { @@ -217,30 +217,33 @@ class MediaGalleriesPreferencesTest : public testing::Test { } MediaGalleryPrefId AddGalleryWithNameV0(const std::string& device_id, - const string16& display_name, + const base::string16& display_name, const base::FilePath& relative_path, bool user_added) { return gallery_prefs()->AddGalleryInternal( device_id, display_name, relative_path, user_added, - string16(), string16(), string16(), 0, base::Time(), false, 0); + base::string16(), base::string16(), base::string16(), 0, base::Time(), + false, 0); } MediaGalleryPrefId AddGalleryWithNameV1(const std::string& device_id, - const string16& display_name, + const base::string16& display_name, const base::FilePath& relative_path, bool user_added) { return gallery_prefs()->AddGalleryInternal( device_id, display_name, relative_path, user_added, - string16(), string16(), string16(), 0, base::Time(), false, 1); + base::string16(), base::string16(), base::string16(), 0, base::Time(), + false, 1); } MediaGalleryPrefId AddGalleryWithNameV2(const std::string& device_id, - const string16& display_name, + const base::string16& display_name, const base::FilePath& relative_path, bool user_added) { return gallery_prefs()->AddGalleryInternal( device_id, display_name, relative_path, user_added, - string16(), string16(), string16(), 0, base::Time(), false, 2); + base::string16(), base::string16(), base::string16(), 0, base::Time(), + false, 2); } bool UpdateDeviceIDForSingletonType(const std::string& device_id) { @@ -382,7 +385,7 @@ TEST_F(MediaGalleriesPreferencesTest, AddGalleryWithVolumeMetadata) { ASCIIToUTF16("model name"), 1000000ULL, now); EXPECT_EQ(default_galleries_count() + 1UL, id); - AddGalleryExpectation(id, string16(), info.device_id(), relative_path, + AddGalleryExpectation(id, base::string16(), info.device_id(), relative_path, MediaGalleryPrefInfo::kAutoDetected); Verify(); @@ -428,7 +431,7 @@ TEST_F(MediaGalleriesPreferencesTest, ReplaceGalleryWithVolumeMetadata) { ASCIIToUTF16("model name"), 1000000ULL, now); EXPECT_EQ(id, metadata_id); - AddGalleryExpectation(id, string16(), info.device_id(), relative_path, + AddGalleryExpectation(id, base::string16(), info.device_id(), relative_path, MediaGalleryPrefInfo::kAutoDetected); // Make sure the display_name is set to empty now, as the metadata @@ -502,7 +505,7 @@ TEST_F(MediaGalleriesPreferencesTest, UpdateGalleryNameV2) { Verify(); // Won't override the name -- don't change any expectation. - info.set_name(string16()); + info.set_name(base::string16()); AddGalleryWithNameV2(info.device_id(), info.name(), relative_path, false); Verify(); @@ -864,9 +867,9 @@ TEST(MediaGalleryPrefInfoTest, NameGeneration) { info.model_name = ASCIIToUTF16("model"); EXPECT_EQ(ASCIIToUTF16("o2"), info.GetGalleryDisplayName()); - info.display_name = string16(); + info.display_name = base::string16(); EXPECT_EQ(ASCIIToUTF16("vol"), info.GetGalleryDisplayName()); - info.volume_label = string16(); + info.volume_label = base::string16(); EXPECT_EQ(ASCIIToUTF16("vendor, model"), info.GetGalleryDisplayName()); info.device_id = StorageInfo::MakeDeviceId( diff --git a/chrome/browser/media_galleries/win/mtp_device_delegate_impl_win.cc b/chrome/browser/media_galleries/win/mtp_device_delegate_impl_win.cc index 1119a17e..c2e1e52 100644 --- a/chrome/browser/media_galleries/win/mtp_device_delegate_impl_win.cc +++ b/chrome/browser/media_galleries/win/mtp_device_delegate_impl_win.cc @@ -36,14 +36,14 @@ namespace { // Gets the details of the MTP partition storage specified by the // |storage_path| on the UI thread. Returns true if the storage details are // valid and returns false otherwise. -bool GetStorageInfoOnUIThread(const string16& storage_path, - string16* pnp_device_id, - string16* storage_object_id) { +bool GetStorageInfoOnUIThread(const base::string16& storage_path, + base::string16* pnp_device_id, + base::string16* storage_object_id) { DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); DCHECK(!storage_path.empty()); DCHECK(pnp_device_id); DCHECK(storage_object_id); - string16 storage_device_id; + base::string16 storage_device_id; base::RemoveChars(storage_path, L"\\\\", &storage_device_id); DCHECK(!storage_device_id.empty()); // TODO(gbillock): Take the StorageMonitor as an argument. @@ -70,7 +70,7 @@ string16 GetFileObjectIdFromPathOnBlockingPoolThread( PortableDeviceMapService::GetInstance()->GetPortableDevice( device_info.registered_device_path); if (!device) - return string16(); + return base::string16(); if (device_info.registered_device_path == file_path.value()) return device_info.storage_object_id; @@ -78,13 +78,13 @@ string16 GetFileObjectIdFromPathOnBlockingPoolThread( base::FilePath relative_path; if (!base::FilePath(device_info.registered_device_path).AppendRelativePath( file_path, &relative_path)) - return string16(); + return base::string16(); std::vector<string16> path_components; relative_path.GetComponents(&path_components); DCHECK(!path_components.empty()); - string16 parent_id(device_info.storage_object_id); - string16 file_object_id; + base::string16 parent_id(device_info.storage_object_id); + base::string16 file_object_id; for (size_t i = 0; i < path_components.size(); ++i) { file_object_id = media_transfer_protocol::GetObjectIdFromName(device, parent_id, @@ -111,8 +111,8 @@ CreateFileEnumeratorOnBlockingPoolThread( if (!device) return scoped_ptr<MTPDeviceObjectEnumerator>(); - string16 object_id = GetFileObjectIdFromPathOnBlockingPoolThread(device_info, - root); + base::string16 object_id = + GetFileObjectIdFromPathOnBlockingPoolThread(device_info, root); if (object_id.empty()) return scoped_ptr<MTPDeviceObjectEnumerator>(); @@ -130,8 +130,9 @@ CreateFileEnumeratorOnBlockingPoolThread( // |pnp_device_id| specifies the PnP device id. // |registered_device_path| specifies the registered file system root path for // the given device. -bool OpenDeviceOnBlockingPoolThread(const string16& pnp_device_id, - const string16& registered_device_path) { +bool OpenDeviceOnBlockingPoolThread( + const base::string16& pnp_device_id, + const base::string16& registered_device_path) { base::ThreadRestrictions::AssertIOAllowed(); DCHECK(!pnp_device_id.empty()); DCHECK(!registered_device_path.empty()); @@ -163,8 +164,8 @@ base::PlatformFileError GetFileInfoOnBlockingPoolThread( if (!device) return base::PLATFORM_FILE_ERROR_FAILED; - string16 object_id = GetFileObjectIdFromPathOnBlockingPoolThread(device_info, - file_path); + base::string16 object_id = + GetFileObjectIdFromPathOnBlockingPoolThread(device_info, file_path); if (object_id.empty()) return base::PLATFORM_FILE_ERROR_FAILED; return media_transfer_protocol::GetFileEntryInfo(device, object_id, @@ -227,7 +228,7 @@ base::PlatformFileError GetFileStreamOnBlockingPoolThread( if (!device) return base::PLATFORM_FILE_ERROR_FAILED; - string16 file_object_id = + base::string16 file_object_id = GetFileObjectIdFromPathOnBlockingPoolThread( device_info, file_details->request_info().device_file_path); if (file_object_id.empty()) @@ -286,7 +287,7 @@ DWORD WriteDataChunkIntoSnapshotFileOnBlockingPoolThread( } void DeletePortableDeviceOnBlockingPoolThread( - const string16& registered_device_path) { + const base::string16& registered_device_path) { base::ThreadRestrictions::AssertIOAllowed(); PortableDeviceMapService::GetInstance()->RemovePortableDevice( registered_device_path); @@ -297,10 +298,10 @@ void DeletePortableDeviceOnBlockingPoolThread( // Used by CreateMTPDeviceAsyncDelegate() to create the MTP device // delegate on the IO thread. void OnGetStorageInfoCreateDelegate( - const string16& device_location, + const base::string16& device_location, const CreateMTPDeviceAsyncDelegateCallback& callback, - string16* pnp_device_id, - string16* storage_object_id, + base::string16* pnp_device_id, + base::string16* storage_object_id, bool succeeded) { DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); DCHECK(pnp_device_id); @@ -313,12 +314,12 @@ void OnGetStorageInfoCreateDelegate( } void CreateMTPDeviceAsyncDelegate( - const string16& device_location, + const base::string16& device_location, const CreateMTPDeviceAsyncDelegateCallback& callback) { DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); DCHECK(!device_location.empty()); - string16* pnp_device_id = new string16; - string16* storage_object_id = new string16; + base::string16* pnp_device_id = new base::string16; + base::string16* storage_object_id = new base::string16; content::BrowserThread::PostTaskAndReplyWithResult<bool>( content::BrowserThread::UI, FROM_HERE, @@ -336,9 +337,9 @@ void CreateMTPDeviceAsyncDelegate( // MTPDeviceDelegateImplWin --------------------------------------------------- MTPDeviceDelegateImplWin::StorageDeviceInfo::StorageDeviceInfo( - const string16& pnp_device_id, - const string16& registered_device_path, - const string16& storage_object_id) + const base::string16& pnp_device_id, + const base::string16& registered_device_path, + const base::string16& storage_object_id) : pnp_device_id(pnp_device_id), registered_device_path(registered_device_path), storage_object_id(storage_object_id) { @@ -355,9 +356,9 @@ MTPDeviceDelegateImplWin::PendingTaskInfo::PendingTaskInfo( } MTPDeviceDelegateImplWin::MTPDeviceDelegateImplWin( - const string16& registered_device_path, - const string16& pnp_device_id, - const string16& storage_object_id) + const base::string16& registered_device_path, + const base::string16& pnp_device_id, + const base::string16& storage_object_id) : storage_device_info_(pnp_device_id, registered_device_path, storage_object_id), init_state_(UNINITIALIZED), diff --git a/chrome/browser/media_galleries/win/mtp_device_delegate_impl_win.h b/chrome/browser/media_galleries/win/mtp_device_delegate_impl_win.h index 6d31894..8db1dfe 100644 --- a/chrome/browser/media_galleries/win/mtp_device_delegate_impl_win.h +++ b/chrome/browser/media_galleries/win/mtp_device_delegate_impl_win.h @@ -37,30 +37,30 @@ class MTPDeviceDelegateImplWin : public MTPDeviceAsyncDelegate { public: // Structure used to represent MTP device storage partition details. struct StorageDeviceInfo { - StorageDeviceInfo(const string16& pnp_device_id, - const string16& registered_device_path, - const string16& storage_object_id); + StorageDeviceInfo(const base::string16& pnp_device_id, + const base::string16& registered_device_path, + const base::string16& storage_object_id); // The PnP Device Id, used to open the device for communication, // e.g. "\\?\usb#vid_04a9&pid_3073#12#{6ac27878-a6fa-4155-ba85-f1d4f33}". - const string16 pnp_device_id; + const base::string16 pnp_device_id; // The media file system root path, which is obtained during the // registration of MTP device storage partition as a file system, // e.g. "\\MTP:StorageSerial:SID-{10001,E,9823}:237483". - const string16 registered_device_path; + const base::string16 registered_device_path; // The MTP device storage partition object identifier, used to enumerate the // storage contents, e.g. "s10001". - const string16 storage_object_id; + const base::string16 storage_object_id; }; private: friend void OnGetStorageInfoCreateDelegate( - const string16& device_location, + const base::string16& device_location, const CreateMTPDeviceAsyncDelegateCallback& callback, - string16* pnp_device_id, - string16* storage_object_id, + base::string16* pnp_device_id, + base::string16* storage_object_id, bool succeeded); enum InitializationState { @@ -82,9 +82,9 @@ class MTPDeviceDelegateImplWin : public MTPDeviceAsyncDelegate { // Defers the device initializations until the first file operation request. // Do all the initializations in EnsureInitAndRunTask() function. - MTPDeviceDelegateImplWin(const string16& registered_device_path, - const string16& pnp_device_id, - const string16& storage_object_id); + MTPDeviceDelegateImplWin(const base::string16& registered_device_path, + const base::string16& pnp_device_id, + const base::string16& storage_object_id); // Destructed via CancelPendingTasksAndDeleteDelegate(). virtual ~MTPDeviceDelegateImplWin(); diff --git a/chrome/browser/media_galleries/win/mtp_device_delegate_impl_win_unittest.cc b/chrome/browser/media_galleries/win/mtp_device_delegate_impl_win_unittest.cc index 18c11b0..af4344b 100644 --- a/chrome/browser/media_galleries/win/mtp_device_delegate_impl_win_unittest.cc +++ b/chrome/browser/media_galleries/win/mtp_device_delegate_impl_win_unittest.cc @@ -49,13 +49,13 @@ class MTPDeviceDelegateImplWinTest : public ChromeRenderViewHostTestHarness { void TearDown() OVERRIDE; void ProcessAttach(const std::string& id, - const string16& name, + const base::string16& name, const base::FilePath::StringType& location); std::string AttachDevice(StorageInfo::Type type, const std::string& unique_id, const base::FilePath& location); void CheckGalleryInfo(const MediaFileSystemInfo& info, - const string16& name, + const base::string16& name, const base::FilePath& path, bool removable, bool media_device); @@ -109,9 +109,10 @@ void MTPDeviceDelegateImplWinTest::TearDown() { void MTPDeviceDelegateImplWinTest::ProcessAttach( const std::string& id, - const string16& label, + const base::string16& label, const base::FilePath::StringType& location) { - StorageInfo info(id, string16(), location, label, string16(), string16(), 0); + StorageInfo info(id, base::string16(), location, label, base::string16(), + base::string16(), 0); monitor_->receiver()->ProcessAttach(info); } @@ -121,7 +122,7 @@ std::string MTPDeviceDelegateImplWinTest::AttachDevice( const base::FilePath& location) { std::string device_id = StorageInfo::MakeDeviceId(type, unique_id); DCHECK(StorageInfo::IsRemovableDevice(device_id)); - string16 label = location.LossyDisplayName(); + base::string16 label = location.LossyDisplayName(); ProcessAttach(device_id, label, location.value()); base::RunLoop().RunUntilIdle(); return device_id; @@ -129,7 +130,7 @@ std::string MTPDeviceDelegateImplWinTest::AttachDevice( void MTPDeviceDelegateImplWinTest::CheckGalleryInfo( const MediaFileSystemInfo& info, - const string16& name, + const base::string16& name, const base::FilePath& path, bool removable, bool media_device) { diff --git a/chrome/browser/media_galleries/win/mtp_device_object_entry.cc b/chrome/browser/media_galleries/win/mtp_device_object_entry.cc index 127ac01..4078fbb 100644 --- a/chrome/browser/media_galleries/win/mtp_device_object_entry.cc +++ b/chrome/browser/media_galleries/win/mtp_device_object_entry.cc @@ -9,8 +9,8 @@ MTPDeviceObjectEntry::MTPDeviceObjectEntry() : is_directory(false), size(0) { } -MTPDeviceObjectEntry::MTPDeviceObjectEntry(const string16& object_id, - const string16& object_name, +MTPDeviceObjectEntry::MTPDeviceObjectEntry(const base::string16& object_id, + const base::string16& object_name, bool is_directory, int64 size, const base::Time& last_modified_time) diff --git a/chrome/browser/media_galleries/win/mtp_device_object_entry.h b/chrome/browser/media_galleries/win/mtp_device_object_entry.h index 775e43b..b26652e 100644 --- a/chrome/browser/media_galleries/win/mtp_device_object_entry.h +++ b/chrome/browser/media_galleries/win/mtp_device_object_entry.h @@ -16,18 +16,18 @@ // IPortableDeviceProperties::GetValues(). struct MTPDeviceObjectEntry { MTPDeviceObjectEntry(); // Necessary for STL. - MTPDeviceObjectEntry(const string16& object_id, - const string16& object_name, + MTPDeviceObjectEntry(const base::string16& object_id, + const base::string16& object_name, bool is_directory, int64 size, const base::Time& last_modified_time); // The object identifier obtained using IEnumPortableDeviceObjectIDs::Next(), // e.g. "o299". - string16 object_id; + base::string16 object_id; // Friendly name of the object, e.g. "IMG_9911.jpeg". - string16 name; + base::string16 name; // True if the current object is a directory/folder/album content type. bool is_directory; diff --git a/chrome/browser/media_galleries/win/mtp_device_object_enumerator.cc b/chrome/browser/media_galleries/win/mtp_device_object_enumerator.cc index 5414d0e..8c2fa8b 100644 --- a/chrome/browser/media_galleries/win/mtp_device_object_enumerator.cc +++ b/chrome/browser/media_galleries/win/mtp_device_object_enumerator.cc @@ -57,7 +57,7 @@ base::Time MTPDeviceObjectEnumerator::LastModifiedTime() { string16 MTPDeviceObjectEnumerator::GetObjectId() const { DCHECK(thread_checker_.CalledOnValidThread()); if (!IsIndexReadyAndInRange()) - return string16(); + return base::string16(); return object_entries_[index_].object_id; } diff --git a/chrome/browser/media_galleries/win/mtp_device_object_enumerator.h b/chrome/browser/media_galleries/win/mtp_device_object_enumerator.h index ce2c3e9..a460f61 100644 --- a/chrome/browser/media_galleries/win/mtp_device_object_enumerator.h +++ b/chrome/browser/media_galleries/win/mtp_device_object_enumerator.h @@ -29,7 +29,7 @@ class MTPDeviceObjectEnumerator { // If the current file object entry is valid, returns an non-empty object id. // Returns an empty string otherwise. - string16 GetObjectId() const; + base::string16 GetObjectId() const; private: // Returns true if the enumerator has more entries to traverse, false diff --git a/chrome/browser/media_galleries/win/mtp_device_object_enumerator_unittest.cc b/chrome/browser/media_galleries/win/mtp_device_object_enumerator_unittest.cc index 7c2725c..85ddf08 100644 --- a/chrome/browser/media_galleries/win/mtp_device_object_enumerator_unittest.cc +++ b/chrome/browser/media_galleries/win/mtp_device_object_enumerator_unittest.cc @@ -18,10 +18,10 @@ namespace { struct MTPDeviceObjectEntryData { // Friendly name of the object, e.g. "IMG_9911.jpeg". - string16 name; + base::string16 name; // The object identifier, e.g. "o299". - string16 object_id; + base::string16 object_id; // True if the current object is a directory/folder/album content type. bool is_directory; diff --git a/chrome/browser/media_galleries/win/mtp_device_operations_util.cc b/chrome/browser/media_galleries/win/mtp_device_operations_util.cc index 0d9ac6c1..8424183 100644 --- a/chrome/browser/media_galleries/win/mtp_device_operations_util.cc +++ b/chrome/browser/media_galleries/win/mtp_device_operations_util.cc @@ -69,7 +69,7 @@ base::win::ScopedComPtr<IPortableDeviceContent> GetDeviceContent( // |parent_id| specifies the parent object identifier. base::win::ScopedComPtr<IEnumPortableDeviceObjectIDs> GetDeviceObjectEnumerator( IPortableDevice* device, - const string16& parent_id) { + const base::string16& parent_id) { base::ThreadRestrictions::AssertIOAllowed(); DCHECK(device); DCHECK(!parent_id.empty()); @@ -106,14 +106,14 @@ bool IsDirectory(IPortableDeviceValues* properties_values) { // Returns the friendly name of the object from the property key values // specified by the |properties_values|. -string16 GetObjectName(IPortableDeviceValues* properties_values, +base::string16 GetObjectName(IPortableDeviceValues* properties_values, bool is_directory) { DCHECK(properties_values); base::win::ScopedCoMem<char16> buffer; REFPROPERTYKEY key = is_directory ? WPD_OBJECT_NAME : WPD_OBJECT_ORIGINAL_FILE_NAME; HRESULT hr = properties_values->GetStringValue(key, &buffer); - string16 result; + base::string16 result; if (SUCCEEDED(hr)) result.assign(buffer); return result; @@ -165,8 +165,8 @@ bool GetObjectSize(IPortableDeviceValues* properties_values, int64* size) { // transfer protocol |device|. On success, returns true and fills in |name|, // |is_directory|, |size| and |last_modified_time|. bool GetObjectDetails(IPortableDevice* device, - const string16 object_id, - string16* name, + const base::string16 object_id, + base::string16* name, bool* is_directory, int64* size, base::Time* last_modified_time) { @@ -228,13 +228,13 @@ bool GetObjectDetails(IPortableDevice* device, // Creates an MTP device object entry for the given |device| and |object_id|. // On success, returns true and fills in |entry|. bool GetMTPDeviceObjectEntry(IPortableDevice* device, - const string16& object_id, + const base::string16& object_id, MTPDeviceObjectEntry* entry) { base::ThreadRestrictions::AssertIOAllowed(); DCHECK(device); DCHECK(!object_id.empty()); DCHECK(entry); - string16 name; + base::string16 name; bool is_directory; int64 size; base::Time last_modified_time; @@ -252,8 +252,8 @@ bool GetMTPDeviceObjectEntry(IPortableDevice* device, // |object_name|. Leave |object_name| blank to request all entries. On // success returns true and set |object_entries|. bool GetMTPDeviceObjectEntries(IPortableDevice* device, - const string16& directory_object_id, - const string16& object_name, + const base::string16& directory_object_id, + const base::string16& object_name, MTPDeviceObjectEntries* object_entries) { base::ThreadRestrictions::AssertIOAllowed(); DCHECK(device); @@ -295,7 +295,7 @@ bool GetMTPDeviceObjectEntries(IPortableDevice* device, } // namespace base::win::ScopedComPtr<IPortableDevice> OpenDevice( - const string16& pnp_device_id) { + const base::string16& pnp_device_id) { base::ThreadRestrictions::AssertIOAllowed(); DCHECK(!pnp_device_id.empty()); base::win::ScopedComPtr<IPortableDeviceValues> client_info; @@ -317,7 +317,7 @@ base::win::ScopedComPtr<IPortableDevice> OpenDevice( base::PlatformFileError GetFileEntryInfo( IPortableDevice* device, - const string16& object_id, + const base::string16& object_id, base::PlatformFileInfo* file_entry_info) { DCHECK(device); DCHECK(!object_id.empty()); @@ -336,14 +336,14 @@ base::PlatformFileError GetFileEntryInfo( } bool GetDirectoryEntries(IPortableDevice* device, - const string16& directory_object_id, + const base::string16& directory_object_id, MTPDeviceObjectEntries* object_entries) { - return GetMTPDeviceObjectEntries(device, directory_object_id, string16(), - object_entries); + return GetMTPDeviceObjectEntries(device, directory_object_id, + base::string16(), object_entries); } HRESULT GetFileStreamForObject(IPortableDevice* device, - const string16& file_object_id, + const base::string16& file_object_id, IStream** file_stream, DWORD* optimal_transfer_size) { base::ThreadRestrictions::AssertIOAllowed(); @@ -392,14 +392,14 @@ DWORD CopyDataChunkToLocalFile(IStream* stream, return data_len; } -string16 GetObjectIdFromName(IPortableDevice* device, - const string16& parent_id, - const string16& object_name) { +base::string16 GetObjectIdFromName(IPortableDevice* device, + const base::string16& parent_id, + const base::string16& object_name) { MTPDeviceObjectEntries object_entries; if (!GetMTPDeviceObjectEntries(device, parent_id, object_name, &object_entries) || object_entries.empty()) - return string16(); + return base::string16(); // TODO(thestig): This DCHECK can fail. Multiple MTP objects can have // the same name. Handle the situation gracefully. Refer to crbug.com/169930 // for more details. diff --git a/chrome/browser/media_galleries/win/mtp_device_operations_util.h b/chrome/browser/media_galleries/win/mtp_device_operations_util.h index d11de86..7fb7229 100644 --- a/chrome/browser/media_galleries/win/mtp_device_operations_util.h +++ b/chrome/browser/media_galleries/win/mtp_device_operations_util.h @@ -26,7 +26,7 @@ namespace media_transfer_protocol { // play device ID string. On success, returns the IPortableDevice interface. // On failure, returns NULL. base::win::ScopedComPtr<IPortableDevice> OpenDevice( - const string16& pnp_device_id); + const base::string16& pnp_device_id); // Gets the details of the object specified by |object_id| from the given MTP // |device|. On success, returns no error (base::PLATFORM_FILE_OK) and fills in @@ -34,7 +34,7 @@ base::win::ScopedComPtr<IPortableDevice> OpenDevice( // and |file_entry_info| is not set. base::PlatformFileError GetFileEntryInfo( IPortableDevice* device, - const string16& object_id, + const base::string16& object_id, base::PlatformFileInfo* file_entry_info); // Gets the entries of the directory specified by |directory_object_id| from @@ -42,7 +42,7 @@ base::PlatformFileError GetFileEntryInfo( // |object_entries|. On failure, returns false and |object_entries| is not // set. bool GetDirectoryEntries(IPortableDevice* device, - const string16& directory_object_id, + const base::string16& directory_object_id, MTPDeviceObjectEntries* object_entries); // Gets an IStream interface to read the object content data from the |device|. @@ -51,7 +51,7 @@ bool GetDirectoryEntries(IPortableDevice* device, // On failure, returns an error code and |file_stream| and // |optimal_transfer_size| are not set. HRESULT GetFileStreamForObject(IPortableDevice* device, - const string16& file_object_id, + const base::string16& file_object_id, IStream** file_stream, DWORD* optimal_transfer_size); @@ -74,8 +74,8 @@ DWORD CopyDataChunkToLocalFile(IStream* stream, // |parent_id| specifies the object's parent identifier. // |object_name| specifies the friendly name of the object. string16 GetObjectIdFromName(IPortableDevice* device, - const string16& parent_id, - const string16& object_name); + const base::string16& parent_id, + const base::string16& object_name); } // namespace media_transfer_protocol diff --git a/chrome/browser/media_galleries/win/portable_device_map_service.cc b/chrome/browser/media_galleries/win/portable_device_map_service.cc index 557353e..82b8eb4 100644 --- a/chrome/browser/media_galleries/win/portable_device_map_service.cc +++ b/chrome/browser/media_galleries/win/portable_device_map_service.cc @@ -22,7 +22,7 @@ PortableDeviceMapService* PortableDeviceMapService::GetInstance() { } void PortableDeviceMapService::AddPortableDevice( - const string16& device_location, + const base::string16& device_location, IPortableDevice* device) { base::ThreadRestrictions::AssertIOAllowed(); DCHECK(!device_location.empty()); @@ -32,7 +32,7 @@ void PortableDeviceMapService::AddPortableDevice( } void PortableDeviceMapService::MarkPortableDeviceForDeletion( - const string16& device_location) { + const base::string16& device_location) { DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); DCHECK(!device_location.empty()); base::AutoLock lock(lock_); @@ -42,7 +42,7 @@ void PortableDeviceMapService::MarkPortableDeviceForDeletion( } void PortableDeviceMapService::RemovePortableDevice( - const string16& device_location) { + const base::string16& device_location) { base::ThreadRestrictions::AssertIOAllowed(); DCHECK(!device_location.empty()); base::AutoLock lock(lock_); @@ -52,7 +52,7 @@ void PortableDeviceMapService::RemovePortableDevice( } IPortableDevice* PortableDeviceMapService::GetPortableDevice( - const string16& device_location) { + const base::string16& device_location) { base::ThreadRestrictions::AssertIOAllowed(); DCHECK(!device_location.empty()); base::AutoLock lock(lock_); diff --git a/chrome/browser/media_galleries/win/portable_device_map_service.h b/chrome/browser/media_galleries/win/portable_device_map_service.h index 01a5900..16e4567 100644 --- a/chrome/browser/media_galleries/win/portable_device_map_service.h +++ b/chrome/browser/media_galleries/win/portable_device_map_service.h @@ -21,7 +21,7 @@ class PortableDeviceMapService { // Adds the portable |device| interface to the map service for the device // specified by the |device_location|. Called on a blocking pool thread. - void AddPortableDevice(const string16& device_location, + void AddPortableDevice(const base::string16& device_location, IPortableDevice* device); // Marks the IPortableDevice interface of the device specified by the @@ -32,19 +32,19 @@ class PortableDeviceMapService { // remove the IPortableDevice interface from the map service. // // Called on the IO thread. - void MarkPortableDeviceForDeletion(const string16& device_location); + void MarkPortableDeviceForDeletion(const base::string16& device_location); // Removes the IPortableDevice interface from the map service for the device // specified by the |device_location|. Callers of this function should have // already called MarkPortableDeviceForDeletion() on the IO thread. // Called on a blocking pool thread. - void RemovePortableDevice(const string16& device_location); + void RemovePortableDevice(const base::string16& device_location); // Gets the IPortableDevice interface associated with the device specified // by the |device_location|. Returns NULL if the |device_location| is no // longer valid (e.g. the corresponding device is detached etc). // Called on a blocking pool thread. - IPortableDevice* GetPortableDevice(const string16& device_location); + IPortableDevice* GetPortableDevice(const base::string16& device_location); private: friend struct base::DefaultLazyInstanceTraits<PortableDeviceMapService>; @@ -60,7 +60,7 @@ class PortableDeviceMapService { bool scheduled_to_delete; }; - typedef std::map<const string16, PortableDeviceInfo> PortableDeviceMap; + typedef std::map<const base::string16, PortableDeviceInfo> PortableDeviceMap; // Get access to this class using GetInstance() method. PortableDeviceMapService(); diff --git a/chrome/browser/memory_details.h b/chrome/browser/memory_details.h index fb2ebb3..8756acd 100644 --- a/chrome/browser/memory_details.h +++ b/chrome/browser/memory_details.h @@ -48,9 +48,9 @@ struct ProcessMemoryInformation { // The committed bytes. base::CommittedKBytes committed; // The process version - string16 version; + base::string16 version; // The process product name. - string16 product_name; + base::string16 product_name; // The number of processes which this memory represents. int num_processes; // A process is a diagnostics process if it is rendering about:memory. @@ -74,8 +74,8 @@ struct ProcessData { ~ProcessData(); ProcessData& operator=(const ProcessData& rhs); - string16 name; - string16 process_name; + base::string16 name; + base::string16 process_name; ProcessMemoryInformationList processes; // Track site data for predicting process counts with out-of-process iframes. diff --git a/chrome/browser/metrics/metrics_log.cc b/chrome/browser/metrics/metrics_log.cc index f286d1f..72d738b 100644 --- a/chrome/browser/metrics/metrics_log.cc +++ b/chrome/browser/metrics/metrics_log.cc @@ -874,7 +874,7 @@ void MetricsLog::RecordOmniboxOpenedURL(const OmniboxLog& log) { omnibox_event->set_just_deleted_text(log.just_deleted_text); omnibox_event->set_num_typed_terms(num_terms); omnibox_event->set_selected_index(log.selected_index); - if (log.completed_length != string16::npos) + if (log.completed_length != base::string16::npos) omnibox_event->set_completed_length(log.completed_length); if (log.elapsed_time_since_user_first_modified_omnibox != base::TimeDelta::FromMilliseconds(-1)) { diff --git a/chrome/browser/metrics/metrics_service.cc b/chrome/browser/metrics/metrics_service.cc index d3993e1..bffc614 100644 --- a/chrome/browser/metrics/metrics_service.cc +++ b/chrome/browser/metrics/metrics_service.cc @@ -1792,7 +1792,7 @@ void MetricsService::LogPluginLoadingError(const base::FilePath& plugin_path) { MetricsService::ChildProcessStats& MetricsService::GetChildProcessStats( const content::ChildProcessData& data) { - const string16& child_name = data.name; + const base::string16& child_name = data.name; if (!ContainsKey(child_process_stats_buffer_, child_name)) { child_process_stats_buffer_[child_name] = ChildProcessStats(data.process_type); @@ -1821,7 +1821,7 @@ void MetricsService::RecordPluginChanges(PrefService* pref) { } // TODO(viettrungluu): remove conversions - string16 name16 = UTF8ToUTF16(plugin_name); + base::string16 name16 = UTF8ToUTF16(plugin_name); if (child_process_stats_buffer_.find(name16) == child_process_stats_buffer_.end()) { continue; diff --git a/chrome/browser/metrics/variations/variations_registry_syncer_win.cc b/chrome/browser/metrics/variations/variations_registry_syncer_win.cc index 3f24e41..6f092e6 100644 --- a/chrome/browser/metrics/variations/variations_registry_syncer_win.cc +++ b/chrome/browser/metrics/variations/variations_registry_syncer_win.cc @@ -50,7 +50,7 @@ void VariationsRegistrySyncer::SyncWithRegistry() { !InstallUtil::IsPerUserInstall(chrome_exe.value().c_str()); // Read the current bits from the registry. - string16 registry_labels; + base::string16 registry_labels; bool success = GoogleUpdateSettings::ReadExperimentLabels(is_system_install, ®istry_labels); if (!success) { @@ -60,17 +60,18 @@ void VariationsRegistrySyncer::SyncWithRegistry() { // Since the non-Variations contents of experiment_labels should not be, // clobbered, separate them from the Variations contents. - const string16 other_labels = ExtractNonVariationLabels(registry_labels); + const base::string16 other_labels = + ExtractNonVariationLabels(registry_labels); // Compute the new Variations part of the label. base::FieldTrial::ActiveGroups active_groups; base::FieldTrialList::GetActiveFieldTrialGroups(&active_groups); - const string16 variation_labels = + const base::string16 variation_labels = BuildGoogleUpdateExperimentLabel(active_groups); // Append the old non-Variations labels with the new Variations labels and // write it back to the registry. - const string16 combined_labels = + const base::string16 combined_labels = CombineExperimentLabels(variation_labels, other_labels); if (!GoogleUpdateSettings::SetExperimentLabels(is_system_install, diff --git a/chrome/browser/metro_viewer/chrome_metro_viewer_process_host_aurawin.cc b/chrome/browser/metro_viewer/chrome_metro_viewer_process_host_aurawin.cc index d5fc136..bd72501 100644 --- a/chrome/browser/metro_viewer/chrome_metro_viewer_process_host_aurawin.cc +++ b/chrome/browser/metro_viewer/chrome_metro_viewer_process_host_aurawin.cc @@ -133,12 +133,12 @@ void ChromeMetroViewerProcessHost::OnSetTargetSurface( content::NotificationService::NoDetails()); } -void ChromeMetroViewerProcessHost::OnOpenURL(const string16& url) { +void ChromeMetroViewerProcessHost::OnOpenURL(const base::string16& url) { OpenURL(GURL(url)); } void ChromeMetroViewerProcessHost::OnHandleSearchRequest( - const string16& search_string) { + const base::string16& search_string) { GURL url(GetDefaultSearchURLForSearchTerms( ProfileManager::GetDefaultProfileOrOffTheRecord(), search_string)); if (url.is_valid()) diff --git a/chrome/browser/metro_viewer/chrome_metro_viewer_process_host_aurawin.h b/chrome/browser/metro_viewer/chrome_metro_viewer_process_host_aurawin.h index c32e597..69c10c3 100644 --- a/chrome/browser/metro_viewer/chrome_metro_viewer_process_host_aurawin.h +++ b/chrome/browser/metro_viewer/chrome_metro_viewer_process_host_aurawin.h @@ -17,8 +17,9 @@ class ChromeMetroViewerProcessHost : public win8::MetroViewerProcessHost { // IPC::Listener implementation virtual void OnChannelConnected(int32 peer_pid) OVERRIDE; virtual void OnSetTargetSurface(gfx::NativeViewId target_surface) OVERRIDE; - virtual void OnOpenURL(const string16& url) OVERRIDE; - virtual void OnHandleSearchRequest(const string16& search_string) OVERRIDE; + virtual void OnOpenURL(const base::string16& url) OVERRIDE; + virtual void OnHandleSearchRequest( + const base::string16& search_string) OVERRIDE; virtual void OnWindowSizeChanged(uint32 width, uint32 height) OVERRIDE; DISALLOW_COPY_AND_ASSIGN(ChromeMetroViewerProcessHost); diff --git a/chrome/browser/net/chrome_network_delegate.cc b/chrome/browser/net/chrome_network_delegate.cc index 9deb2f8..e021791 100644 --- a/chrome/browser/net/chrome_network_delegate.cc +++ b/chrome/browser/net/chrome_network_delegate.cc @@ -576,7 +576,7 @@ void ChromeNetworkDelegate::OnURLRequestDestroyed(net::URLRequest* request) { } void ChromeNetworkDelegate::OnPACScriptError(int line_number, - const string16& error) { + const base::string16& error) { extensions::ProxyEventRouter::GetInstance()->OnPACScriptError( event_router_.get(), profile_, line_number, error); } diff --git a/chrome/browser/net/chrome_network_delegate.h b/chrome/browser/net/chrome_network_delegate.h index 2aa2c45..84f5d09 100644 --- a/chrome/browser/net/chrome_network_delegate.h +++ b/chrome/browser/net/chrome_network_delegate.h @@ -155,7 +155,7 @@ class ChromeNetworkDelegate : public net::NetworkDelegate { virtual void OnCompleted(net::URLRequest* request, bool started) OVERRIDE; virtual void OnURLRequestDestroyed(net::URLRequest* request) OVERRIDE; virtual void OnPACScriptError(int line_number, - const string16& error) OVERRIDE; + const base::string16& error) OVERRIDE; virtual net::NetworkDelegate::AuthRequiredResponse OnAuthRequired( net::URLRequest* request, const net::AuthChallengeInfo& auth_info, diff --git a/chrome/browser/net/connection_tester.cc b/chrome/browser/net/connection_tester.cc index 0d38a6c..c9d1dad 100644 --- a/chrome/browser/net/connection_tester.cc +++ b/chrome/browser/net/connection_tester.cc @@ -473,7 +473,7 @@ string16 ConnectionTester::ProxySettingsExperimentDescription( return ASCIIToUTF16("Auto-detect proxy settings"); default: NOTREACHED(); - return string16(); + return base::string16(); } } @@ -483,14 +483,14 @@ string16 ConnectionTester::HostResolverExperimentDescription( // TODO(eroman): Use proper string resources. switch (experiment) { case HOST_RESOLVER_EXPERIMENT_PLAIN: - return string16(); + return base::string16(); case HOST_RESOLVER_EXPERIMENT_DISABLE_IPV6: return ASCIIToUTF16("Disable IPv6 host resolving"); case HOST_RESOLVER_EXPERIMENT_IPV6_PROBE: return ASCIIToUTF16("Probe for IPv6 host resolving"); default: NOTREACHED(); - return string16(); + return base::string16(); } } diff --git a/chrome/browser/net/connection_tester.h b/chrome/browser/net/connection_tester.h index df1bf34..ba9dec9 100644 --- a/chrome/browser/net/connection_tester.h +++ b/chrome/browser/net/connection_tester.h @@ -140,9 +140,9 @@ class ConnectionTester { void RunAllTests(const GURL& url); // Returns a text string explaining what |experiment| is testing. - static string16 ProxySettingsExperimentDescription( + static base::string16 ProxySettingsExperimentDescription( ProxySettingsExperiment experiment); - static string16 HostResolverExperimentDescription( + static base::string16 HostResolverExperimentDescription( HostResolverExperiment experiment); private: diff --git a/chrome/browser/net/net_error_tab_helper.cc b/chrome/browser/net/net_error_tab_helper.cc index 4243ed2..a00ad62 100644 --- a/chrome/browser/net/net_error_tab_helper.cc +++ b/chrome/browser/net/net_error_tab_helper.cc @@ -93,7 +93,7 @@ void NetErrorTabHelper::DidStartProvisionalLoadForFrame( void NetErrorTabHelper::DidCommitProvisionalLoadForFrame( int64 frame_id, - const string16& frame_unique_name, + const base::string16& frame_unique_name, bool is_main_frame, const GURL& url, PageTransition transition_type, @@ -119,11 +119,11 @@ void NetErrorTabHelper::DidCommitProvisionalLoadForFrame( void NetErrorTabHelper::DidFailProvisionalLoad( int64 frame_id, - const string16& frame_unique_name, + const base::string16& frame_unique_name, bool is_main_frame, const GURL& validated_url, int error_code, - const string16& error_description, + const base::string16& error_description, RenderViewHost* render_view_host) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); diff --git a/chrome/browser/net/net_error_tab_helper.h b/chrome/browser/net/net_error_tab_helper.h index c091f8b..90b0133 100644 --- a/chrome/browser/net/net_error_tab_helper.h +++ b/chrome/browser/net/net_error_tab_helper.h @@ -57,7 +57,7 @@ class NetErrorTabHelper 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, @@ -65,11 +65,11 @@ class NetErrorTabHelper 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; protected: diff --git a/chrome/browser/net/net_error_tab_helper_unittest.cc b/chrome/browser/net/net_error_tab_helper_unittest.cc index 488faeb..b643290 100644 --- a/chrome/browser/net/net_error_tab_helper_unittest.cc +++ b/chrome/browser/net/net_error_tab_helper_unittest.cc @@ -78,7 +78,7 @@ class NetErrorTabHelperTest : public testing::Test { void CommitProvisionalLoad(MainFrame main_frame) { tab_helper_.DidCommitProvisionalLoadForFrame( 1, // frame id - string16(), + base::string16(), (main_frame == MAIN_FRAME), bogus_url_, // url content::PAGE_TRANSITION_TYPED, @@ -95,11 +95,11 @@ class NetErrorTabHelperTest : public testing::Test { tab_helper_.DidFailProvisionalLoad( 1, // frame id - string16(), + base::string16(), (main_frame == MAIN_FRAME), bogus_url_, // validated_url net_error, - string16(), + base::string16(), NULL); // render_view_host } diff --git a/chrome/browser/net/proxy_browsertest.cc b/chrome/browser/net/proxy_browsertest.cc index 5897396..8b92d2b 100644 --- a/chrome/browser/net/proxy_browsertest.cc +++ b/chrome/browser/net/proxy_browsertest.cc @@ -137,7 +137,7 @@ IN_PROC_BROWSER_TEST_F(ProxyBrowserTest, MAYBE_BasicAuthWSConnect) { browser(), ws_server.GetURL("connect_check.html").ReplaceComponents(replacements)); - const string16 result = watcher.WaitAndGetTitle(); + const base::string16 result = watcher.WaitAndGetTitle(); EXPECT_TRUE(EqualsASCII(result, "PASS")); EXPECT_TRUE(observer.auth_handled()); } diff --git a/chrome/browser/net/websocket_browsertest.cc b/chrome/browser/net/websocket_browsertest.cc index 444a032..58b4f65 100644 --- a/chrome/browser/net/websocket_browsertest.cc +++ b/chrome/browser/net/websocket_browsertest.cc @@ -56,7 +56,7 @@ IN_PROC_BROWSER_TEST_F(WebSocketBrowserTest, WebSocketSplitSegments) { ws_server_.GetURL( "split_packet_check.html").ReplaceComponents(replacements)); - const string16 result = watcher.WaitAndGetTitle(); + const base::string16 result = watcher.WaitAndGetTitle(); EXPECT_TRUE(EqualsASCII(result, "PASS")); } @@ -87,7 +87,7 @@ IN_PROC_BROWSER_TEST_F(WebSocketBrowserTest, wss_server_.GetURL( "split_packet_check.html").ReplaceComponents(replacements)); - const string16 result = watcher.WaitAndGetTitle(); + const base::string16 result = watcher.WaitAndGetTitle(); EXPECT_TRUE(EqualsASCII(result, "PASS")); } diff --git a/chrome/browser/notifications/balloon_host.cc b/chrome/browser/notifications/balloon_host.cc index c3de873..89a73e4 100644 --- a/chrome/browser/notifications/balloon_host.cc +++ b/chrome/browser/notifications/balloon_host.cc @@ -61,7 +61,7 @@ content::WebContents* BalloonHost::GetAssociatedWebContents() const { return NULL; } -const string16& BalloonHost::GetSource() const { +const base::string16& BalloonHost::GetSource() const { return balloon_->notification().display_source(); } diff --git a/chrome/browser/notifications/balloon_host.h b/chrome/browser/notifications/balloon_host.h index 693b21b..c87f43e 100644 --- a/chrome/browser/notifications/balloon_host.h +++ b/chrome/browser/notifications/balloon_host.h @@ -39,7 +39,7 @@ class BalloonHost : public content::WebContentsDelegate, const OVERRIDE; virtual content::WebContents* GetAssociatedWebContents() const OVERRIDE; - const string16& GetSource() const; + const base::string16& GetSource() const; content::WebContents* web_contents() const { return web_contents_.get(); } diff --git a/chrome/browser/notifications/balloon_notification_ui_manager.cc b/chrome/browser/notifications/balloon_notification_ui_manager.cc index 6a946f5..a420ce5 100644 --- a/chrome/browser/notifications/balloon_notification_ui_manager.cc +++ b/chrome/browser/notifications/balloon_notification_ui_manager.cc @@ -90,7 +90,7 @@ void BalloonNotificationUIManager::Add(const Notification& notification, bool BalloonNotificationUIManager::Update(const Notification& notification, Profile* profile) { const GURL& origin = notification.origin_url(); - const string16& replace_id = notification.replace_id(); + const base::string16& replace_id = notification.replace_id(); if (replace_id.empty()) return false; @@ -226,7 +226,7 @@ bool BalloonNotificationUIManager::UpdateNotification( const Notification& notification, Profile* profile) { const GURL& origin = notification.origin_url(); - const string16& replace_id = notification.replace_id(); + const base::string16& replace_id = notification.replace_id(); DCHECK(!replace_id.empty()); diff --git a/chrome/browser/notifications/desktop_notification_service.cc b/chrome/browser/notifications/desktop_notification_service.cc index 5a16feb..eecc9be 100644 --- a/chrome/browser/notifications/desktop_notification_service.cc +++ b/chrome/browser/notifications/desktop_notification_service.cc @@ -69,7 +69,7 @@ class NotificationPermissionInfoBarDelegate : public ConfirmInfoBarDelegate { static void Create(InfoBarService* infobar_service, DesktopNotificationService* notification_service, const GURL& origin, - const string16& display_name, + const base::string16& display_name, int process_id, int route_id, int callback_context); @@ -78,7 +78,7 @@ class NotificationPermissionInfoBarDelegate : public ConfirmInfoBarDelegate { NotificationPermissionInfoBarDelegate( DesktopNotificationService* notification_service, const GURL& origin, - const string16& display_name, + const base::string16& display_name, int process_id, int route_id, int callback_context); @@ -87,8 +87,8 @@ class NotificationPermissionInfoBarDelegate : public ConfirmInfoBarDelegate { // ConfirmInfoBarDelegate: virtual int GetIconID() const OVERRIDE; virtual Type GetInfoBarType() 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; @@ -97,7 +97,7 @@ class NotificationPermissionInfoBarDelegate : public ConfirmInfoBarDelegate { // The display name for the origin to be displayed. Will be different from // origin_ for extensions. - string16 display_name_; + base::string16 display_name_; // The notification service to be used. DesktopNotificationService* notification_service_; @@ -119,7 +119,7 @@ void NotificationPermissionInfoBarDelegate::Create( InfoBarService* infobar_service, DesktopNotificationService* notification_service, const GURL& origin, - const string16& display_name, + const base::string16& display_name, int process_id, int route_id, int callback_context) { @@ -133,7 +133,7 @@ void NotificationPermissionInfoBarDelegate::Create( NotificationPermissionInfoBarDelegate::NotificationPermissionInfoBarDelegate( DesktopNotificationService* notification_service, const GURL& origin, - const string16& display_name, + const base::string16& display_name, int process_id, int route_id, int callback_context) @@ -166,12 +166,12 @@ InfoBarDelegate::Type return PAGE_ACTION_TYPE; } -string16 NotificationPermissionInfoBarDelegate::GetMessageText() const { +base::string16 NotificationPermissionInfoBarDelegate::GetMessageText() const { return l10n_util::GetStringFUTF16(IDS_NOTIFICATION_PERMISSIONS, display_name_); } -string16 NotificationPermissionInfoBarDelegate::GetButtonLabel( +base::string16 NotificationPermissionInfoBarDelegate::GetButtonLabel( InfoBarButton button) const { return l10n_util::GetStringUTF16((button == BUTTON_OK) ? IDS_NOTIFICATION_PERMISSION_YES : IDS_NOTIFICATION_PERMISSION_NO); @@ -210,8 +210,10 @@ void DesktopNotificationService::RegisterProfilePrefs( } // static -string16 DesktopNotificationService::CreateDataUrl( - const GURL& icon_url, const string16& title, const string16& body, +base::string16 DesktopNotificationService::CreateDataUrl( + const GURL& icon_url, + const base::string16& title, + const base::string16& body, WebTextDirection dir) { int resource; std::vector<std::string> subst; @@ -225,9 +227,9 @@ string16 DesktopNotificationService::CreateDataUrl( "right" : "left"); } else if (title.empty() || body.empty()) { resource = IDR_NOTIFICATION_1LINE_HTML; - string16 line = title.empty() ? body : title; + base::string16 line = title.empty() ? body : title; // Strings are div names in the template file. - string16 line_name = title.empty() ? ASCIIToUTF16("description") + base::string16 line_name = title.empty() ? ASCIIToUTF16("description") : ASCIIToUTF16("title"); subst.push_back(net::EscapeForHTML(UTF16ToUTF8(line_name))); subst.push_back(net::EscapeForHTML(UTF16ToUTF8(line))); @@ -244,7 +246,7 @@ string16 DesktopNotificationService::CreateDataUrl( } // static -string16 DesktopNotificationService::CreateDataUrl( +base::string16 DesktopNotificationService::CreateDataUrl( int resource, const std::vector<std::string>& subst) { const base::StringPiece template_html( ResourceBundle::GetSharedInstance().GetRawDataResource( @@ -252,7 +254,7 @@ string16 DesktopNotificationService::CreateDataUrl( if (template_html.empty()) { NOTREACHED() << "unable to load template. ID: " << resource; - return string16(); + return base::string16(); } std::string data = ReplaceStringPlaceholders(template_html, subst, NULL); @@ -263,17 +265,17 @@ string16 DesktopNotificationService::CreateDataUrl( // static std::string DesktopNotificationService::AddNotification( const GURL& origin_url, - const string16& title, - const string16& message, + const base::string16& title, + const base::string16& message, const GURL& icon_url, - const string16& replace_id, + const base::string16& replace_id, NotificationDelegate* delegate, Profile* profile) { if (message_center::IsRichNotificationEnabled()) { // For message center create a non-HTML notification with |icon_url|. Notification notification(origin_url, icon_url, title, message, blink::WebTextDirectionDefault, - string16(), replace_id, delegate); + base::string16(), replace_id, delegate); g_browser_process->notification_ui_manager()->Add(notification, profile); return notification.notification_id(); } @@ -282,7 +284,7 @@ std::string DesktopNotificationService::AddNotification( GURL content_url(CreateDataUrl( icon_url, title, message, blink::WebTextDirectionDefault)); Notification notification( - GURL(), content_url, string16(), replace_id, delegate); + GURL(), content_url, base::string16(), replace_id, delegate); g_browser_process->notification_ui_manager()->Add(notification, profile); return notification.notification_id(); } @@ -290,17 +292,17 @@ std::string DesktopNotificationService::AddNotification( // static std::string DesktopNotificationService::AddIconNotification( const GURL& origin_url, - const string16& title, - const string16& message, + const base::string16& title, + const base::string16& message, const gfx::Image& icon, - const string16& replace_id, + const base::string16& replace_id, NotificationDelegate* delegate, Profile* profile) { if (message_center::IsRichNotificationEnabled()) { // For message center create a non-HTML notification with |icon|. Notification notification(origin_url, icon, title, message, blink::WebTextDirectionDefault, - string16(), replace_id, delegate); + base::string16(), replace_id, delegate); g_browser_process->notification_ui_manager()->Add(notification, profile); return notification.notification_id(); } @@ -489,7 +491,8 @@ bool DesktopNotificationService::ShowDesktopNotification( params.notification_id, source == WorkerNotification); - string16 display_source = DisplayNameForOriginInProcessId(origin, process_id); + base::string16 display_source = + DisplayNameForOriginInProcessId(origin, process_id); Notification notification(origin, params.icon_url, params.title, params.body, params.direction, display_source, params.replace_id, proxy); @@ -501,7 +504,7 @@ bool DesktopNotificationService::ShowDesktopNotification( return true; } -string16 DesktopNotificationService::DisplayNameForOriginInProcessId( +base::string16 DesktopNotificationService::DisplayNameForOriginInProcessId( const GURL& origin, int process_id) { // If the source is an extension, lookup the display name. // Message center prefers to use extension name if the notification diff --git a/chrome/browser/notifications/desktop_notification_service.h b/chrome/browser/notifications/desktop_notification_service.h index c4bf961..b08e539 100644 --- a/chrome/browser/notifications/desktop_notification_service.h +++ b/chrome/browser/notifications/desktop_notification_service.h @@ -94,15 +94,15 @@ class DesktopNotificationService : public BrowserContextKeyedService, // Creates a data:xxxx URL which contains the full HTML for a notification // using supplied icon, title, and text, run through a template which contains // the standard formatting for notifications. - static string16 CreateDataUrl(const GURL& icon_url, - const string16& title, - const string16& body, - blink::WebTextDirection dir); + static base::string16 CreateDataUrl(const GURL& icon_url, + const base::string16& title, + const base::string16& body, + blink::WebTextDirection dir); // Creates a data:xxxx URL which contains the full HTML for a notification // using resource template which contains the standard formatting for // notifications. - static string16 CreateDataUrl(int resource, + static base::string16 CreateDataUrl(int resource, const std::vector<std::string>& subst); // Add a desktop notification. On non-Ash platforms this will generate a HTML @@ -111,19 +111,19 @@ class DesktopNotificationService : public BrowserContextKeyedService, // TODO(mukai): remove these methods. HTML notifications are no longer // supported. static std::string AddNotification(const GURL& origin_url, - const string16& title, - const string16& message, + const base::string16& title, + const base::string16& message, const GURL& icon_url, - const string16& replace_id, + const base::string16& replace_id, NotificationDelegate* delegate, Profile* profile); // Same as above, but takes a gfx::Image for the icon instead. static std::string AddIconNotification(const GURL& origin_url, - const string16& title, - const string16& message, + const base::string16& title, + const base::string16& message, const gfx::Image& icon, - const string16& replace_id, + const base::string16& replace_id, NotificationDelegate* delegate, Profile* profile); @@ -170,7 +170,8 @@ class DesktopNotificationService : public BrowserContextKeyedService, // Returns a display name for an origin in the process id, to be used in // permission infobar or on the frame of the notification toast. Different // from the origin itself when dealing with extensions. - string16 DisplayNameForOriginInProcessId(const GURL& origin, int process_id); + base::string16 DisplayNameForOriginInProcessId(const GURL& origin, + int process_id); // Notifies the observers when permissions settings change. void NotifySettingsChange(); |