Index: services/catalog/catalog.cc |
diff --git a/services/catalog/catalog.cc b/services/catalog/catalog.cc |
index 19b088373551c99d2c1e8b8e4fe61aab08804696..4545267c5ca6092c94929df129ae0cd3acbf8bfa 100644 |
--- a/services/catalog/catalog.cc |
+++ b/services/catalog/catalog.cc |
@@ -19,6 +19,7 @@ |
#include "services/catalog/instance.h" |
#include "services/catalog/reader.h" |
#include "services/shell/public/cpp/connection.h" |
+#include "services/shell/public/cpp/names.h" |
#include "services/shell/public/cpp/service_context.h" |
namespace catalog { |
@@ -38,19 +39,21 @@ bool IsPathNameValid(const std::string& name) { |
base::FilePath GetPathForApplicationName(const std::string& application_name) { |
std::string path = application_name; |
- const bool is_mojo = |
- base::StartsWith(path, "mojo:", base::CompareCase::INSENSITIVE_ASCII); |
+ const bool is_service = |
+ base::StartsWith(path, "service:", base::CompareCase::INSENSITIVE_ASCII); |
const bool is_exe = |
- !is_mojo && |
+ !is_service && |
base::StartsWith(path, "exe:", base::CompareCase::INSENSITIVE_ASCII); |
- if (!is_mojo && !is_exe) |
+ if (!is_service && !is_exe) |
return base::FilePath(); |
if (path.find('.') != std::string::npos) |
return base::FilePath(); |
- if (is_mojo) |
- path.erase(path.begin(), path.begin() + 5); |
- else |
- path.erase(path.begin(), path.begin() + 4); |
+ if (is_service) { |
+ path.erase(path.begin(), |
+ path.begin() + strlen(shell::kNameType_Service) + 1); |
+ } else { |
+ path.erase(path.begin(), path.begin() + strlen(shell::kNameType_Exe) + 1); |
+ } |
base::TrimString(path, "/", &path); |
size_t end_of_name = path.find('/'); |
if (end_of_name != std::string::npos) |