| 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 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 430 const extensions::Extension* extension = registry->GetExtensionById( | 430 const extensions::Extension* extension = registry->GetExtensionById( |
| 431 shortcut_info->extension_id, extensions::ExtensionRegistry::EVERYTHING); | 431 shortcut_info->extension_id, extensions::ExtensionRegistry::EVERYTHING); |
| 432 if (!extension) | 432 if (!extension) |
| 433 return; | 433 return; |
| 434 } | 434 } |
| 435 | 435 |
| 436 ScheduleCreatePlatformShortcut(reason, locations, std::move(shortcut_info), | 436 ScheduleCreatePlatformShortcut(reason, locations, std::move(shortcut_info), |
| 437 file_handlers_info); | 437 file_handlers_info); |
| 438 } | 438 } |
| 439 | 439 |
| 440 void CreateNonAppShortcut(const ShortcutLocations& locations, | |
| 441 std::unique_ptr<ShortcutInfo> shortcut_info) { | |
| 442 ScheduleCreatePlatformShortcut(SHORTCUT_CREATION_AUTOMATED, locations, | |
| 443 std::move(shortcut_info), | |
| 444 extensions::FileHandlersInfo()); | |
| 445 } | |
| 446 | |
| 447 void CreateShortcuts(ShortcutCreationReason reason, | 440 void CreateShortcuts(ShortcutCreationReason reason, |
| 448 const ShortcutLocations& locations, | 441 const ShortcutLocations& locations, |
| 449 Profile* profile, | 442 Profile* profile, |
| 450 const extensions::Extension* app) { | 443 const extensions::Extension* app) { |
| 451 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 444 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 452 | 445 |
| 453 if (!ShouldCreateShortcutFor(reason, profile, app)) | 446 if (!ShouldCreateShortcutFor(reason, profile, app)) |
| 454 return; | 447 return; |
| 455 | 448 |
| 456 GetInfoForApp( | 449 GetInfoForApp( |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 516 | 509 |
| 517 #if defined(OS_LINUX) | 510 #if defined(OS_LINUX) |
| 518 std::string GetWMClassFromAppName(std::string app_name) { | 511 std::string GetWMClassFromAppName(std::string app_name) { |
| 519 base::i18n::ReplaceIllegalCharactersInPath(&app_name, '_'); | 512 base::i18n::ReplaceIllegalCharactersInPath(&app_name, '_'); |
| 520 base::TrimString(app_name, "_", &app_name); | 513 base::TrimString(app_name, "_", &app_name); |
| 521 return app_name; | 514 return app_name; |
| 522 } | 515 } |
| 523 #endif | 516 #endif |
| 524 | 517 |
| 525 } // namespace web_app | 518 } // namespace web_app |
| OLD | NEW |