| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 383 if (!shortcut_info.extension_id.empty()) | 383 if (!shortcut_info.extension_id.empty()) |
| 384 return GenerateApplicationNameFromExtensionId(shortcut_info.extension_id); | 384 return GenerateApplicationNameFromExtensionId(shortcut_info.extension_id); |
| 385 else | 385 else |
| 386 return GenerateApplicationNameFromURL(shortcut_info.url); | 386 return GenerateApplicationNameFromURL(shortcut_info.url); |
| 387 } | 387 } |
| 388 | 388 |
| 389 std::string GenerateApplicationNameFromURL(const GURL& url) { | 389 std::string GenerateApplicationNameFromURL(const GURL& url) { |
| 390 std::string t; | 390 std::string t; |
| 391 t.append(url.host()); | 391 t.append(url.host()); |
| 392 t.append("_"); | 392 t.append("_"); |
| 393 t.append(url.path()); | 393 t.append(url.path().as_string()); |
| 394 return t; | 394 return t; |
| 395 } | 395 } |
| 396 | 396 |
| 397 std::string GenerateApplicationNameFromExtensionId(const std::string& id) { | 397 std::string GenerateApplicationNameFromExtensionId(const std::string& id) { |
| 398 std::string t(kCrxAppPrefix); | 398 std::string t(kCrxAppPrefix); |
| 399 t.append(id); | 399 t.append(id); |
| 400 return t; | 400 return t; |
| 401 } | 401 } |
| 402 | 402 |
| 403 std::string GetExtensionIdFromApplicationName(const std::string& app_name) { | 403 std::string GetExtensionIdFromApplicationName(const std::string& app_name) { |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 509 | 509 |
| 510 #if defined(OS_LINUX) | 510 #if defined(OS_LINUX) |
| 511 std::string GetWMClassFromAppName(std::string app_name) { | 511 std::string GetWMClassFromAppName(std::string app_name) { |
| 512 base::i18n::ReplaceIllegalCharactersInPath(&app_name, '_'); | 512 base::i18n::ReplaceIllegalCharactersInPath(&app_name, '_'); |
| 513 base::TrimString(app_name, "_", &app_name); | 513 base::TrimString(app_name, "_", &app_name); |
| 514 return app_name; | 514 return app_name; |
| 515 } | 515 } |
| 516 #endif | 516 #endif |
| 517 | 517 |
| 518 } // namespace web_app | 518 } // namespace web_app |
| OLD | NEW |