| 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_EXTERNAL_PROCESS_IMPORTER_HOST_H_ | 5 #ifndef CHROME_BROWSER_IMPORTER_EXTERNAL_PROCESS_IMPORTER_HOST_H_ |
| 6 #define CHROME_BROWSER_IMPORTER_EXTERNAL_PROCESS_IMPORTER_HOST_H_ | 6 #define CHROME_BROWSER_IMPORTER_EXTERNAL_PROCESS_IMPORTER_HOST_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 // A series of functions invoked at the start, during and end of the import | 64 // A series of functions invoked at the start, during and end of the import |
| 65 // process. The middle functions are notifications that the a harvesting of a | 65 // process. The middle functions are notifications that the a harvesting of a |
| 66 // particular source of data (specified by |item|) is under way. | 66 // particular source of data (specified by |item|) is under way. |
| 67 void NotifyImportStarted(); | 67 void NotifyImportStarted(); |
| 68 void NotifyImportItemStarted(importer::ImportItem item); | 68 void NotifyImportItemStarted(importer::ImportItem item); |
| 69 void NotifyImportItemEnded(importer::ImportItem item); | 69 void NotifyImportItemEnded(importer::ImportItem item); |
| 70 void NotifyImportEnded(); | 70 void NotifyImportEnded(); |
| 71 | 71 |
| 72 private: | 72 private: |
| 73 // ExternalProcessImporterHost deletes itself in OnImportEnded(). | 73 // ExternalProcessImporterHost deletes itself in OnImportEnded(). |
| 74 virtual ~ExternalProcessImporterHost(); | 74 ~ExternalProcessImporterHost() override; |
| 75 | 75 |
| 76 // Launches the utility process that starts the import task, unless bookmark | 76 // Launches the utility process that starts the import task, unless bookmark |
| 77 // or template model are not yet loaded. If load is not detected, this method | 77 // or template model are not yet loaded. If load is not detected, this method |
| 78 // will be called when the loading observer sees that model loading is | 78 // will be called when the loading observer sees that model loading is |
| 79 // complete. | 79 // complete. |
| 80 virtual void LaunchImportIfReady(); | 80 virtual void LaunchImportIfReady(); |
| 81 | 81 |
| 82 // BaseBookmarkModelObserver: | 82 // BaseBookmarkModelObserver: |
| 83 virtual void BookmarkModelLoaded(BookmarkModel* model, | 83 void BookmarkModelLoaded(BookmarkModel* model, bool ids_reassigned) override; |
| 84 bool ids_reassigned) override; | 84 void BookmarkModelBeingDeleted(BookmarkModel* model) override; |
| 85 virtual void BookmarkModelBeingDeleted(BookmarkModel* model) override; | 85 void BookmarkModelChanged() override; |
| 86 virtual void BookmarkModelChanged() override; | |
| 87 | 86 |
| 88 // Called when TemplateURLService has been loaded. | 87 // Called when TemplateURLService has been loaded. |
| 89 void OnTemplateURLServiceLoaded(); | 88 void OnTemplateURLServiceLoaded(); |
| 90 | 89 |
| 91 // ShowWarningDialog() asks user to close the application that is owning the | 90 // ShowWarningDialog() asks user to close the application that is owning the |
| 92 // lock. They can retry or skip the importing process. | 91 // lock. They can retry or skip the importing process. |
| 93 // This method should not be called if the importer is in headless mode. | 92 // This method should not be called if the importer is in headless mode. |
| 94 void ShowWarningDialog(); | 93 void ShowWarningDialog(); |
| 95 | 94 |
| 96 // This is called when when user ends the lock dialog by clicking on either | 95 // This is called when when user ends the lock dialog by clicking on either |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 // True if the import process has been cancelled. | 153 // True if the import process has been cancelled. |
| 155 bool cancelled_; | 154 bool cancelled_; |
| 156 | 155 |
| 157 // Vends weak pointers for the importer to call us back. | 156 // Vends weak pointers for the importer to call us back. |
| 158 base::WeakPtrFactory<ExternalProcessImporterHost> weak_ptr_factory_; | 157 base::WeakPtrFactory<ExternalProcessImporterHost> weak_ptr_factory_; |
| 159 | 158 |
| 160 DISALLOW_COPY_AND_ASSIGN(ExternalProcessImporterHost); | 159 DISALLOW_COPY_AND_ASSIGN(ExternalProcessImporterHost); |
| 161 }; | 160 }; |
| 162 | 161 |
| 163 #endif // CHROME_BROWSER_IMPORTER_EXTERNAL_PROCESS_IMPORTER_HOST_H_ | 162 #endif // CHROME_BROWSER_IMPORTER_EXTERNAL_PROCESS_IMPORTER_HOST_H_ |
| OLD | NEW |