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