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 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 // For example, creating a hosted app from a website. Double check that | 376 // For example, creating a hosted app from a website. Double check that |
377 // it still exists. | 377 // it still exists. |
378 Profile* profile = g_browser_process->profile_manager()->GetProfileByPath( | 378 Profile* profile = g_browser_process->profile_manager()->GetProfileByPath( |
379 shortcut_info.profile_path); | 379 shortcut_info.profile_path); |
380 if (!profile) | 380 if (!profile) |
381 return; | 381 return; |
382 | 382 |
383 extensions::ExtensionRegistry* registry = | 383 extensions::ExtensionRegistry* registry = |
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::EVERYTHING); |
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(const ShortcutLocations& locations, |
395 const ShortcutInfo& shortcut_info) { | 395 const ShortcutInfo& shortcut_info) { |
396 ScheduleCreatePlatformShortcut(SHORTCUT_CREATION_AUTOMATED, locations, | 396 ScheduleCreatePlatformShortcut(SHORTCUT_CREATION_AUTOMATED, locations, |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
469 | 469 |
470 #if defined(OS_LINUX) | 470 #if defined(OS_LINUX) |
471 std::string GetWMClassFromAppName(std::string app_name) { | 471 std::string GetWMClassFromAppName(std::string app_name) { |
472 base::i18n::ReplaceIllegalCharactersInPath(&app_name, '_'); | 472 base::i18n::ReplaceIllegalCharactersInPath(&app_name, '_'); |
473 base::TrimString(app_name, "_", &app_name); | 473 base::TrimString(app_name, "_", &app_name); |
474 return app_name; | 474 return app_name; |
475 } | 475 } |
476 #endif | 476 #endif |
477 | 477 |
478 } // namespace web_app | 478 } // namespace web_app |
OLD | NEW |