summaryrefslogtreecommitdiffstats
path: root/win8/delegate_execute
diff options
context:
space:
mode:
authordbeam@chromium.org <dbeam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-20 17:35:56 +0000
committerdbeam@chromium.org <dbeam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-20 17:35:56 +0000
commit4dcc2ec6b1a9417aab85183acbca64761ccdd32d (patch)
treeec1ac02e939a76a038f3c47824a34c36fb2de90e /win8/delegate_execute
parentfdd91ad2e68f187bc301c30ecda7e503dae32126 (diff)
downloadchromium_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
Diffstat (limited to 'win8/delegate_execute')
-rw-r--r--win8/delegate_execute/chrome_util.cc10
-rw-r--r--win8/delegate_execute/command_execute_impl.cc14
-rw-r--r--win8/delegate_execute/command_execute_impl.h6
-rw-r--r--win8/delegate_execute/crash_server_init.cc4
-rw-r--r--win8/delegate_execute/delegate_execute.cc4
-rw-r--r--win8/delegate_execute/delegate_execute_operation.cc2
-rw-r--r--win8/delegate_execute/delegate_execute_operation.h8
-rw-r--r--win8/delegate_execute/delegate_execute_util.cc10
-rw-r--r--win8/delegate_execute/delegate_execute_util.h4
-rw-r--r--win8/delegate_execute/delegate_execute_util_unittest.cc21
10 files changed, 43 insertions, 40 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));
}