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

Side by Side Diff: chrome/browser/viewer/viewer_process_host.cc

Issue 10984007: in-chrome viewer for metro (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review fixes Created 8 years, 2 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/browser/viewer/viewer_process_host.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/browser/viewer/viewer_process_host.h"
6
7 #include "base/logging.h"
8 #include "chrome/common/viewer_messages.h"
9 #include "content/public/browser/browser_thread.h"
10 #include "ipc/ipc_channel_proxy.h"
11 #include "ui/surface/accelerated_surface_win.h"
12
13 namespace chrome {
14
15 ViewerProcessHost::ViewerProcessHost()
16 : ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) {
jam 2012/09/28 17:07:54 nit: not needed now that you use channelproxy
17 channel_.reset(new IPC::ChannelProxy(
18 "viewer",
19 IPC::Channel::MODE_NAMED_SERVER,
20 this,
21 content::BrowserThread::GetMessageLoopProxyForThread(
22 content::BrowserThread::IO)));
23 }
24
25 ViewerProcessHost::~ViewerProcessHost() {
26 }
27
28 bool ViewerProcessHost::Send(IPC::Message* msg) {
29 return channel_->Send(msg);
30 }
31
32 bool ViewerProcessHost::OnMessageReceived(const IPC::Message& message) {
33 DCHECK(CalledOnValidThread());
34 bool handled = true;
35 IPC_BEGIN_MESSAGE_MAP(ViewerProcessHost, message)
36 IPC_MESSAGE_HANDLER(ViewerHostMsg_SetTargetSurface, OnSetTargetSurface)
37 IPC_MESSAGE_UNHANDLED(handled = false)
38 IPC_END_MESSAGE_MAP()
39 return handled;
40 }
41
42 void ViewerProcessHost::OnSetTargetSurface(uint32 target_surface) {
43 DLOG(INFO) << __FUNCTION__ << ", target_surface = " << target_surface;
44 HWND hwnd = reinterpret_cast<HWND>(target_surface);
45
46 scoped_refptr<AcceleratedPresenter> any_window =
47 AcceleratedPresenter::GetForWindow(NULL);
48 any_window->SetNewTargetWindow(hwnd);
49 }
50
51 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/viewer/viewer_process_host.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698