OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <glib.h> | 8 #include <glib.h> |
9 #include <stdlib.h> | 9 #include <stdlib.h> |
10 #include <sys/stat.h> | 10 #include <sys/stat.h> |
(...skipping 20 matching lines...) Expand all Loading... |
31 #include "base/threading/thread.h" | 31 #include "base/threading/thread.h" |
32 #include "base/utf_string_conversions.h" | 32 #include "base/utf_string_conversions.h" |
33 #include "build/build_config.h" | 33 #include "build/build_config.h" |
34 #include "chrome/browser/web_applications/web_app.h" | 34 #include "chrome/browser/web_applications/web_app.h" |
35 #include "chrome/common/chrome_constants.h" | 35 #include "chrome/common/chrome_constants.h" |
36 #include "chrome/common/chrome_paths.h" | 36 #include "chrome/common/chrome_paths.h" |
37 #include "content/public/browser/browser_thread.h" | 37 #include "content/public/browser/browser_thread.h" |
38 #include "googleurl/src/gurl.h" | 38 #include "googleurl/src/gurl.h" |
39 #include "ui/gfx/codec/png_codec.h" | 39 #include "ui/gfx/codec/png_codec.h" |
40 | 40 |
| 41 using content::BrowserThread; |
| 42 |
41 namespace { | 43 namespace { |
42 | 44 |
43 // Helper to launch xdg scripts. We don't want them to ask any questions on the | 45 // Helper to launch xdg scripts. We don't want them to ask any questions on the |
44 // terminal etc. The function returns true if the utility launches and exits | 46 // terminal etc. The function returns true if the utility launches and exits |
45 // cleanly, in which case |exit_code| returns the utility's exit code. | 47 // cleanly, in which case |exit_code| returns the utility's exit code. |
46 bool LaunchXdgUtility(const std::vector<std::string>& argv, int* exit_code) { | 48 bool LaunchXdgUtility(const std::vector<std::string>& argv, int* exit_code) { |
47 // xdg-settings internally runs xdg-mime, which uses mv to move newly-created | 49 // xdg-settings internally runs xdg-mime, which uses mv to move newly-created |
48 // files on top of originals after making changes to them. In the event that | 50 // files on top of originals after making changes to them. In the event that |
49 // the original files are owned by another user (e.g. root, which can happen | 51 // the original files are owned by another user (e.g. root, which can happen |
50 // if they are updated within sudo), mv will prompt the user to confirm if | 52 // if they are updated within sudo), mv will prompt the user to confirm if |
(...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
601 shortcut_info.extension_id, | 603 shortcut_info.extension_id, |
602 shortcut_info.title, | 604 shortcut_info.title, |
603 icon_name); | 605 icon_name); |
604 | 606 |
605 if (shortcut_info.create_on_desktop) | 607 if (shortcut_info.create_on_desktop) |
606 CreateShortcutOnDesktop(shortcut_filename, contents); | 608 CreateShortcutOnDesktop(shortcut_filename, contents); |
607 | 609 |
608 if (shortcut_info.create_in_applications_menu) | 610 if (shortcut_info.create_in_applications_menu) |
609 CreateShortcutInApplicationsMenu(shortcut_filename, contents); | 611 CreateShortcutInApplicationsMenu(shortcut_filename, contents); |
610 } | 612 } |
OLD | NEW |