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

Side by Side Diff: chrome/utility/profile_import_handler.cc

Issue 323693002: Split printing utility IPC messages into its own file. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix win Created 6 years, 6 months 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 | Annotate | Revision Log
« no previous file with comments | « chrome/utility/profile_import_handler.h ('k') | chrome/utility/utility_message_handler.h » ('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 #include "chrome/utility/profile_import_handler.h" 5 #include "chrome/utility/profile_import_handler.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "base/message_loop/message_loop_proxy.h" 9 #include "base/message_loop/message_loop_proxy.h"
10 #include "base/threading/thread.h" 10 #include "base/threading/thread.h"
11 #include "chrome/common/importer/profile_import_process_messages.h" 11 #include "chrome/common/importer/profile_import_process_messages.h"
12 #include "chrome/utility/importer/external_process_importer_bridge.h" 12 #include "chrome/utility/importer/external_process_importer_bridge.h"
13 #include "chrome/utility/importer/importer.h" 13 #include "chrome/utility/importer/importer.h"
14 #include "chrome/utility/importer/importer_creator.h" 14 #include "chrome/utility/importer/importer_creator.h"
15 #include "content/public/utility/utility_thread.h" 15 #include "content/public/utility/utility_thread.h"
16 16
17 namespace chrome { 17 namespace {
18
19 bool Send(IPC::Message* message) {
20 return content::UtilityThread::Get()->Send(message);
21 }
22
23 } // namespace
18 24
19 ProfileImportHandler::ProfileImportHandler() : items_to_import_(0) {} 25 ProfileImportHandler::ProfileImportHandler() : items_to_import_(0) {}
20 26
21 ProfileImportHandler::~ProfileImportHandler() {} 27 ProfileImportHandler::~ProfileImportHandler() {}
22 28
23 bool ProfileImportHandler::OnMessageReceived(const IPC::Message& message) { 29 bool ProfileImportHandler::OnMessageReceived(const IPC::Message& message) {
24 bool handled = true; 30 bool handled = true;
25 IPC_BEGIN_MESSAGE_MAP(ProfileImportHandler, message) 31 IPC_BEGIN_MESSAGE_MAP(ProfileImportHandler, message)
26 IPC_MESSAGE_HANDLER(ProfileImportProcessMsg_StartImport, OnImportStart) 32 IPC_MESSAGE_HANDLER(ProfileImportProcessMsg_StartImport, OnImportStart)
27 IPC_MESSAGE_HANDLER(ProfileImportProcessMsg_CancelImport, OnImportCancel) 33 IPC_MESSAGE_HANDLER(ProfileImportProcessMsg_CancelImport, OnImportCancel)
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 } 82 }
77 } 83 }
78 84
79 void ProfileImportHandler::ImporterCleanup() { 85 void ProfileImportHandler::ImporterCleanup() {
80 importer_->Cancel(); 86 importer_->Cancel();
81 importer_ = NULL; 87 importer_ = NULL;
82 bridge_ = NULL; 88 bridge_ = NULL;
83 import_thread_.reset(); 89 import_thread_.reset();
84 content::UtilityThread::Get()->ReleaseProcessIfNeeded(); 90 content::UtilityThread::Get()->ReleaseProcessIfNeeded();
85 } 91 }
86
87 // static
88 bool ProfileImportHandler::Send(IPC::Message* message) {
89 return content::UtilityThread::Get()->Send(message);
90 }
91
92 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/utility/profile_import_handler.h ('k') | chrome/utility/utility_message_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698