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" |
11 #include "base/string_util.h" | 11 #include "base/string_util.h" |
12 #include "base/threading/thread.h" | 12 #include "base/threading/thread.h" |
13 #include "base/utf_string_conversions.h" | 13 #include "base/utf_string_conversions.h" |
14 #include "chrome/common/chrome_constants.h" | 14 #include "chrome/common/chrome_constants.h" |
15 #include "chrome/common/chrome_version_info.h" | 15 #include "chrome/common/chrome_version_info.h" |
16 #include "chrome/common/extensions/extension.h" | 16 #include "chrome/common/extensions/extension.h" |
17 #include "chrome/common/url_constants.h" | 17 #include "chrome/common/url_constants.h" |
18 #include "chrome/installer/util/browser_distribution.h" | |
18 #include "content/public/browser/browser_thread.h" | 19 #include "content/public/browser/browser_thread.h" |
19 #include "extensions/common/constants.h" | 20 #include "extensions/common/constants.h" |
20 #include "grit/chromium_strings.h" | 21 #include "grit/chromium_strings.h" |
21 #include "ui/base/l10n/l10n_util.h" | 22 #include "ui/base/l10n/l10n_util.h" |
22 | 23 |
23 using content::BrowserThread; | 24 using content::BrowserThread; |
24 | 25 |
25 namespace { | 26 namespace { |
26 | 27 |
27 #if defined(TOOLKIT_VIEWS) | 28 #if defined(TOOLKIT_VIEWS) |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
221 #endif | 222 #endif |
222 | 223 |
223 #if defined(TOOLKIT_GTK) | 224 #if defined(TOOLKIT_GTK) |
224 std::string GetWMClassFromAppName(std::string app_name) { | 225 std::string GetWMClassFromAppName(std::string app_name) { |
225 file_util::ReplaceIllegalCharactersInPath(&app_name, '_'); | 226 file_util::ReplaceIllegalCharactersInPath(&app_name, '_'); |
226 TrimString(app_name, "_", &app_name); | 227 TrimString(app_name, "_", &app_name); |
227 return app_name; | 228 return app_name; |
228 } | 229 } |
229 #endif | 230 #endif |
230 | 231 |
231 string16 GetAppShortcutsSubdirName() { | 232 string16 GetAppShortcutsSubdirName() { |
gab
2013/05/15 21:26:38
You shouldn't need this method, just use ShellUtil
calamity
2013/08/27 07:59:35
As far as I'm aware, I can't use BrowserDistributi
gab
2013/08/28 19:52:27
Ah, right, installer_util target is linked on non-
calamity
2013/09/20 05:54:52
It didn't work on linux. The installer_util target
| |
232 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel(); | 233 BrowserDistribution* dist = BrowserDistribution::GetDistribution(); |
233 if (channel == chrome::VersionInfo::CHANNEL_CANARY) | 234 return dist->GetAppShortcutsSubdirName(); |
234 return l10n_util::GetStringUTF16(IDS_APP_SHORTCUTS_SUBDIR_NAME_CANARY); | |
235 return l10n_util::GetStringUTF16(IDS_APP_SHORTCUTS_SUBDIR_NAME); | |
236 } | 235 } |
237 | 236 |
238 } // namespace web_app | 237 } // namespace web_app |
OLD | NEW |