diff options
author | dbeam@chromium.org <dbeam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-20 17:35:56 +0000 |
---|---|---|
committer | dbeam@chromium.org <dbeam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-20 17:35:56 +0000 |
commit | 4dcc2ec6b1a9417aab85183acbca64761ccdd32d (patch) | |
tree | ec1ac02e939a76a038f3c47824a34c36fb2de90e | |
parent | fdd91ad2e68f187bc301c30ecda7e503dae32126 (diff) | |
download | chromium_src-4dcc2ec6b1a9417aab85183acbca64761ccdd32d.zip chromium_src-4dcc2ec6b1a9417aab85183acbca64761ccdd32d.tar.gz chromium_src-4dcc2ec6b1a9417aab85183acbca64761ccdd32d.tar.bz2 |
Add base:: to string16s in win8/.
R=grt@chromium.org
BUG=329295
Review URL: https://codereview.chromium.org/119733002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@242114 0039d316-1c4b-4281-b951-d872f2087c98
42 files changed, 240 insertions, 227 deletions
diff --git a/win8/delegate_execute/chrome_util.cc b/win8/delegate_execute/chrome_util.cc index 3695b33..89d869d 100644 --- a/win8/delegate_execute/chrome_util.cc +++ b/win8/delegate_execute/chrome_util.cc @@ -45,10 +45,10 @@ const wchar_t kRegPathChromeClientBase[] = // use by a browser process. // TODO(grt): Move this somewhere central so it can be used by both this // IsBrowserRunning (below) and IsBrowserAlreadyRunning (browser_util_win.cc). -string16 GetEventName(const base::FilePath& chrome_exe) { +base::string16 GetEventName(const base::FilePath& chrome_exe) { static wchar_t const kEventPrefix[] = L"Global\\"; const size_t prefix_len = arraysize(kEventPrefix) - 1; - string16 name; + base::string16 name; name.reserve(prefix_len + chrome_exe.value().size()); name.assign(kEventPrefix, prefix_len); name.append(chrome_exe.value()); @@ -80,10 +80,10 @@ bool NewChromeExeExists(const base::FilePath& chrome_exe) { return base::PathExists(new_chrome_exe); } -bool GetUpdateCommand(bool is_per_user, string16* update_command) { +bool GetUpdateCommand(bool is_per_user, base::string16* update_command) { const HKEY root = is_per_user ? HKEY_CURRENT_USER : HKEY_LOCAL_MACHINE; BrowserDistribution* dist = BrowserDistribution::GetDistribution(); - string16 reg_path_chrome_client = kRegPathChromeClientBase; + base::string16 reg_path_chrome_client = kRegPathChromeClientBase; reg_path_chrome_client.append(dist->GetAppGuid()); base::win::RegKey key(root, reg_path_chrome_client.c_str(), KEY_QUERY_VALUE); @@ -107,7 +107,7 @@ void UpdateChromeIfNeeded(const base::FilePath& chrome_exe) { if (InstallUtil::IsPerUserInstall(chrome_exe.value().c_str())) { // Read the update command from the registry. - string16 update_command; + base::string16 update_command; if (!GetUpdateCommand(true, &update_command)) { AtlTrace("%hs. Failed to read update command from registry.\n", __FUNCTION__); diff --git a/win8/delegate_execute/command_execute_impl.cc b/win8/delegate_execute/command_execute_impl.cc index cb68f54..9381fd2 100644 --- a/win8/delegate_execute/command_execute_impl.cc +++ b/win8/delegate_execute/command_execute_impl.cc @@ -36,7 +36,7 @@ namespace { // Helper function to retrieve the url from IShellItem interface passed in. // Returns S_OK on success. -HRESULT GetUrlFromShellItem(IShellItem* shell_item, string16* url) { +HRESULT GetUrlFromShellItem(IShellItem* shell_item, base::string16* url) { DCHECK(shell_item); DCHECK(url); // First attempt to get the url from the underlying IDataObject if any. This @@ -329,12 +329,12 @@ STDMETHODIMP CommandExecuteImpl::Execute() { BrowserDistribution* distribution = BrowserDistribution::GetDistribution(); bool is_per_user_install = InstallUtil::IsPerUserInstall( chrome_exe_.value().c_str()); - string16 app_id = ShellUtil::GetBrowserModelId( + base::string16 app_id = ShellUtil::GetBrowserModelId( distribution, is_per_user_install); DWORD pid = 0; if (launch_scheme_ == INTERNET_SCHEME_FILE && - display_name_.find(installer::kChromeExe) != string16::npos) { + display_name_.find(installer::kChromeExe) != base::string16::npos) { AtlTrace("Activating for file\n"); hr = activation_manager->ActivateApplication(app_id.c_str(), verb_.c_str(), @@ -415,7 +415,7 @@ bool CommandExecuteImpl::FindChromeExe(base::FilePath* chrome_exe) { } bool CommandExecuteImpl::GetLaunchScheme( - string16* display_name, INTERNET_SCHEME* scheme) { + base::string16* display_name, INTERNET_SCHEME* scheme) { if (!item_array_) return false; @@ -465,7 +465,7 @@ bool CommandExecuteImpl::GetLaunchScheme( HRESULT CommandExecuteImpl::LaunchDesktopChrome() { AtlTrace("In %hs\n", __FUNCTION__); - string16 display_name = display_name_; + base::string16 display_name = display_name_; switch (launch_scheme_) { case INTERNET_SCHEME_FILE: @@ -473,7 +473,7 @@ HRESULT CommandExecuteImpl::LaunchDesktopChrome() { // should honor it. For e.g. If the user clicks on a html file when // chrome is the default we should treat it as a parameter to be passed // to chrome. - if (display_name.find(installer::kChromeExe) != string16::npos) + if (display_name.find(installer::kChromeExe) != base::string16::npos) display_name.clear(); break; @@ -484,7 +484,7 @@ HRESULT CommandExecuteImpl::LaunchDesktopChrome() { CommandLine chrome( delegate_execute::MakeChromeCommandLine(chrome_exe_, parameters_, display_name)); - string16 command_line(chrome.GetCommandLineString()); + base::string16 command_line(chrome.GetCommandLineString()); AtlTrace("Formatted command line is %ls\n", command_line.c_str()); diff --git a/win8/delegate_execute/command_execute_impl.h b/win8/delegate_execute/command_execute_impl.h index 7b1490b..7e4bf7c 100644 --- a/win8/delegate_execute/command_execute_impl.h +++ b/win8/delegate_execute/command_execute_impl.h @@ -88,7 +88,7 @@ class ATL_NO_VTABLE DECLSPEC_UUID("071BB5F2-85A4-424F-BFE7-5F1609BE4C2C") static bool path_provider_initialized_; - bool GetLaunchScheme(string16* display_name, INTERNET_SCHEME* scheme); + bool GetLaunchScheme(base::string16* display_name, INTERNET_SCHEME* scheme); HRESULT LaunchDesktopChrome(); // Returns the launch mode, i.e. desktop launch/metro launch, etc. EC_HOST_UI_MODE GetLaunchMode(); @@ -97,8 +97,8 @@ class ATL_NO_VTABLE DECLSPEC_UUID("071BB5F2-85A4-424F-BFE7-5F1609BE4C2C") CommandLine parameters_; base::FilePath chrome_exe_; STARTUPINFO start_info_; - string16 verb_; - string16 display_name_; + base::string16 verb_; + base::string16 display_name_; INTERNET_SCHEME launch_scheme_; base::IntegrityLevel integrity_level_; diff --git a/win8/delegate_execute/crash_server_init.cc b/win8/delegate_execute/crash_server_init.cc index 7689316..646c57b 100644 --- a/win8/delegate_execute/crash_server_init.cc +++ b/win8/delegate_execute/crash_server_init.cc @@ -70,12 +70,12 @@ scoped_ptr<google_breakpad::ExceptionHandler> InitializeCrashReporting() { wchar_t temp_path[MAX_PATH + 1] = {0}; DWORD path_len = ::GetTempPath(MAX_PATH, temp_path); - string16 pipe_name; + base::string16 pipe_name; pipe_name = kGoogleUpdatePipeName; if (IsRunningSystemInstall()) { pipe_name += kSystemPrincipalSid; } else { - string16 user_sid; + base::string16 user_sid; if (base::win::GetUserSidString(&user_sid)) { pipe_name += user_sid; } else { diff --git a/win8/delegate_execute/delegate_execute.cc b/win8/delegate_execute/delegate_execute.cc index ddb9883..837505b 100644 --- a/win8/delegate_execute/delegate_execute.cc +++ b/win8/delegate_execute/delegate_execute.cc @@ -47,7 +47,7 @@ class DelegateExecuteModule HRESULT PreMessageLoop(int nShowCmd) { HRESULT hr = S_OK; - string16 clsid_string; + base::string16 clsid_string; GUID clsid; BrowserDistribution* dist = BrowserDistribution::GetDistribution(); if (!dist->GetCommandExecuteImplClsid(&clsid_string)) @@ -121,7 +121,7 @@ int RelaunchChrome(const DelegateExecuteOperation& operation) { base::win::ScopedCOMInitializer com_initializer; - string16 relaunch_flags(operation.relaunch_flags()); + base::string16 relaunch_flags(operation.relaunch_flags()); SHELLEXECUTEINFO sei = { sizeof(sei) }; sei.fMask = SEE_MASK_FLAG_LOG_USAGE; sei.nShow = SW_SHOWNORMAL; diff --git a/win8/delegate_execute/delegate_execute_operation.cc b/win8/delegate_execute/delegate_execute_operation.cc index a733312..91e5eff 100644 --- a/win8/delegate_execute/delegate_execute_operation.cc +++ b/win8/delegate_execute/delegate_execute_operation.cc @@ -45,7 +45,7 @@ bool DelegateExecuteOperation::Init(const CommandLine* cmd_line) { } DWORD DelegateExecuteOperation::GetParentPid() const { - std::vector<string16> parts; + std::vector<base::string16> parts; base::SplitString(mutex_, L'.', &parts); if (parts.size() != 3) return 0; diff --git a/win8/delegate_execute/delegate_execute_operation.h b/win8/delegate_execute/delegate_execute_operation.h index 7d1456c..91e2231 100644 --- a/win8/delegate_execute/delegate_execute_operation.h +++ b/win8/delegate_execute/delegate_execute_operation.h @@ -49,11 +49,11 @@ class DelegateExecuteOperation { return operation_type_; } - const string16& relaunch_flags() const { + const base::string16& relaunch_flags() const { return relaunch_flags_; } - const string16& mutex() const { + const base::string16& mutex() const { return mutex_; } @@ -66,9 +66,9 @@ class DelegateExecuteOperation { private: OperationType operation_type_; - string16 relaunch_flags_; + base::string16 relaunch_flags_; base::FilePath relaunch_shortcut_; - string16 mutex_; + base::string16 mutex_; DISALLOW_COPY_AND_ASSIGN(DelegateExecuteOperation); }; diff --git a/win8/delegate_execute/delegate_execute_util.cc b/win8/delegate_execute/delegate_execute_util.cc index 6a3dc04..c3097a2 100644 --- a/win8/delegate_execute/delegate_execute_util.cc +++ b/win8/delegate_execute/delegate_execute_util.cc @@ -13,7 +13,7 @@ CommandLine CommandLineFromParameters(const wchar_t* params) { CommandLine command_line(CommandLine::NO_PROGRAM); if (params) { - string16 command_string(L"noprogram.exe "); + base::string16 command_string(L"noprogram.exe "); command_string.append(params); command_line.ParseFromString(command_string); command_line.SetProgram(base::FilePath()); @@ -24,7 +24,7 @@ CommandLine CommandLineFromParameters(const wchar_t* params) { CommandLine MakeChromeCommandLine(const base::FilePath& chrome_exe, const CommandLine& params, - const string16& argument) { + const base::string16& argument) { CommandLine chrome_cmd(params); chrome_cmd.SetProgram(chrome_exe); @@ -34,15 +34,15 @@ CommandLine MakeChromeCommandLine(const base::FilePath& chrome_exe, return chrome_cmd; } -string16 ParametersFromSwitch(const char* a_switch) { +base::string16 ParametersFromSwitch(const char* a_switch) { if (!a_switch) - return string16(); + return base::string16(); CommandLine cmd_line(CommandLine::NO_PROGRAM); cmd_line.AppendSwitch(a_switch); - string16 command_string(cmd_line.GetCommandLineString()); + base::string16 command_string(cmd_line.GetCommandLineString()); TrimWhitespace(command_string, TRIM_ALL, &command_string); return command_string; } diff --git a/win8/delegate_execute/delegate_execute_util.h b/win8/delegate_execute/delegate_execute_util.h index adb2e7a..4f32e96 100644 --- a/win8/delegate_execute/delegate_execute_util.h +++ b/win8/delegate_execute/delegate_execute_util.h @@ -21,11 +21,11 @@ CommandLine CommandLineFromParameters(const wchar_t* params); // from |params| plus an optional |argument|. CommandLine MakeChromeCommandLine(const base::FilePath& chrome_exe, const CommandLine& params, - const string16& argument); + const base::string16& argument); // Returns a properly quoted command-line string less the program (argv[0]) // containing |switch|. -string16 ParametersFromSwitch(const char* a_switch); +base::string16 ParametersFromSwitch(const char* a_switch); } // namespace delegate_execute diff --git a/win8/delegate_execute/delegate_execute_util_unittest.cc b/win8/delegate_execute/delegate_execute_util_unittest.cc index f01b157..ca444b8 100644 --- a/win8/delegate_execute/delegate_execute_util_unittest.cc +++ b/win8/delegate_execute/delegate_execute_util_unittest.cc @@ -42,38 +42,41 @@ TEST(DelegateExecuteUtil, MakeChromeCommandLineTest) { // Empty params and argument contains only the exe. cl = delegate_execute::MakeChromeCommandLine( - this_exe, delegate_execute::CommandLineFromParameters(NULL), string16()); + this_exe, + delegate_execute::CommandLineFromParameters(NULL), + base::string16()); EXPECT_EQ(1, cl.argv().size()); EXPECT_EQ(this_exe.value(), cl.GetProgram().value()); // Empty params with arg contains the arg. cl = delegate_execute::MakeChromeCommandLine( this_exe, delegate_execute::CommandLineFromParameters(NULL), - string16(kSomeArgument)); + base::string16(kSomeArgument)); EXPECT_EQ(2, cl.argv().size()); EXPECT_EQ(this_exe.value(), cl.GetProgram().value()); EXPECT_EQ(1, cl.GetArgs().size()); - EXPECT_EQ(string16(kSomeArgument), cl.GetArgs()[0]); + EXPECT_EQ(base::string16(kSomeArgument), cl.GetArgs()[0]); // Params with switchs and args plus arg contains the arg. cl = delegate_execute::MakeChromeCommandLine( this_exe, delegate_execute::CommandLineFromParameters( base::StringPrintf(L"--%ls -- %ls", ASCIIToWide(kSomeSwitch).c_str(), kOtherArgument).c_str()), - string16(kSomeArgument)); + base::string16(kSomeArgument)); EXPECT_EQ(5, cl.argv().size()); EXPECT_EQ(this_exe.value(), cl.GetProgram().value()); EXPECT_TRUE(cl.HasSwitch(kSomeSwitch)); CommandLine::StringVector args(cl.GetArgs()); EXPECT_EQ(2, args.size()); + EXPECT_NE( + args.end(), + std::find(args.begin(), args.end(), base::string16(kOtherArgument))); EXPECT_NE(args.end(), - std::find(args.begin(), args.end(), string16(kOtherArgument))); - EXPECT_NE(args.end(), - std::find(args.begin(), args.end(), string16(kSomeArgument))); + std::find(args.begin(), args.end(), base::string16(kSomeArgument))); } TEST(DelegateExecuteUtil, ParametersFromSwitchTest) { - EXPECT_EQ(string16(), delegate_execute::ParametersFromSwitch(NULL)); - EXPECT_EQ(string16(L"--some-switch"), + EXPECT_EQ(base::string16(), delegate_execute::ParametersFromSwitch(NULL)); + EXPECT_EQ(base::string16(L"--some-switch"), delegate_execute::ParametersFromSwitch(kSomeSwitch)); } diff --git a/win8/metro_driver/chrome_app_view.cc b/win8/metro_driver/chrome_app_view.cc index 2bc555b..3a9d23e 100644 --- a/win8/metro_driver/chrome_app_view.cc +++ b/win8/metro_driver/chrome_app_view.cc @@ -1088,8 +1088,8 @@ HRESULT ChromeAppView::OnShareDataRequested( return E_FAIL; } - string16 current_title(current_tab_info.title); - string16 current_url(current_tab_info.url); + base::string16 current_title(current_tab_info.title); + base::string16 current_url(current_tab_info.url); LocalFree(current_tab_info.title); LocalFree(current_tab_info.url); diff --git a/win8/metro_driver/chrome_app_view.h b/win8/metro_driver/chrome_app_view.h index 0554ab3..77d6781 100644 --- a/win8/metro_driver/chrome_app_view.h +++ b/win8/metro_driver/chrome_app_view.h @@ -155,8 +155,8 @@ struct Globals { HANDLE host_thread; ChromeAppView* view; WNDPROC g_core_proc; - string16 navigation_url; - string16 search_string; + base::string16 navigation_url; + base::string16 search_string; winapp::Activation::ApplicationExecutionState previous_state; winapp::Activation::ActivationKind initial_activation_kind; bool is_initial_activation; @@ -164,7 +164,7 @@ struct Globals { // to be initiated from that thread, notably spawning file pickers. base::MessageLoopProxy* appview_msg_loop; winapp::Core::ICoreApplicationExit* app_exit; - string16 metro_command_line_switches; + base::string16 metro_command_line_switches; }; extern Globals globals; diff --git a/win8/metro_driver/chrome_app_view_ash.cc b/win8/metro_driver/chrome_app_view_ash.cc index e8cedc3..79649ff 100644 --- a/win8/metro_driver/chrome_app_view_ash.cc +++ b/win8/metro_driver/chrome_app_view_ash.cc @@ -195,7 +195,7 @@ class ChromeChannelListener : public IPC::Listener { } void OnOpenURLOnDesktop(const base::FilePath& shortcut, - const string16& url) { + const base::string16& url) { ui_proxy_->PostTask(FROM_HERE, base::Bind(&ChromeAppViewAsh::OnOpenURLOnDesktop, base::Unretained(app_view_), @@ -209,8 +209,8 @@ class ChromeChannelListener : public IPC::Listener { reinterpret_cast<HCURSOR>(cursor))); } - void OnDisplayFileOpenDialog(const string16& title, - const string16& filter, + void OnDisplayFileOpenDialog(const base::string16& title, + const base::string16& filter, const base::FilePath& default_path, bool allow_multiple_files) { ui_proxy_->PostTask(FROM_HERE, @@ -231,7 +231,7 @@ class ChromeChannelListener : public IPC::Listener { params)); } - void OnDisplayFolderPicker(const string16& title) { + void OnDisplayFolderPicker(const base::string16& title) { ui_proxy_->PostTask( FROM_HERE, base::Bind(&ChromeAppViewAsh::OnDisplayFolderPicker, @@ -327,7 +327,8 @@ bool LaunchChromeBrowserProcess(const wchar_t* additional_parameters, DVLOG(1) << "Activate: ActivationKind_Launch"; mswrw::HString launch_args_str; launch_args->get_Arguments(launch_args_str.GetAddressOf()); - string16 actual_launch_args(MakeStdWString(launch_args_str.Get())); + base::string16 actual_launch_args( + MakeStdWString(launch_args_str.Get())); if (actual_launch_args == win8::kMetroViewerConnectVerb) { DVLOG(1) << __FUNCTION__ << "Not launching chrome server"; return true; @@ -342,7 +343,7 @@ bool LaunchChromeBrowserProcess(const wchar_t* additional_parameters, if (!PathService::Get(base::FILE_EXE, &chrome_exe_path)) return false; - string16 parameters = L"--silent-launch --viewer-connect "; + base::string16 parameters = L"--silent-launch --viewer-connect "; if (additional_parameters) parameters += additional_parameters; @@ -758,7 +759,7 @@ void ChromeAppViewAsh::OnActivateDesktop(const base::FilePath& file_path, } void ChromeAppViewAsh::OnOpenURLOnDesktop(const base::FilePath& shortcut, - const string16& url) { + const base::string16& url) { base::FilePath::StringType file = shortcut.value(); SHELLEXECUTEINFO sei = { sizeof(sei) }; sei.fMask = SEE_MASK_FLAG_LOG_USAGE; @@ -774,8 +775,8 @@ void ChromeAppViewAsh::OnSetCursor(HCURSOR cursor) { } void ChromeAppViewAsh::OnDisplayFileOpenDialog( - const string16& title, - const string16& filter, + const base::string16& title, + const base::string16& filter, const base::FilePath& default_path, bool allow_multiple_files) { DVLOG(1) << __FUNCTION__; @@ -804,7 +805,7 @@ void ChromeAppViewAsh::OnDisplayFileSaveAsDialog( file_picker_->Run(); } -void ChromeAppViewAsh::OnDisplayFolderPicker(const string16& title) { +void ChromeAppViewAsh::OnDisplayFolderPicker(const base::string16& title) { DVLOG(1) << __FUNCTION__; // The FolderPickerSession instance is deleted when we receive a // callback from the FolderPickerSession class about the completion of the @@ -919,7 +920,7 @@ void ChromeAppViewAsh::OnInputSourceChanged() { } void ChromeAppViewAsh::OnCompositionChanged( - const string16& text, + const base::string16& text, int32 selection_start, int32 selection_end, const std::vector<metro_viewer::UnderlineInfo>& underlines) { @@ -927,7 +928,7 @@ void ChromeAppViewAsh::OnCompositionChanged( text, selection_start, selection_end, underlines)); } -void ChromeAppViewAsh::OnTextCommitted(const string16& text) { +void ChromeAppViewAsh::OnTextCommitted(const base::string16& text) { ui_channel_->Send(new MetroViewerHostMsg_ImeTextCommitted(text)); } @@ -1230,7 +1231,7 @@ HRESULT ChromeAppViewAsh::HandleSearchRequest( mswrw::HString search_string; CheckHR(search_args->get_QueryText(search_string.GetAddressOf())); - string16 search_text(MakeStdWString(search_string.Get())); + base::string16 search_text(MakeStdWString(search_string.Get())); ui_loop_.PostTask(FROM_HERE, base::Bind(&ChromeAppViewAsh::OnSearchRequest, @@ -1255,7 +1256,7 @@ HRESULT ChromeAppViewAsh::HandleProtocolRequest( protocol_args->get_Uri(&uri); mswrw::HString url; uri->get_AbsoluteUri(url.GetAddressOf()); - string16 actual_url(MakeStdWString(url.Get())); + base::string16 actual_url(MakeStdWString(url.Get())); DVLOG(1) << "Received url request: " << actual_url; ui_loop_.PostTask(FROM_HERE, @@ -1276,12 +1277,12 @@ HRESULT ChromeAppViewAsh::OnEdgeGestureCompleted( return S_OK; } -void ChromeAppViewAsh::OnSearchRequest(const string16& search_string) { +void ChromeAppViewAsh::OnSearchRequest(const base::string16& search_string) { DCHECK(ui_channel_); ui_channel_->Send(new MetroViewerHostMsg_SearchRequest(search_string)); } -void ChromeAppViewAsh::OnNavigateToUrl(const string16& url) { +void ChromeAppViewAsh::OnNavigateToUrl(const base::string16& url) { DCHECK(ui_channel_); ui_channel_->Send(new MetroViewerHostMsg_OpenURL(url)); } diff --git a/win8/metro_driver/chrome_app_view_ash.h b/win8/metro_driver/chrome_app_view_ash.h index ed07796..c52f050 100644 --- a/win8/metro_driver/chrome_app_view_ash.h +++ b/win8/metro_driver/chrome_app_view_ash.h @@ -66,15 +66,16 @@ class ChromeAppViewAsh static HRESULT Unsnap(); void OnActivateDesktop(const base::FilePath& file_path, bool ash_exit); - void OnOpenURLOnDesktop(const base::FilePath& shortcut, const string16& url); + void OnOpenURLOnDesktop(const base::FilePath& shortcut, + const base::string16& url); void OnSetCursor(HCURSOR cursor); - void OnDisplayFileOpenDialog(const string16& title, - const string16& filter, + void OnDisplayFileOpenDialog(const base::string16& title, + const base::string16& filter, const base::FilePath& default_path, bool allow_multiple_files); void OnDisplayFileSaveAsDialog( const MetroViewerHostMsg_SaveAsDialogParams& params); - void OnDisplayFolderPicker(const string16& title); + void OnDisplayFolderPicker(const base::string16& title); void OnSetCursorPos(int x, int y); // This function is invoked when the open file operation completes. The @@ -117,11 +118,11 @@ class ChromeAppViewAsh // TextServiceDelegate overrides. virtual void OnCompositionChanged( - const string16& text, + const base::string16& text, int32 selection_start, int32 selection_end, const std::vector<metro_viewer::UnderlineInfo>& underlines) OVERRIDE; - virtual void OnTextCommitted(const string16& text) OVERRIDE; + virtual void OnTextCommitted(const base::string16& text) OVERRIDE; // Convenience for sending a MetroViewerHostMsg_MouseButton with the specified // parameters. @@ -181,8 +182,8 @@ class ChromeAppViewAsh // Tasks posted to the UI thread to initiate the search/url navigation // requests. - void OnSearchRequest(const string16& search_string); - void OnNavigateToUrl(const string16& url); + void OnSearchRequest(const base::string16& search_string); + void OnNavigateToUrl(const base::string16& url); HRESULT OnSizeChanged(winui::Core::ICoreWindow* sender, winui::Core::IWindowSizeChangedEventArgs* args); diff --git a/win8/metro_driver/chrome_url_launch_handler.cc b/win8/metro_driver/chrome_url_launch_handler.cc index 897276a..7c99b13 100644 --- a/win8/metro_driver/chrome_url_launch_handler.cc +++ b/win8/metro_driver/chrome_url_launch_handler.cc @@ -72,7 +72,7 @@ void ChromeUrlLaunchHandler::HandleSearchRequest(T* args) { DVLOG(1) << __FUNCTION__; mswrw::HString search_string; args->get_QueryText(search_string.GetAddressOf()); - string16 search_text(MakeStdWString(search_string.Get())); + base::string16 search_text(MakeStdWString(search_string.Get())); globals.search_string = search_text; DVLOG(1) << search_text.c_str(); // If this is the initial activation then we wait for Chrome to initiate the @@ -88,7 +88,7 @@ void ChromeUrlLaunchHandler::HandleProtocolLaunch( args->get_Uri(&uri); mswrw::HString url; uri->get_AbsoluteUri(url.GetAddressOf()); - string16 actual_url(MakeStdWString(url.Get())); + base::string16 actual_url(MakeStdWString(url.Get())); globals.navigation_url = actual_url; // If this is the initial activation then we wait for Chrome to initiate the @@ -100,27 +100,27 @@ void ChromeUrlLaunchHandler::HandleProtocolLaunch( // |launch_args| is an encoded command line, minus the executable name. To // find the URL to launch the first argument is used. If any other parameters // are encoded in |launch_args| they are ignored. -string16 ChromeUrlLaunchHandler::GetUrlFromLaunchArgs( - const string16& launch_args) { +base::string16 ChromeUrlLaunchHandler::GetUrlFromLaunchArgs( + const base::string16& launch_args) { if (launch_args == L"opennewwindow") { VLOG(1) << "Returning new tab url"; return L"chrome://newtab"; } - string16 dummy_command_line(L"dummy.exe "); + base::string16 dummy_command_line(L"dummy.exe "); dummy_command_line.append(launch_args); CommandLine command_line = CommandLine::FromString(dummy_command_line); CommandLine::StringVector args = command_line.GetArgs(); if (args.size() > 0) return args[0]; - return string16(); + return base::string16(); } void ChromeUrlLaunchHandler::HandleLaunch( winapp::Activation::ILaunchActivatedEventArgs* args) { mswrw::HString launch_args; args->get_Arguments(launch_args.GetAddressOf()); - string16 actual_launch_args(MakeStdWString(launch_args.Get())); + base::string16 actual_launch_args(MakeStdWString(launch_args.Get())); globals.navigation_url = GetUrlFromLaunchArgs(actual_launch_args); DVLOG(1) << __FUNCTION__ << ", launch_args=" << actual_launch_args << ", url=" << globals.navigation_url diff --git a/win8/metro_driver/chrome_url_launch_handler.h b/win8/metro_driver/chrome_url_launch_handler.h index d8c7ed0..093b57b 100644 --- a/win8/metro_driver/chrome_url_launch_handler.h +++ b/win8/metro_driver/chrome_url_launch_handler.h @@ -37,7 +37,7 @@ class ChromeUrlLaunchHandler { winapp::Search::ISearchPane* search_pane, winapp::Search::ISearchPaneQuerySubmittedEventArgs* args); - string16 GetUrlFromLaunchArgs(const string16& launch_args); + base::string16 GetUrlFromLaunchArgs(const base::string16& launch_args); // Invoked when a url is navigated from a metro app or in the metro // shelf. diff --git a/win8/metro_driver/file_picker.cc b/win8/metro_driver/file_picker.cc index cf1c878..f824869 100644 --- a/win8/metro_driver/file_picker.cc +++ b/win8/metro_driver/file_picker.cc @@ -30,7 +30,7 @@ class StringVectorImpl : public mswr::RuntimeClass<StringVectorItf> { std::for_each(strings_.begin(), strings_.end(), ::WindowsDeleteString); } - HRESULT RuntimeClassInitialize(const std::vector<string16>& list) { + HRESULT RuntimeClassInitialize(const std::vector<base::string16>& list) { for (size_t i = 0; i < list.size(); ++i) strings_.push_back(MakeHString(list[i])); @@ -132,7 +132,7 @@ class OpenFilePickerSession : public FilePickerSessionBase { // Composes a multi-file result string suitable for returning to a // from a storage file collection. static HRESULT ComposeMultiFileResult(StorageFileVectorCollection* files, - string16* result); + base::string16* result); private: DISALLOW_COPY_AND_ASSIGN(OpenFilePickerSession); }; @@ -243,7 +243,7 @@ HRESULT OpenFilePickerSession::MultiPickerDone(MultiFileAsyncOp* async, HRESULT hr = async->GetResults(files.GetAddressOf()); if (files) { - string16 result; + base::string16 result; if (SUCCEEDED(hr)) hr = ComposeMultiFileResult(files.Get(), &result); @@ -305,7 +305,7 @@ HRESULT OpenFilePickerSession::StartFilePicker() { break; // There can be a single extension, or a list of semicolon-separated ones. - std::vector<string16> extensions_win32_style; + std::vector<base::string16> extensions_win32_style; size_t extension_count = Tokenize(walk, L";", &extensions_win32_style); DCHECK_EQ(extension_count, extensions_win32_style.size()); @@ -318,9 +318,10 @@ HRESULT OpenFilePickerSession::StartFilePicker() { hr = extension.Set(L"*"); } else { // Metro wants suffixes only, not patterns. - string16 ext = base::FilePath(extensions_win32_style[i]).Extension(); + base::string16 ext = + base::FilePath(extensions_win32_style[i]).Extension(); if ((ext.size() < 2) || - (ext.find_first_of(L"*?") != string16::npos)) { + (ext.find_first_of(L"*?") != base::string16::npos)) { continue; } hr = extension.Set(ext.c_str()); @@ -371,7 +372,7 @@ HRESULT OpenFilePickerSession::StartFilePicker() { } HRESULT OpenFilePickerSession::ComposeMultiFileResult( - StorageFileVectorCollection* files, string16* result) { + StorageFileVectorCollection* files, base::string16* result) { DCHECK(files != NULL); DCHECK(result != NULL); @@ -475,17 +476,18 @@ HRESULT SaveFilePickerSession::StartFilePicker() { break; // There can be a single extension, or a list of semicolon-separated ones. - std::vector<string16> extensions_win32_style; + std::vector<base::string16> extensions_win32_style; size_t extension_count = Tokenize(walk, L";", &extensions_win32_style); DCHECK_EQ(extension_count, extensions_win32_style.size()); // Metro wants suffixes only, not patterns. Also, metro does not support // the all files ("*") pattern in the save picker. - std::vector<string16> extensions; + std::vector<base::string16> extensions; for (size_t i = 0; i < extensions_win32_style.size(); ++i) { - string16 ext = base::FilePath(extensions_win32_style[i]).Extension(); + base::string16 ext = + base::FilePath(extensions_win32_style[i]).Extension(); if ((ext.size() < 2) || - (ext.find_first_of(L"*?") != string16::npos)) + (ext.find_first_of(L"*?") != base::string16::npos)) continue; extensions.push_back(ext); } @@ -530,7 +532,7 @@ HRESULT SaveFilePickerSession::StartFilePicker() { mswr::ComPtr<StringVectorItf> list; hr = mswr::MakeAndInitialize<StringVectorImpl>( - list.GetAddressOf(), std::vector<string16>(1, L".dat")); + list.GetAddressOf(), std::vector<base::string16>(1, L".dat")); if (FAILED(hr)) return hr; @@ -581,7 +583,7 @@ HRESULT SaveFilePickerSession::FilePickerDone(SaveFileAsyncOp* async, hr = storage_item->get_Path(file_path.GetAddressOf()); if (SUCCEEDED(hr)) { - string16 path_str = MakeStdWString(file_path.Get()); + base::string16 path_str = MakeStdWString(file_path.Get()); // If the selected file name is longer than the supplied buffer, // we return false as per GetOpenFileName documentation. diff --git a/win8/metro_driver/file_picker_ash.cc b/win8/metro_driver/file_picker_ash.cc index 343d7b4..902ee78 100644 --- a/win8/metro_driver/file_picker_ash.cc +++ b/win8/metro_driver/file_picker_ash.cc @@ -28,7 +28,7 @@ class StringVectorImpl : public mswr::RuntimeClass<StringVectorItf> { std::for_each(strings_.begin(), strings_.end(), ::WindowsDeleteString); } - HRESULT RuntimeClassInitialize(const std::vector<string16>& list) { + HRESULT RuntimeClassInitialize(const std::vector<base::string16>& list) { for (size_t i = 0; i < list.size(); ++i) strings_.push_back(MakeHString(list[i])); @@ -82,8 +82,8 @@ class StringVectorImpl : public mswr::RuntimeClass<StringVectorItf> { } // namespace FilePickerSessionBase::FilePickerSessionBase(ChromeAppViewAsh* app_view, - const string16& title, - const string16& filter, + const base::string16& title, + const base::string16& filter, const base::FilePath& default_path) : app_view_(app_view), title_(title), @@ -117,8 +117,8 @@ bool FilePickerSessionBase::DoFilePicker() { OpenFilePickerSession::OpenFilePickerSession( ChromeAppViewAsh* app_view, - const string16& title, - const string16& filter, + const base::string16& title, + const base::string16& filter, const base::FilePath& default_path, bool allow_multi_select) : FilePickerSessionBase(app_view, title, filter, default_path), @@ -165,7 +165,7 @@ HRESULT OpenFilePickerSession::MultiPickerDone(MultiFileAsyncOp* async, HRESULT hr = async->GetResults(files.GetAddressOf()); if (files) { - string16 result; + base::string16 result; if (SUCCEEDED(hr)) hr = ComposeMultiFileResult(files.Get(), &result); @@ -243,7 +243,7 @@ HRESULT OpenFilePickerSession::StartFilePicker() { break; // There can be a single extension, or a list of semicolon-separated ones. - std::vector<string16> extensions_win32_style; + std::vector<base::string16> extensions_win32_style; size_t extension_count = Tokenize(walk, L";", &extensions_win32_style); DCHECK_EQ(extension_count, extensions_win32_style.size()); @@ -256,9 +256,10 @@ HRESULT OpenFilePickerSession::StartFilePicker() { hr = extension.Set(L"*"); } else { // Metro wants suffixes only, not patterns. - string16 ext = base::FilePath(extensions_win32_style[i]).Extension(); + base::string16 ext = + base::FilePath(extensions_win32_style[i]).Extension(); if ((ext.size() < 2) || - (ext.find_first_of(L"*?") != string16::npos)) { + (ext.find_first_of(L"*?") != base::string16::npos)) { continue; } hr = extension.Set(ext.c_str()); @@ -309,7 +310,7 @@ HRESULT OpenFilePickerSession::StartFilePicker() { } HRESULT OpenFilePickerSession::ComposeMultiFileResult( - StorageFileVectorCollection* files, string16* result) { + StorageFileVectorCollection* files, base::string16* result) { DCHECK(files != NULL); DCHECK(result != NULL); @@ -424,17 +425,18 @@ HRESULT SaveFilePickerSession::StartFilePicker() { break; // There can be a single extension, or a list of semicolon-separated ones. - std::vector<string16> extensions_win32_style; + std::vector<base::string16> extensions_win32_style; size_t extension_count = Tokenize(walk, L";", &extensions_win32_style); DCHECK_EQ(extension_count, extensions_win32_style.size()); // Metro wants suffixes only, not patterns. Also, metro does not support // the all files ("*") pattern in the save picker. - std::vector<string16> extensions; + std::vector<base::string16> extensions; for (size_t i = 0; i < extensions_win32_style.size(); ++i) { - string16 ext = base::FilePath(extensions_win32_style[i]).Extension(); + base::string16 ext = + base::FilePath(extensions_win32_style[i]).Extension(); if ((ext.size() < 2) || - (ext.find_first_of(L"*?") != string16::npos)) + (ext.find_first_of(L"*?") != base::string16::npos)) continue; extensions.push_back(ext); } @@ -479,7 +481,7 @@ HRESULT SaveFilePickerSession::StartFilePicker() { mswr::ComPtr<StringVectorItf> list; hr = mswr::MakeAndInitialize<StringVectorImpl>( - list.GetAddressOf(), std::vector<string16>(1, L".dat")); + list.GetAddressOf(), std::vector<base::string16>(1, L".dat")); if (FAILED(hr)) return hr; @@ -491,7 +493,7 @@ HRESULT SaveFilePickerSession::StartFilePicker() { } if (!default_path_.empty()) { - string16 file_part = default_path_.BaseName().value(); + base::string16 file_part = default_path_.BaseName().value(); // If the suggested_name is a root directory, then don't set it as the // suggested name. if (file_part.size() == 1 && file_part[0] == L'\\') @@ -534,7 +536,7 @@ HRESULT SaveFilePickerSession::FilePickerDone(SaveFileAsyncOp* async, hr = storage_item->get_Path(file_path.GetAddressOf()); if (SUCCEEDED(hr)) { - string16 path_str = MakeStdWString(file_path.Get()); + base::string16 path_str = MakeStdWString(file_path.Get()); result_ = path_str; success_ = true; } @@ -549,7 +551,7 @@ HRESULT SaveFilePickerSession::FilePickerDone(SaveFileAsyncOp* async, } FolderPickerSession::FolderPickerSession(ChromeAppViewAsh* app_view, - const string16& title) + const base::string16& title) : FilePickerSessionBase(app_view, title, L"", base::FilePath()) {} HRESULT FolderPickerSession::StartFilePicker() { @@ -603,7 +605,7 @@ HRESULT FolderPickerSession::FolderPickerDone(FolderPickerAsyncOp* async, hr = storage_item->get_Path(file_path.GetAddressOf()); if (SUCCEEDED(hr)) { - string16 path_str = MakeStdWString(file_path.Get()); + base::string16 path_str = MakeStdWString(file_path.Get()); result_ = path_str; success_ = true; } diff --git a/win8/metro_driver/file_picker_ash.h b/win8/metro_driver/file_picker_ash.h index b081156..d3de43c 100644 --- a/win8/metro_driver/file_picker_ash.h +++ b/win8/metro_driver/file_picker_ash.h @@ -23,8 +23,8 @@ class FilePickerSessionBase { public: // Creates a file picker for open_file_name. explicit FilePickerSessionBase(ChromeAppViewAsh* app_view, - const string16& title, - const string16& filter, + const base::string16& title, + const base::string16& filter, const base::FilePath& default_path); virtual ~FilePickerSessionBase() { @@ -33,7 +33,7 @@ class FilePickerSessionBase { // Runs the picker, returns true on success. bool Run(); - const string16& result() const { + const base::string16& result() const { return result_; } @@ -51,10 +51,10 @@ class FilePickerSessionBase { bool success_; // The title of the file picker. - string16 title_; + base::string16 title_; // The file type filter. - string16 filter_; + base::string16 filter_; // The starting directory/file name. base::FilePath default_path_; @@ -63,7 +63,7 @@ class FilePickerSessionBase { // instance when the file open/save operations complete. ChromeAppViewAsh* app_view_; - string16 result_; + base::string16 result_; private: // Initiate a file picker, must be called on the main metro thread. @@ -78,8 +78,8 @@ class FilePickerSessionBase { class OpenFilePickerSession : public FilePickerSessionBase { public: explicit OpenFilePickerSession(ChromeAppViewAsh* app_view, - const string16& title, - const string16& filter, + const base::string16& title, + const base::string16& filter, const base::FilePath& default_path, bool allow_multi_select); @@ -110,7 +110,7 @@ class OpenFilePickerSession : public FilePickerSessionBase { // Composes a multi-file result string suitable for returning to a // from a storage file collection. static HRESULT ComposeMultiFileResult(StorageFileVectorCollection* files, - string16* result); + base::string16* result); private: // True if the multi file picker is to be displayed. @@ -149,7 +149,7 @@ class SaveFilePickerSession : public FilePickerSessionBase { class FolderPickerSession : public FilePickerSessionBase { public: explicit FolderPickerSession(ChromeAppViewAsh* app_view, - const string16& title); + const base::string16& title); private: virtual HRESULT StartFilePicker() OVERRIDE; diff --git a/win8/metro_driver/ime/text_service.cc b/win8/metro_driver/ime/text_service.cc index 7147d20..d9015ca 100644 --- a/win8/metro_driver/ime/text_service.cc +++ b/win8/metro_driver/ime/text_service.cc @@ -374,7 +374,7 @@ class TextServiceImpl : public TextService, } virtual void OnCompositionChanged( - const string16& text, + const base::string16& text, int32 selection_start, int32 selection_end, const std::vector<metro_viewer::UnderlineInfo>& underlines) OVERRIDE { @@ -386,7 +386,7 @@ class TextServiceImpl : public TextService, underlines); } - virtual void OnTextCommitted(const string16& text) OVERRIDE { + virtual void OnTextCommitted(const base::string16& text) OVERRIDE { if (!delegate_) return; delegate_->OnTextCommitted(text); diff --git a/win8/metro_driver/ime/text_service_delegate.h b/win8/metro_driver/ime/text_service_delegate.h index ea9cde7..9b22a82 100644 --- a/win8/metro_driver/ime/text_service_delegate.h +++ b/win8/metro_driver/ime/text_service_delegate.h @@ -26,13 +26,13 @@ class TextServiceDelegate { // Called when on-going composition is updated. An empty |text| represents // that the composition is canceled. virtual void OnCompositionChanged( - const string16& text, + const base::string16& text, int32 selection_start, int32 selection_end, const std::vector<metro_viewer::UnderlineInfo>& underlines) = 0; // Called when |text| is committed. - virtual void OnTextCommitted(const string16& text) = 0; + virtual void OnTextCommitted(const base::string16& text) = 0; }; } // namespace metro_driver diff --git a/win8/metro_driver/ime/text_store.cc b/win8/metro_driver/ime/text_store.cc index a8f0d95..e406e1b 100644 --- a/win8/metro_driver/ime/text_store.cc +++ b/win8/metro_driver/ime/text_store.cc @@ -267,7 +267,7 @@ STDMETHODIMP TextStore::GetText(LONG acp_start, acp_end = std::min(acp_end, acp_start + static_cast<LONG>(text_buffer_size)); *text_buffer_copied = acp_end - acp_start; - const string16& result = + const base::string16& result = string_buffer_.substr(acp_start, *text_buffer_copied); for (size_t i = 0; i < result.size(); ++i) text_buffer[i] = result[i]; @@ -414,7 +414,7 @@ STDMETHODIMP TextStore::InsertTextAtSelection(DWORD flags, DCHECK_LE(start_pos, end_pos); string_buffer_ = string_buffer_.substr(0, start_pos) + - string16(text_buffer, text_buffer + text_buffer_size) + + base::string16(text_buffer, text_buffer + text_buffer_size) + string_buffer_.substr(end_pos); if (acp_start) *acp_start = start_pos; @@ -525,10 +525,10 @@ STDMETHODIMP TextStore::RequestLock(DWORD lock_flags, HRESULT* result) { // TextStoreDelegate::ConfirmComposition() or // TextStoreDelegate::SetComposition(). const uint32 new_committed_size = committed_size_; - const string16& new_committed_string = + const base::string16& new_committed_string = string_buffer_.substr(last_committed_size, new_committed_size - last_committed_size); - const string16& composition_string = + const base::string16& composition_string = string_buffer_.substr(new_committed_size); // If there is new committed string, calls @@ -857,7 +857,8 @@ bool TextStore::ConfirmComposition() { // This logic is based on the observation about how to emulate // ImmNotifyIME(NI_COMPOSITIONSTR, CPS_COMPLETE, 0) by CUAS. - const string16& composition_text = string_buffer_.substr(committed_size_); + const base::string16& composition_text = + string_buffer_.substr(committed_size_); if (!composition_text.empty()) delegate_->OnTextCommitted(composition_text); diff --git a/win8/metro_driver/ime/text_store.h b/win8/metro_driver/ime/text_store.h index 8ed4d61..975592c 100644 --- a/win8/metro_driver/ime/text_store.h +++ b/win8/metro_driver/ime/text_store.h @@ -261,7 +261,7 @@ class ATL_NO_VTABLE TextStore // Example: "aoi" is committed, and "umi" is under composition. // |string_buffer_|: "aoiumi" // |committed_size_|: 3 - string16 string_buffer_; + base::string16 string_buffer_; uint32 committed_size_; // |selection_start_| and |selection_end_| indicates the selection range. diff --git a/win8/metro_driver/ime/text_store_delegate.h b/win8/metro_driver/ime/text_store_delegate.h index af06516..153d664 100644 --- a/win8/metro_driver/ime/text_store_delegate.h +++ b/win8/metro_driver/ime/text_store_delegate.h @@ -30,13 +30,13 @@ class TextStoreDelegate { // Called when on-going composition is updated. An empty |text| represents // that the composition is canceled. virtual void OnCompositionChanged( - const string16& text, + const base::string16& text, int32 selection_start, int32 selection_end, const std::vector<metro_viewer::UnderlineInfo>& underlines) = 0; // Called when |text| is committed. - virtual void OnTextCommitted(const string16& text) = 0; + virtual void OnTextCommitted(const base::string16& text) = 0; // Called when an IME requests the caret position. Objects that implement // this method must return the caret position in screen coordinates. diff --git a/win8/metro_driver/metro_dialog_box.cc b/win8/metro_driver/metro_dialog_box.cc index 25e7082..1217fed 100644 --- a/win8/metro_driver/metro_dialog_box.cc +++ b/win8/metro_driver/metro_dialog_box.cc @@ -141,7 +141,7 @@ HRESULT STDMETHODCALLTYPE MetroDialogBox::Invoke( mswrw::HString label; command->get_Label(label.GetAddressOf()); - string16 button_label = MakeStdWString(label.Get()); + base::string16 button_label = MakeStdWString(label.Get()); DVLOG(1) << "Clicked button label is : " << button_label; if (button_label == dialog_box_info_.button1_label) { DVLOG(1) << "Button1 clicked"; diff --git a/win8/metro_driver/metro_dialog_box.h b/win8/metro_driver/metro_dialog_box.h index 5a6a94d..a8ee5b6 100644 --- a/win8/metro_driver/metro_dialog_box.h +++ b/win8/metro_driver/metro_dialog_box.h @@ -16,10 +16,10 @@ class MetroDialogBox : public winui::Popups::IUICommandInvokedHandler { public: struct DialogBoxInfo { - string16 title; - string16 content; - string16 button1_label; - string16 button2_label; + base::string16 title; + base::string16 content; + base::string16 button1_label; + base::string16 button2_label; base::win::MetroDialogButtonPressedHandler button1_handler; base::win::MetroDialogButtonPressedHandler button2_handler; }; diff --git a/win8/metro_driver/metro_driver.cc b/win8/metro_driver/metro_driver.cc index 940b5b1..846a71f 100644 --- a/win8/metro_driver/metro_driver.cc +++ b/win8/metro_driver/metro_driver.cc @@ -30,10 +30,10 @@ LONG WINAPI ErrorReportingHandler(EXCEPTION_POINTERS* ex_info) { DWORD code = ex_info->ExceptionRecord->ExceptionCode; ULONG_PTR* info = ex_info->ExceptionRecord->ExceptionInformation; if (code == EXCEPTION_RO_ORIGINATEERROR) { - string16 msg(reinterpret_cast<wchar_t*>(info[2]), info[1]); + base::string16 msg(reinterpret_cast<wchar_t*>(info[2]), info[1]); LOG(ERROR) << "VEH: Metro error 0x" << std::hex << info[0] << ": " << msg; } else if (code == EXCEPTION_RO_TRANSFORMERROR) { - string16 msg(reinterpret_cast<wchar_t*>(info[3]), info[2]); + base::string16 msg(reinterpret_cast<wchar_t*>(info[3]), info[2]); LOG(ERROR) << "VEH: Metro old error 0x" << std::hex << info[0] << " new error 0x" << info[1] << ": " << msg; } diff --git a/win8/metro_driver/secondary_tile.cc b/win8/metro_driver/secondary_tile.cc index 97ff63d1..d892199 100644 --- a/win8/metro_driver/secondary_tile.cc +++ b/win8/metro_driver/secondary_tile.cc @@ -89,7 +89,7 @@ HRESULT TileRequestCompleter::Respond(winfoundtn::IAsyncOperation<bool>* async, return S_OK; } -void DeleteTileFromStartScreen(const string16& tile_id, +void DeleteTileFromStartScreen(const base::string16& tile_id, const MetroPinUmaResultCallback& callback) { DVLOG(1) << __FUNCTION__; mswr::ComPtr<winui::StartScreen::ISecondaryTileFactory> tile_factory; @@ -121,9 +121,9 @@ void DeleteTileFromStartScreen(const string16& tile_id, completer->Complete(completion); } -void CreateTileOnStartScreen(const string16& tile_id, - const string16& title_str, - const string16& url_str, +void CreateTileOnStartScreen(const base::string16& tile_id, + const base::string16& title_str, + const base::string16& url_str, const base::FilePath& logo_path, const MetroPinUmaResultCallback& callback) { VLOG(1) << __FUNCTION__; @@ -156,7 +156,8 @@ void CreateTileOnStartScreen(const string16& tile_id, CheckHR(hr, "Failed to create URIFactory"); mswrw::HString logo_url; - logo_url.Attach(MakeHString(string16(L"file:///").append(logo_path.value()))); + logo_url.Attach( + MakeHString(base::string16(L"file:///").append(logo_path.value()))); mswr::ComPtr<winfoundtn::IUriRuntimeClass> uri; hr = uri_factory->CreateUri(logo_url.Get(), &uri); CheckHR(hr, "Failed to create URI"); @@ -192,7 +193,7 @@ void CreateTileOnStartScreen(const string16& tile_id, } // namespace -BOOL MetroIsPinnedToStartScreen(const string16& tile_id) { +BOOL MetroIsPinnedToStartScreen(const base::string16& tile_id) { mswr::ComPtr<winui::StartScreen::ISecondaryTileStatics> tile_statics; HRESULT hr = winrt_utils::CreateActivationFactory( RuntimeClass_Windows_UI_StartScreen_SecondaryTile, @@ -205,7 +206,7 @@ BOOL MetroIsPinnedToStartScreen(const string16& tile_id) { return exists; } -void MetroUnPinFromStartScreen(const string16& tile_id, +void MetroUnPinFromStartScreen(const base::string16& tile_id, const MetroPinUmaResultCallback& callback) { globals.appview_msg_loop->PostTask( FROM_HERE, base::Bind(&DeleteTileFromStartScreen, @@ -213,9 +214,9 @@ void MetroUnPinFromStartScreen(const string16& tile_id, callback)); } -void MetroPinToStartScreen(const string16& tile_id, - const string16& title, - const string16& url, +void MetroPinToStartScreen(const base::string16& tile_id, + const base::string16& title, + const base::string16& url, const base::FilePath& logo_path, const MetroPinUmaResultCallback& callback) { globals.appview_msg_loop->PostTask( diff --git a/win8/metro_driver/secondary_tile.h b/win8/metro_driver/secondary_tile.h index 9740864..1166e13 100644 --- a/win8/metro_driver/secondary_tile.h +++ b/win8/metro_driver/secondary_tile.h @@ -9,18 +9,18 @@ #include "base/win/metro.h" extern "C" __declspec(dllexport) -BOOL MetroIsPinnedToStartScreen(const string16& tile_id); +BOOL MetroIsPinnedToStartScreen(const base::string16& tile_id); extern "C" __declspec(dllexport) void MetroUnPinFromStartScreen( - const string16& tile_id, + const base::string16& tile_id, const base::win::MetroPinUmaResultCallback& callback); extern "C" __declspec(dllexport) void MetroPinToStartScreen( - const string16& tile_id, - const string16& title, - const string16& url, + const base::string16& tile_id, + const base::string16& title, + const base::string16& url, const base::FilePath& logo_path, const base::win::MetroPinUmaResultCallback& callback); diff --git a/win8/metro_driver/toast_notification_handler.cc b/win8/metro_driver/toast_notification_handler.cc index ab014d4..fb44b11 100644 --- a/win8/metro_driver/toast_notification_handler.cc +++ b/win8/metro_driver/toast_notification_handler.cc @@ -64,7 +64,7 @@ HRESULT GetTextNodeRoot( // The index parameter identifies which text node we append to. HRESULT CreateTextNode(winxml::Dom::IXmlDocument* xml_doc, int index, - const string16& text_string) { + const base::string16& text_string) { DCHECK(xml_doc); mswr::ComPtr<winxml::Dom::IXmlElement> document_element; @@ -206,7 +206,8 @@ void ToastNotificationHandler::DisplayNotification( BrowserDistribution* dist = BrowserDistribution::GetDistribution(); bool is_per_user_install = InstallUtil::IsPerUserInstall( chrome_path.value().c_str()); - string16 appid = ShellUtil::GetBrowserModelId(dist, is_per_user_install); + base::string16 appid = + ShellUtil::GetBrowserModelId(dist, is_per_user_install); DVLOG(1) << "Chrome Appid is " << appid.c_str(); mswrw::HString app_user_model_id; diff --git a/win8/metro_driver/toast_notification_handler.h b/win8/metro_driver/toast_notification_handler.h index 8f3587d..f30aee8 100644 --- a/win8/metro_driver/toast_notification_handler.h +++ b/win8/metro_driver/toast_notification_handler.h @@ -17,12 +17,12 @@ class ToastNotificationHandler { struct DesktopNotification { std::string origin_url; std::string icon_url; - string16 title; - string16 body; - string16 display_source; + base::string16 title; + base::string16 body; + base::string16 display_source; std::string id; base::win::MetroNotificationClickedHandler notification_handler; - string16 notification_context; + base::string16 notification_context; DesktopNotification(const char* notification_origin, const char* notification_icon, diff --git a/win8/metro_driver/winrt_utils.cc b/win8/metro_driver/winrt_utils.cc index 6d66cec..26da18a 100644 --- a/win8/metro_driver/winrt_utils.cc +++ b/win8/metro_driver/winrt_utils.cc @@ -23,7 +23,7 @@ void CheckHR(HRESULT hr, const char* message) { } } -HSTRING MakeHString(const string16& str) { +HSTRING MakeHString(const base::string16& str) { HSTRING hstr; if (FAILED(::WindowsCreateString(str.c_str(), static_cast<UINT32>(str.size()), &hstr))) { @@ -32,13 +32,13 @@ HSTRING MakeHString(const string16& str) { return hstr; } -string16 MakeStdWString(HSTRING hstring) { +base::string16 MakeStdWString(HSTRING hstring) { const wchar_t* str; UINT32 size = 0; str = ::WindowsGetStringRawBuffer(hstring, &size); if (!size) - return string16(); - return string16(str, size); + return base::string16(); + return base::string16(str, size); } namespace { @@ -170,7 +170,7 @@ HRESULT CompareProperties(winfoundtn::IPropertyValue* lhs, } bool GetArgumentsFromShortcut(const base::FilePath& shortcut, - string16* arguments) { + base::string16* arguments) { HRESULT result; base::win::ScopedComPtr<IShellLink> i_shell_link; bool is_resolved = false; @@ -200,7 +200,7 @@ bool GetArgumentsFromShortcut(const base::FilePath& shortcut, return is_resolved; } -string16 ReadArgumentsFromPinnedTaskbarShortcut() { +base::string16 ReadArgumentsFromPinnedTaskbarShortcut() { wchar_t path_buffer[MAX_PATH] = {}; if (SUCCEEDED(SHGetFolderPath(NULL, CSIDL_APPDATA, NULL, @@ -214,7 +214,7 @@ string16 ReadArgumentsFromPinnedTaskbarShortcut() { BrowserDistribution::SHORTCUT_CHROME) + installer::kLnkExt; shortcut = shortcut.Append(link_name); - string16 arguments; + base::string16 arguments; if (GetArgumentsFromShortcut(shortcut, &arguments)) { return arguments; } diff --git a/win8/metro_driver/winrt_utils.h b/win8/metro_driver/winrt_utils.h index 3016c85..e3a777f 100644 --- a/win8/metro_driver/winrt_utils.h +++ b/win8/metro_driver/winrt_utils.h @@ -14,9 +14,9 @@ void CheckHR(HRESULT hr, const char* str = nullptr); -HSTRING MakeHString(const string16& str); +HSTRING MakeHString(const base::string16& str); -string16 MakeStdWString(HSTRING hstring); +base::string16 MakeStdWString(HSTRING hstring); namespace winrt_utils { @@ -53,7 +53,7 @@ HRESULT CompareProperties( // shortcut's command line. This is intended for scenarios where those shortcut // parameters are ordinarily ignored (i.e. metro apps on win8). Returns an // empty string on failure. -string16 ReadArgumentsFromPinnedTaskbarShortcut(); +base::string16 ReadArgumentsFromPinnedTaskbarShortcut(); } // namespace winrt_utils diff --git a/win8/test/metro_registration_helper.cc b/win8/test/metro_registration_helper.cc index 75319a9..cd4a772 100644 --- a/win8/test/metro_registration_helper.cc +++ b/win8/test/metro_registration_helper.cc @@ -98,7 +98,7 @@ bool IsTestDefaultForProtocol(const wchar_t* protocol) { return false; } - return string16(win8::test::kDefaultTestProgId).compare(current_app) == 0; + return !base::string16(win8::test::kDefaultTestProgId).compare(current_app); } } // namespace diff --git a/win8/test/open_with_dialog_async.cc b/win8/test/open_with_dialog_async.cc index f491149..2308b55 100644 --- a/win8/test/open_with_dialog_async.cc +++ b/win8/test/open_with_dialog_async.cc @@ -27,8 +27,8 @@ namespace { struct OpenWithContext { OpenWithContext( HWND parent_window_in, - const string16& file_name_in, - const string16& file_type_class_in, + const base::string16& file_name_in, + const base::string16& file_type_class_in, int open_as_info_flags_in, const scoped_refptr<base::SingleThreadTaskRunner>& client_runner_in, const OpenWithDialogCallback& callback_in); @@ -36,8 +36,8 @@ struct OpenWithContext { base::Thread thread; HWND parent_window; - string16 file_name; - string16 file_type_class; + base::string16 file_name; + base::string16 file_type_class; int open_as_info_flags; scoped_refptr<base::SingleThreadTaskRunner> client_runner; OpenWithDialogCallback callback; @@ -45,8 +45,8 @@ struct OpenWithContext { OpenWithContext::OpenWithContext( HWND parent_window_in, - const string16& file_name_in, - const string16& file_type_class_in, + const base::string16& file_name_in, + const base::string16& file_type_class_in, int open_as_info_flags_in, const scoped_refptr<base::SingleThreadTaskRunner>& client_runner_in, const OpenWithDialogCallback& callback_in) @@ -104,8 +104,8 @@ void OpenWithDialogTask(OpenWithContext* context) { void OpenWithDialogAsync( HWND parent_window, - const string16& file_name, - const string16& file_type_class, + const base::string16& file_name, + const base::string16& file_type_class, int open_as_info_flags, const OpenWithDialogCallback& callback) { DCHECK_GE(base::win::GetVersion(), base::win::VERSION_VISTA); diff --git a/win8/test/open_with_dialog_async.h b/win8/test/open_with_dialog_async.h index 9f92645..62ddbed0 100644 --- a/win8/test/open_with_dialog_async.h +++ b/win8/test/open_with_dialog_async.h @@ -25,8 +25,8 @@ typedef base::Callback<void(HRESULT)> OpenWithDialogCallback; // the dedicated thread will be leaked if the calling thread's message loop goes // away before the interaction completes. void OpenWithDialogAsync(HWND parent_window, - const string16& file_name, - const string16& file_type_class, + const base::string16& file_name, + const base::string16& file_type_class, int open_as_info_flags, const OpenWithDialogCallback& callback); diff --git a/win8/test/open_with_dialog_controller.cc b/win8/test/open_with_dialog_controller.cc index 86b8161..5a454ef 100644 --- a/win8/test/open_with_dialog_controller.cc +++ b/win8/test/open_with_dialog_controller.cc @@ -31,9 +31,9 @@ const wchar_t kShellFlyoutClassName[] = L"Shell_Flyout"; void OnMakeDefaultComplete( const base::Closure& closure, HRESULT* result_out, - std::vector<string16>* choices_out, + std::vector<base::string16>* choices_out, HRESULT hr, - std::vector<string16> choices) { + std::vector<base::string16> choices) { *result_out = hr; *choices_out = choices; closure.Run(); @@ -53,8 +53,8 @@ class OpenWithDialogController::Context { void Orphan(); void Begin(HWND parent_window, - const string16& url_protocol, - const string16& program_name, + const base::string16& url_protocol, + const base::string16& program_name, const OpenWithDialogController::SetDefaultCallback& callback); private: @@ -75,20 +75,20 @@ class OpenWithDialogController::Context { void OnTimeout(); void OnInitialized(HRESULT result); - void OnAutomationResult(HRESULT result, std::vector<string16> choices); + void OnAutomationResult(HRESULT result, std::vector<base::string16> choices); void OnOpenWithComplete(HRESULT result); base::ThreadChecker thread_checker_; State state_; internal::UIAutomationClient automation_client_; HWND parent_window_; - string16 file_name_; - string16 file_type_class_; + base::string16 file_name_; + base::string16 file_type_class_; int open_as_info_flags_; OpenWithDialogController::SetDefaultCallback callback_; HRESULT open_with_result_; HRESULT automation_result_; - std::vector<string16> automation_choices_; + std::vector<base::string16> automation_choices_; base::WeakPtrFactory<Context> weak_ptr_factory_; DISALLOW_COPY_AND_ASSIGN(OpenWithDialogController::Context); }; @@ -124,8 +124,8 @@ void OpenWithDialogController::Context::Orphan() { void OpenWithDialogController::Context::Begin( HWND parent_window, - const string16& url_protocol, - const string16& program_name, + const base::string16& url_protocol, + const base::string16& program_name, const OpenWithDialogController::SetDefaultCallback& callback) { DCHECK(thread_checker_.CalledOnValidThread()); @@ -191,7 +191,7 @@ void OpenWithDialogController::Context::OnInitialized(HRESULT result) { void OpenWithDialogController::Context::OnAutomationResult( HRESULT result, - std::vector<string16> choices) { + std::vector<base::string16> choices) { DCHECK(thread_checker_.CalledOnValidThread()); DCHECK_EQ(automation_result_, E_FAIL); @@ -244,8 +244,8 @@ OpenWithDialogController::~OpenWithDialogController() { void OpenWithDialogController::Begin( HWND parent_window, - const string16& url_protocol, - const string16& program, + const base::string16& url_protocol, + const base::string16& program, const SetDefaultCallback& callback) { DCHECK_EQ(context_.get(), static_cast<Context*>(NULL)); if (base::win::GetVersion() < base::win::VERSION_WIN8) { @@ -254,7 +254,7 @@ void OpenWithDialogController::Begin( // to this thread's task runner to call it. base::ThreadTaskRunnerHandle::Get()->PostTask( FROM_HERE, - base::Bind(callback, E_FAIL, std::vector<string16>())); + base::Bind(callback, E_FAIL, std::vector<base::string16>())); return; } @@ -264,9 +264,9 @@ void OpenWithDialogController::Begin( HRESULT OpenWithDialogController::RunSynchronously( HWND parent_window, - const string16& protocol, - const string16& program, - std::vector<string16>* choices) { + const base::string16& protocol, + const base::string16& program, + std::vector<base::string16>* choices) { DCHECK_EQ(base::MessageLoop::current(), static_cast<base::MessageLoop*>(NULL)); if (base::win::GetVersion() < base::win::VERSION_WIN8) { diff --git a/win8/test/open_with_dialog_controller.h b/win8/test/open_with_dialog_controller.h index 4354a56..18ac9e9 100644 --- a/win8/test/open_with_dialog_controller.h +++ b/win8/test/open_with_dialog_controller.h @@ -24,8 +24,8 @@ class OpenWithDialogController { // interaction. If the HRESULT indicates success, the interaction completed // successfully. Otherwise, the vector of strings may contain the list of // possible choices if the desired program could not be selected. - typedef base::Callback<void(HRESULT, - std::vector<string16>)> SetDefaultCallback; + typedef base::Callback<void(HRESULT, std::vector<base::string16>)> + SetDefaultCallback; OpenWithDialogController(); ~OpenWithDialogController(); @@ -38,8 +38,8 @@ class OpenWithDialogController { // since |program| will not show up verbatim in the dialog (e.g., in EN-US, it // will be prefixed by "Keep using "). void Begin(HWND parent_window, - const string16& url_protocol, - const string16& program, + const base::string16& url_protocol, + const base::string16& program, const SetDefaultCallback& callback); // Sychronously drives the dialog by running a message loop. Do not by any @@ -47,9 +47,9 @@ class OpenWithDialogController { // on success. Otherwise, |choices| may contain the list of possible choices // if the desired program could not be selected. HRESULT RunSynchronously(HWND parent_window, - const string16& url_protocol, - const string16& program, - std::vector<string16>* choices); + const base::string16& url_protocol, + const base::string16& program, + std::vector<base::string16>* choices); private: class Context; diff --git a/win8/test/test_registrar.cc b/win8/test/test_registrar.cc index 25445c9..b5cec10 100644 --- a/win8/test/test_registrar.cc +++ b/win8/test/test_registrar.cc @@ -92,18 +92,18 @@ class TestDelegateExecuteModule command_line.GetSwitchValueNative( win8::test::kTestProgId).c_str()); - string16 exe_path( + base::string16 exe_path( command_line.GetSwitchValueNative(win8::test::kTestExePath)); - string16 exe_open_command(base::StringPrintf(L"\"%ls\" -- %%*", - exe_path.c_str())); + base::string16 exe_open_command( + base::StringPrintf(L"\"%ls\" -- %%*", exe_path.c_str())); registrar->AddReplacement(L"EXE_OPEN_COMMAND", exe_open_command.c_str()); - string16 exe_icon(base::StringPrintf(L"%ls,0", exe_path.c_str())); + base::string16 exe_icon(base::StringPrintf(L"%ls,0", exe_path.c_str())); registrar->AddReplacement(L"EXE_ICON", exe_icon.c_str()); - string16 prog_id_open_command(base::StringPrintf(L"\"%ls\" -- \"%%1\"", - exe_path.c_str())); + base::string16 prog_id_open_command( + base::StringPrintf(L"\"%ls\" -- \"%%1\"", exe_path.c_str())); registrar->AddReplacement(L"PROG_ID_OPEN_COMMAND", prog_id_open_command.c_str()); diff --git a/win8/test/ui_automation_client.cc b/win8/test/ui_automation_client.cc index ef2d9ba..6af9bc4 100644 --- a/win8/test/ui_automation_client.cc +++ b/win8/test/ui_automation_client.cc @@ -40,8 +40,8 @@ class UIAutomationClient::Context { // posting |init_callback|. void Initialize( scoped_refptr<base::SingleThreadTaskRunner> client_runner, - string16 class_name, - string16 item_name, + base::string16 class_name, + base::string16 item_name, UIAutomationClient::InitializedCallback init_callback, UIAutomationClient::ResultCallback result_callback); @@ -69,7 +69,7 @@ class UIAutomationClient::Context { const base::win::ScopedComPtr<IUIAutomationElement>& element); HRESULT GetInvokableItems( const base::win::ScopedComPtr<IUIAutomationElement>& element, - std::vector<string16>* choices); + std::vector<base::string16>* choices); void CloseWindow(const base::win::ScopedComPtr<IUIAutomationElement>& window); base::ThreadChecker thread_checker_; @@ -78,10 +78,10 @@ class UIAutomationClient::Context { scoped_refptr<base::SingleThreadTaskRunner> client_runner_; // The class name of the window for which the client waits. - string16 class_name_; + base::string16 class_name_; // The name of the item to invoke. - string16 item_name_; + base::string16 item_name_; // The consumer's result callback. ResultCallback result_callback_; @@ -180,8 +180,8 @@ UIAutomationClient::Context::~Context() { void UIAutomationClient::Context::Initialize( scoped_refptr<base::SingleThreadTaskRunner> client_runner, - string16 class_name, - string16 item_name, + base::string16 class_name, + base::string16 item_name, UIAutomationClient::InitializedCallback init_callback, UIAutomationClient::ResultCallback result_callback) { // This and all other methods must be called on the automation thread. @@ -325,7 +325,7 @@ void UIAutomationClient::Context::HandleWindowOpen( return; } - string16 class_name(V_BSTR(&var)); + base::string16 class_name(V_BSTR(&var)); // Window class names are atoms, which are case-insensitive. if (class_name.size() == class_name_.size() && @@ -345,7 +345,7 @@ void UIAutomationClient::Context::ProcessWindow( DCHECK(thread_checker_.CalledOnValidThread()); HRESULT result = S_OK; - std::vector<string16> choices; + std::vector<base::string16> choices; result = InvokeDesiredItem(window); if (FAILED(result)) { GetInvokableItems(window, &choices); @@ -457,7 +457,7 @@ HRESULT UIAutomationClient::Context::InvokeDesiredItem( // Populates |choices| with the names of all invokable children of |element|. HRESULT UIAutomationClient::Context::GetInvokableItems( const base::win::ScopedComPtr<IUIAutomationElement>& element, - std::vector<string16>* choices) { + std::vector<base::string16>* choices) { DCHECK(choices); DCHECK(thread_checker_.CalledOnValidThread()); @@ -545,7 +545,7 @@ HRESULT UIAutomationClient::Context::GetInvokableItems( LOG(ERROR) << __FUNCTION__ " name is not a BSTR: " << V_VT(&var); continue; } - choices->push_back(string16(V_BSTR(&var))); + choices->push_back(base::string16(V_BSTR(&var))); var.Reset(); } @@ -602,7 +602,7 @@ UIAutomationClient::~UIAutomationClient() { } void UIAutomationClient::Begin(const wchar_t* class_name, - const string16& item_name, + const base::string16& item_name, const InitializedCallback& init_callback, const ResultCallback& result_callback) { DCHECK(thread_checker_.CalledOnValidThread()); @@ -617,7 +617,7 @@ void UIAutomationClient::Begin(const wchar_t* class_name, base::Bind(&UIAutomationClient::Context::Initialize, context_, base::ThreadTaskRunnerHandle::Get(), - string16(class_name), + base::string16(class_name), item_name, init_callback, result_callback)); diff --git a/win8/test/ui_automation_client.h b/win8/test/ui_automation_client.h index 7e98329..e8b89f7 100644 --- a/win8/test/ui_automation_client.h +++ b/win8/test/ui_automation_client.h @@ -36,7 +36,8 @@ class UIAutomationClient { // If the HRESULT argument indicates success, the desired item in the window // was invoked. Otherwise, the string vector (if not empty) contains the list // of possible items in the window. - typedef base::Callback<void(HRESULT, std::vector<string16>)> ResultCallback; + typedef base::Callback<void(HRESULT, std::vector<base::string16>)> + ResultCallback; UIAutomationClient(); ~UIAutomationClient(); @@ -46,7 +47,7 @@ class UIAutomationClient { // Otherwise, |result_callback| will be invoked once |item_name| has been // invoked. void Begin(const wchar_t* class_name, - const string16& item_name, + const base::string16& item_name, const InitializedCallback& init_callback, const ResultCallback& result_callback); diff --git a/win8/viewer/metro_viewer_process_host.h b/win8/viewer/metro_viewer_process_host.h index ad034ad..e156226 100644 --- a/win8/viewer/metro_viewer_process_host.h +++ b/win8/viewer/metro_viewer_process_host.h @@ -66,12 +66,12 @@ class MetroViewerProcessHost : public IPC::Listener, // Called over IPC by the viewer process to request that the url passed in be // opened. - virtual void OnOpenURL(const string16& url) = 0; + virtual void OnOpenURL(const base::string16& url) = 0; // Called over IPC by the viewer process to request that the search string // passed in is passed to the default search provider and a URL navigation be // performed. - virtual void OnHandleSearchRequest(const string16& search_string) = 0; + virtual void OnHandleSearchRequest(const base::string16& search_string) = 0; // Called over IPC by the viewer process when the window size has changed. virtual void OnWindowSizeChanged(uint32 width, uint32 height) = 0; |