summaryrefslogtreecommitdiffstats
path: root/chrome/common/importer/ie_importer_utils_win.cc
blob: 726e5b0166870a3f5e23cac14bb12b1591599b59 (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
38
39
40
41
42
43
44
45
46
47
48
// Copyright (c) 2013 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/importer/ie_importer_utils_win.h"

#include "chrome/common/importer/importer_test_registry_overrider_win.h"

namespace {

const base::char16 kIEFavoritesOrderKey[] =
    L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\"
    L"MenuOrder\\Favorites";

const base::char16 kIEStorage2Key[] =
  L"Software\\Microsoft\\Internet Explorer\\IntelliForms\\Storage2";

const base::char16 kIESettingsMainKey[] =
  L"Software\\Microsoft\\Internet Explorer\\Main";

base::string16 GetPotentiallyOverridenIEKey(
    const base::string16& desired_key_path) {
  base::string16 test_reg_override(
      ImporterTestRegistryOverrider::GetTestRegistryOverride());
  return test_reg_override.empty() ? desired_key_path : test_reg_override;
}

}  // namespace

namespace importer {

base::string16 GetIEFavoritesOrderKey() {
  // Return kIEFavoritesOrderKey unless an override has been set for tests.
  return GetPotentiallyOverridenIEKey(kIEFavoritesOrderKey);
}

base::string16 GetIE7PasswordsKey() {
  // Return kIEStorage2Key unless an override has been set for tests.
  return GetPotentiallyOverridenIEKey(kIEStorage2Key);
}

base::string16 GetIESettingsKey() {
  // Return kIESettingsMainKey unless an override has been set for tests.
  return GetPotentiallyOverridenIEKey(kIESettingsMainKey);
}

}  // namespace importer