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

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

Issue 320503004: Refactored the ShortcutLocations.hidden flag on linux (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed nits Created 6 years, 6 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/web_applications/web_app.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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 const ShortcutInfo& shortcut_info, 47 const ShortcutInfo& shortcut_info,
48 const extensions::FileHandlersInfo& file_handlers_info) { 48 const extensions::FileHandlersInfo& file_handlers_info) {
49 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::FILE)); 49 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::FILE));
50 50
51 scoped_ptr<base::Environment> env(base::Environment::Create()); 51 scoped_ptr<base::Environment> env(base::Environment::Create());
52 52
53 // Find out whether shortcuts are already installed. 53 // Find out whether shortcuts are already installed.
54 ShortcutLocations creation_locations = 54 ShortcutLocations creation_locations =
55 shell_integration_linux::GetExistingShortcutLocations( 55 shell_integration_linux::GetExistingShortcutLocations(
56 env.get(), shortcut_info.profile_path, shortcut_info.extension_id); 56 env.get(), shortcut_info.profile_path, shortcut_info.extension_id);
57
57 // Always create a hidden shortcut in applications if a visible one is not 58 // Always create a hidden shortcut in applications if a visible one is not
58 // being created. This allows the operating system to identify the app, but 59 // being created. This allows the operating system to identify the app, but
59 // not show it in the menu. 60 // not show it in the menu.
60 creation_locations.hidden = true; 61 if (creation_locations.applications_menu_location == APP_MENU_LOCATION_NONE)
62 creation_locations.applications_menu_location = APP_MENU_LOCATION_HIDDEN;
61 63
62 CreatePlatformShortcuts(web_app_path, 64 CreatePlatformShortcuts(web_app_path,
63 shortcut_info, 65 shortcut_info,
64 file_handlers_info, 66 file_handlers_info,
65 creation_locations, 67 creation_locations,
66 SHORTCUT_CREATION_BY_USER); 68 SHORTCUT_CREATION_AUTOMATED);
67 } 69 }
68 70
69 void DeleteAllShortcutsForProfile(const base::FilePath& profile_path) { 71 void DeleteAllShortcutsForProfile(const base::FilePath& profile_path) {
70 #if !defined(OS_CHROMEOS) 72 #if !defined(OS_CHROMEOS)
71 shell_integration_linux::DeleteAllDesktopShortcuts(profile_path); 73 shell_integration_linux::DeleteAllDesktopShortcuts(profile_path);
72 #endif 74 #endif
73 } 75 }
74 76
75 } // namespace internals 77 } // namespace internals
76 78
77 } // namespace web_app 79 } // namespace web_app
OLDNEW
« no previous file with comments | « chrome/browser/web_applications/web_app.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698