OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "win8/viewer/metro_viewer_process_host.h" | 5 #include "win8/viewer/metro_viewer_process_host.h" |
6 | 6 |
7 #include <shlobj.h> | 7 #include <shlobj.h> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 | 42 |
43 void MetroViewerProcessHost::InternalMessageFilter::OnChannelConnected( | 43 void MetroViewerProcessHost::InternalMessageFilter::OnChannelConnected( |
44 int32 peer_pid) { | 44 int32 peer_pid) { |
45 owner_->NotifyChannelConnected(); | 45 owner_->NotifyChannelConnected(); |
46 } | 46 } |
47 | 47 |
48 MetroViewerProcessHost::InternalMessageFilter::~InternalMessageFilter() { | 48 MetroViewerProcessHost::InternalMessageFilter::~InternalMessageFilter() { |
49 } | 49 } |
50 | 50 |
51 MetroViewerProcessHost::MetroViewerProcessHost( | 51 MetroViewerProcessHost::MetroViewerProcessHost( |
52 const scoped_refptr<base::SingleThreadTaskRunner>& ipc_task_runner) { | 52 const scoped_refptr<base::SingleThreadTaskRunner>& ipc_task_runner, |
| 53 IPC::AttachmentBroker* attachment_broker) { |
53 DCHECK(!instance_); | 54 DCHECK(!instance_); |
54 instance_ = this; | 55 instance_ = this; |
55 | 56 |
56 channel_ = IPC::ChannelProxy::Create(kMetroViewerIPCChannelName, | 57 channel_ = IPC::ChannelProxy::Create(kMetroViewerIPCChannelName, |
57 IPC::Channel::MODE_NAMED_SERVER, | 58 IPC::Channel::MODE_NAMED_SERVER, this, |
58 this, | 59 ipc_task_runner, attachment_broker); |
59 ipc_task_runner); | |
60 } | 60 } |
61 | 61 |
62 MetroViewerProcessHost::~MetroViewerProcessHost() { | 62 MetroViewerProcessHost::~MetroViewerProcessHost() { |
63 if (!channel_) { | 63 if (!channel_) { |
64 instance_ = NULL; | 64 instance_ = NULL; |
65 return; | 65 return; |
66 } | 66 } |
67 | 67 |
68 base::ProcessId viewer_process_id = GetViewerProcessId(); | 68 base::ProcessId viewer_process_id = GetViewerProcessId(); |
69 channel_->Close(); | 69 channel_->Close(); |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
336 const base::FilePath& folder) { | 336 const base::FilePath& folder) { |
337 if (success) | 337 if (success) |
338 select_folder_completion_callback_.Run(base::FilePath(folder), 0, NULL); | 338 select_folder_completion_callback_.Run(base::FilePath(folder), 0, NULL); |
339 else | 339 else |
340 failure_callback_.Run(NULL); | 340 failure_callback_.Run(NULL); |
341 select_folder_completion_callback_.Reset(); | 341 select_folder_completion_callback_.Reset(); |
342 failure_callback_.Reset(); | 342 failure_callback_.Reset(); |
343 } | 343 } |
344 | 344 |
345 } // namespace win8 | 345 } // namespace win8 |
OLD | NEW |