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

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

Issue 10823437: Callback flow to register Chrome and update shortcuts after OS upgrade to Windows 8 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Reimplementing registry changes using AppCommand; adding checks in InstallationValidator. Created 8 years, 3 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #ifndef CHROME_INSTALLER_UTIL_APP_COMMAND_H_ 5 #ifndef CHROME_INSTALLER_UTIL_APP_COMMAND_H_
6 #define CHROME_INSTALLER_UTIL_APP_COMMAND_H_ 6 #define CHROME_INSTALLER_UTIL_APP_COMMAND_H_
7 7
8 #include <windows.h> 8 #include <windows.h>
9 9
10 #include <string> 10 #include <string>
11 11
12 class WorkItemList; 12 class WorkItemList;
13 13
14 namespace base { 14 namespace base {
15 namespace win { 15 namespace win {
16 class RegKey; 16 class RegKey;
17 } 17 }
18 } 18 }
19 19
20 namespace installer { 20 namespace installer {
21 21
22 // A description of a command registered by setup.exe that can be invoked by 22 // A description of a command registered by setup.exe that can be invoked by
23 // Google Update. This class is CopyConstructible and Assignable for use in 23 // Google Update. This class is CopyConstructible and Assignable for use in
24 // STL containers. 24 // STL containers.
25 class AppCommand { 25 class AppCommand {
26 public: 26 public:
27 AppCommand(); 27 AppCommand();
28 AppCommand(const std::wstring& command_line, bool send_pings, 28 AppCommand(const std::wstring& command_line, bool send_pings,
gab 2012/08/28 16:08:19 Use string16 instead of std::wstring (or presubmit
grt (UTC plus 2) 2012/08/28 19:35:40 since the command line is the only mandatory prope
huangs 2012/08/29 17:02:54 Done (std::wstring --> string16).
huangs 2012/08/29 17:02:54 Done (simplifying constructor; changed callers to
29 bool is_web_accessible, bool is_auto_run_on_os_upgrade);
gab 2012/08/28 16:08:19 Why do you need anything, but |is_auto_run_on_os_u
huangs 2012/08/29 17:02:54 Made changes suggested by grt@.
30 // Ctor for code that don't use is_auto_run_on_os_upgrade.
31 AppCommand(const std::wstring& command_line, bool send_pings,
29 bool is_web_accessible); 32 bool is_web_accessible);
30 // The implicit dtor, copy ctor and assignment operator are desired. 33 // The implicit dtor, copy ctor and assignment operator are desired.
31 34
32 // Initializes an instance from the command in |key|. 35 // Initializes an instance from the command in |key|.
33 bool Initialize(const base::win::RegKey& key); 36 bool Initialize(const base::win::RegKey& key);
34 37
35 // Adds to |item_list| work items to write this object to the key named 38 // Adds to |item_list| work items to write this object to the key named
36 // |command_path| under |predefined_root|. 39 // |command_path| under |predefined_root|.
37 void AddWorkItems(HKEY predefined_root, 40 void AddWorkItems(HKEY predefined_root,
38 const std::wstring& command_path, 41 const std::wstring& command_path,
39 WorkItemList* item_list) const; 42 WorkItemList* item_list) const;
40 43
41 // Returns the command-line for the app command as it is represented in the 44 // Returns the command-line for the app command as it is represented in the
42 // registry. Use CommandLine::FromString() on this value to check arguments 45 // registry. Use CommandLine::FromString() on this value to check arguments
43 // or to launch the command. 46 // or to launch the command.
44 const std::wstring& command_line() const { return command_line_; } 47 const std::wstring& command_line() const { return command_line_; }
45 void set_command_line(const std::wstring& command_line) { 48 void set_command_line(const std::wstring& command_line) {
46 command_line_ = command_line; 49 command_line_ = command_line;
47 } 50 }
48 51
49 bool sends_pings() const { return sends_pings_; } 52 bool sends_pings() const { return sends_pings_; }
50 void set_sends_pings(bool sends_pings) { sends_pings_ = sends_pings; } 53 void set_sends_pings(bool sends_pings) { sends_pings_ = sends_pings; }
51 54
52 bool is_web_accessible() const { return is_web_accessible_; } 55 bool is_web_accessible() const { return is_web_accessible_; }
53 void set_is_web_accessible(bool is_web_accessible) { 56 void set_is_web_accessible(bool is_web_accessible) {
54 is_web_accessible_ = is_web_accessible; 57 is_web_accessible_ = is_web_accessible;
55 } 58 }
56 59
60 bool is_auto_run_on_os_upgrade() const { return is_auto_run_on_os_upgrade_; }
61 void set_is_auto_run_on_os_upgrade(bool is_auto_run_on_os_upgrade) {
62 is_auto_run_on_os_upgrade_ = is_auto_run_on_os_upgrade;
63 }
64
57 protected: 65 protected:
58 std::wstring command_line_; 66 std::wstring command_line_;
59 bool sends_pings_; 67 bool sends_pings_;
60 bool is_web_accessible_; 68 bool is_web_accessible_;
69 bool is_auto_run_on_os_upgrade_;
61 }; 70 };
62 71
63 } // namespace installer 72 } // namespace installer
64 73
65 #endif // CHROME_INSTALLER_UTIL_APP_COMMAND_H_ 74 #endif // CHROME_INSTALLER_UTIL_APP_COMMAND_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698