blob: 6f98046c93acb4a2a678f9436a67074171bce332 (
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
// Copyright (c) 2010 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.
#ifndef CHROME_BROWSER_IMPORTER_IMPORTER_LIST_H_
#define CHROME_BROWSER_IMPORTER_IMPORTER_LIST_H_
#pragma once
#include <string>
#include <vector>
#include "build/build_config.h"
#include "base/basictypes.h"
#include "chrome/browser/importer/importer_data_types.h"
class Importer;
class ImporterList {
public:
ImporterList();
~ImporterList();
// Detects the installed browsers and their associated profiles, then
// stores their information in a list. It returns the list of description
// of all profiles.
void DetectSourceProfiles();
Importer* CreateImporterByType(importer::ProfileType type);
// Returns the number of different browser profiles you can import from.
int GetAvailableProfileCount() const;
// Returns the name of the profile at the 'index' slot. The profiles are
// ordered such that the profile at index 0 is the likely default browser.
std::wstring GetSourceProfileNameAt(int index) const;
// Returns the ProfileInfo at the specified index. The ProfileInfo should be
// passed to StartImportSettings().
const importer::ProfileInfo& GetSourceProfileInfoAt(int index) const;
// Returns the ProfileInfo with the given browser type.
const importer::ProfileInfo& GetSourceProfileInfoForBrowserType(
int browser_type) const;
// Helper methods for detecting available profiles.
#if defined(OS_WIN)
void DetectIEProfiles();
#endif
void DetectFirefoxProfiles();
void DetectGoogleToolbarProfiles();
#if defined(OS_MACOSX)
void DetectSafariProfiles();
#endif
private:
// The list of profiles with the default one first.
std::vector<importer::ProfileInfo*> source_profiles_;
DISALLOW_COPY_AND_ASSIGN(ImporterList);
};
#endif // CHROME_BROWSER_IMPORTER_IMPORTER_LIST_H_
|