OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/ref_counted.h" | 12 #include "base/ref_counted.h" |
13 #include "base/string16.h" | 13 #include "base/string16.h" |
14 #include "googleurl/src/gurl.h" | 14 #include "googleurl/src/gurl.h" |
15 #include "third_party/skia/include/core/SkBitmap.h" | 15 #include "third_party/skia/include/core/SkBitmap.h" |
16 | 16 |
17 class FilePath; | 17 class FilePath; |
18 | 18 |
19 #if defined(USE_X11) | 19 #if defined(USE_X11) |
20 namespace base { | 20 namespace base { |
21 class EnvVarGetter; | 21 class Environment; |
22 } | 22 } |
23 #endif | 23 #endif |
24 | 24 |
25 class ShellIntegration { | 25 class ShellIntegration { |
26 public: | 26 public: |
27 // Sets Chrome as default browser (only for current user). Returns false if | 27 // Sets Chrome as default browser (only for current user). Returns false if |
28 // this operation fails. | 28 // this operation fails. |
29 static bool SetAsDefaultBrowser(); | 29 static bool SetAsDefaultBrowser(); |
30 | 30 |
31 // On Linux, it may not be possible to determine or set the default browser | 31 // On Linux, it may not be possible to determine or set the default browser |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 // Re-implementation of chrome_plugin_utill::CPB_GetCommandLineArgumentsCommon | 71 // Re-implementation of chrome_plugin_utill::CPB_GetCommandLineArgumentsCommon |
72 // which is deprecated. If |extension_app_id| is non-empty, an arguments | 72 // which is deprecated. If |extension_app_id| is non-empty, an arguments |
73 // string is created using the kAppId=<id> flag. Otherwise, the kApp=<url> is | 73 // string is created using the kAppId=<id> flag. Otherwise, the kApp=<url> is |
74 // used. | 74 // used. |
75 // FIXME This function is dangerous, do not use! You cannot treat | 75 // FIXME This function is dangerous, do not use! You cannot treat |
76 // command lines as plain strings as there are metacharacters. | 76 // command lines as plain strings as there are metacharacters. |
77 static std::string GetCommandLineArgumentsCommon(const GURL& url, | 77 static std::string GetCommandLineArgumentsCommon(const GURL& url, |
78 const string16& extension_app_id); | 78 const string16& extension_app_id); |
79 | 79 |
80 #if defined(USE_X11) | 80 #if defined(USE_X11) |
81 static bool GetDesktopShortcutTemplate(base::EnvVarGetter* env_getter, | 81 static bool GetDesktopShortcutTemplate(base::Environment* env, |
82 std::string* output); | 82 std::string* output); |
83 | 83 |
84 // Returns filename for .desktop file based on |url|, sanitized for security. | 84 // Returns filename for .desktop file based on |url|, sanitized for security. |
85 static FilePath GetDesktopShortcutFilename(const GURL& url); | 85 static FilePath GetDesktopShortcutFilename(const GURL& url); |
86 | 86 |
87 // Returns contents for .desktop file based on |template_contents|, |url| | 87 // Returns contents for .desktop file based on |template_contents|, |url| |
88 // and |title|. The |template_contents| should be contents of .desktop file | 88 // and |title|. The |template_contents| should be contents of .desktop file |
89 // used to launch Chrome. | 89 // used to launch Chrome. |
90 static std::string GetDesktopFileContents( | 90 static std::string GetDesktopFileContents( |
91 const std::string& template_contents, const GURL& url, | 91 const std::string& template_contents, const GURL& url, |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 // state. | 168 // state. |
169 void UpdateUI(DefaultBrowserState state); | 169 void UpdateUI(DefaultBrowserState state); |
170 | 170 |
171 DefaultBrowserObserver* observer_; | 171 DefaultBrowserObserver* observer_; |
172 | 172 |
173 DISALLOW_COPY_AND_ASSIGN(DefaultBrowserWorker); | 173 DISALLOW_COPY_AND_ASSIGN(DefaultBrowserWorker); |
174 }; | 174 }; |
175 }; | 175 }; |
176 | 176 |
177 #endif // CHROME_BROWSER_SHELL_INTEGRATION_H_ | 177 #endif // CHROME_BROWSER_SHELL_INTEGRATION_H_ |
OLD | NEW |