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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 static const char kCrxAppPrefix[] = "_crx_"; | 134 static const char kCrxAppPrefix[] = "_crx_"; |
135 | 135 |
136 namespace internals { | 136 namespace internals { |
137 | 137 |
138 base::FilePath GetSanitizedFileName(const base::string16& name) { | 138 base::FilePath GetSanitizedFileName(const base::string16& name) { |
139 #if defined(OS_WIN) | 139 #if defined(OS_WIN) |
140 base::string16 file_name = name; | 140 base::string16 file_name = name; |
141 #else | 141 #else |
142 std::string file_name = base::UTF16ToUTF8(name); | 142 std::string file_name = base::UTF16ToUTF8(name); |
143 #endif | 143 #endif |
144 file_util::ReplaceIllegalCharactersInPath(&file_name, '_'); | 144 base::i18n::ReplaceIllegalCharactersInPath(&file_name, '_'); |
145 return base::FilePath(file_name); | 145 return base::FilePath(file_name); |
146 } | 146 } |
147 | 147 |
148 } // namespace internals | 148 } // namespace internals |
149 | 149 |
150 ShortcutInfo::ShortcutInfo() | 150 ShortcutInfo::ShortcutInfo() |
151 : is_platform_app(false) { | 151 : is_platform_app(false) { |
152 } | 152 } |
153 | 153 |
154 ShortcutInfo::~ShortcutInfo() {} | 154 ShortcutInfo::~ShortcutInfo() {} |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
419 icons->push_back(app_info.icons[i]); | 419 icons->push_back(app_info.icons[i]); |
420 } | 420 } |
421 } | 421 } |
422 | 422 |
423 std::sort(icons->begin(), icons->end(), &IconPrecedes); | 423 std::sort(icons->begin(), icons->end(), &IconPrecedes); |
424 } | 424 } |
425 #endif | 425 #endif |
426 | 426 |
427 #if defined(OS_LINUX) | 427 #if defined(OS_LINUX) |
428 std::string GetWMClassFromAppName(std::string app_name) { | 428 std::string GetWMClassFromAppName(std::string app_name) { |
429 file_util::ReplaceIllegalCharactersInPath(&app_name, '_'); | 429 base::i18n::ReplaceIllegalCharactersInPath(&app_name, '_'); |
430 base::TrimString(app_name, "_", &app_name); | 430 base::TrimString(app_name, "_", &app_name); |
431 return app_name; | 431 return app_name; |
432 } | 432 } |
433 #endif | 433 #endif |
434 | 434 |
435 } // namespace web_app | 435 } // namespace web_app |
OLD | NEW |