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

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,
41 VERIFY_SHORTCUT_FAILURE_CREATE_SHELL_LINK_INSTANCE,
42 VERIFY_SHORTCUT_FAILURE_QUERY_FROM_PERSIST,
43 VERIFY_SHORTCUT_FAILURE_LOAD_FROM_PERSIST,
44 VERIFY_SHORTCUT_FAILURE_GET_PATH_NAMES
45 };
46
38 // Relative path of the URL Protocol registry entry (prefixed with '\'). 47 // Relative path of the URL Protocol registry entry (prefixed with '\').
39 static const wchar_t* kRegURLProtocol; 48 static const wchar_t* kRegURLProtocol;
40 49
41 // Relative path of DefaultIcon registry entry (prefixed with '\'). 50 // Relative path of DefaultIcon registry entry (prefixed with '\').
42 static const wchar_t* kRegDefaultIcon; 51 static const wchar_t* kRegDefaultIcon;
43 52
44 // Relative path of "shell" registry key. 53 // Relative path of "shell" registry key.
45 static const wchar_t* kRegShellPath; 54 static const wchar_t* kRegShellPath;
46 55
47 // Relative path of shell open command in Windows registry 56 // 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(). 444 // should call GetCurrentInstallationSuffix().
436 static bool GetOldUserSpecificRegistrySuffix(string16* suffix); 445 static bool GetOldUserSpecificRegistrySuffix(string16* suffix);
437 446
438 // Returns the base32 encoding (using the [A-Z2-7] alphabet) of |bytes|. 447 // Returns the base32 encoding (using the [A-Z2-7] alphabet) of |bytes|.
439 // |size| is the length of |bytes|. 448 // |size| is the length of |bytes|.
440 // Note: This method does not suffix the output with '=' signs as technically 449 // 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 450 // required by the base32 standard for inputs that aren't a multiple of 5
442 // bytes. 451 // bytes.
443 static string16 ByteArrayToBase32(const uint8* bytes, size_t size); 452 static string16 ByteArrayToBase32(const uint8* bytes, size_t size);
444 453
454 // Verify that a shortcut exists with the expected information.
455 // |exe_path| The shortcut's exe.
456 // |shortcut| The path to shortcut.
457 // |description| The shortcut's description.
458 // |icon_index| The icon's index in the exe.
459 static VerifyShortcuts VerifyChromeShortcut(const string16& exe_path,
gab 2012/08/08 20:41:14 Also move this to align it with its new position i
gab 2012/08/09 02:52:32 Ping.
Halli 2012/08/09 16:07:57 Done.
460 const string16& shortcut,
461 const string16& description,
462 int icon_index);
445 private: 463 private:
446 DISALLOW_COPY_AND_ASSIGN(ShellUtil); 464 DISALLOW_COPY_AND_ASSIGN(ShellUtil);
447 }; 465 };
448 466
449 467
450 #endif // CHROME_INSTALLER_UTIL_SHELL_UTIL_H_ 468 #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