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

Side by Side Diff: chrome/browser/web_applications/web_app_linux.cc

Issue 12208085: On Linux, automatically create app shortcuts on install or update. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Work around obscure crash due to bug in glib <= 2.32. Created 7 years, 9 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
« no previous file with comments | « chrome/browser/shell_integration_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/environment.h" 7 #include "base/environment.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "chrome/browser/shell_integration_linux.h" 9 #include "chrome/browser/shell_integration_linux.h"
10 #include "content/public/browser/browser_thread.h" 10 #include "content/public/browser/browser_thread.h"
(...skipping 22 matching lines...) Expand all
33 void DeletePlatformShortcuts( 33 void DeletePlatformShortcuts(
34 const base::FilePath& web_app_path, 34 const base::FilePath& web_app_path,
35 const ShellIntegration::ShortcutInfo& shortcut_info) { 35 const ShellIntegration::ShortcutInfo& shortcut_info) {
36 ShellIntegrationLinux::DeleteDesktopShortcuts(shortcut_info.profile_path, 36 ShellIntegrationLinux::DeleteDesktopShortcuts(shortcut_info.profile_path,
37 shortcut_info.extension_id); 37 shortcut_info.extension_id);
38 } 38 }
39 39
40 void UpdatePlatformShortcuts( 40 void UpdatePlatformShortcuts(
41 const base::FilePath& web_app_path, 41 const base::FilePath& web_app_path,
42 const ShellIntegration::ShortcutInfo& shortcut_info) { 42 const ShellIntegration::ShortcutInfo& shortcut_info) {
43 // TODO(benwells): Implement this. 43 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::FILE));
44
45 scoped_ptr<base::Environment> env(base::Environment::Create());
46
47 // Find out whether shortcuts are already installed.
48 ShellIntegration::ShortcutLocations creation_locations =
49 ShellIntegrationLinux::GetExistingShortcutLocations(
50 env.get(), shortcut_info.profile_path, shortcut_info.extension_id);
51 // Always create a hidden shortcut in applications if a visible one is not
52 // being created. This allows the operating system to identify the app, but
53 // not show it in the menu.
54 creation_locations.hidden = true;
55
56 CreatePlatformShortcuts(web_app_path, shortcut_info, creation_locations);
44 } 57 }
45 58
46 } // namespace internals 59 } // namespace internals
47 60
48 } // namespace web_app 61 } // namespace web_app
OLDNEW
« no previous file with comments | « chrome/browser/shell_integration_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698