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 // This file declares methods that are useful for integrating Chrome in | 5 // This file declares methods that are useful for integrating Chrome in |
6 // Windows shell. These methods are all static and currently part of | 6 // Windows shell. These methods are all static and currently part of |
7 // ShellUtil class. | 7 // ShellUtil class. |
8 | 8 |
9 #ifndef CHROME_INSTALLER_UTIL_SHELL_UTIL_H_ | 9 #ifndef CHROME_INSTALLER_UTIL_SHELL_UTIL_H_ |
10 #define CHROME_INSTALLER_UTIL_SHELL_UTIL_H_ | 10 #define CHROME_INSTALLER_UTIL_SHELL_UTIL_H_ |
11 | 11 |
12 #include <windows.h> | 12 #include <windows.h> |
13 | 13 |
14 #include <map> | 14 #include <map> |
15 #include <vector> | 15 #include <vector> |
16 | 16 |
17 #include "base/basictypes.h" | 17 #include "base/basictypes.h" |
18 #include "base/files/file_path.h" | 18 #include "base/files/file_path.h" |
19 #include "base/logging.h" | 19 #include "base/logging.h" |
20 #include "base/string16.h" | 20 #include "base/string16.h" |
21 #include "chrome/installer/util/browser_distribution.h" | |
21 #include "chrome/installer/util/work_item_list.h" | 22 #include "chrome/installer/util/work_item_list.h" |
22 | 23 |
23 class BrowserDistribution; | 24 class BrowserDistribution; |
24 | 25 |
25 // This is a utility class that provides common shell integration methods | 26 // This is a utility class that provides common shell integration methods |
26 // that can be used by installer as well as Chrome. | 27 // that can be used by installer as well as Chrome. |
27 class ShellUtil { | 28 class ShellUtil { |
28 public: | 29 public: |
29 // Input to any methods that make changes to OS shell. | 30 // Input to any methods that make changes to OS shell. |
30 enum ShellChange { | 31 enum ShellChange { |
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
323 // |location| may be one of SHORTCUT_LOCATION_DESKTOP, | 324 // |location| may be one of SHORTCUT_LOCATION_DESKTOP, |
324 // SHORTCUT_LOCATION_QUICK_LAUNCH, or SHORTCUT_LOCATION_START_MENU. | 325 // SHORTCUT_LOCATION_QUICK_LAUNCH, or SHORTCUT_LOCATION_START_MENU. |
325 static bool CreateOrUpdateShortcut( | 326 static bool CreateOrUpdateShortcut( |
326 ShellUtil::ShortcutLocation location, | 327 ShellUtil::ShortcutLocation location, |
327 BrowserDistribution* dist, | 328 BrowserDistribution* dist, |
328 const ShellUtil::ShortcutProperties& properties, | 329 const ShellUtil::ShortcutProperties& properties, |
329 ShellUtil::ShortcutOperation operation); | 330 ShellUtil::ShortcutOperation operation); |
330 | 331 |
331 // Returns the string "|icon_path|,|icon_index|" (see, for example, | 332 // Returns the string "|icon_path|,|icon_index|" (see, for example, |
332 // http://msdn.microsoft.com/library/windows/desktop/dd391573.aspx). | 333 // http://msdn.microsoft.com/library/windows/desktop/dd391573.aspx). |
333 static string16 FormatIconLocation(const string16& icon_path, int icon_index); | 334 static string16 FormatIconLocation( |
gab
2013/06/18 19:50:29
I prefer to keep the old signature here; all calle
calamity
2013/06/27 01:27:44
Done.
| |
335 const string16& icon_path, | |
336 BrowserDistribution::ShortcutEnum shortcut_enum); | |
gab
2013/06/18 19:50:29
All callers have a BrowserDistribution already, pa
| |
334 | 337 |
335 // This method returns the command to open URLs/files using chrome. Typically | 338 // This method returns the command to open URLs/files using chrome. Typically |
336 // this command is written to the registry under shell\open\command key. | 339 // this command is written to the registry under shell\open\command key. |
337 // |chrome_exe|: the full path to chrome.exe | 340 // |chrome_exe|: the full path to chrome.exe |
338 static string16 GetChromeShellOpenCmd(const string16& chrome_exe); | 341 static string16 GetChromeShellOpenCmd(const string16& chrome_exe); |
339 | 342 |
340 // This method returns the command to be called by the DelegateExecute verb | 343 // This method returns the command to be called by the DelegateExecute verb |
341 // handler to launch chrome on Windows 8. Typically this command is written to | 344 // handler to launch chrome on Windows 8. Typically this command is written to |
342 // the registry under the HKCR\Chrome\.exe\shell\(open|run)\command key. | 345 // the registry under the HKCR\Chrome\.exe\shell\(open|run)\command key. |
343 // |chrome_exe|: the full path to chrome.exe | 346 // |chrome_exe|: the full path to chrome.exe |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
565 // required by the base32 standard for inputs that aren't a multiple of 5 | 568 // required by the base32 standard for inputs that aren't a multiple of 5 |
566 // bytes. | 569 // bytes. |
567 static string16 ByteArrayToBase32(const uint8* bytes, size_t size); | 570 static string16 ByteArrayToBase32(const uint8* bytes, size_t size); |
568 | 571 |
569 private: | 572 private: |
570 DISALLOW_COPY_AND_ASSIGN(ShellUtil); | 573 DISALLOW_COPY_AND_ASSIGN(ShellUtil); |
571 }; | 574 }; |
572 | 575 |
573 | 576 |
574 #endif // CHROME_INSTALLER_UTIL_SHELL_UTIL_H_ | 577 #endif // CHROME_INSTALLER_UTIL_SHELL_UTIL_H_ |
OLD | NEW |