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/base_paths.h" |
9 #include "base/command_line.h" | 10 #include "base/command_line.h" |
10 #include "base/file_util.h" | 11 #include "base/file_util.h" |
11 #include "base/logging.h" | 12 #include "base/logging.h" |
12 #include "base/md5.h" | 13 #include "base/md5.h" |
13 #include "base/path_service.h" | 14 #include "base/path_service.h" |
14 #include "base/stringprintf.h" | 15 #include "base/stringprintf.h" |
15 #include "base/utf_string_conversions.h" | 16 #include "base/utf_string_conversions.h" |
16 #include "base/win/shortcut.h" | 17 #include "base/win/shortcut.h" |
17 #include "base/win/windows_version.h" | 18 #include "base/win/windows_version.h" |
18 #include "chrome/common/chrome_paths.h" | |
19 #include "chrome/common/chrome_switches.h" | 19 #include "chrome/common/chrome_switches.h" |
20 #include "content/public/browser/browser_thread.h" | 20 #include "content/public/browser/browser_thread.h" |
21 #include "ui/gfx/icon_util.h" | 21 #include "ui/gfx/icon_util.h" |
22 | 22 |
23 namespace { | 23 namespace { |
24 | 24 |
25 const FilePath::CharType kIconChecksumFileExt[] = FILE_PATH_LITERAL(".ico.md5"); | 25 const FilePath::CharType kIconChecksumFileExt[] = FILE_PATH_LITERAL(".ico.md5"); |
26 | 26 |
27 // Calculates image checksum using MD5. | 27 // Calculates image checksum using MD5. |
28 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... |
75 std::vector<FilePath> shortcut_paths; | 75 std::vector<FilePath> shortcut_paths; |
76 | 76 |
77 // Locations to add to shortcut_paths. | 77 // Locations to add to shortcut_paths. |
78 struct { | 78 struct { |
79 const bool& use_this_location; | 79 const bool& use_this_location; |
80 int location_id; | 80 int location_id; |
81 const wchar_t* sub_dir; | 81 const wchar_t* sub_dir; |
82 } locations[] = { | 82 } locations[] = { |
83 { | 83 { |
84 shortcut_info.create_on_desktop, | 84 shortcut_info.create_on_desktop, |
85 chrome::DIR_USER_DESKTOP, | 85 base::DIR_USER_DESKTOP, |
86 NULL | 86 NULL |
87 }, { | 87 }, { |
88 shortcut_info.create_in_applications_menu, | 88 shortcut_info.create_in_applications_menu, |
89 base::DIR_START_MENU, | 89 base::DIR_START_MENU, |
90 NULL | 90 NULL |
91 }, { | 91 }, { |
92 shortcut_info.create_in_quick_launch_bar, | 92 shortcut_info.create_in_quick_launch_bar, |
93 // 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 |
94 // base::PATH_START as a flag for this case. | 94 // base::PATH_START as a flag for this case. |
95 (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... |
323 // they are all unpinned. | 323 // they are all unpinned. |
324 base::win::TaskbarUnpinShortcutLink(j->value().c_str()); | 324 base::win::TaskbarUnpinShortcutLink(j->value().c_str()); |
325 file_util::Delete(*j, false); | 325 file_util::Delete(*j, false); |
326 } | 326 } |
327 } | 327 } |
328 } | 328 } |
329 | 329 |
330 } // namespace internals | 330 } // namespace internals |
331 | 331 |
332 } // namespace web_app | 332 } // namespace web_app |
OLD | NEW |