diff options
Diffstat (limited to 'win8/delegate_execute/delegate_execute_operation.cc')
-rw-r--r-- | win8/delegate_execute/delegate_execute_operation.cc | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/win8/delegate_execute/delegate_execute_operation.cc b/win8/delegate_execute/delegate_execute_operation.cc new file mode 100644 index 0000000..e6823f0 --- /dev/null +++ b/win8/delegate_execute/delegate_execute_operation.cc @@ -0,0 +1,37 @@ +// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "win8/delegate_execute/delegate_execute_operation.h" + +#include "base/command_line.h" +#include "chrome/common/chrome_switches.h" + +namespace delegate_execute { + +DelegateExecuteOperation::DelegateExecuteOperation() + : operation_type_(EXE_MODULE) { +} + +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; + } +} + +void DelegateExecuteOperation::Clear() { + operation_type_ = EXE_MODULE; + relaunch_shortcut_.clear(); +} + +} // namespace delegate_execute |