| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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/browser/metro_viewer/metro_viewer_process_host_win.h" | 5 #include "chrome/browser/metro_viewer/metro_viewer_process_host_win.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
| 9 #include "chrome/browser/browser_process_platform_part_aurawin.h" | 9 #include "chrome/browser/browser_process_platform_part_aurawin.h" |
| 10 #include "chrome/browser/ui/ash/ash_init.h" | 10 #include "chrome/browser/ui/ash/ash_init.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 ipc_channel_name.c_str(), | 50 ipc_channel_name.c_str(), |
| 51 IPC::Channel::MODE_NAMED_SERVER, | 51 IPC::Channel::MODE_NAMED_SERVER, |
| 52 this, | 52 this, |
| 53 content::BrowserThread::GetMessageLoopProxyForThread( | 53 content::BrowserThread::GetMessageLoopProxyForThread( |
| 54 content::BrowserThread::IO))); | 54 content::BrowserThread::IO))); |
| 55 } | 55 } |
| 56 | 56 |
| 57 MetroViewerProcessHost::~MetroViewerProcessHost() { | 57 MetroViewerProcessHost::~MetroViewerProcessHost() { |
| 58 } | 58 } |
| 59 | 59 |
| 60 base::ProcessId MetroViewerProcessHost::GetViewerProcessId() { |
| 61 if (channel_) |
| 62 return channel_->peer_pid(); |
| 63 return base::kNullProcessId; |
| 64 } |
| 65 |
| 60 bool MetroViewerProcessHost::Send(IPC::Message* msg) { | 66 bool MetroViewerProcessHost::Send(IPC::Message* msg) { |
| 61 return channel_->Send(msg); | 67 return channel_->Send(msg); |
| 62 } | 68 } |
| 63 | 69 |
| 64 bool MetroViewerProcessHost::OnMessageReceived(const IPC::Message& message) { | 70 bool MetroViewerProcessHost::OnMessageReceived(const IPC::Message& message) { |
| 65 DCHECK(CalledOnValidThread()); | 71 DCHECK(CalledOnValidThread()); |
| 66 bool handled = true; | 72 bool handled = true; |
| 67 IPC_BEGIN_MESSAGE_MAP(MetroViewerProcessHost, message) | 73 IPC_BEGIN_MESSAGE_MAP(MetroViewerProcessHost, message) |
| 68 IPC_MESSAGE_HANDLER(MetroViewerHostMsg_SetTargetSurface, OnSetTargetSurface) | 74 IPC_MESSAGE_HANDLER(MetroViewerHostMsg_SetTargetSurface, OnSetTargetSurface) |
| 69 IPC_MESSAGE_UNHANDLED(handled = false) | 75 IPC_MESSAGE_UNHANDLED(handled = false) |
| (...skipping 29 matching lines...) Expand all Loading... |
| 99 scoped_refptr<AcceleratedPresenter> any_window = | 105 scoped_refptr<AcceleratedPresenter> any_window = |
| 100 AcceleratedPresenter::GetForWindow(NULL); | 106 AcceleratedPresenter::GetForWindow(NULL); |
| 101 any_window->SetNewTargetWindow(hwnd); | 107 any_window->SetNewTargetWindow(hwnd); |
| 102 aura::RemoteRootWindowHostWin::Instance()->Connected(this); | 108 aura::RemoteRootWindowHostWin::Instance()->Connected(this); |
| 103 // Tell the rest of Chrome that Ash is running. | 109 // Tell the rest of Chrome that Ash is running. |
| 104 content::NotificationService::current()->Notify( | 110 content::NotificationService::current()->Notify( |
| 105 chrome::NOTIFICATION_ASH_SESSION_STARTED, | 111 chrome::NOTIFICATION_ASH_SESSION_STARTED, |
| 106 content::NotificationService::AllSources(), | 112 content::NotificationService::AllSources(), |
| 107 content::NotificationService::NoDetails()); | 113 content::NotificationService::NoDetails()); |
| 108 } | 114 } |
| OLD | NEW |