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

Side by Side Diff: win8/delegate_execute/delegate_execute_operation.h

Issue 10914160: Manually merging remaining Win8 changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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) 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 #ifndef WIN8_DELEGATE_EXECUTE_DELEGATE_EXECUTE_OPERATION_H_ 5 #ifndef WIN8_DELEGATE_EXECUTE_DELEGATE_EXECUTE_OPERATION_H_
6 #define WIN8_DELEGATE_EXECUTE_DELEGATE_EXECUTE_OPERATION_H_ 6 #define WIN8_DELEGATE_EXECUTE_DELEGATE_EXECUTE_OPERATION_H_
7 7
8 #include <atldef.h> 8 #include <atldef.h>
9 #include <windows.h>
9 10
10 #include "base/basictypes.h" 11 #include "base/basictypes.h"
11 #include "base/file_path.h" 12 #include "base/file_path.h"
13 #include "base/string16.h"
12 14
13 class CommandLine; 15 class CommandLine;
14 16
15 namespace delegate_execute { 17 namespace delegate_execute {
16 18
17 // Parses a portion of the DelegateExecute handler's command line to determine 19 // Parses a portion of the DelegateExecute handler's command line to determine
18 // the desired operation. 20 // the desired operation. The operation type is decided by looking at the
21 // command line. The operations are:
22 // DELEGATE_EXECUTE:
23 // When the delegate_execute.exe is invoked by windows when a chrome
24 // activation via the shell, possibly using ShellExecute. Control must
25 // be given to ATLs WinMain.
26 // RELAUNCH_CHROME:
27 // When the delegate_execute.exe is launched by chrome, when chrome needs
28 // to re-launch itself. The required command line parameters are:
29 // --relaunch-shortcut=<PathToShortcut>
30 // --wait-for-mutex=<MutexNamePid>
31 // The PathToShortcut must be the fully qualified file name to the chrome
32 // shortcut that has the appId and other 'metro ready' parameters.
33 // The MutexNamePid is a mutex name that also encodes the process id and
34 // must follow the format <A>.<B>.<pid> where A and B are arbitray strings
35 // (usually chrome.relaunch) and pid is the process id of chrome.
19 class DelegateExecuteOperation { 36 class DelegateExecuteOperation {
20 public: 37 public:
21 enum OperationType { 38 enum OperationType {
22 EXE_MODULE, 39 DELEGATE_EXECUTE,
23 RELAUNCH_CHROME, 40 RELAUNCH_CHROME,
24 }; 41 };
25 42
26 DelegateExecuteOperation(); 43 DelegateExecuteOperation();
27 ~DelegateExecuteOperation(); 44 ~DelegateExecuteOperation();
28 45
29 void Initialize(const CommandLine* command_line); 46 bool Init(const CommandLine* cmd_line);
30 47
31 OperationType operation_type() const { 48 OperationType operation_type() const {
32 return operation_type_; 49 return operation_type_;
33 } 50 }
34 51
35 // Returns the argument to the --relaunch-shortcut switch. Valid only when 52 const char* relaunch_flags() const {
36 // the operation is RELAUNCH_CHROME. 53 return relaunch_flags_;
37 const FilePath& relaunch_shortcut() const { 54 }
38 ATLASSERT(operation_type_ == RELAUNCH_CHROME); 55
56 const string16& mutex() const {
57 return mutex_;
58 }
59
60 // Returns the process id of the parent or 0 on failure.
61 DWORD GetParentPid() const;
62
63 const FilePath& shortcut() const {
39 return relaunch_shortcut_; 64 return relaunch_shortcut_;
40 } 65 }
41 66
42 private: 67 private:
43 void Clear(); 68 OperationType operation_type_;
69 const char* relaunch_flags_;
70 FilePath relaunch_shortcut_;
71 string16 mutex_;
44 72
45 OperationType operation_type_;
46 FilePath relaunch_shortcut_;
47 DISALLOW_COPY_AND_ASSIGN(DelegateExecuteOperation); 73 DISALLOW_COPY_AND_ASSIGN(DelegateExecuteOperation);
48 }; 74 };
49 75
50 } // namespace delegate_execute 76 } // namespace delegate_execute
51 77
52 #endif // WIN8_DELEGATE_EXECUTE_DELEGATE_EXECUTE_OPERATION_H_ 78 #endif // WIN8_DELEGATE_EXECUTE_DELEGATE_EXECUTE_OPERATION_H_
OLDNEW
« no previous file with comments | « win8/delegate_execute/delegate_execute.cc ('k') | win8/delegate_execute/delegate_execute_operation.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698