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 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 shortcut_info.profile_path, shortcut_info.extension_id, | 187 shortcut_info.profile_path, shortcut_info.extension_id, |
188 shortcut_info.url); | 188 shortcut_info.url); |
189 return internals::CreatePlatformShortcuts(shortcut_data_dir, shortcut_info, | 189 return internals::CreatePlatformShortcuts(shortcut_data_dir, shortcut_info, |
190 creation_locations, | 190 creation_locations, |
191 creation_reason); | 191 creation_reason); |
192 } | 192 } |
193 | 193 |
194 bool IsValidUrl(const GURL& url) { | 194 bool IsValidUrl(const GURL& url) { |
195 static const char* const kValidUrlSchemes[] = { | 195 static const char* const kValidUrlSchemes[] = { |
196 chrome::kFileScheme, | 196 chrome::kFileScheme, |
197 chrome::kFileSystemScheme, | 197 content::kFileSystemScheme, |
198 content::kFtpScheme, | 198 content::kFtpScheme, |
199 content::kHttpScheme, | 199 content::kHttpScheme, |
200 content::kHttpsScheme, | 200 content::kHttpsScheme, |
201 extensions::kExtensionScheme, | 201 extensions::kExtensionScheme, |
202 }; | 202 }; |
203 | 203 |
204 for (size_t i = 0; i < arraysize(kValidUrlSchemes); ++i) { | 204 for (size_t i = 0; i < arraysize(kValidUrlSchemes); ++i) { |
205 if (url.SchemeIs(kValidUrlSchemes[i])) | 205 if (url.SchemeIs(kValidUrlSchemes[i])) |
206 return true; | 206 return true; |
207 } | 207 } |
(...skipping 20 matching lines...) Expand all Loading... |
228 | 228 |
229 #if defined(OS_LINUX) | 229 #if defined(OS_LINUX) |
230 std::string GetWMClassFromAppName(std::string app_name) { | 230 std::string GetWMClassFromAppName(std::string app_name) { |
231 file_util::ReplaceIllegalCharactersInPath(&app_name, '_'); | 231 file_util::ReplaceIllegalCharactersInPath(&app_name, '_'); |
232 base::TrimString(app_name, "_", &app_name); | 232 base::TrimString(app_name, "_", &app_name); |
233 return app_name; | 233 return app_name; |
234 } | 234 } |
235 #endif | 235 #endif |
236 | 236 |
237 } // namespace web_app | 237 } // namespace web_app |
OLD | NEW |