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 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 return internals::CreatePlatformShortcuts(shortcut_data_dir, shortcut_info, | 191 return internals::CreatePlatformShortcuts(shortcut_data_dir, shortcut_info, |
192 creation_locations, | 192 creation_locations, |
193 creation_reason); | 193 creation_reason); |
194 } | 194 } |
195 | 195 |
196 bool IsValidUrl(const GURL& url) { | 196 bool IsValidUrl(const GURL& url) { |
197 static const char* const kValidUrlSchemes[] = { | 197 static const char* const kValidUrlSchemes[] = { |
198 chrome::kFileScheme, | 198 chrome::kFileScheme, |
199 chrome::kFileSystemScheme, | 199 chrome::kFileSystemScheme, |
200 chrome::kFtpScheme, | 200 chrome::kFtpScheme, |
201 chrome::kHttpScheme, | 201 content::kHttpScheme, |
202 content::kHttpsScheme, | 202 content::kHttpsScheme, |
203 extensions::kExtensionScheme, | 203 extensions::kExtensionScheme, |
204 }; | 204 }; |
205 | 205 |
206 for (size_t i = 0; i < arraysize(kValidUrlSchemes); ++i) { | 206 for (size_t i = 0; i < arraysize(kValidUrlSchemes); ++i) { |
207 if (url.SchemeIs(kValidUrlSchemes[i])) | 207 if (url.SchemeIs(kValidUrlSchemes[i])) |
208 return true; | 208 return true; |
209 } | 209 } |
210 | 210 |
211 return false; | 211 return false; |
(...skipping 25 matching lines...) Expand all Loading... |
237 #endif | 237 #endif |
238 | 238 |
239 string16 GetAppShortcutsSubdirName() { | 239 string16 GetAppShortcutsSubdirName() { |
240 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel(); | 240 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel(); |
241 if (channel == chrome::VersionInfo::CHANNEL_CANARY) | 241 if (channel == chrome::VersionInfo::CHANNEL_CANARY) |
242 return l10n_util::GetStringUTF16(IDS_APP_SHORTCUTS_SUBDIR_NAME_CANARY); | 242 return l10n_util::GetStringUTF16(IDS_APP_SHORTCUTS_SUBDIR_NAME_CANARY); |
243 return l10n_util::GetStringUTF16(IDS_APP_SHORTCUTS_SUBDIR_NAME); | 243 return l10n_util::GetStringUTF16(IDS_APP_SHORTCUTS_SUBDIR_NAME); |
244 } | 244 } |
245 | 245 |
246 } // namespace web_app | 246 } // namespace web_app |
OLD | NEW |