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

Side by Side Diff: win8/viewer/metro_viewer_process_host.cc

Issue 15731003: Make the browser->metro_viewer IPC channel name a constant instead of hardcoding it in a few places… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix explicits Created 7 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 | « win8/viewer/metro_viewer_process_host.h ('k') | win8/win8.gyp » ('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) 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"
11 #include "base/files/file_path.h" 11 #include "base/files/file_path.h"
12 #include "base/memory/ref_counted.h" 12 #include "base/memory/ref_counted.h"
13 #include "base/process.h" 13 #include "base/process.h"
14 #include "base/strings/string16.h" 14 #include "base/strings/string16.h"
15 #include "base/synchronization/waitable_event.h" 15 #include "base/synchronization/waitable_event.h"
16 #include "base/time.h" 16 #include "base/time.h"
17 #include "base/win/scoped_comptr.h" 17 #include "base/win/scoped_comptr.h"
18 #include "ipc/ipc_message.h" 18 #include "ipc/ipc_message.h"
19 #include "ipc/ipc_message_macros.h" 19 #include "ipc/ipc_message_macros.h"
20 #include "ui/aura/remote_root_window_host_win.h" 20 #include "ui/aura/remote_root_window_host_win.h"
21 #include "ui/metro_viewer/metro_viewer_messages.h" 21 #include "ui/metro_viewer/metro_viewer_messages.h"
22 #include "win8/viewer/metro_viewer_constants.h"
22 23
23 namespace win8 { 24 namespace win8 {
24 25
25 MetroViewerProcessHost::InternalMessageFilter::InternalMessageFilter( 26 MetroViewerProcessHost::InternalMessageFilter::InternalMessageFilter(
26 MetroViewerProcessHost* owner) : owner_(owner) { 27 MetroViewerProcessHost* owner) : owner_(owner) {
27 } 28 }
28 29
29 void MetroViewerProcessHost::InternalMessageFilter::OnChannelConnected( 30 void MetroViewerProcessHost::InternalMessageFilter::OnChannelConnected(
30 int32 /* peer_pid */) { 31 int32 /* peer_pid */) {
31 owner_->NotifyChannelConnected(); 32 owner_->NotifyChannelConnected();
32 } 33 }
33 34
34 MetroViewerProcessHost::MetroViewerProcessHost( 35 MetroViewerProcessHost::MetroViewerProcessHost(
35 const std::string& ipc_channel_name,
36 base::SingleThreadTaskRunner* ipc_task_runner) { 36 base::SingleThreadTaskRunner* ipc_task_runner) {
37 37
38 channel_.reset(new IPC::ChannelProxy( 38 channel_.reset(new IPC::ChannelProxy(
39 ipc_channel_name.c_str(), 39 kMetroViewerIPCChannelName,
40 IPC::Channel::MODE_NAMED_SERVER, 40 IPC::Channel::MODE_NAMED_SERVER,
41 this, 41 this,
42 ipc_task_runner)); 42 ipc_task_runner));
43 } 43 }
44 44
45 MetroViewerProcessHost::~MetroViewerProcessHost() { 45 MetroViewerProcessHost::~MetroViewerProcessHost() {
46 } 46 }
47 47
48 base::ProcessId MetroViewerProcessHost::GetViewerProcessId() { 48 base::ProcessId MetroViewerProcessHost::GetViewerProcessId() {
49 if (channel_) 49 if (channel_)
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 return handled ? true : 101 return handled ? true :
102 aura::RemoteRootWindowHostWin::Instance()->OnMessageReceived(message); 102 aura::RemoteRootWindowHostWin::Instance()->OnMessageReceived(message);
103 } 103 }
104 104
105 void MetroViewerProcessHost::NotifyChannelConnected() { 105 void MetroViewerProcessHost::NotifyChannelConnected() {
106 if (channel_connected_event_) 106 if (channel_connected_event_)
107 channel_connected_event_->Signal(); 107 channel_connected_event_->Signal();
108 } 108 }
109 109
110 } // namespace win8 110 } // namespace win8
OLDNEW
« no previous file with comments | « win8/viewer/metro_viewer_process_host.h ('k') | win8/win8.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698