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 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 84 // is still used to generate the app id (windows app id, not chrome app id). | 84 // is still used to generate the app id (windows app id, not chrome app id). |
| 85 std::string extension_id; | 85 std::string extension_id; |
| 86 string16 title; | 86 string16 title; |
| 87 string16 description; | 87 string16 description; |
| 88 FilePath extension_path; | 88 FilePath extension_path; |
| 89 gfx::Image favicon; | 89 gfx::Image favicon; |
| 90 FilePath profile_path; | 90 FilePath profile_path; |
| 91 | 91 |
| 92 // Shortcuts to platform apps are created differently. They start up with | 92 // Shortcuts to platform apps are created differently. They start up with |
| 93 // their own user data directory and load the app from |extension_path|. | 93 // their own user data directory and load the app from |extension_path|. |
| 94 bool is_platform_app; | 94 bool is_platform_app; |
|
benwells
2012/09/05 03:57:50
Can we delete this field from ShortcutInfo now?
| |
| 95 bool create_on_desktop; | 95 bool create_on_desktop; |
| 96 bool create_in_applications_menu; | 96 bool create_in_applications_menu; |
| 97 | 97 |
| 98 // For Windows, this refers to quick launch bar prior to Win7. In Win7, | 98 // For Windows, this refers to quick launch bar prior to Win7. In Win7, |
| 99 // this means "pin to taskbar". For Mac/Linux, this could be used for | 99 // this means "pin to taskbar". For Mac/Linux, this could be used for |
| 100 // Mac dock or the gnome/kde application launcher. However, those are not | 100 // Mac dock or the gnome/kde application launcher. However, those are not |
| 101 // implemented yet. | 101 // implemented yet. |
| 102 bool create_in_quick_launch_bar; | 102 bool create_in_quick_launch_bar; |
| 103 }; | 103 }; |
| 104 | 104 |
| 105 // Data that needs to be passed between the app launcher stub and Chrome. | 105 // Data that needs to be passed between the app launcher stub and Chrome. |
| 106 struct AppModeInfo { | 106 struct AppModeInfo { |
| 107 }; | 107 }; |
| 108 static void SetAppModeInfo(const AppModeInfo* info); | 108 static void SetAppModeInfo(const AppModeInfo* info); |
| 109 static const AppModeInfo* AppModeInfo(); | 109 static const AppModeInfo* AppModeInfo(); |
| 110 | 110 |
| 111 // Is the current instance of Chrome running in App mode. | 111 // Is the current instance of Chrome running in App mode. |
| 112 bool IsRunningInAppMode(); | 112 bool IsRunningInAppMode(); |
| 113 | 113 |
| 114 // Set up command line arguments for launching a URL or an app. | 114 // Set up command line arguments for launching a URL or an app. |
| 115 // The new command line reuses the current process's user data directory (and | 115 // The new command line reuses the current process's user data directory (and |
| 116 // login profile, for ChromeOS). | 116 // login profile, for ChromeOS). |
| 117 // If |extension_app_id| is non-empty, the arguments use kAppId=<id>. | 117 // If |extension_app_id| is non-empty, the arguments use kAppId=<id>. |
| 118 // Otherwise, kApp=<url> is used. If |is_platform_app| is true the flag | 118 // Otherwise, kApp=<url> is used. |
| 119 // --enable-platform-apps is added to the command line. | |
| 120 static CommandLine CommandLineArgsForLauncher( | 119 static CommandLine CommandLineArgsForLauncher( |
| 121 const GURL& url, | 120 const GURL& url, |
| 122 const std::string& extension_app_id, | 121 const std::string& extension_app_id, |
| 123 bool is_platform_app, | |
| 124 const FilePath& profile_path); | 122 const FilePath& profile_path); |
| 125 | 123 |
| 126 #if defined(OS_WIN) | 124 #if defined(OS_WIN) |
| 127 // Generates an application user model ID (AppUserModelId) for a given app | 125 // Generates an application user model ID (AppUserModelId) for a given app |
| 128 // name and profile path. The returned app id is in the format of | 126 // name and profile path. The returned app id is in the format of |
| 129 // "|app_name|[.<profile_id>]". "profile_id" is appended when user override | 127 // "|app_name|[.<profile_id>]". "profile_id" is appended when user override |
| 130 // the default value. | 128 // the default value. |
| 131 // Note: If the app has an installation specific suffix (e.g. on user-level | 129 // Note: If the app has an installation specific suffix (e.g. on user-level |
| 132 // Chrome installs), |app_name| should already be suffixed, this method will | 130 // Chrome installs), |app_name| should already be suffixed, this method will |
| 133 // then further suffix it with the profile id as described above. | 131 // then further suffix it with the profile id as described above. |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 296 // Set Chrome as the default handler for this protocol. | 294 // Set Chrome as the default handler for this protocol. |
| 297 virtual bool SetAsDefault(bool interactive_permitted) OVERRIDE; | 295 virtual bool SetAsDefault(bool interactive_permitted) OVERRIDE; |
| 298 | 296 |
| 299 std::string protocol_; | 297 std::string protocol_; |
| 300 | 298 |
| 301 DISALLOW_COPY_AND_ASSIGN(DefaultProtocolClientWorker); | 299 DISALLOW_COPY_AND_ASSIGN(DefaultProtocolClientWorker); |
| 302 }; | 300 }; |
| 303 }; | 301 }; |
| 304 | 302 |
| 305 #endif // CHROME_BROWSER_SHELL_INTEGRATION_H_ | 303 #endif // CHROME_BROWSER_SHELL_INTEGRATION_H_ |
| OLD | NEW |