summaryrefslogtreecommitdiffstats
path: root/chrome/common/switch_utils.cc
blob: f765c17c9f72664791d8dd047ffd88d5c2a9757d (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
// Copyright (c) 2011 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 "chrome/common/switch_utils.h"

#include "base/basictypes.h"
#include "chrome/common/chrome_switches.h"

namespace switches {

// Switches enumerated here will be removed when a background instance of
// Chrome restarts itself. If your key is designed to only be used once,
// or if it does not make sense when restarting a background instance to
// pick up an automatic update, be sure to add it to this list.
const char* const kSwitchesToRemoveOnAutorestart[] = {
  switches::kActivateExistingProfileBrowser,
  switches::kApp,
  switches::kAppId,
  switches::kForceFirstRun,
  switches::kMakeDefaultBrowser,
  switches::kNoStartupWindow,
  switches::kRestoreLastSession,
  switches::kShowAppList,
  switches::kWinJumplistAction
};

void RemoveSwitchesForAutostart(
    std::map<std::string, base::CommandLine::StringType>* switch_list) {
  for (size_t i = 0; i < arraysize(kSwitchesToRemoveOnAutorestart); ++i)
    switch_list->erase(kSwitchesToRemoveOnAutorestart[i]);
}

}  // namespace switches