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 15 matching lines...) Expand all Loading... |
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" | 35 #include "chrome/common/chrome_plugin_util.h" |
36 #include "gfx/codec/png_codec.h" | |
37 #include "googleurl/src/gurl.h" | 36 #include "googleurl/src/gurl.h" |
| 37 #include "ui/gfx/codec/png_codec.h" |
38 | 38 |
39 namespace { | 39 namespace { |
40 | 40 |
41 // Helper to launch xdg scripts. We don't want them to ask any questions on the | 41 // Helper to launch xdg scripts. We don't want them to ask any questions on the |
42 // terminal etc. | 42 // terminal etc. |
43 bool LaunchXdgUtility(const std::vector<std::string>& argv) { | 43 bool LaunchXdgUtility(const std::vector<std::string>& argv) { |
44 // xdg-settings internally runs xdg-mime, which uses mv to move newly-created | 44 // 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 | 45 // files on top of originals after making changes to them. In the event that |
46 // the original files are owned by another user (e.g. root, which can happen | 46 // the original files are owned by another user (e.g. root, which can happen |
47 // if they are updated within sudo), mv will prompt the user to confirm if | 47 // if they are updated within sudo), mv will prompt the user to confirm if |
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
379 std::string contents = GetDesktopFileContents( | 379 std::string contents = GetDesktopFileContents( |
380 shortcut_template, shortcut_info.url, shortcut_info.extension_id, | 380 shortcut_template, shortcut_info.url, shortcut_info.extension_id, |
381 shortcut_info.title, icon_name); | 381 shortcut_info.title, icon_name); |
382 | 382 |
383 if (shortcut_info.create_on_desktop) | 383 if (shortcut_info.create_on_desktop) |
384 CreateShortcutOnDesktop(shortcut_filename, contents); | 384 CreateShortcutOnDesktop(shortcut_filename, contents); |
385 | 385 |
386 if (shortcut_info.create_in_applications_menu) | 386 if (shortcut_info.create_in_applications_menu) |
387 CreateShortcutInApplicationsMenu(shortcut_filename, contents); | 387 CreateShortcutInApplicationsMenu(shortcut_filename, contents); |
388 } | 388 } |
OLD | NEW |