summaryrefslogtreecommitdiffstats
path: root/win8/delegate_execute/delegate_execute_operation.cc
blob: e6823f06b5bf95c504b1399178cff880def34b9a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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