1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/importer/profile_import_process_client.h"
6
7 #include "chrome/browser/history/history_types.h"
8 #include "chrome/browser/importer/profile_import_process_host.h"
9 #include "chrome/browser/importer/profile_import_process_messages.h"
10 #include "chrome/browser/search_engines/template_url.h"
11 #include "googleurl/src/gurl.h"
12 #include "ipc/ipc_message_macros.h"
13 #include "webkit/glue/password_form.h"
14
ProfileImportProcessClient()15 ProfileImportProcessClient::ProfileImportProcessClient() {
16 }
17
OnProcessCrashed(int exit_status)18 void ProfileImportProcessClient::OnProcessCrashed(int exit_status) {
19 }
20
OnImportStart()21 void ProfileImportProcessClient::OnImportStart() {
22 }
23
OnImportFinished(bool succeeded,const std::string & error_msg)24 void ProfileImportProcessClient::OnImportFinished(
25 bool succeeded,
26 const std::string& error_msg) {
27 }
28
OnImportItemStart(int item)29 void ProfileImportProcessClient::OnImportItemStart(int item) {
30 }
31
OnImportItemFinished(int item)32 void ProfileImportProcessClient::OnImportItemFinished(int item) {
33 }
34
OnImportItemFailed(const std::string & error_msg)35 void ProfileImportProcessClient::OnImportItemFailed(
36 const std::string& error_msg) {
37 }
38
OnHistoryImportStart(size_t total_history_rows_count)39 void ProfileImportProcessClient::OnHistoryImportStart(
40 size_t total_history_rows_count) {
41 }
42
OnHistoryImportGroup(const std::vector<history::URLRow> & history_rows_group,int visit_source)43 void ProfileImportProcessClient::OnHistoryImportGroup(
44 const std::vector<history::URLRow>& history_rows_group,
45 int visit_source) {
46 }
47
OnHomePageImportReady(const GURL & home_page)48 void ProfileImportProcessClient::OnHomePageImportReady(const GURL& home_page) {
49 }
50
OnBookmarksImportStart(const string16 & first_folder_name,int options,size_t total_bookmarks_count)51 void ProfileImportProcessClient::OnBookmarksImportStart(
52 const string16& first_folder_name,
53 int options,
54 size_t total_bookmarks_count) {
55 }
56
OnBookmarksImportGroup(const std::vector<ProfileWriter::BookmarkEntry> & bookmarks)57 void ProfileImportProcessClient::OnBookmarksImportGroup(
58 const std::vector<ProfileWriter::BookmarkEntry>& bookmarks) {
59 }
60
OnFaviconsImportStart(size_t total_favicons_count)61 void ProfileImportProcessClient::OnFaviconsImportStart(
62 size_t total_favicons_count) {
63 }
64
OnFaviconsImportGroup(const std::vector<history::ImportedFaviconUsage> & favicons_group)65 void ProfileImportProcessClient::OnFaviconsImportGroup(
66 const std::vector<history::ImportedFaviconUsage>& favicons_group) {
67 }
68
OnPasswordFormImportReady(const webkit_glue::PasswordForm & form)69 void ProfileImportProcessClient::OnPasswordFormImportReady(
70 const webkit_glue::PasswordForm& form) {
71 }
72
OnKeywordsImportReady(const std::vector<TemplateURL> & template_urls,int default_keyword_index,bool unique_on_host_and_path)73 void ProfileImportProcessClient::OnKeywordsImportReady(
74 const std::vector<TemplateURL>& template_urls,
75 int default_keyword_index,
76 bool unique_on_host_and_path) {
77 }
78
OnMessageReceived(const IPC::Message & message)79 bool ProfileImportProcessClient::OnMessageReceived(
80 const IPC::Message& message) {
81 bool handled = true;
82 IPC_BEGIN_MESSAGE_MAP(ProfileImportProcessClient, message)
83 // Notification messages about the state of the import process.
84 IPC_MESSAGE_HANDLER(ProfileImportProcessHostMsg_Import_Started,
85 OnImportStart)
86 IPC_MESSAGE_HANDLER(ProfileImportProcessHostMsg_Import_Finished,
87 OnImportFinished)
88 IPC_MESSAGE_HANDLER(ProfileImportProcessHostMsg_ImportItem_Started,
89 OnImportItemStart)
90 IPC_MESSAGE_HANDLER(ProfileImportProcessHostMsg_ImportItem_Finished,
91 OnImportItemFinished)
92
93 // Data messages containing items to be written to the user profile.
94 IPC_MESSAGE_HANDLER(ProfileImportProcessHostMsg_NotifyHistoryImportStart,
95 OnHistoryImportStart)
96 IPC_MESSAGE_HANDLER(ProfileImportProcessHostMsg_NotifyHistoryImportGroup,
97 OnHistoryImportGroup)
98 IPC_MESSAGE_HANDLER(ProfileImportProcessHostMsg_NotifyHomePageImportReady,
99 OnHomePageImportReady)
100 IPC_MESSAGE_HANDLER(ProfileImportProcessHostMsg_NotifyBookmarksImportStart,
101 OnBookmarksImportStart)
102 IPC_MESSAGE_HANDLER(ProfileImportProcessHostMsg_NotifyBookmarksImportGroup,
103 OnBookmarksImportGroup)
104 IPC_MESSAGE_HANDLER(ProfileImportProcessHostMsg_NotifyFaviconsImportStart,
105 OnFaviconsImportStart)
106 IPC_MESSAGE_HANDLER(ProfileImportProcessHostMsg_NotifyFaviconsImportGroup,
107 OnFaviconsImportGroup)
108 IPC_MESSAGE_HANDLER(ProfileImportProcessHostMsg_NotifyPasswordFormReady,
109 OnPasswordFormImportReady)
110 IPC_MESSAGE_HANDLER(ProfileImportProcessHostMsg_NotifyKeywordsReady,
111 OnKeywordsImportReady)
112 IPC_MESSAGE_UNHANDLED(handled = false)
113 IPC_END_MESSAGE_MAP_EX()
114 return handled;
115 }
116
~ProfileImportProcessClient()117 ProfileImportProcessClient::~ProfileImportProcessClient() {
118 }
119