Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Side by Side Diff: chrome/browser/apps/shortcut_manager.cc

Issue 13864015: Move app launcher and chrome apps shortcut strings into the installer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@migrate_app_id_fix
Patch Set: fix linux unit tests Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/apps/shortcut_manager.h" 5 #include "chrome/browser/apps/shortcut_manager.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/prefs/pref_service.h" 10 #include "base/prefs/pref_service.h"
(...skipping 23 matching lines...) Expand all
34 34
35 using extensions::Extension; 35 using extensions::Extension;
36 36
37 namespace { 37 namespace {
38 38
39 // Creates a shortcut for an application in the applications menu, if there is 39 // Creates a shortcut for an application in the applications menu, if there is
40 // not already one present. 40 // not already one present.
41 void CreateShortcutsInApplicationsMenu( 41 void CreateShortcutsInApplicationsMenu(
42 const ShellIntegration::ShortcutInfo& shortcut_info) { 42 const ShellIntegration::ShortcutInfo& shortcut_info) {
43 ShellIntegration::ShortcutLocations creation_locations; 43 ShellIntegration::ShortcutLocations creation_locations;
44 creation_locations.in_applications_menu = true; 44 creation_locations.in_applications_menu_root = true;
gab 2013/10/03 17:22:49 We don't want it in the root, right?
calamity 2013/10/14 02:24:25 Done.
45 // Create the shortcut in the Chrome Apps subdir. 45 // Create the shortcut in the Chrome Apps subdir.
46 creation_locations.applications_menu_subdir = 46 creation_locations.in_applications_menu_chrome_apps_subdir = true;
47 web_app::GetAppShortcutsSubdirName();
48 web_app::CreateShortcuts(shortcut_info, creation_locations, 47 web_app::CreateShortcuts(shortcut_info, creation_locations,
49 web_app::SHORTCUT_CREATION_AUTOMATED); 48 web_app::SHORTCUT_CREATION_AUTOMATED);
50 } 49 }
51 50
52 bool ShouldCreateShortcutFor(const extensions::Extension* extension) { 51 bool ShouldCreateShortcutFor(const extensions::Extension* extension) {
53 return extension->is_platform_app() && 52 return extension->is_platform_app() &&
54 extension->location() != extensions::Manifest::COMPONENT && 53 extension->location() != extensions::Manifest::COMPONENT &&
55 extension->ShouldDisplayInAppLauncher(); 54 extension->ShouldDisplayInAppLauncher();
56 } 55 }
57 56
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 *it->get(), profile_, base::Bind(&CreateShortcutsInApplicationsMenu)); 194 *it->get(), profile_, base::Bind(&CreateShortcutsInApplicationsMenu));
196 } 195 }
197 } 196 }
198 197
199 void AppShortcutManager::DeleteApplicationShortcuts( 198 void AppShortcutManager::DeleteApplicationShortcuts(
200 const Extension* extension) { 199 const Extension* extension) {
201 ShellIntegration::ShortcutInfo delete_info = 200 ShellIntegration::ShortcutInfo delete_info =
202 web_app::ShortcutInfoForExtensionAndProfile(extension, profile_); 201 web_app::ShortcutInfoForExtensionAndProfile(extension, profile_);
203 web_app::DeleteAllShortcuts(delete_info); 202 web_app::DeleteAllShortcuts(delete_info);
204 } 203 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chrome_browser_main_win.cc » ('j') | chrome/browser/shell_integration.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698