| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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" |
| 11 #include "base/ref_counted.h" | 11 #include "base/ref_counted.h" |
| 12 #include "base/string16.h" | 12 #include "base/string16.h" |
| 13 #include "googleurl/src/gurl.h" | 13 #include "googleurl/src/gurl.h" |
| 14 | 14 |
| 15 #if defined(OS_LINUX) |
| 16 #include "third_party/skia/include/core/SkBitmap.h" |
| 17 #endif |
| 18 |
| 15 class FilePath; | 19 class FilePath; |
| 16 class MessageLoop; | 20 class MessageLoop; |
| 17 | 21 |
| 18 class ShellIntegration { | 22 class ShellIntegration { |
| 19 public: | 23 public: |
| 20 // Sets Chrome as default browser (only for current user). Returns false if | 24 // Sets Chrome as default browser (only for current user). Returns false if |
| 21 // this operation fails. | 25 // this operation fails. |
| 22 static bool SetAsDefaultBrowser(); | 26 static bool SetAsDefaultBrowser(); |
| 23 | 27 |
| 24 // On Linux, it may not be possible to determine or set the default browser | 28 // On Linux, it may not be possible to determine or set the default browser |
| (...skipping 18 matching lines...) Expand all Loading... |
| 43 | 47 |
| 44 #if defined(OS_LINUX) | 48 #if defined(OS_LINUX) |
| 45 // Returns filename for .desktop file based on |url|, sanitized for security. | 49 // Returns filename for .desktop file based on |url|, sanitized for security. |
| 46 static FilePath GetDesktopShortcutFilename(const GURL& url); | 50 static FilePath GetDesktopShortcutFilename(const GURL& url); |
| 47 | 51 |
| 48 // Returns contents for .desktop file based on |template_contents|, |url| | 52 // Returns contents for .desktop file based on |template_contents|, |url| |
| 49 // and |title|. The |template_contents| should be contents of .desktop file | 53 // and |title|. The |template_contents| should be contents of .desktop file |
| 50 // used to launch Chrome. | 54 // used to launch Chrome. |
| 51 static std::string GetDesktopFileContents( | 55 static std::string GetDesktopFileContents( |
| 52 const std::string& template_contents, const GURL& url, | 56 const std::string& template_contents, const GURL& url, |
| 53 const string16& title); | 57 const string16& title, const std::string& icon_name); |
| 54 | 58 |
| 55 struct ShortcutInfo { | 59 struct ShortcutInfo { |
| 56 GURL url; | 60 GURL url; |
| 57 string16 title; | 61 string16 title; |
| 62 SkBitmap favicon; |
| 58 | 63 |
| 59 bool create_on_desktop; | 64 bool create_on_desktop; |
| 60 bool create_in_applications_menu; | 65 bool create_in_applications_menu; |
| 61 }; | 66 }; |
| 62 | 67 |
| 63 // Creates a desktop shortcut. It is not guaranteed to exist immediately after | 68 // Creates a desktop shortcut. It is not guaranteed to exist immediately after |
| 64 // returning from this function, because actual file operation is done on the | 69 // returning from this function, because actual file operation is done on the |
| 65 // file thread. | 70 // file thread. |
| 66 static void CreateDesktopShortcut(const ShortcutInfo& shortcut_info); | 71 static void CreateDesktopShortcut(const ShortcutInfo& shortcut_info); |
| 67 #endif // defined(OS_LINUX) | 72 #endif // defined(OS_LINUX) |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 DefaultBrowserObserver* observer_; | 127 DefaultBrowserObserver* observer_; |
| 123 | 128 |
| 124 MessageLoop* ui_loop_; | 129 MessageLoop* ui_loop_; |
| 125 MessageLoop* file_loop_; | 130 MessageLoop* file_loop_; |
| 126 | 131 |
| 127 DISALLOW_COPY_AND_ASSIGN(DefaultBrowserWorker); | 132 DISALLOW_COPY_AND_ASSIGN(DefaultBrowserWorker); |
| 128 }; | 133 }; |
| 129 }; | 134 }; |
| 130 | 135 |
| 131 #endif // CHROME_BROWSER_SHELL_INTEGRATION_H__ | 136 #endif // CHROME_BROWSER_SHELL_INTEGRATION_H__ |
| OLD | NEW |