OLD | NEW |
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 <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/callback_forward.h" | 13 #include "base/callback_forward.h" |
14 #include "base/macros.h" | 14 #include "base/macros.h" |
15 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
| 16 #include "base/sequence_checker.h" |
16 #include "base/strings/string16.h" | 17 #include "base/strings/string16.h" |
17 #include "chrome/common/importer/importer_data_types.h" | 18 #include "chrome/common/importer/importer_data_types.h" |
18 | 19 |
19 // ImporterList detects installed browsers and profiles via | 20 // ImporterList detects installed browsers and profiles via |
20 // DetectSourceProfilesWorker(). ImporterList lives on the UI thread. | 21 // DetectSourceProfilesWorker(). ImporterList lives on the UI thread. |
21 class ImporterList { | 22 class ImporterList { |
22 public: | 23 public: |
23 ImporterList(); | 24 ImporterList(); |
24 ~ImporterList(); | 25 ~ImporterList(); |
25 | 26 |
(...skipping 21 matching lines...) Expand all Loading... |
47 private: | 48 private: |
48 // Called when the source profiles are loaded. Copies the loaded profiles | 49 // Called when the source profiles are loaded. Copies the loaded profiles |
49 // in |profiles| and calls |profiles_loaded_callback|. | 50 // in |profiles| and calls |profiles_loaded_callback|. |
50 void SourceProfilesLoaded( | 51 void SourceProfilesLoaded( |
51 const base::Closure& profiles_loaded_callback, | 52 const base::Closure& profiles_loaded_callback, |
52 const std::vector<importer::SourceProfile>& profiles); | 53 const std::vector<importer::SourceProfile>& profiles); |
53 | 54 |
54 // The list of profiles with the default one first. | 55 // The list of profiles with the default one first. |
55 std::vector<importer::SourceProfile> source_profiles_; | 56 std::vector<importer::SourceProfile> source_profiles_; |
56 | 57 |
| 58 SEQUENCE_CHECKER(sequence_checker_); |
| 59 |
57 base::WeakPtrFactory<ImporterList> weak_ptr_factory_; | 60 base::WeakPtrFactory<ImporterList> weak_ptr_factory_; |
58 | 61 |
59 DISALLOW_COPY_AND_ASSIGN(ImporterList); | 62 DISALLOW_COPY_AND_ASSIGN(ImporterList); |
60 }; | 63 }; |
61 | 64 |
62 #endif // CHROME_BROWSER_IMPORTER_IMPORTER_LIST_H_ | 65 #endif // CHROME_BROWSER_IMPORTER_IMPORTER_LIST_H_ |
OLD | NEW |