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/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 void MetroViewerProcessHost::InternalMessageFilter::OnChannelConnected( | 44 void MetroViewerProcessHost::InternalMessageFilter::OnChannelConnected( |
45 int32 /* peer_pid */) { | 45 int32 /* peer_pid */) { |
46 owner_->NotifyChannelConnected(); | 46 owner_->NotifyChannelConnected(); |
47 } | 47 } |
48 | 48 |
49 MetroViewerProcessHost::MetroViewerProcessHost( | 49 MetroViewerProcessHost::MetroViewerProcessHost( |
50 base::SingleThreadTaskRunner* ipc_task_runner) { | 50 base::SingleThreadTaskRunner* ipc_task_runner) { |
51 DCHECK(!instance_); | 51 DCHECK(!instance_); |
52 instance_ = this; | 52 instance_ = this; |
53 | 53 |
54 channel_.reset(new IPC::ChannelProxy( | 54 channel_ = IPC::ChannelProxy::Create(kMetroViewerIPCChannelName, |
55 kMetroViewerIPCChannelName, | 55 IPC::Channel::MODE_NAMED_SERVER, |
56 IPC::Channel::MODE_NAMED_SERVER, | 56 this, |
57 this, | 57 ipc_task_runner); |
58 ipc_task_runner)); | |
59 } | 58 } |
60 | 59 |
61 MetroViewerProcessHost::~MetroViewerProcessHost() { | 60 MetroViewerProcessHost::~MetroViewerProcessHost() { |
62 if (!channel_) { | 61 if (!channel_) { |
63 instance_ = NULL; | 62 instance_ = NULL; |
64 return; | 63 return; |
65 } | 64 } |
66 | 65 |
67 base::ProcessId viewer_process_id = GetViewerProcessId(); | 66 base::ProcessId viewer_process_id = GetViewerProcessId(); |
68 channel_->Close(); | 67 channel_->Close(); |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
336 const base::FilePath& folder) { | 335 const base::FilePath& folder) { |
337 if (success) | 336 if (success) |
338 select_folder_completion_callback_.Run(base::FilePath(folder), 0, NULL); | 337 select_folder_completion_callback_.Run(base::FilePath(folder), 0, NULL); |
339 else | 338 else |
340 failure_callback_.Run(NULL); | 339 failure_callback_.Run(NULL); |
341 select_folder_completion_callback_.Reset(); | 340 select_folder_completion_callback_.Reset(); |
342 failure_callback_.Reset(); | 341 failure_callback_.Reset(); |
343 } | 342 } |
344 | 343 |
345 } // namespace win8 | 344 } // namespace win8 |
OLD | NEW |