OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/web_applications/web_app.h" | 5 #include "chrome/browser/web_applications/web_app.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/i18n/file_util_icu.h" | 10 #include "base/i18n/file_util_icu.h" |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 FilePath::StringType scheme_port_path(UTF8ToUTF16(scheme_port)); | 74 FilePath::StringType scheme_port_path(UTF8ToUTF16(scheme_port)); |
75 #elif defined(OS_POSIX) | 75 #elif defined(OS_POSIX) |
76 FilePath::StringType host_path(host); | 76 FilePath::StringType host_path(host); |
77 FilePath::StringType scheme_port_path(scheme_port); | 77 FilePath::StringType scheme_port_path(scheme_port); |
78 #endif | 78 #endif |
79 | 79 |
80 return app_data_dir.Append(host_path).Append(scheme_port_path); | 80 return app_data_dir.Append(host_path).Append(scheme_port_path); |
81 } | 81 } |
82 | 82 |
83 FilePath GetWebAppDataDirectory(const FilePath& profile_path, | 83 FilePath GetWebAppDataDirectory(const FilePath& profile_path, |
84 const Extension& extension) { | 84 const extensions::Extension& extension) { |
85 return GetWebAppDataDirectory( | 85 return GetWebAppDataDirectory( |
86 profile_path, extension.id(), GURL(extension.launch_web_url())); | 86 profile_path, extension.id(), GURL(extension.launch_web_url())); |
87 } | 87 } |
88 | 88 |
89 std::string GenerateApplicationNameFromInfo( | 89 std::string GenerateApplicationNameFromInfo( |
90 const ShellIntegration::ShortcutInfo& shortcut_info) { | 90 const ShellIntegration::ShortcutInfo& shortcut_info) { |
91 if (!shortcut_info.extension_id.empty()) { | 91 if (!shortcut_info.extension_id.empty()) { |
92 return web_app::GenerateApplicationNameFromExtensionId( | 92 return web_app::GenerateApplicationNameFromExtensionId( |
93 shortcut_info.extension_id); | 93 shortcut_info.extension_id); |
94 } else { | 94 } else { |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 | 179 |
180 #if defined(TOOLKIT_GTK) | 180 #if defined(TOOLKIT_GTK) |
181 std::string GetWMClassFromAppName(std::string app_name) { | 181 std::string GetWMClassFromAppName(std::string app_name) { |
182 file_util::ReplaceIllegalCharactersInPath(&app_name, '_'); | 182 file_util::ReplaceIllegalCharactersInPath(&app_name, '_'); |
183 TrimString(app_name, "_", &app_name); | 183 TrimString(app_name, "_", &app_name); |
184 return app_name; | 184 return app_name; |
185 } | 185 } |
186 #endif | 186 #endif |
187 | 187 |
188 } // namespace web_app | 188 } // namespace web_app |
OLD | NEW |