Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(62)

Side by Side Diff: chrome/browser/importer/importer_list.h

Issue 1492663006: Improved handling of importer profile creation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added missing header file Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/importer/importer_list.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_IMPORTER_IMPORTER_LIST_H_ 5 #ifndef CHROME_BROWSER_IMPORTER_IMPORTER_LIST_H_
6 #define CHROME_BROWSER_IMPORTER_IMPORTER_LIST_H_ 6 #define CHROME_BROWSER_IMPORTER_IMPORTER_LIST_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/basictypes.h" 11 #include "base/basictypes.h"
12 #include "base/callback_forward.h" 12 #include "base/callback_forward.h"
13 #include "base/memory/scoped_vector.h"
14 #include "base/memory/weak_ptr.h" 13 #include "base/memory/weak_ptr.h"
15 #include "base/strings/string16.h" 14 #include "base/strings/string16.h"
16 15 #include "chrome/common/importer/importer_data_types.h"
17 namespace importer {
18 struct SourceProfile;
19 }
20 16
21 // ImporterList detects installed browsers and profiles via 17 // ImporterList detects installed browsers and profiles via
22 // DetectSourceProfilesWorker(). ImporterList lives on the UI thread. 18 // DetectSourceProfilesWorker(). ImporterList lives on the UI thread.
23 class ImporterList { 19 class ImporterList {
24 public: 20 public:
25 ImporterList(); 21 ImporterList();
26 ~ImporterList(); 22 ~ImporterList();
27 23
28 // Detects the installed browsers and their associated profiles, then stores 24 // Detects the installed browsers and their associated profiles, then stores
29 // their information in a list to be accessed via count() and 25 // their information in a list to be accessed via count() and
(...skipping 10 matching lines...) Expand all
40 36
41 // Returns the number of different source profiles you can import from. 37 // Returns the number of different source profiles you can import from.
42 size_t count() const { return source_profiles_.size(); } 38 size_t count() const { return source_profiles_.size(); }
43 39
44 // Returns the SourceProfile at |index|. The profiles are ordered such that 40 // Returns the SourceProfile at |index|. The profiles are ordered such that
45 // the profile at index 0 is the likely default browser. The SourceProfile 41 // the profile at index 0 is the likely default browser. The SourceProfile
46 // should be passed to ImporterHost::StartImportSettings(). 42 // should be passed to ImporterHost::StartImportSettings().
47 const importer::SourceProfile& GetSourceProfileAt(size_t index) const; 43 const importer::SourceProfile& GetSourceProfileAt(size_t index) const;
48 44
49 private: 45 private:
50 // Called when the source profiles are loaded. Takes ownership of the 46 // Called when the source profiles are loaded. Copies the loaded profiles
51 // loaded profiles in |profiles| and calls |profiles_loaded_callback|. 47 // in |profiles| and calls |profiles_loaded_callback|.
52 void SourceProfilesLoaded( 48 void SourceProfilesLoaded(
53 const base::Closure& profiles_loaded_callback, 49 const base::Closure& profiles_loaded_callback,
54 const std::vector<importer::SourceProfile*>& profiles); 50 const std::vector<importer::SourceProfile>& profiles);
55 51
56 // The list of profiles with the default one first. 52 // The list of profiles with the default one first.
57 ScopedVector<importer::SourceProfile> source_profiles_; 53 std::vector<importer::SourceProfile> source_profiles_;
58 54
59 base::WeakPtrFactory<ImporterList> weak_ptr_factory_; 55 base::WeakPtrFactory<ImporterList> weak_ptr_factory_;
60 56
61 DISALLOW_COPY_AND_ASSIGN(ImporterList); 57 DISALLOW_COPY_AND_ASSIGN(ImporterList);
62 }; 58 };
63 59
64 #endif // CHROME_BROWSER_IMPORTER_IMPORTER_LIST_H_ 60 #endif // CHROME_BROWSER_IMPORTER_IMPORTER_LIST_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/importer/importer_list.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698