OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/web_applications/web_app.h" | 5 #include "chrome/browser/web_applications/web_app.h" |
6 | 6 |
7 #include <shlobj.h> | 7 #include <shlobj.h> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/md5.h" | 12 #include "base/md5.h" |
13 #include "base/path_service.h" | 13 #include "base/path_service.h" |
14 #include "base/stringprintf.h" | 14 #include "base/stringprintf.h" |
15 #include "base/utf_string_conversions.h" | 15 #include "base/utf_string_conversions.h" |
16 #include "base/win/shortcut.h" | 16 #include "base/win/shortcut.h" |
17 #include "base/win/windows_version.h" | 17 #include "base/win/windows_version.h" |
| 18 #include "chrome/common/chrome_paths.h" |
18 #include "chrome/common/chrome_switches.h" | 19 #include "chrome/common/chrome_switches.h" |
19 #include "content/public/browser/browser_thread.h" | 20 #include "content/public/browser/browser_thread.h" |
20 #include "ui/gfx/icon_util.h" | 21 #include "ui/gfx/icon_util.h" |
21 | 22 |
22 namespace { | 23 namespace { |
23 | 24 |
24 const FilePath::CharType kIconChecksumFileExt[] = FILE_PATH_LITERAL(".ico.md5"); | 25 const FilePath::CharType kIconChecksumFileExt[] = FILE_PATH_LITERAL(".ico.md5"); |
25 | 26 |
26 // Calculates image checksum using MD5. | 27 // Calculates image checksum using MD5. |
27 void GetImageCheckSum(const SkBitmap& image, base::MD5Digest* digest) { | 28 void GetImageCheckSum(const SkBitmap& image, base::MD5Digest* digest) { |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 std::vector<FilePath> shortcut_paths; | 75 std::vector<FilePath> shortcut_paths; |
75 | 76 |
76 // Locations to add to shortcut_paths. | 77 // Locations to add to shortcut_paths. |
77 struct { | 78 struct { |
78 const bool& use_this_location; | 79 const bool& use_this_location; |
79 int location_id; | 80 int location_id; |
80 const wchar_t* sub_dir; | 81 const wchar_t* sub_dir; |
81 } locations[] = { | 82 } locations[] = { |
82 { | 83 { |
83 shortcut_info.create_on_desktop, | 84 shortcut_info.create_on_desktop, |
84 base::DIR_USER_DESKTOP, | 85 chrome::DIR_USER_DESKTOP, |
85 NULL | 86 NULL |
86 }, { | 87 }, { |
87 shortcut_info.create_in_applications_menu, | 88 shortcut_info.create_in_applications_menu, |
88 base::DIR_START_MENU, | 89 base::DIR_START_MENU, |
89 NULL | 90 NULL |
90 }, { | 91 }, { |
91 shortcut_info.create_in_quick_launch_bar, | 92 shortcut_info.create_in_quick_launch_bar, |
92 // For Win7, create_in_quick_launch_bar means pinning to taskbar. Use | 93 // For Win7, create_in_quick_launch_bar means pinning to taskbar. Use |
93 // base::PATH_START as a flag for this case. | 94 // base::PATH_START as a flag for this case. |
94 (base::win::GetVersion() >= base::win::VERSION_WIN7) ? | 95 (base::win::GetVersion() >= base::win::VERSION_WIN7) ? |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 // they are all unpinned. | 323 // they are all unpinned. |
323 base::win::TaskbarUnpinShortcutLink(j->value().c_str()); | 324 base::win::TaskbarUnpinShortcutLink(j->value().c_str()); |
324 file_util::Delete(*j, false); | 325 file_util::Delete(*j, false); |
325 } | 326 } |
326 } | 327 } |
327 } | 328 } |
328 | 329 |
329 } // namespace internals | 330 } // namespace internals |
330 | 331 |
331 } // namespace web_app | 332 } // namespace web_app |
OLD | NEW |