summaryrefslogtreecommitdiffstats
path: root/win8
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-02 05:12:33 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-02 05:12:33 +0000
commita3ef4830d5b5fdc52e5d7d0cb33dae8844f0961e (patch)
treebdd4dac76e6034ef6cf33450e203269a715ea0e6 /win8
parent8bc574c57115e9ffd0169f33131c0865997dcb35 (diff)
downloadchromium_src-a3ef4830d5b5fdc52e5d7d0cb33dae8844f0961e.zip
chromium_src-a3ef4830d5b5fdc52e5d7d0cb33dae8844f0961e.tar.gz
chromium_src-a3ef4830d5b5fdc52e5d7d0cb33dae8844f0961e.tar.bz2
Add FilePath to base namespace.
This updates headers that forward-declare it and a few random places to use the namespace explicitly. There us a using declaration in file_path.h that makes the rest compile, which we can do in future passes. Review URL: https://codereview.chromium.org/12163003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@180245 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'win8')
-rw-r--r--win8/delegate_execute/chrome_util.cc17
-rw-r--r--win8/delegate_execute/chrome_util.h6
-rw-r--r--win8/delegate_execute/command_execute_impl.cc10
-rw-r--r--win8/delegate_execute/command_execute_impl.h4
-rw-r--r--win8/delegate_execute/delegate_execute_operation.cc3
-rw-r--r--win8/delegate_execute/delegate_execute_operation.h4
-rw-r--r--win8/delegate_execute/delegate_execute_util.cc4
-rw-r--r--win8/delegate_execute/delegate_execute_util.h4
-rw-r--r--win8/delegate_execute/delegate_execute_util_unittest.cc2
-rw-r--r--win8/metro_driver/file_picker_ash.h9
10 files changed, 36 insertions, 27 deletions
diff --git a/win8/delegate_execute/chrome_util.cc b/win8/delegate_execute/chrome_util.cc
index 701f2e8..b67e80f 100644
--- a/win8/delegate_execute/chrome_util.cc
+++ b/win8/delegate_execute/chrome_util.cc
@@ -36,7 +36,8 @@ const wchar_t kAppUserModelId[] = L"Chromium";
// TODO(grt): These constants live in installer_util. Consider moving them
// into common_constants to allow for reuse.
-const FilePath::CharType kNewChromeExe[] = FILE_PATH_LITERAL("new_chrome.exe");
+const base::FilePath::CharType kNewChromeExe[] =
+ FILE_PATH_LITERAL("new_chrome.exe");
const wchar_t kRenameCommandValue[] = L"cmd";
const wchar_t kChromeAppGuid[] = L"{8A69D345-D564-463c-AFF1-A69D9E530F96}";
const wchar_t kRegPathChromeClient[] =
@@ -48,7 +49,7 @@ const int kExitCodeRenameSuccessful = 23;
// 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 FilePath& chrome_exe) {
+string16 GetEventName(const base::FilePath& chrome_exe) {
static wchar_t const kEventPrefix[] = L"Global\\";
const size_t prefix_len = arraysize(kEventPrefix) - 1;
string16 name;
@@ -63,7 +64,7 @@ string16 GetEventName(const FilePath& chrome_exe) {
// Returns true if |chrome_exe| is in use by a browser process. In this case,
// "in use" means past ChromeBrowserMainParts::PreMainMessageLoopRunImpl.
-bool IsBrowserRunning(const FilePath& chrome_exe) {
+bool IsBrowserRunning(const base::FilePath& chrome_exe) {
base::win::ScopedHandle handle(::OpenEvent(
SYNCHRONIZE, FALSE, GetEventName(chrome_exe).c_str()));
if (handle.IsValid())
@@ -78,8 +79,8 @@ bool IsBrowserRunning(const FilePath& chrome_exe) {
// Returns true if the file new_chrome.exe exists in the same directory as
// |chrome_exe|.
-bool NewChromeExeExists(const FilePath& chrome_exe) {
- FilePath new_chrome_exe(chrome_exe.DirName().Append(kNewChromeExe));
+bool NewChromeExeExists(const base::FilePath& chrome_exe) {
+ base::FilePath new_chrome_exe(chrome_exe.DirName().Append(kNewChromeExe));
return file_util::PathExists(new_chrome_exe);
}
@@ -93,7 +94,7 @@ bool GetUpdateCommand(bool is_per_user, string16* update_command) {
#endif // GOOGLE_CHROME_BUILD
// TODO(grt): This code also lives in installer_util. Refactor for reuse.
-bool IsPerUserInstall(const FilePath& chrome_exe) {
+bool IsPerUserInstall(const base::FilePath& chrome_exe) {
wchar_t program_files_path[MAX_PATH] = {0};
if (SUCCEEDED(SHGetFolderPath(NULL, CSIDL_PROGRAM_FILES, NULL,
SHGFP_TYPE_CURRENT, program_files_path))) {
@@ -188,7 +189,7 @@ bool GetUserSpecificRegistrySuffix(string16* suffix) {
namespace delegate_execute {
-void UpdateChromeIfNeeded(const FilePath& chrome_exe) {
+void UpdateChromeIfNeeded(const base::FilePath& chrome_exe) {
#if defined(GOOGLE_CHROME_BUILD)
// Nothing to do if a browser is already running or if there's no
// new_chrome.exe.
@@ -253,7 +254,7 @@ void UpdateChromeIfNeeded(const FilePath& chrome_exe) {
}
// TODO(gab): This code also lives in shell_util. Refactor for reuse.
-string16 GetAppId(const FilePath& chrome_exe) {
+string16 GetAppId(const base::FilePath& chrome_exe) {
string16 app_id(kAppUserModelId);
string16 suffix;
if (IsPerUserInstall(chrome_exe) &&
diff --git a/win8/delegate_execute/chrome_util.h b/win8/delegate_execute/chrome_util.h
index 634ce6c..f65ec2f 100644
--- a/win8/delegate_execute/chrome_util.h
+++ b/win8/delegate_execute/chrome_util.h
@@ -7,15 +7,17 @@
#include "base/string16.h"
+namespace base {
class FilePath;
+}
namespace delegate_execute {
// Finalizes a previously updated installation.
-void UpdateChromeIfNeeded(const FilePath& chrome_exe);
+void UpdateChromeIfNeeded(const base::FilePath& chrome_exe);
// Returns the appid of the Chrome pointed to by |chrome_exe|.
-string16 GetAppId(const FilePath& chrome_exe);
+string16 GetAppId(const base::FilePath& chrome_exe);
} // namespace delegate_execute
diff --git a/win8/delegate_execute/command_execute_impl.cc b/win8/delegate_execute/command_execute_impl.cc
index 96ca46b..18ba4e7 100644
--- a/win8/delegate_execute/command_execute_impl.cc
+++ b/win8/delegate_execute/command_execute_impl.cc
@@ -60,12 +60,12 @@ HRESULT GetUrlFromShellItem(IShellItem* shell_item, string16* url) {
}
bool LaunchChromeBrowserProcess() {
- FilePath delegate_exe_path;
+ base::FilePath delegate_exe_path;
if (!PathService::Get(base::FILE_EXE, &delegate_exe_path))
return false;
// First try and go up a level to find chrome.exe.
- FilePath chrome_exe_path =
+ base::FilePath chrome_exe_path =
delegate_exe_path.DirName()
.DirName()
.Append(chrome::kBrowserProcessExecutableName);
@@ -242,7 +242,7 @@ STDMETHODIMP CommandExecuteImpl::GetValue(enum AHE_TYPE* pahe) {
return S_OK;
}
- FilePath user_data_dir;
+ base::FilePath user_data_dir;
if (!PathService::Get(chrome::DIR_USER_DATA, &user_data_dir)) {
AtlTrace("Failed to get chrome's data dir path, E_FAIL\n");
return E_FAIL;
@@ -376,11 +376,11 @@ STDMETHODIMP CommandExecuteImpl::AllowForegroundTransfer(void* reserved) {
// Returns false if chrome.exe cannot be found.
// static
-bool CommandExecuteImpl::FindChromeExe(FilePath* chrome_exe) {
+bool CommandExecuteImpl::FindChromeExe(base::FilePath* chrome_exe) {
AtlTrace("In %hs\n", __FUNCTION__);
// Look for chrome.exe one folder above delegate_execute.exe (as expected in
// Chrome installs). Failing that, look for it alonside delegate_execute.exe.
- FilePath dir_exe;
+ base::FilePath dir_exe;
if (!PathService::Get(base::DIR_EXE, &dir_exe)) {
AtlTrace("Failed to get current exe path\n");
return false;
diff --git a/win8/delegate_execute/command_execute_impl.h b/win8/delegate_execute/command_execute_impl.h
index 8e0fcbf..1b137d9 100644
--- a/win8/delegate_execute/command_execute_impl.h
+++ b/win8/delegate_execute/command_execute_impl.h
@@ -85,7 +85,7 @@ class ATL_NO_VTABLE DECLSPEC_UUID("A2DF06F9-A21A-44A8-8A99-8B9C84F29160")
STDMETHOD(AllowForegroundTransfer)(void* reserved);
private:
- static bool FindChromeExe(FilePath* chrome_exe);
+ static bool FindChromeExe(base::FilePath* chrome_exe);
static bool path_provider_initialized_;
@@ -96,7 +96,7 @@ class ATL_NO_VTABLE DECLSPEC_UUID("A2DF06F9-A21A-44A8-8A99-8B9C84F29160")
CComPtr<IShellItemArray> item_array_;
CommandLine parameters_;
- FilePath chrome_exe_;
+ base::FilePath chrome_exe_;
STARTUPINFO start_info_;
string16 verb_;
string16 display_name_;
diff --git a/win8/delegate_execute/delegate_execute_operation.cc b/win8/delegate_execute/delegate_execute_operation.cc
index f4aaa41..9663828 100644
--- a/win8/delegate_execute/delegate_execute_operation.cc
+++ b/win8/delegate_execute/delegate_execute_operation.cc
@@ -20,7 +20,8 @@ DelegateExecuteOperation::~DelegateExecuteOperation() {
}
bool DelegateExecuteOperation::Init(const CommandLine* cmd_line) {
- FilePath shortcut(cmd_line->GetSwitchValuePath(switches::kRelaunchShortcut));
+ base::FilePath shortcut(
+ cmd_line->GetSwitchValuePath(switches::kRelaunchShortcut));
if (shortcut.empty()) {
operation_type_ = DELEGATE_EXECUTE;
return true;
diff --git a/win8/delegate_execute/delegate_execute_operation.h b/win8/delegate_execute/delegate_execute_operation.h
index 3fc1b00..8d2900d 100644
--- a/win8/delegate_execute/delegate_execute_operation.h
+++ b/win8/delegate_execute/delegate_execute_operation.h
@@ -60,14 +60,14 @@ class DelegateExecuteOperation {
// Returns the process id of the parent or 0 on failure.
DWORD GetParentPid() const;
- const FilePath& shortcut() const {
+ const base::FilePath& shortcut() const {
return relaunch_shortcut_;
}
private:
OperationType operation_type_;
string16 relaunch_flags_;
- FilePath relaunch_shortcut_;
+ base::FilePath relaunch_shortcut_;
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 d04c667..70ca3e3 100644
--- a/win8/delegate_execute/delegate_execute_util.cc
+++ b/win8/delegate_execute/delegate_execute_util.cc
@@ -16,13 +16,13 @@ CommandLine CommandLineFromParameters(const wchar_t* params) {
string16 command_string(L"noprogram.exe ");
command_string.append(params);
command_line.ParseFromString(command_string);
- command_line.SetProgram(FilePath());
+ command_line.SetProgram(base::FilePath());
}
return command_line;
}
-CommandLine MakeChromeCommandLine(const FilePath& chrome_exe,
+CommandLine MakeChromeCommandLine(const base::FilePath& chrome_exe,
const CommandLine& params,
const string16& argument) {
CommandLine chrome_cmd(params);
diff --git a/win8/delegate_execute/delegate_execute_util.h b/win8/delegate_execute/delegate_execute_util.h
index 5f001ff..36f1556 100644
--- a/win8/delegate_execute/delegate_execute_util.h
+++ b/win8/delegate_execute/delegate_execute_util.h
@@ -8,7 +8,9 @@
#include "base/command_line.h"
#include "base/string16.h"
+namespace base {
class FilePath;
+}
namespace delegate_execute {
@@ -17,7 +19,7 @@ CommandLine CommandLineFromParameters(const wchar_t* params);
// Returns a CommandLine to launch |chrome_exe| with all switches and arguments
// from |params| plus an optional |argument|.
-CommandLine MakeChromeCommandLine(const FilePath& chrome_exe,
+CommandLine MakeChromeCommandLine(const base::FilePath& chrome_exe,
const CommandLine& params,
const string16& argument);
diff --git a/win8/delegate_execute/delegate_execute_util_unittest.cc b/win8/delegate_execute/delegate_execute_util_unittest.cc
index 360d8e7..6fcf65d 100644
--- a/win8/delegate_execute/delegate_execute_util_unittest.cc
+++ b/win8/delegate_execute/delegate_execute_util_unittest.cc
@@ -36,7 +36,7 @@ TEST(DelegateExecuteUtil, CommandLineFromParametersTest) {
TEST(DelegateExecuteUtil, MakeChromeCommandLineTest) {
static const wchar_t kSomeArgument[] = L"http://some.url/";
static const wchar_t kOtherArgument[] = L"http://some.other.url/";
- const FilePath this_exe(CommandLine::ForCurrentProcess()->GetProgram());
+ const base::FilePath this_exe(CommandLine::ForCurrentProcess()->GetProgram());
CommandLine cl(CommandLine::NO_PROGRAM);
diff --git a/win8/metro_driver/file_picker_ash.h b/win8/metro_driver/file_picker_ash.h
index ec8cf6a..4426f5c 100644
--- a/win8/metro_driver/file_picker_ash.h
+++ b/win8/metro_driver/file_picker_ash.h
@@ -10,10 +10,13 @@
#include "base/compiler_specific.h"
#include "base/string16.h"
-class FilePath;
class ChromeAppViewAsh;
struct MetroViewerHostMsg_SaveAsDialogParams;
+namespace base {
+class FilePath;
+}
+
// Base class for the file pickers.
class FilePickerSessionBase {
public:
@@ -79,7 +82,7 @@ class OpenFilePickerSession : public FilePickerSessionBase {
const string16& default_path,
bool allow_multi_select);
- const std::vector<FilePath>& filenames() const {
+ const std::vector<base::FilePath>& filenames() const {
return filenames_;
}
@@ -113,7 +116,7 @@ class OpenFilePickerSession : public FilePickerSessionBase {
bool allow_multi_select_;
// If multi select is true then this member contains the list of filenames
// to be returned back.
- std::vector<FilePath> filenames_;
+ std::vector<base::FilePath> filenames_;
DISALLOW_COPY_AND_ASSIGN(OpenFilePickerSession);
};