Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(580)

Side by Side Diff: chrome/installer/util/shell_util.h

Issue 10826188: Sharing shell_util_unittest code to verify shortcuts (Closed) Base URL: https://src.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/installer/util/shell_util.cc » ('j') | chrome/installer/util/shell_util.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_
(...skipping 17 matching lines...) Expand all
28 // This is a utility class that provides common shell integration methods 28 // This is a utility class that provides common shell integration methods
29 // that can be used by installer as well as Chrome. 29 // that can be used by installer as well as Chrome.
30 class ShellUtil { 30 class ShellUtil {
31 public: 31 public:
32 // Input to any methods that make changes to OS shell. 32 // Input to any methods that make changes to OS shell.
33 enum ShellChange { 33 enum ShellChange {
34 CURRENT_USER = 0x1, // Make any shell changes only at the user level 34 CURRENT_USER = 0x1, // Make any shell changes only at the user level
35 SYSTEM_LEVEL = 0x2 // Make any shell changes only at the system level 35 SYSTEM_LEVEL = 0x2 // Make any shell changes only at the system level
36 }; 36 };
37 37
38 enum VerifyShortcuts {
39 VERIFY_SHORTCUT_SUCCESS,
40 VERIFY_SHORTCUT_FAILURE_UNEXPECTED,
41 VERIFY_SHORTCUT_FAILURE_PATH,
42 VERIFY_SHORTCUT_FAILURE_DESCRIPTION,
43 VERIFY_SHORTCUT_FAILURE_ICON_INDEX
44 };
45
38 // Relative path of the URL Protocol registry entry (prefixed with '\'). 46 // Relative path of the URL Protocol registry entry (prefixed with '\').
39 static const wchar_t* kRegURLProtocol; 47 static const wchar_t* kRegURLProtocol;
40 48
41 // Relative path of DefaultIcon registry entry (prefixed with '\'). 49 // Relative path of DefaultIcon registry entry (prefixed with '\').
42 static const wchar_t* kRegDefaultIcon; 50 static const wchar_t* kRegDefaultIcon;
43 51
44 // Relative path of "shell" registry key. 52 // Relative path of "shell" registry key.
45 static const wchar_t* kRegShellPath; 53 static const wchar_t* kRegShellPath;
46 54
47 // Relative path of shell open command in Windows registry 55 // Relative path of shell open command in Windows registry
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 // should call GetCurrentInstallationSuffix(). 443 // should call GetCurrentInstallationSuffix().
436 static bool GetOldUserSpecificRegistrySuffix(string16* suffix); 444 static bool GetOldUserSpecificRegistrySuffix(string16* suffix);
437 445
438 // Returns the base32 encoding (using the [A-Z2-7] alphabet) of |bytes|. 446 // Returns the base32 encoding (using the [A-Z2-7] alphabet) of |bytes|.
439 // |size| is the length of |bytes|. 447 // |size| is the length of |bytes|.
440 // Note: This method does not suffix the output with '=' signs as technically 448 // Note: This method does not suffix the output with '=' signs as technically
441 // required by the base32 standard for inputs that aren't a multiple of 5 449 // required by the base32 standard for inputs that aren't a multiple of 5
442 // bytes. 450 // bytes.
443 static string16 ByteArrayToBase32(const uint8* bytes, size_t size); 451 static string16 ByteArrayToBase32(const uint8* bytes, size_t size);
444 452
453 // Verify that a shortcut exists with the expected information.
454 // |exe_path| The shortcut's exe.
455 // |shortcut| The path to shortcut.
456 // |description| The shortcut's description.
457 // |icon_index| The icon's index in the exe.
458 static VerifyShortcuts VerifyChromeShortcut(const string16& exe_path,
459 const string16& shortcut,
460 const string16& description,
461 int icon_index);
445 private: 462 private:
446 DISALLOW_COPY_AND_ASSIGN(ShellUtil); 463 DISALLOW_COPY_AND_ASSIGN(ShellUtil);
447 }; 464 };
448 465
449 466
450 #endif // CHROME_INSTALLER_UTIL_SHELL_UTIL_H_ 467 #endif // CHROME_INSTALLER_UTIL_SHELL_UTIL_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/installer/util/shell_util.cc » ('j') | chrome/installer/util/shell_util.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698