| 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/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/i18n/file_util_icu.h" | 9 #include "base/i18n/file_util_icu.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 data_dir, | 128 data_dir, |
| 129 shortcut_info.extension_id, | 129 shortcut_info.extension_id, |
| 130 shortcut_info.url), | 130 shortcut_info.url), |
| 131 data_dir, | 131 data_dir, |
| 132 shortcut_info)); | 132 shortcut_info)); |
| 133 } | 133 } |
| 134 | 134 |
| 135 bool IsValidUrl(const GURL& url) { | 135 bool IsValidUrl(const GURL& url) { |
| 136 static const char* const kValidUrlSchemes[] = { | 136 static const char* const kValidUrlSchemes[] = { |
| 137 chrome::kFileScheme, | 137 chrome::kFileScheme, |
| 138 chrome::kFileSystemScheme, |
| 138 chrome::kFtpScheme, | 139 chrome::kFtpScheme, |
| 139 chrome::kHttpScheme, | 140 chrome::kHttpScheme, |
| 140 chrome::kHttpsScheme, | 141 chrome::kHttpsScheme, |
| 141 chrome::kExtensionScheme, | 142 chrome::kExtensionScheme, |
| 142 }; | 143 }; |
| 143 | 144 |
| 144 for (size_t i = 0; i < arraysize(kValidUrlSchemes); ++i) { | 145 for (size_t i = 0; i < arraysize(kValidUrlSchemes); ++i) { |
| 145 if (url.SchemeIs(kValidUrlSchemes[i])) | 146 if (url.SchemeIs(kValidUrlSchemes[i])) |
| 146 return true; | 147 return true; |
| 147 } | 148 } |
| (...skipping 20 matching lines...) Expand all Loading... |
| 168 | 169 |
| 169 #if defined(TOOLKIT_USES_GTK) | 170 #if defined(TOOLKIT_USES_GTK) |
| 170 std::string GetWMClassFromAppName(std::string app_name) { | 171 std::string GetWMClassFromAppName(std::string app_name) { |
| 171 file_util::ReplaceIllegalCharactersInPath(&app_name, '_'); | 172 file_util::ReplaceIllegalCharactersInPath(&app_name, '_'); |
| 172 TrimString(app_name, "_", &app_name); | 173 TrimString(app_name, "_", &app_name); |
| 173 return app_name; | 174 return app_name; |
| 174 } | 175 } |
| 175 #endif | 176 #endif |
| 176 | 177 |
| 177 } // namespace web_app | 178 } // namespace web_app |
| OLD | NEW |