From 15959c271d0a85fa4e466c39a4e897b4e00183bc Mon Sep 17 00:00:00 2001 From: Oliver Hamlet Date: Sun, 1 Feb 2015 14:21:49 +0000 Subject: [PATCH] Removed broken custom import scheme. It was never used, because the Polymer elements that could be imported using it would themselves import using relative (ie. file) schemes, which would then fail. Since LOOT now Vulcanizes its imports, the whole process is now unnecessary anyway. --- src/backend/globals.cpp.in | 1 - src/backend/globals.h | 1 - src/gui/app.cpp | 4 ---- src/gui/scheme.cpp | 16 +++------------- 4 files changed, 3 insertions(+), 19 deletions(-) diff --git a/src/backend/globals.cpp.in b/src/backend/globals.cpp.in index 73f0853b..bfd7edf9 100644 --- a/src/backend/globals.cpp.in +++ b/src/backend/globals.cpp.in @@ -37,7 +37,6 @@ namespace loot { //Common paths. const boost::filesystem::path g_path_readme = boost::filesystem::current_path() / "docs" / "LOOT Readme.html"; const boost::filesystem::path g_path_report = boost::filesystem::current_path() / "resources" / "report" / "index.html"; - const boost::filesystem::path g_path_imports = boost::filesystem::current_path() / "resources" / "report"; const boost::filesystem::path g_path_l10n = boost::filesystem::current_path() / "resources" / "l10n"; #ifdef _WIN32 const boost::filesystem::path g_path_local = GetLocalAppDataPath() / "LOOT"; diff --git a/src/backend/globals.h b/src/backend/globals.h index e020744b..3621967e 100644 --- a/src/backend/globals.h +++ b/src/backend/globals.h @@ -38,7 +38,6 @@ namespace loot { //Common paths. extern const boost::filesystem::path g_path_readme; extern const boost::filesystem::path g_path_report; - extern const boost::filesystem::path g_path_imports; extern const boost::filesystem::path g_path_l10n; extern const boost::filesystem::path g_path_local; extern const boost::filesystem::path g_path_settings; diff --git a/src/gui/app.cpp b/src/gui/app.cpp index 42fb9e79..42bce830 100644 --- a/src/gui/app.cpp +++ b/src/gui/app.cpp @@ -64,9 +64,6 @@ namespace loot { // Disable spell checking. command_line->AppendSwitch("--disable-spell-checking"); - - // Temporary workaround until I figure out what's wrong with my custom URL handling. - command_line->AppendSwitch("--allow-file-access-from-files"); } } @@ -100,7 +97,6 @@ namespace loot { // Register the custom "loot" scheme handlers. CefRegisterSchemeHandlerFactory("loot", "l10n", new LootSchemeHandlerFactory()); - CefRegisterSchemeHandlerFactory("loot", "import", new LootSchemeHandlerFactory()); // Specify CEF browser settings here. CefBrowserSettings browser_settings; diff --git a/src/gui/scheme.cpp b/src/gui/scheme.cpp index 7dfe0353..3d79d558 100644 --- a/src/gui/scheme.cpp +++ b/src/gui/scheme.cpp @@ -45,19 +45,9 @@ namespace loot { CefRefPtr request) { BOOST_LOG_TRIVIAL(trace) << "Handling custom scheme: " << string(request->GetURL()); - /* Two custom URLs are possible: - loot://l10n/ - loot://import/ - */ - - // Get the path from the custom URL. - string file; - if (boost::starts_with(request->GetURL().ToString(), "loot://l10n/")) { - file = (g_path_l10n / request->GetURL().ToString().substr(12)).string(); - } - else { - file = (g_path_imports / request->GetURL().ToString().substr(14)).string(); - } + // Get the path from the custom URL, which is of the form + // loot://l10n/ + string file = (g_path_l10n / request->GetURL().ToString().substr(12)).string(); CefResponse::HeaderMap headers; headers.emplace("Access-Control-Allow-Origin", "*");