diff options
author | avi@google.com <avi@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-27 00:02:26 +0000 |
---|---|---|
committer | avi@google.com <avi@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-27 00:02:26 +0000 |
commit | ca370a589bf573e24e97bb4032e6d04d055c1b92 (patch) | |
tree | baf069522ba4abbfb91c3dd4553345077b7d9963 /webkit | |
parent | 78346405241cb4b27d7a031de538b285ff89c65f (diff) | |
download | chromium_src-ca370a589bf573e24e97bb4032e6d04d055c1b92.zip chromium_src-ca370a589bf573e24e97bb4032e6d04d055c1b92.tar.gz chromium_src-ca370a589bf573e24e97bb4032e6d04d055c1b92.tar.bz2 |
Uses FilePath instead of std::wstring in webkit_glue::GetApplicationDirectory.
Patch by tfarina.
BUG=None
TEST=None
Review URL: http://codereview.chromium.org/173304
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24565 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/glue/plugins/plugin_list_win.cc | 14 | ||||
-rw-r--r-- | webkit/glue/webkit_glue.h | 4 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_shell.cc | 10 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_worker/test_worker_main.cc | 4 |
4 files changed, 13 insertions, 19 deletions
diff --git a/webkit/glue/plugins/plugin_list_win.cc b/webkit/glue/plugins/plugin_list_win.cc index d7778b2..95ea743 100644 --- a/webkit/glue/plugins/plugin_list_win.cc +++ b/webkit/glue/plugins/plugin_list_win.cc @@ -41,24 +41,22 @@ const TCHAR kRegistryJavaHome[] = _T("JavaHome"); // The application path where we expect to find plugins. void GetAppDirectory(std::set<FilePath>* plugin_dirs) { - std::wstring app_path; - // TODO(avi): use PathService directly + FilePath app_path; if (!webkit_glue::GetApplicationDirectory(&app_path)) return; - app_path.append(L"\\plugins"); - plugin_dirs->insert(FilePath(app_path)); + app_path = app_path.AppendASCII("plugins"); + plugin_dirs->insert(app_path); } // The executable path where we expect to find plugins. void GetExeDirectory(std::set<FilePath>* plugin_dirs) { - std::wstring exe_path; - // TODO(avi): use PathService directly + FilePath exe_path; if (!webkit_glue::GetExeDirectory(&exe_path)) return; - exe_path.append(L"\\plugins"); - plugin_dirs->insert(FilePath(exe_path)); + exe_path = exe_path.AppendASCII("plugins"); + plugin_dirs->insert(exe_path); } // Gets the installed path for a registered app. diff --git a/webkit/glue/webkit_glue.h b/webkit/glue/webkit_glue.h index c52f0b1..ebe6f11 100644 --- a/webkit/glue/webkit_glue.h +++ b/webkit/glue/webkit_glue.h @@ -166,7 +166,7 @@ void ClipboardReadHTML(string16* markup, GURL* url); // GetExeDirectory(), depending on the embedder's implementation. // Path is an output parameter to receive the path. // Returns true if successful, false otherwise. -bool GetApplicationDirectory(std::wstring* path); +bool GetApplicationDirectory(FilePath* path); // Gets the URL where the inspector's HTML file resides. It must use the // protocol returned by GetUIResourceProtocol. @@ -179,7 +179,7 @@ std::string GetUIResourceProtocol(); // Gets the directory where the launching executable resides on disk. // Path is an output parameter to receive the path. // Returns true if successful, false otherwise. -bool GetExeDirectory(std::wstring* path); +bool GetExeDirectory(FilePath* path); // Embedders implement this function to return the list of plugins to Webkit. void GetPlugins(bool refresh, std::vector<WebPluginInfo>* plugins); diff --git a/webkit/tools/test_shell/test_shell.cc b/webkit/tools/test_shell/test_shell.cc index fa6c46e..89980fe 100644 --- a/webkit/tools/test_shell/test_shell.cc +++ b/webkit/tools/test_shell/test_shell.cc @@ -621,12 +621,8 @@ void AppendToLog(const char* file, int line, const char* msg) { logging::LogMessage(file, line).stream() << msg; } -bool GetApplicationDirectory(std::wstring *path) { - bool r; - FilePath fp; - r = PathService::Get(base::DIR_EXE, &fp); - *path = fp.ToWStringHack(); - return r; +bool GetApplicationDirectory(FilePath* path) { + return PathService::Get(base::DIR_EXE, path); } GURL GetInspectorURL() { @@ -637,7 +633,7 @@ std::string GetUIResourceProtocol() { return "test-shell-resource"; } -bool GetExeDirectory(std::wstring *path) { +bool GetExeDirectory(FilePath* path) { return GetApplicationDirectory(path); } diff --git a/webkit/tools/test_shell/test_worker/test_worker_main.cc b/webkit/tools/test_shell/test_worker/test_worker_main.cc index 02eaf32..1002fbe 100644 --- a/webkit/tools/test_shell/test_worker/test_worker_main.cc +++ b/webkit/tools/test_shell/test_worker/test_worker_main.cc @@ -184,7 +184,7 @@ void AppendToLog(const char* file, int line, const char* msg) { logging::LogMessage(file, line).stream() << msg; } -bool GetApplicationDirectory(std::wstring *path) { +bool GetApplicationDirectory(FilePath* path) { return PathService::Get(base::DIR_EXE, path); } @@ -196,7 +196,7 @@ std::string GetUIResourceProtocol() { return "test-shell-resource"; } -bool GetExeDirectory(std::wstring *path) { +bool GetExeDirectory(FilePath* path) { return PathService::Get(base::DIR_EXE, path); } |