Chromium Code Reviews| 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 #ifndef CHROME_BROWSER_SHELL_INTEGRATION_H_ | 5 #ifndef CHROME_BROWSER_SHELL_INTEGRATION_H_ |
| 6 #define CHROME_BROWSER_SHELL_INTEGRATION_H_ | 6 #define CHROME_BROWSER_SHELL_INTEGRATION_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 112 | 112 |
| 113 // Set up command line arguments for launching a platform app. | 113 // Set up command line arguments for launching a platform app. |
| 114 // The command line will have the switches --app-id, --user-data-dir and | 114 // The command line will have the switches --app-id, --user-data-dir and |
| 115 // --load-extension, using values |extension_app_id|, |user_data_dir| and | 115 // --load-extension, using values |extension_app_id|, |user_data_dir| and |
| 116 // |extension_path| respectively. | 116 // |extension_path| respectively. |
| 117 static CommandLine CommandLineArgsForPlatformApp( | 117 static CommandLine CommandLineArgsForPlatformApp( |
| 118 const std::string& extension_app_id, | 118 const std::string& extension_app_id, |
| 119 const FilePath& user_data_dir, | 119 const FilePath& user_data_dir, |
| 120 const FilePath& extension_path); | 120 const FilePath& extension_path); |
| 121 | 121 |
| 122 #if defined(USE_X11) | 122 #if defined(USE_X11) |
|
sail
2012/04/12 15:06:29
could you move this to shell_integration_linux.h?
benwells
2012/04/13 01:48:48
They're part of the ShellIntegration class, not th
sail
2012/04/13 01:59:14
Sorry, I mistook which struct this was in. Regardl
benwells
2012/04/13 02:09:02
Agreed. There are currently no platform specific h
sail
2012/04/13 02:16:41
You don't have to move everything. Just create a n
benwells
2012/04/13 04:55:30
OK. I've moved just the new function. Let me know
| |
| 123 // Returns filename of the desktop shortcut used to launch the browser. | 123 // Returns filename of the desktop shortcut used to launch the browser. |
| 124 static std::string GetDesktopName(base::Environment* env); | 124 static std::string GetDesktopName(base::Environment* env); |
| 125 | 125 |
| 126 static bool GetDesktopShortcutTemplate(base::Environment* env, | 126 static bool GetDesktopShortcutTemplate(base::Environment* env, |
| 127 std::string* output); | 127 std::string* output); |
| 128 | 128 |
| 129 // Returns filename for .desktop file based on |url|, sanitized for security. | 129 // Returns filename for .desktop file based on |url|, sanitized for security. |
| 130 static FilePath GetDesktopShortcutFilename(const GURL& url); | 130 static FilePath GetDesktopShortcutFilename(const GURL& url); |
| 131 | 131 |
| 132 // Returns contents for .desktop file based on |template_contents|, |url| | 132 // Returns contents for .desktop file based on |template_contents|, |url| |
| 133 // and |title|. The |template_contents| should be contents of .desktop file | 133 // and |title|. The |template_contents| should be contents of .desktop file |
| 134 // used to launch Chrome. | 134 // used to launch Chrome. |
| 135 static std::string GetDesktopFileContents( | 135 static std::string GetDesktopFileContents( |
| 136 const std::string& template_contents, | 136 const std::string& template_contents, |
| 137 const std::string& app_name, | 137 const std::string& app_name, |
| 138 const GURL& url, | 138 const GURL& url, |
| 139 const std::string& extension_id, | 139 const std::string& extension_id, |
| 140 const bool is_platform_app, | |
| 141 const FilePath& web_app_path, | |
| 142 const FilePath& extension_path, | |
| 140 const string16& title, | 143 const string16& title, |
| 141 const std::string& icon_name); | 144 const std::string& icon_name); |
| 142 | 145 |
| 143 static void CreateDesktopShortcut(const ShortcutInfo& shortcut_info, | 146 static bool CreateDesktopShortcut(const ShortcutInfo& shortcut_info, |
| 144 const std::string& shortcut_template); | 147 const std::string& shortcut_template); |
| 148 | |
| 149 static bool CreateDesktopShortcutForChromeApp( | |
| 150 const ShortcutInfo& shortcut_info, | |
| 151 const FilePath& web_app_path, | |
| 152 const std::string& shortcut_template); | |
| 145 #endif // defined(USE_X11) | 153 #endif // defined(USE_X11) |
| 146 | 154 |
| 147 #if defined(OS_WIN) | 155 #if defined(OS_WIN) |
| 148 // Generates Win7 app id for given app name and profile path. The returned app | 156 // Generates Win7 app id for given app name and profile path. The returned app |
| 149 // id is in the format of "|app_name|[.<profile_id>]". "profile_id" is | 157 // id is in the format of "|app_name|[.<profile_id>]". "profile_id" is |
| 150 // appended when user override the default value. | 158 // appended when user override the default value. |
| 151 static string16 GetAppId(const string16& app_name, | 159 static string16 GetAppId(const string16& app_name, |
| 152 const FilePath& profile_path); | 160 const FilePath& profile_path); |
| 153 | 161 |
| 154 // Generates Win7 app id for Chromium by calling GetAppId with | 162 // Generates Win7 app id for Chromium by calling GetAppId with |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 293 // Set Chrome as the default handler for this protocol. | 301 // Set Chrome as the default handler for this protocol. |
| 294 virtual void SetAsDefault() OVERRIDE; | 302 virtual void SetAsDefault() OVERRIDE; |
| 295 | 303 |
| 296 std::string protocol_; | 304 std::string protocol_; |
| 297 | 305 |
| 298 DISALLOW_COPY_AND_ASSIGN(DefaultProtocolClientWorker); | 306 DISALLOW_COPY_AND_ASSIGN(DefaultProtocolClientWorker); |
| 299 }; | 307 }; |
| 300 }; | 308 }; |
| 301 | 309 |
| 302 #endif // CHROME_BROWSER_SHELL_INTEGRATION_H_ | 310 #endif // CHROME_BROWSER_SHELL_INTEGRATION_H_ |
| OLD | NEW |