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 #include "chrome/browser/shell_integration.h" | 5 #include "chrome/browser/shell_integration.h" |
6 | 6 |
7 #include <fcntl.h> | 7 #include <fcntl.h> |
8 #include <stdlib.h> | 8 #include <stdlib.h> |
9 #include <sys/stat.h> | 9 #include <sys/stat.h> |
10 #include <sys/types.h> | 10 #include <sys/types.h> |
(...skipping 14 matching lines...) Expand all Loading... |
25 #include "base/scoped_temp_dir.h" | 25 #include "base/scoped_temp_dir.h" |
26 #include "base/string_number_conversions.h" | 26 #include "base/string_number_conversions.h" |
27 #include "base/string_tokenizer.h" | 27 #include "base/string_tokenizer.h" |
28 #include "base/string_util.h" | 28 #include "base/string_util.h" |
29 #include "base/task.h" | 29 #include "base/task.h" |
30 #include "base/threading/thread.h" | 30 #include "base/threading/thread.h" |
31 #include "base/utf_string_conversions.h" | 31 #include "base/utf_string_conversions.h" |
32 #include "chrome/browser/browser_thread.h" | 32 #include "chrome/browser/browser_thread.h" |
33 #include "chrome/common/chrome_constants.h" | 33 #include "chrome/common/chrome_constants.h" |
34 #include "chrome/common/chrome_paths.h" | 34 #include "chrome/common/chrome_paths.h" |
35 #include "chrome/common/chrome_plugin_util.h" | |
36 #include "googleurl/src/gurl.h" | 35 #include "googleurl/src/gurl.h" |
37 #include "ui/gfx/codec/png_codec.h" | 36 #include "ui/gfx/codec/png_codec.h" |
38 | 37 |
39 namespace { | 38 namespace { |
40 | 39 |
41 // Helper to launch xdg scripts. We don't want them to ask any questions on the | 40 // Helper to launch xdg scripts. We don't want them to ask any questions on the |
42 // terminal etc. | 41 // terminal etc. |
43 bool LaunchXdgUtility(const std::vector<std::string>& argv) { | 42 bool LaunchXdgUtility(const std::vector<std::string>& argv) { |
44 // xdg-settings internally runs xdg-mime, which uses mv to move newly-created | 43 // xdg-settings internally runs xdg-mime, which uses mv to move newly-created |
45 // files on top of originals after making changes to them. In the event that | 44 // files on top of originals after making changes to them. In the event that |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
379 std::string contents = GetDesktopFileContents( | 378 std::string contents = GetDesktopFileContents( |
380 shortcut_template, shortcut_info.url, shortcut_info.extension_id, | 379 shortcut_template, shortcut_info.url, shortcut_info.extension_id, |
381 shortcut_info.title, icon_name); | 380 shortcut_info.title, icon_name); |
382 | 381 |
383 if (shortcut_info.create_on_desktop) | 382 if (shortcut_info.create_on_desktop) |
384 CreateShortcutOnDesktop(shortcut_filename, contents); | 383 CreateShortcutOnDesktop(shortcut_filename, contents); |
385 | 384 |
386 if (shortcut_info.create_in_applications_menu) | 385 if (shortcut_info.create_in_applications_menu) |
387 CreateShortcutInApplicationsMenu(shortcut_filename, contents); | 386 CreateShortcutInApplicationsMenu(shortcut_filename, contents); |
388 } | 387 } |
OLD | NEW |