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

Unified Diff: win8/delegate_execute/delegate_execute_operation.cc

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « win8/delegate_execute/delegate_execute_operation.h ('k') | win8/metro_driver/chrome_app_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: win8/delegate_execute/delegate_execute_operation.cc
diff --git a/win8/delegate_execute/delegate_execute_operation.cc b/win8/delegate_execute/delegate_execute_operation.cc
index e6823f06b5bf95c504b1399178cff880def34b9a..f2ba2c47ac101a103b3dea4c1f7859625e54c732 100644
--- a/win8/delegate_execute/delegate_execute_operation.cc
+++ b/win8/delegate_execute/delegate_execute_operation.cc
@@ -5,33 +5,49 @@
#include "win8/delegate_execute/delegate_execute_operation.h"
#include "base/command_line.h"
+#include "base/string_number_conversions.h"
+#include "base/string_split.h"
#include "chrome/common/chrome_switches.h"
namespace delegate_execute {
DelegateExecuteOperation::DelegateExecuteOperation()
- : operation_type_(EXE_MODULE) {
+ : operation_type_(DELEGATE_EXECUTE),
+ relaunch_flags_("") {
}
DelegateExecuteOperation::~DelegateExecuteOperation() {
- Clear();
}
-void DelegateExecuteOperation::Initialize(const CommandLine* command_line) {
- Clear();
-
- // --relaunch-shortcut=PathToShortcut triggers the relaunch Chrome operation.
- FilePath shortcut(
- command_line->GetSwitchValuePath(switches::kRelaunchShortcut));
- if (!shortcut.empty()) {
- relaunch_shortcut_ = shortcut;
- operation_type_ = RELAUNCH_CHROME;
+bool DelegateExecuteOperation::Init(const CommandLine* cmd_line) {
+ FilePath shortcut(cmd_line->GetSwitchValuePath(switches::kRelaunchShortcut));
+ if (shortcut.empty()) {
+ operation_type_ = DELEGATE_EXECUTE;
+ return true;
}
+ relaunch_shortcut_ = shortcut;
+ mutex_ = cmd_line->GetSwitchValueNative(switches::kWaitForMutex);
+ if (mutex_.empty())
+ return false;
+ // Add the mode forcing flags, if any.
+ if (cmd_line->HasSwitch(switches::kForceDesktop))
+ relaunch_flags_ = switches::kForceDesktop;
+ else if (cmd_line->HasSwitch(switches::kForceImmersive))
+ relaunch_flags_ = switches::kForceImmersive;
+
+ operation_type_ = RELAUNCH_CHROME;
+ return true;
}
-void DelegateExecuteOperation::Clear() {
- operation_type_ = EXE_MODULE;
- relaunch_shortcut_.clear();
+DWORD DelegateExecuteOperation::GetParentPid() const {
+ std::vector<string16> parts;
+ base::SplitString(mutex_, L'.', &parts);
+ if (parts.size() != 3)
+ return 0;
+ DWORD pid;
+ if (!base::StringToUint(parts[2], reinterpret_cast<uint32*>(&pid)))
+ return 0;
+ return pid;
}
} // namespace delegate_execute
« no previous file with comments | « win8/delegate_execute/delegate_execute_operation.h ('k') | win8/metro_driver/chrome_app_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698