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

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') | no next file with comments »
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 VerifyShortcutStatus {
39 VERIFY_SHORTCUT_SUCCESS = 0,
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 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
405 // does not exist, this method is a no-op and returns false. 413 // does not exist, this method is a no-op and returns false.
406 static bool UpdateChromeShortcut(BrowserDistribution* dist, 414 static bool UpdateChromeShortcut(BrowserDistribution* dist,
407 const string16& chrome_exe, 415 const string16& chrome_exe,
408 const string16& shortcut, 416 const string16& shortcut,
409 const string16& arguments, 417 const string16& arguments,
410 const string16& description, 418 const string16& description,
411 const string16& icon_path, 419 const string16& icon_path,
412 int icon_index, 420 int icon_index,
413 uint32 options); 421 uint32 options);
414 422
423 // Verify that a shortcut exists with the expected information.
424 // |exe_path| The shortcut's exe.
425 // |shortcut| The path to the shortcut.
426 // |description| The shortcut's description.
427 // |icon_index| The icon's index in the exe.
428 static VerifyShortcutStatus VerifyChromeShortcut(const string16& exe_path,
429 const string16& shortcut,
430 const string16& description,
431 int icon_index);
432
415 // Sets |suffix| to the base 32 encoding of the md5 hash of this user's sid 433 // Sets |suffix| to the base 32 encoding of the md5 hash of this user's sid
416 // preceded by a dot. 434 // preceded by a dot.
417 // This is guaranteed to be unique on the machine and 27 characters long 435 // This is guaranteed to be unique on the machine and 27 characters long
418 // (including the '.'). 436 // (including the '.').
419 // This suffix is then meant to be added to all registration that may conflict 437 // This suffix is then meant to be added to all registration that may conflict
420 // with another user-level Chrome install. 438 // with another user-level Chrome install.
421 // Note that prior to Chrome 21, the suffix registered used to be the user's 439 // Note that prior to Chrome 21, the suffix registered used to be the user's
422 // username (see GetOldUserSpecificRegistrySuffix() below). We still honor old 440 // username (see GetOldUserSpecificRegistrySuffix() below). We still honor old
423 // installs registered that way, but it was wrong because some of the 441 // installs registered that way, but it was wrong because some of the
424 // characters allowed in a username are not allowed in a ProgId. 442 // characters allowed in a username are not allowed in a ProgId.
(...skipping 16 matching lines...) Expand all
441 // required by the base32 standard for inputs that aren't a multiple of 5 459 // required by the base32 standard for inputs that aren't a multiple of 5
442 // bytes. 460 // bytes.
443 static string16 ByteArrayToBase32(const uint8* bytes, size_t size); 461 static string16 ByteArrayToBase32(const uint8* bytes, size_t size);
444 462
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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698