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/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
384 extensions::ExtensionRegistry::Get(profile); | 384 extensions::ExtensionRegistry::Get(profile); |
385 const extensions::Extension* extension = registry->GetExtensionById( | 385 const extensions::Extension* extension = registry->GetExtensionById( |
386 shortcut_info.extension_id, extensions::ExtensionRegistry::ENABLED); | 386 shortcut_info.extension_id, extensions::ExtensionRegistry::ENABLED); |
387 if (!extension) | 387 if (!extension) |
388 return; | 388 return; |
389 | 389 |
390 ScheduleCreatePlatformShortcut(reason, locations, shortcut_info, | 390 ScheduleCreatePlatformShortcut(reason, locations, shortcut_info, |
391 file_handlers_info); | 391 file_handlers_info); |
392 } | 392 } |
393 | 393 |
394 void CreateNonAppShortcut(const ShortcutLocations& locations, | 394 void CreateNonAppShortcut( |
395 const ShortcutInfo& shortcut_info) { | 395 ShortcutCreationReason reason, |
396 ScheduleCreatePlatformShortcut(SHORTCUT_CREATION_AUTOMATED, locations, | 396 const ShortcutLocations& locations, |
397 shortcut_info, extensions::FileHandlersInfo()); | 397 const ShortcutInfo& shortcut_info, |
| 398 const extensions::FileHandlersInfo& file_handlers_info) { |
| 399 ScheduleCreatePlatformShortcut(reason, locations, shortcut_info, |
| 400 file_handlers_info); |
398 } | 401 } |
399 | 402 |
400 void CreateShortcuts(ShortcutCreationReason reason, | 403 void CreateShortcuts(ShortcutCreationReason reason, |
401 const ShortcutLocations& locations, | 404 const ShortcutLocations& locations, |
402 Profile* profile, | 405 Profile* profile, |
403 const extensions::Extension* app) { | 406 const extensions::Extension* app) { |
404 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 407 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
405 | 408 |
406 if (!ShouldCreateShortcutFor(profile, app)) | 409 if (!ShouldCreateShortcutFor(profile, app)) |
407 return; | 410 return; |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
469 | 472 |
470 #if defined(OS_LINUX) | 473 #if defined(OS_LINUX) |
471 std::string GetWMClassFromAppName(std::string app_name) { | 474 std::string GetWMClassFromAppName(std::string app_name) { |
472 base::i18n::ReplaceIllegalCharactersInPath(&app_name, '_'); | 475 base::i18n::ReplaceIllegalCharactersInPath(&app_name, '_'); |
473 base::TrimString(app_name, "_", &app_name); | 476 base::TrimString(app_name, "_", &app_name); |
474 return app_name; | 477 return app_name; |
475 } | 478 } |
476 #endif | 479 #endif |
477 | 480 |
478 } // namespace web_app | 481 } // namespace web_app |
OLD | NEW |