diff options
author | tony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-24 07:01:19 +0000 |
---|---|---|
committer | tony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-24 07:01:19 +0000 |
commit | 81c4864633619b46ac8e262f1db5956878e8fb17 (patch) | |
tree | 8553369251037ffb2a39267cb5f9f735ebfd75af | |
parent | 237f93b11344c39b706fe618d94367a6e7323a1f (diff) | |
download | chromium_src-81c4864633619b46ac8e262f1db5956878e8fb17.zip chromium_src-81c4864633619b46ac8e262f1db5956878e8fb17.tar.gz chromium_src-81c4864633619b46ac8e262f1db5956878e8fb17.tar.bz2 |
Fix bookmark manager on mac and windows.
Mac was failing because the resources directory
was in a different place.
Win was failing because path separators between
two filepaths are different causing the equality
check to fail.
TBR=erg
Review URL: http://codereview.chromium.org/2873017
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50706 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/dom_ui/bookmarks_ui_uitest.cc | 2 | ||||
-rw-r--r-- | chrome/browser/extensions/extension_protocols.cc | 11 | ||||
-rw-r--r-- | chrome/common/chrome_paths.cc | 5 | ||||
-rw-r--r-- | chrome/common/chrome_paths.h | 1 |
4 files changed, 10 insertions, 9 deletions
diff --git a/chrome/browser/dom_ui/bookmarks_ui_uitest.cc b/chrome/browser/dom_ui/bookmarks_ui_uitest.cc index 318c9b2..3e3ac33 100644 --- a/chrome/browser/dom_ui/bookmarks_ui_uitest.cc +++ b/chrome/browser/dom_ui/bookmarks_ui_uitest.cc @@ -58,7 +58,7 @@ class BookmarksUITest : public UITest { }; // http://code.google.com/p/chromium/issues/detail?id=39532 -TEST_F(BookmarksUITest, DISABLED_ShouldRedirectToExtension) { +TEST_F(BookmarksUITest, FLAKY_ShouldRedirectToExtension) { scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0)); ASSERT_TRUE(browser.get()); diff --git a/chrome/browser/extensions/extension_protocols.cc b/chrome/browser/extensions/extension_protocols.cc index 2a740f1..0a868f4 100644 --- a/chrome/browser/extensions/extension_protocols.cc +++ b/chrome/browser/extensions/extension_protocols.cc @@ -12,6 +12,7 @@ #include "base/message_loop.h" #include "base/path_service.h" #include "base/string_util.h" +#include "build/build_config.h" #include "chrome/browser/net/chrome_url_request_context.h" #include "chrome/browser/renderer_host/resource_dispatcher_host.h" #include "chrome/browser/renderer_host/resource_dispatcher_host_request_info.h" @@ -91,10 +92,16 @@ static URLRequestJob* CreateExtensionURLRequestJob(URLRequest* request, } FilePath resources_path; - if (PathService::Get(chrome::FILE_RESOURCES_PACK, &resources_path) && - directory_path.DirName() == resources_path.RemoveExtension()) { + if (PathService::Get(chrome::DIR_RESOURCES, &resources_path) && + directory_path.DirName() == resources_path) { FilePath relative_path = directory_path.BaseName().Append( extension_file_util::ExtensionURLToRelativeFilePath(request->url())); +#if defined(OS_WIN) + // TODO(tc): This is a hack, we should normalize paths another way. + FilePath::StringType path = relative_path.value(); + std::replace(path.begin(), path.end(), '\\', '/'); + relative_path = FilePath(path); +#endif // TODO(tc): Make a map of FilePath -> resource ids so we don't have to // covert to FilePaths all the time. This will be more useful as we add diff --git a/chrome/common/chrome_paths.cc b/chrome/common/chrome_paths.cc index f6257c4ac..6f77510 100644 --- a/chrome/common/chrome_paths.cc +++ b/chrome/common/chrome_paths.cc @@ -158,11 +158,6 @@ bool PathProvider(int key, FilePath* result) { return false; cur = cur.Append(FILE_PATH_LITERAL("shared")); break; - case chrome::DIR_BOOKMARK_MANAGER: - if (!PathService::Get(chrome::DIR_RESOURCES, &cur)) - return false; - cur = cur.Append(FILE_PATH_LITERAL("bookmark_manager")); - break; case chrome::DIR_INSPECTOR: if (!PathService::Get(chrome::DIR_RESOURCES, &cur)) return false; diff --git a/chrome/common/chrome_paths.h b/chrome/common/chrome_paths.h index 3e3a8ec..2d90e0a 100644 --- a/chrome/common/chrome_paths.h +++ b/chrome/common/chrome_paths.h @@ -24,7 +24,6 @@ enum { // used by Chrome at runtime. DIR_SHARED_RESOURCES, // Directory containing js and css files used // by DOMUI and component extensions. - DIR_BOOKMARK_MANAGER, // Directory containing the bookmark manager. DIR_INSPECTOR, // Directory where web inspector is located. DIR_APP_DICTIONARIES, // Directory where the global dictionaries are. DIR_USER_DOCUMENTS, // Directory for a user's "My Documents". |