blob: e1c9fbada708fcb08e11b8e72e1b81c0feb4cd70 [file] [log] [blame]
[email protected]8806d3b2012-04-13 06:46:341// 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
3// found in the LICENSE file.
4
5#ifndef CHROME_BROWSER_SHELL_INTEGRATION_LINUX_H_
6#define CHROME_BROWSER_SHELL_INTEGRATION_LINUX_H_
[email protected]8806d3b2012-04-13 06:46:347
8#include <string>
9
10#include "base/basictypes.h"
11#include "base/file_path.h"
12#include "chrome/browser/shell_integration.h"
[email protected]98566d7a2012-04-17 00:28:5613#include "googleurl/src/gurl.h"
14
15namespace base {
16class Environment;
17}
[email protected]8806d3b2012-04-13 06:46:3418
19namespace ShellIntegrationLinux {
20
[email protected]98566d7a2012-04-17 00:28:5621// Returns filename of the desktop shortcut used to launch the browser.
22std::string GetDesktopName(base::Environment* env);
23
24bool GetDesktopShortcutTemplate(base::Environment* env,
25 std::string* output);
26
27// Returns filename for .desktop file based on |url|, sanitized for security.
[email protected]0b7df36d2012-07-11 09:50:4728FilePath GetWebShortcutFilename(const GURL& url);
29
30// Returns filename for .desktop file based on |profile_path| and
31// |extension_id|, sanitized for security.
32FilePath GetExtensionShortcutFilename(const FilePath& profile_path,
33 const std::string& extension_id);
[email protected]98566d7a2012-04-17 00:28:5634
35// Returns contents for .desktop file based on |template_contents|, |url|
36// and |title|. The |template_contents| should be contents of .desktop file
37// used to launch Chrome.
38std::string GetDesktopFileContents(const std::string& template_contents,
39 const std::string& app_name,
40 const GURL& url,
41 const std::string& extension_id,
[email protected]98566d7a2012-04-17 00:28:5642 const FilePath& extension_path,
43 const string16& title,
[email protected]5951c852012-06-20 00:12:5344 const std::string& icon_name,
45 const FilePath& profile_path);
[email protected]98566d7a2012-04-17 00:28:5646
[email protected]0b7df36d2012-07-11 09:50:4747
48// Create shortcuts on the desktop or in the application menu (as specified by
49// |shortcut_info|), for the web page or extension in |shortcut_info|. Use the
50// shortcut template contained in |shortcut_template|.
51// For extensions, duplicate shortcuts are avoided, so if a requested shortcut
52// already exists it is deleted first.
[email protected]98566d7a2012-04-17 00:28:5653bool CreateDesktopShortcut(const ShellIntegration::ShortcutInfo& shortcut_info,
54 const std::string& shortcut_template);
55
[email protected]0b7df36d2012-07-11 09:50:4756// Delete any desktop shortcuts on desktop or in the application menu that have
57// been added for the extension with |extension_id| in |profile_path|.
58void DeleteDesktopShortcuts(const FilePath& profile_path,
59 const std::string& extension_id);
60
[email protected]8806d3b2012-04-13 06:46:3461} // namespace ShellIntegrationLinux
62
63#endif // CHROME_BROWSER_SHELL_INTEGRATION_LINUX_H_